autoforma 1.0.55 → 1.0.56
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/README.md +286 -157
- package/dist/components/AutoForm/AutoForm.d.ts +17 -0
- package/dist/components/AutoForm/AutoForm.types.d.ts +35 -0
- package/dist/components/AutoForm/index.d.ts +0 -0
- package/dist/fields/FieldRenderer/DefaultFieldRender.d.ts +10 -0
- package/dist/fields/FieldRenderer/FieldLayoutWrapper.d.ts +9 -0
- package/dist/fields/FieldRenderer/FieldRenderer.d.ts +3 -0
- package/dist/fields/FieldRenderer/FieldRenderer.types.d.ts +7 -0
- package/dist/fields/context/RenderersContext.d.ts +7 -0
- package/dist/fields/handlers/BuiltInHandler.d.ts +9 -0
- package/dist/fields/handlers/CustomTypeRendererResolver.d.ts +10 -0
- package/dist/fields/handlers/FieldNameHandler.d.ts +10 -0
- package/dist/fields/handlers/FieldTypeHandler.d.ts +10 -0
- package/dist/fields/handlers/RendererHandler.d.ts +10 -0
- package/dist/fields/renderer.types.d.ts +12 -0
- package/dist/fields/renderers/ArrayFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/CheckBoxFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/DateFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/DateTimeFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/NumberFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/ObjectFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/RichTextEditorFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/SelectFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/SwitchFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/TagsFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/TextFieldRenderer.d.ts +4 -0
- package/dist/fields/renderers/TimeFieldRenderer.d.ts +4 -0
- package/dist/fields/resolver/FieldRendererResolver.d.ts +3 -0
- package/dist/fields/types.d.ts +60 -0
- package/dist/fields/utils/layout.utils.d.ts +5 -0
- package/dist/fields/utils/values.utils.d.ts +4 -0
- package/dist/index.cjs.js +143 -62
- package/dist/index.d.ts +6 -2
- package/dist/index.es.js +22192 -13217
- package/dist/theme.d.ts +6 -6
- package/package.json +46 -13
- package/dist/components/AutoForm.d.ts +0 -18
- package/dist/components/FieldRender.d.ts +0 -16
- package/dist/components/fields/ArrayField.d.ts +0 -13
- package/dist/components/fields/CheckField.d.ts +0 -7
- package/dist/components/fields/DateField.d.ts +0 -6
- package/dist/components/fields/DateTimeField.d.ts +0 -6
- package/dist/components/fields/NumberField.d.ts +0 -6
- package/dist/components/fields/ObjectField.d.ts +0 -9
- package/dist/components/fields/SelectField.d.ts +0 -10
- package/dist/components/fields/TextAreaField.d.ts +0 -6
- package/dist/components/fields/TextField.d.ts +0 -6
- package/dist/components/fields/TimeField.d.ts +0 -6
- package/dist/types/custom-render.d.ts +0 -11
- package/dist/types/field.d.ts +0 -30
- package/dist/types/form.d.ts +0 -7
package/dist/index.cjs.js
CHANGED
|
@@ -1,78 +1,159 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(
|
|
1
|
+
"use strict";var gh=Object.defineProperty;var yh=(n,e,t)=>e in n?gh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ca=(n,e,t)=>yh(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),x=require("@mantine/core"),L=require("dayjs"),bh=require("react-dom");function ol(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _r={exports:{}},Gn={};/**
|
|
2
2
|
* @license React
|
|
3
|
-
* react-jsx-runtime.production.
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ua;function xh(){if(ua)return Gn;ua=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var l in s)l!=="key"&&(o[l]=s[l])}else o=s;return s=o.ref,{$$typeof:n,type:r,key:i,ref:s!==void 0?s:null,props:o}}return Gn.Fragment=e,Gn.jsx=t,Gn.jsxs=t,Gn}var Xn={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
13
|
-
* Copyright (c)
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+re+R}}var Z=!1,le;{var ie=typeof WeakMap=="function"?WeakMap:Map;le=new ie}function pe(R,W){if(!R||Z)return"";{var ne=le.get(R);if(ne!==void 0)return ne}var ve;Z=!0;var Ce=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Te;Te=Q.current,Q.current=null,te();try{if(W){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(qe){ve=qe}Reflect.construct(R,[],Se)}else{try{Se.call()}catch(qe){ve=qe}R.call(Se.prototype)}}else{try{throw Error()}catch(qe){ve=qe}R()}}catch(qe){if(qe&&ve&&typeof qe.stack=="string"){for(var xe=qe.stack.split(`
|
|
19
|
-
`),Ue=ve.stack.split(`
|
|
20
|
-
`),Me=xe.length-1,Le=Ue.length-1;Me>=1&&Le>=0&&xe[Me]!==Ue[Le];)Le--;for(;Me>=1&&Le>=0;Me--,Le--)if(xe[Me]!==Ue[Le]){if(Me!==1||Le!==1)do if(Me--,Le--,Le<0||xe[Me]!==Ue[Le]){var rt=`
|
|
21
|
-
`+xe[Me].replace(" at new "," at ");return R.displayName&&rt.includes("<anonymous>")&&(rt=rt.replace("<anonymous>",R.displayName)),typeof R=="function"&&le.set(R,rt),rt}while(Me>=1&&Le>=0);break}}}finally{Z=!1,Q.current=Te,F(),Error.prepareStackTrace=Ce}var Yt=R?R.displayName||R.name:"",At=Yt?ae(Yt):"";return typeof R=="function"&&le.set(R,At),At}function X(R,W,ne){return pe(R,!1)}function me(R){var W=R.prototype;return!!(W&&W.isReactComponent)}function fe(R,W,ne){if(R==null)return"";if(typeof R=="function")return pe(R,me(R));if(typeof R=="string")return ae(R);switch(R){case l:return ae("Suspense");case u:return ae("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case c:return X(R.render);case d:return fe(R.type,W,ne);case f:{var ve=R,Ce=ve._payload,Te=ve._init;try{return fe(Te(Ce),W,ne)}catch{}}}return""}var ge=Object.prototype.hasOwnProperty,U={},J=y.ReactDebugCurrentFrame;function ee(R){if(R){var W=R._owner,ne=fe(R.type,R._source,W?W.type:null);J.setExtraStackFrame(ne)}else J.setExtraStackFrame(null)}function de(R,W,ne,ve,Ce){{var Te=Function.call.bind(ge);for(var Se in R)if(Te(R,Se)){var xe=void 0;try{if(typeof R[Se]!="function"){var Ue=Error((ve||"React class")+": "+ne+" type `"+Se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof R[Se]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ue.name="Invariant Violation",Ue}xe=R[Se](W,Se,ve,ne,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Me){xe=Me}xe&&!(xe instanceof Error)&&(ee(Ce),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ve||"React class",ne,Se,typeof xe),ee(null)),xe instanceof Error&&!(xe.message in U)&&(U[xe.message]=!0,ee(Ce),w("Failed %s type: %s",ne,xe.message),ee(null))}}}var be=Array.isArray;function oe(R){return be(R)}function he(R){{var W=typeof Symbol=="function"&&Symbol.toStringTag,ne=W&&R[Symbol.toStringTag]||R.constructor.name||"Object";return ne}}function H(R){try{return ce(R),!1}catch{return!0}}function ce(R){return""+R}function we(R){if(H(R))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",he(R)),ce(R)}var Oe=y.ReactCurrentOwner,De={key:!0,ref:!0,__self:!0,__source:!0},je,Pe;function Re(R){if(ge.call(R,"ref")){var W=Object.getOwnPropertyDescriptor(R,"ref").get;if(W&&W.isReactWarning)return!1}return R.ref!==void 0}function Rt(R){if(ge.call(R,"key")){var W=Object.getOwnPropertyDescriptor(R,"key").get;if(W&&W.isReactWarning)return!1}return R.key!==void 0}function Bt(R,W){typeof R.ref=="string"&&Oe.current}function ke(R,W){{var ne=function(){je||(je=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W))};ne.isReactWarning=!0,Object.defineProperty(R,"key",{get:ne,configurable:!0})}}function He(R,W){{var ne=function(){Pe||(Pe=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W))};ne.isReactWarning=!0,Object.defineProperty(R,"ref",{get:ne,configurable:!0})}}var jt=function(R,W,ne,ve,Ce,Te,Se){var xe={$$typeof:t,type:R,key:W,ref:ne,props:Se,_owner:Te};return xe._store={},Object.defineProperty(xe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(xe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ve}),Object.defineProperty(xe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ce}),Object.freeze&&(Object.freeze(xe.props),Object.freeze(xe)),xe};function Et(R,W,ne,ve,Ce){{var Te,Se={},xe=null,Ue=null;ne!==void 0&&(we(ne),xe=""+ne),Rt(W)&&(we(W.key),xe=""+W.key),Re(W)&&(Ue=W.ref,Bt(W,Ce));for(Te in W)ge.call(W,Te)&&!De.hasOwnProperty(Te)&&(Se[Te]=W[Te]);if(R&&R.defaultProps){var Me=R.defaultProps;for(Te in Me)Se[Te]===void 0&&(Se[Te]=Me[Te])}if(xe||Ue){var Le=typeof R=="function"?R.displayName||R.name||"Unknown":R;xe&&ke(Se,Le),Ue&&He(Se,Le)}return jt(R,xe,Ue,Ce,ve,Oe.current,Se)}}var Wt=y.ReactCurrentOwner,Lr=y.ReactDebugCurrentFrame;function Be(R){if(R){var W=R._owner,ne=fe(R.type,R._source,W?W.type:null);Lr.setExtraStackFrame(ne)}else Lr.setExtraStackFrame(null)}var hr;hr=!1;function vr(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Ir(){{if(Wt.current){var R=z(Wt.current.type);if(R)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+R+"`."}return""}}function Un(R){return""}var Fr={};function Gn(R){{var W=Ir();if(!W){var ne=typeof R=="string"?R:R.displayName||R.name;ne&&(W=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+ne+">.")}return W}}function Ae(R,W){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var ne=Gn(W);if(Fr[ne])return;Fr[ne]=!0;var ve="";R&&R._owner&&R._owner!==Wt.current&&(ve=" It was passed a child from "+z(R._owner.type)+"."),Be(R),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ne,ve),Be(null)}}function Nt(R,W){{if(typeof R!="object")return;if(oe(R))for(var ne=0;ne<R.length;ne++){var ve=R[ne];vr(ve)&&Ae(ve,W)}else if(vr(R))R._store&&(R._store.validated=!0);else if(R){var Ce=h(R);if(typeof Ce=="function"&&Ce!==R.entries)for(var Te=Ce.call(R),Se;!(Se=Te.next()).done;)vr(Se.value)&&Ae(Se.value,W)}}}function al(R){{var W=R.type;if(W==null||typeof W=="string")return;var ne;if(typeof W=="function")ne=W.propTypes;else if(typeof W=="object"&&(W.$$typeof===c||W.$$typeof===d))ne=W.propTypes;else return;if(ne){var ve=z(W);de(ne,R.props,"prop",ve,R)}else if(W.PropTypes!==void 0&&!hr){hr=!0;var Ce=z(W);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ce||"Unknown")}typeof W.getDefaultProps=="function"&&!W.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function il(R){{for(var W=Object.keys(R.props),ne=0;ne<W.length;ne++){var ve=W[ne];if(ve!=="children"&&ve!=="key"){Be(R),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ve),Be(null);break}}R.ref!==null&&(Be(R),w("Invalid attribute `ref` supplied to `React.Fragment`."),Be(null))}}var Ps={};function Ms(R,W,ne,ve,Ce,Te){{var Se=P(R);if(!Se){var xe="";(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(xe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ue=Un();Ue?xe+=Ue:xe+=Ir();var Me;R===null?Me="null":oe(R)?Me="array":R!==void 0&&R.$$typeof===t?(Me="<"+(z(R.type)||"Unknown")+" />",xe=" Did you accidentally export a JSX literal instead of a component?"):Me=typeof R,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Me,xe)}var Le=Et(R,W,ne,Ce,Te);if(Le==null)return Le;if(Se){var rt=W.children;if(rt!==void 0)if(ve)if(oe(rt)){for(var Yt=0;Yt<rt.length;Yt++)Nt(rt[Yt],R);Object.freeze&&Object.freeze(rt)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Nt(rt,R)}if(ge.call(W,"key")){var At=z(R),qe=Object.keys(W).filter(function(ml){return ml!=="key"}),qn=qe.length>0?"{key: someKey, "+qe.join(": ..., ")+": ...}":"{key: someKey}";if(!Ps[At+qn]){var fl=qe.length>0?"{"+qe.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
17
|
+
*/var da;function kh(){return da||(da=1,process.env.NODE_ENV!=="production"&&function(){function n(S){if(S==null)return null;if(typeof S=="function")return S.$$typeof===Y?null:S.displayName||S.name||null;if(typeof S=="string")return S;switch(S){case g:return"Fragment";case k:return"Profiler";case b:return"StrictMode";case v:return"Suspense";case w:return"SuspenseList";case B:return"Activity"}if(typeof S=="object")switch(typeof S.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case y:return"Portal";case T:return S.displayName||"Context";case C:return(S._context.displayName||"Context")+".Consumer";case M:var D=S.render;return S=S.displayName,S||(S=D.displayName||D.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case O:return D=S.displayName||null,D!==null?D:n(S.type)||"Memo";case N:D=S._payload,S=S._init;try{return n(S(D))}catch{}}return null}function e(S){return""+S}function t(S){try{e(S);var D=!1}catch{D=!0}if(D){D=console;var A=D.error,P=typeof Symbol=="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object";return A.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P),e(S)}}function r(S){if(S===g)return"<>";if(typeof S=="object"&&S!==null&&S.$$typeof===N)return"<...>";try{var D=n(S);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function s(){var S=$.A;return S===null?null:S.getOwner()}function o(){return Error("react-stack-top-frame")}function i(S){if(F.call(S,"key")){var D=Object.getOwnPropertyDescriptor(S,"key").get;if(D&&D.isReactWarning)return!1}return S.key!==void 0}function l(S,D){function A(){q||(q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}A.isReactWarning=!0,Object.defineProperty(S,"key",{get:A,configurable:!0})}function a(){var S=n(this.type);return J[S]||(J[S]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),S=this.props.ref,S!==void 0?S:null}function c(S,D,A,P,U,de){var R=A.ref;return S={$$typeof:m,type:S,key:D,props:A,_owner:P},(R!==void 0?R:null)!==null?Object.defineProperty(S,"ref",{enumerable:!1,get:a}):Object.defineProperty(S,"ref",{enumerable:!1,value:null}),S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(S,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(S,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(S,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S}function u(S,D,A,P,U,de){var R=D.children;if(R!==void 0)if(P)if(K(R)){for(P=0;P<R.length;P++)d(R[P]);Object.freeze&&Object.freeze(R)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(R);if(F.call(D,"key")){R=n(S);var G=Object.keys(D).filter(function(Z){return Z!=="key"});P=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",j[R+P]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
26
18
|
let props = %s;
|
|
27
19
|
<%s {...props} />
|
|
28
20
|
React keys must be passed directly to JSX without using spread:
|
|
29
21
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,qn,At,fl,At),Ps[At+qn]=!0}}return R===n?il(Le):al(Le),Le}}function cl(R,W,ne){return Ms(R,W,ne,!0)}function ll(R,W,ne){return Ms(R,W,ne,!1)}var ul=ll,dl=cl;yr.Fragment=n,yr.jsx=ul,yr.jsxs=dl}()),yr}var Fs;function gl(){return Fs||(Fs=1,process.env.NODE_ENV==="production"?Vr.exports=hl():Vr.exports=vl()),Vr.exports}var g=gl();function yl(e){if(!/^[0-9a-zA-Z-]+$/.test(e))throw new Error(`[@mantine/use-form] Form name "${e}" is invalid, it should contain only letters, numbers and dashes`)}const bl=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Ve(e,t){bl(()=>{if(e)return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e])}function xl(e,t){e&&yl(e),Ve(`mantine-form:${e}:set-field-value`,r=>t.setFieldValue(r.detail.path,r.detail.value)),Ve(`mantine-form:${e}:set-values`,r=>t.setValues(r.detail)),Ve(`mantine-form:${e}:set-initial-values`,r=>t.setInitialValues(r.detail)),Ve(`mantine-form:${e}:set-errors`,r=>t.setErrors(r.detail)),Ve(`mantine-form:${e}:set-field-error`,r=>t.setFieldError(r.detail.path,r.detail.error)),Ve(`mantine-form:${e}:clear-field-error`,r=>t.clearFieldError(r.detail)),Ve(`mantine-form:${e}:clear-errors`,t.clearErrors),Ve(`mantine-form:${e}:reset`,t.reset),Ve(`mantine-form:${e}:validate`,t.validate),Ve(`mantine-form:${e}:validate-field`,r=>t.validateField(r.detail)),Ve(`mantine-form:${e}:reorder-list-item`,r=>t.reorderListItem(r.detail.path,r.detail.payload)),Ve(`mantine-form:${e}:remove-list-item`,r=>t.removeListItem(r.detail.path,r.detail.index)),Ve(`mantine-form:${e}:insert-list-item`,r=>t.insertListItem(r.detail.path,r.detail.item,r.detail.index)),Ve(`mantine-form:${e}:set-dirty`,r=>t.setDirty(r.detail)),Ve(`mantine-form:${e}:set-touched`,r=>t.setTouched(r.detail)),Ve(`mantine-form:${e}:reset-dirty`,r=>t.resetDirty(r.detail)),Ve(`mantine-form:${e}:reset-touched`,t.resetTouched)}function wl(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:r}=t;r instanceof HTMLInputElement?r.type==="checkbox"?e(r.checked):e(r.value):(r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&e(r.value)}else e(t)}}function lo(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,r)=>{const n=e[r];return n!=null&&n!==!1&&(t[r]=n),t},{})}function Sl(e){const[t,r]=x.useState(lo(e)),n=x.useRef(t),o=x.useCallback(c=>{r(l=>{const u=lo(typeof c=="function"?c(l):c);return n.current=u,u})},[]),s=x.useCallback(()=>o({}),[]),a=x.useCallback(c=>{n.current[c]!==void 0&&o(l=>{const u={...l};return delete u[c],u})},[t]),i=x.useCallback((c,l)=>{l==null||l===!1?a(c):n.current[c]!==l&&o(u=>({...u,[c]:l}))},[t]);return{errorsState:t,setErrors:o,clearErrors:s,setFieldError:i,clearFieldError:a}}function uo(e,t){if(t===null||typeof t!="object")return{};const r={...t};return Object.keys(t).forEach(n=>{n.includes(`${String(e)}.`)&&delete r[n]}),r}function Vs(e,t){const r=e.substring(t.length+1).split(".")[0];return parseInt(r,10)}function zs(e,t,r,n){if(t===void 0)return r;const o=`${String(e)}`;let s=r;n===-1&&(s=uo(`${o}.${t}`,s));const a={...s},i=new Set;return Object.entries(s).filter(([c])=>{if(!c.startsWith(`${o}.`))return!1;const l=Vs(c,o);return Number.isNaN(l)?!1:l>=t}).forEach(([c,l])=>{const u=Vs(c,o),d=c.replace(`${o}.${u}`,`${o}.${u+n}`);a[d]=l,i.add(d),i.has(c)||delete a[c]}),a}function Cl(e,{from:t,to:r},n){const o=`${e}.${t}`,s=`${e}.${r}`,a={...n};return Object.keys(n).every(i=>{let c,l;if(i.startsWith(o)&&(c=i,l=i.replace(o,s)),i.startsWith(s)&&(c=i.replace(s,o),l=i),c&&l){const u=a[c],d=a[l];return d===void 0?delete a[c]:a[c]=d,u===void 0?delete a[l]:a[l]=u,!1}return!0}),a}function Bs(e,t,r){typeof r.value=="object"&&(r.value=Gt(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function Gt(e){if(typeof e!="object")return e;var t=0,r,n,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(a){o.add(Gt(a))})):s==="[object Map]"?(o=new Map,e.forEach(function(a,i){o.set(Gt(i),Gt(a))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(Gt(e.buffer)):s==="[object ArrayBuffer]"?o=e.slice(0):s.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)Bs(o,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(o,r=n[t])&&o[r]===e[r]||Bs(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}function Ya(e){return typeof e!="string"?[]:e.split(".")}function ze(e,t){const r=Ya(e);if(r.length===0||typeof t!="object"||t===null)return;let n=t[r[0]];for(let o=1;o<r.length&&n!=null;o+=1)n=n[r[o]];return n}function Tr(e,t,r){const n=Ya(e);if(n.length===0)return r;const o=Gt(r);if(n.length===1)return o[n[0]]=t,o;let s=o[n[0]];for(let a=1;a<n.length-1;a+=1){if(s===void 0)return o;s=s[n[a]]}return s[n[n.length-1]]=t,o}function Dl(e,{from:t,to:r},n){const o=ze(e,n);if(!Array.isArray(o))return n;const s=[...o],a=o[t];return s.splice(t,1),s.splice(r,0,a),Tr(e,s,n)}function _l(e,t,r,n){const o=ze(e,n);if(!Array.isArray(o))return n;const s=[...o];return s.splice(typeof r=="number"?r:s.length,0,t),Tr(e,s,n)}function Rl(e,t,r){const n=ze(e,r);return Array.isArray(n)?Tr(e,n.filter((o,s)=>s!==t),r):r}function El(e,t,r,n){const o=ze(e,n);if(!Array.isArray(o)||o.length<=r)return n;const s=[...o];return s[r]=t,Tr(e,s,n)}function Nl({$values:e,$errors:t,$status:r}){const n=x.useCallback((i,c)=>{r.clearFieldDirty(i),t.setErrors(l=>Cl(i,c,l)),e.setValues({values:Dl(i,c,e.refValues.current),updateState:!0})},[]),o=x.useCallback((i,c)=>{r.clearFieldDirty(i),t.setErrors(l=>zs(i,c,l,-1)),e.setValues({values:Rl(i,c,e.refValues.current),updateState:!0})},[]),s=x.useCallback((i,c,l)=>{r.clearFieldDirty(i),t.setErrors(u=>zs(i,l,u,1)),e.setValues({values:_l(i,c,l,e.refValues.current),updateState:!0})},[]),a=x.useCallback((i,c,l)=>{r.clearFieldDirty(i),e.setValues({values:El(i,l,c,e.refValues.current),updateState:!0})},[]);return{reorderListItem:n,removeListItem:o,insertListItem:s,replaceListItem:a}}var Xn,Ws;function Tl(){return Ws||(Ws=1,Xn=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var a=s[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Xn}var Ol=Tl();const zr=rr(Ol);function br(e,t){const r=Object.keys(e);if(typeof t=="string"){const n=r.filter(o=>o.startsWith(`${t}.`));return e[t]||n.some(o=>e[o])||!1}return r.some(n=>e[n])}function kl({initialDirty:e,initialTouched:t,mode:r,$values:n}){const[o,s]=x.useState(t),[a,i]=x.useState(e),c=x.useRef(t),l=x.useRef(e),u=x.useCallback(S=>{const O=typeof S=="function"?S(c.current):S;c.current=O,r==="controlled"&&s(O)},[]),d=x.useCallback((S,O=!1)=>{const k=typeof S=="function"?S(l.current):S;l.current=k,(r==="controlled"||O)&&i(k)},[]),f=x.useCallback(()=>u({}),[]),m=x.useCallback(S=>{const O=S?{...n.refValues.current,...S}:n.refValues.current;n.setValuesSnapshot(O),d({})},[]),v=x.useCallback((S,O)=>{u(k=>br(k,S)===O?k:{...k,[S]:O})},[]),p=x.useCallback((S,O,k)=>{d(j=>br(j,S)===O?j:{...j,[S]:O},k)},[]),h=x.useCallback((S,O)=>{const k=br(l.current,S),j=!zr(ze(S,n.getValuesSnapshot()),O),P=uo(S,l.current);P[S]=j,d(P,k!==j)},[]),y=x.useCallback(S=>br(c.current,S),[]),w=x.useCallback(S=>d(O=>{if(typeof S!="string")return O;const k=uo(S,O);return delete k[S],zr(k,O)?O:k}),[]),b=x.useCallback(S=>{if(S){const k=ze(S,l.current);if(typeof k=="boolean")return k;const j=ze(S,n.refValues.current),P=ze(S,n.valuesSnapshot.current);return!zr(j,P)}return Object.keys(l.current).length>0?br(l.current):!zr(n.refValues.current,n.valuesSnapshot.current)},[]),C=x.useCallback(()=>l.current,[]),D=x.useCallback(()=>c.current,[]);return{touchedState:o,dirtyState:a,touchedRef:c,dirtyRef:l,setTouched:u,setDirty:d,resetDirty:m,resetTouched:f,isTouched:y,setFieldTouched:v,setFieldDirty:p,setTouchedState:s,setDirtyState:i,clearFieldDirty:w,isDirty:b,getDirty:C,getTouched:D,setCalculatedFieldDirty:h}}function $l({initialValues:e,onValuesChange:t,mode:r}){const n=x.useRef(!1),[o,s]=x.useState(e||{}),a=x.useRef(o),i=x.useRef(o),c=x.useCallback(({values:p,subscribers:h,updateState:y=!0,mergeWithPreviousValues:w=!0})=>{const b=a.current,C=p instanceof Function?p(a.current):p,D=w?{...b,...C}:C;a.current=D,y&&s(D),t==null||t(D,b),h==null||h.filter(Boolean).forEach(S=>S({updatedValues:D,previousValues:b}))},[t]),l=x.useCallback(p=>{var w;const h=ze(p.path,a.current),y=p.value instanceof Function?p.value(h):p.value;if(h!==y){const b=a.current,C=Tr(p.path,y,a.current);c({values:C,updateState:p.updateState}),(w=p.subscribers)==null||w.filter(Boolean).forEach(D=>D({path:p.path,updatedValues:C,previousValues:b}))}},[c]),u=x.useCallback(p=>{i.current=p},[]),d=x.useCallback((p,h)=>{n.current||(n.current=!0,c({values:p,updateState:r==="controlled"}),u(p),h())},[c]),f=x.useCallback(()=>{c({values:i.current,updateState:!0,mergeWithPreviousValues:!1})},[c]),m=x.useCallback(()=>a.current,[]),v=x.useCallback(()=>i.current,[]);return{initialized:n,stateValues:o,refValues:a,valuesSnapshot:i,setValues:c,setFieldValue:l,resetValues:f,setValuesSnapshot:u,initialize:d,getValues:m,getValuesSnapshot:v}}function jl({$status:e}){const t=x.useRef({}),r=x.useCallback((o,s)=>{x.useEffect(()=>(t.current[o]=t.current[o]||[],t.current[o].push(s),()=>{t.current[o]=t.current[o].filter(a=>a!==s)}),[s])},[]),n=x.useCallback(o=>t.current[o]?t.current[o].map(s=>a=>s({previousValue:ze(o,a.previousValues),value:ze(o,a.updatedValues),touched:e.isTouched(o),dirty:e.isDirty(o)})):[],[]);return{subscribers:t,watch:r,getFieldSubscribers:n}}function Ys(e,t){return e?`${e}-${t.toString()}`:t.toString()}const Br=Symbol("root-rule");function Hs(e){const t=lo(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function fo(e,t,r="",n={}){return typeof e!="object"||e===null?n:Object.keys(e).reduce((o,s)=>{const a=e[s],i=`${r===""?"":`${r}.`}${s}`,c=ze(i,t);let l=!1;return typeof a=="function"&&(o[i]=a(c,t,i)),typeof a=="object"&&Array.isArray(c)&&(l=!0,c.forEach((u,d)=>fo(a,t,`${i}.${d}`,o)),Br in a&&(o[i]=a[Br](c,t,i))),typeof a=="object"&&typeof c=="object"&&c!==null&&(l||fo(a,t,i,o),Br in a&&(o[i]=a[Br](c,t,i))),o},n)}function mo(e,t){return Hs(typeof e=="function"?e(t):fo(e,t))}function Wr(e,t,r){if(typeof e!="string")return{hasError:!1,error:null};const n=mo(t,r),o=Object.keys(n.errors).find(s=>e.split(".").every((a,i)=>a===s.split(".")[i]));return{hasError:!!o,error:o?n.errors[o]:null}}const Al="__MANTINE_FORM_INDEX__";function Us(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]+/g,`.${Al}`)):!1:!1}function Pl({name:e,mode:t="controlled",initialValues:r,initialErrors:n={},initialDirty:o={},initialTouched:s={},clearInputErrorOnChange:a=!0,validateInputOnChange:i=!1,validateInputOnBlur:c=!1,onValuesChange:l,transformValues:u=p=>p,enhanceGetInputProps:d,validate:f,onSubmitPreventDefault:m="always",touchTrigger:v="change"}={}){const p=Sl(n),h=$l({initialValues:r,onValuesChange:l,mode:t}),y=kl({initialDirty:o,initialTouched:s,$values:h,mode:t}),w=Nl({$values:h,$errors:p,$status:y}),b=jl({$status:y}),[C,D]=x.useState(0),[S,O]=x.useState({}),[k,j]=x.useState(!1),P=x.useCallback(()=>{h.resetValues(),p.clearErrors(),y.resetDirty(),y.resetTouched(),t==="uncontrolled"&&D(F=>F+1)},[]),L=x.useCallback(F=>{a&&p.clearErrors(),t==="uncontrolled"&&D(Q=>Q+1),Object.keys(b.subscribers.current).forEach(Q=>{const re=ze(Q,h.refValues.current),ae=ze(Q,F);re!==ae&&b.getFieldSubscribers(Q).forEach(Z=>Z({previousValues:F,updatedValues:h.refValues.current}))})},[a]),V=x.useCallback(F=>{const Q=h.refValues.current;h.initialize(F,()=>t==="uncontrolled"&&D(re=>re+1)),L(Q)},[L]),z=x.useCallback((F,Q,re)=>{const ae=Us(F,i),Z=Q instanceof Function?Q(ze(F,h.refValues.current)):Q;y.setCalculatedFieldDirty(F,Z),v==="change"&&y.setFieldTouched(F,!0),!ae&&a&&p.clearFieldError(F),h.setFieldValue({path:F,value:Q,updateState:t==="controlled",subscribers:[...b.getFieldSubscribers(F),ae?le=>{const ie=Wr(F,f,le.updatedValues);ie.hasError?p.setFieldError(F,ie.error):p.clearFieldError(F)}:null,(re==null?void 0:re.forceUpdate)!==!1&&t!=="controlled"?()=>O(le=>({...le,[F]:(le[F]||0)+1})):null]})},[l,f]),M=x.useCallback(F=>{const Q=h.refValues.current;h.setValues({values:F,updateState:t==="controlled"}),L(Q)},[l,L]),$=x.useCallback(()=>{const F=mo(f,h.refValues.current);return p.setErrors(F.errors),F},[f]),_=x.useCallback(F=>{const Q=Wr(F,f,h.refValues.current);return Q.hasError?p.setFieldError(F,Q.error):p.clearFieldError(F),Q},[f]),E=(F,{type:Q="input",withError:re=!0,withFocus:ae=!0,...Z}={})=>{const ie={onChange:wl(pe=>z(F,pe,{forceUpdate:!1})),"data-path":Ys(e,F)};return re&&(ie.error=p.errorsState[F]),Q==="checkbox"?ie[t==="controlled"?"checked":"defaultChecked"]=ze(F,h.refValues.current):ie[t==="controlled"?"value":"defaultValue"]=ze(F,h.refValues.current),ae&&(ie.onFocus=()=>y.setFieldTouched(F,!0),ie.onBlur=()=>{if(Us(F,c)){const pe=Wr(F,f,h.refValues.current);pe.hasError?p.setFieldError(F,pe.error):p.clearFieldError(F)}}),Object.assign(ie,d==null?void 0:d({inputProps:ie,field:F,options:{type:Q,withError:re,withFocus:ae,...Z},form:te}))},T=(F,Q)=>re=>{m==="always"&&(re==null||re.preventDefault());const ae=$();if(ae.hasErrors)m==="validation-failed"&&(re==null||re.preventDefault()),Q==null||Q(ae.errors,h.refValues.current,re);else{const Z=F==null?void 0:F(u(h.refValues.current),re);Z instanceof Promise&&(j(!0),Z.finally(()=>j(!1)))}},N=F=>u(F||h.refValues.current),I=x.useCallback(F=>{F.preventDefault(),P()},[]),A=x.useCallback(F=>F?!Wr(F,f,h.refValues.current).hasError:!mo(f,h.refValues.current).hasErrors,[f]),B=F=>`${C}-${F}-${S[F]||0}`,Y=x.useCallback(F=>document.querySelector(`[data-path="${Ys(e,F)}"]`),[]),te={watch:b.watch,initialized:h.initialized.current,values:h.stateValues,getValues:h.getValues,getInitialValues:h.getValuesSnapshot,setInitialValues:h.setValuesSnapshot,initialize:V,setValues:M,setFieldValue:z,submitting:k,setSubmitting:j,errors:p.errorsState,setErrors:p.setErrors,setFieldError:p.setFieldError,clearFieldError:p.clearFieldError,clearErrors:p.clearErrors,resetDirty:y.resetDirty,setTouched:y.setTouched,setDirty:y.setDirty,isTouched:y.isTouched,resetTouched:y.resetTouched,isDirty:y.isDirty,getTouched:y.getTouched,getDirty:y.getDirty,reorderListItem:w.reorderListItem,insertListItem:w.insertListItem,removeListItem:w.removeListItem,replaceListItem:w.replaceListItem,reset:P,validate:$,validateField:_,getInputProps:E,onSubmit:T,onReset:I,isValid:A,getTransformedValues:N,key:B,getInputNode:Y};return xl(e,te),te}function Ml(){const e=x.createContext(null);function t({form:n,children:o}){return g.jsx(e.Provider,{value:n,children:o})}function r(){const n=x.useContext(e);if(!n)throw new Error("useFormContext was called outside of FormProvider context");return n}return[t,r,Pl]}function Cr(e,t,r){return t===void 0&&r===void 0?e:t!==void 0&&r===void 0?Math.max(e,t):Math.min(t===void 0&&r!==void 0?e:Math.max(e,t),r)}function Ll(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function Pt(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}const Il=()=>{};function Or(e,t){const r=typeof t=="number"?t:t.delay,n=typeof t=="number"?!1:t.flushOnUnmount,o=Pt(e),s=x.useRef(0),a=Object.assign(x.useCallback((...i)=>{window.clearTimeout(s.current);const c=()=>{s.current!==0&&(s.current=0,o(...i))};a.flush=c,s.current=window.setTimeout(c,r)},[o,r]),{flush:Il});return x.useEffect(()=>()=>{window.clearTimeout(s.current),n&&a.flush()},[a,n]),a}const Gs=["mousedown","touchstart"];function Ha(e,t,r){const n=x.useRef(null);return x.useEffect(()=>{const o=s=>{const{target:a}=s??{};if(Array.isArray(r)){const i=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(l=>!!l&&!s.composedPath().includes(l))&&!i&&e()}else n.current&&!n.current.contains(a)&&e()};return(t||Gs).forEach(s=>document.addEventListener(s,o)),()=>{(t||Gs).forEach(s=>document.removeEventListener(s,o))}},[n,e,r]),n}function Fl(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function Vl(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function zl(e,t,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[n,o]=x.useState(r?t:Vl(e)),s=x.useRef(null);return x.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),Fl(s.current,a=>o(a.matches))},[e]),n}const jo=typeof document<"u"?x.useLayoutEffect:x.useEffect;function yt(e,t){const r=x.useRef(!1);x.useEffect(()=>()=>{r.current=!1},[]),x.useEffect(()=>{if(r.current)return e();r.current=!0},t)}function Ua({opened:e,shouldReturnFocus:t=!0}){const r=x.useRef(null),n=()=>{var o;r.current&&"focus"in r.current&&typeof r.current.focus=="function"&&((o=r.current)==null||o.focus({preventScroll:!0}))};return yt(()=>{let o=-1;const s=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?r.current=document.activeElement:t&&(o=window.setTimeout(n,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),n}const Bl=/input|select|textarea|button|object/,Ga="a, input, select, textarea, button, object, [tabindex]";function Wl(e){return process.env.NODE_ENV==="test"?!1:e.style.display==="none"}function Yl(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(Wl(r))return!1;r=r.parentNode}return!0}function qa(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function po(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(qa(e));return(Bl.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&Yl(e)}function Xa(e){const t=qa(e);return(Number.isNaN(t)||t>=0)&&po(e)}function Hl(e){return Array.from(e.querySelectorAll(Ga)).filter(Xa)}function Ul(e,t){const r=Hl(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();let s=n===o.activeElement||e===o.activeElement;const a=o.activeElement;if(a.tagName==="INPUT"&&a.getAttribute("type")==="radio"&&(s=r.filter(u=>u.getAttribute("type")==="radio"&&u.getAttribute("name")===a.getAttribute("name")).includes(n)),!s)return;t.preventDefault();const c=r[t.shiftKey?r.length-1:0];c&&c.focus()}function Gl(e=!0){const t=x.useRef(null),r=o=>{let s=o.querySelector("[data-autofocus]");if(!s){const a=Array.from(o.querySelectorAll(Ga));s=a.find(Xa)||a.find(po)||null,!s&&po(o)&&(s=o)}s?s.focus({preventScroll:!0}):process.env.NODE_ENV==="development"&&console.warn("[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node",o)},n=x.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()?r(o):process.env.NODE_ENV==="development"&&console.warn("[@mantine/hooks/use-focus-trap] Ref node is not part of the dom",o)}),t.current=o):t.current=null)},[e]);return x.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const o=s=>{s.key==="Tab"&&t.current&&Ul(t.current,s)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),n}const ql=x.useId||(()=>{});function Xl(){const e=ql();return e?`mantine-${e.replace(/:/g,"")}`:""}function nr(e){const t=Xl(),[r,n]=x.useState(t);return jo(()=>{n(Ll())},[]),typeof e=="string"?e:typeof window>"u"?t:r}function Kl(e,t,r){x.useEffect(()=>(window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)),[e,t])}function rn(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function Zl(...e){const t=new Map;return r=>{if(e.forEach(n=>{const o=rn(n,r);o&&t.set(n,o)}),t.size>0)return()=>{e.forEach(n=>{const o=t.get(n);o?o():rn(n,null)}),t.clear()}}}function Ze(...e){return x.useCallback(Zl(...e),e)}function bt({value:e,defaultValue:t,finalValue:r,onChange:n=()=>{}}){const[o,s]=x.useState(t!==void 0?t:r),a=(i,...c)=>{s(i),n==null||n(i,...c)};return e!==void 0?[e,n,!0]:[o,a,!1]}function Ka(e,t){return zl("(prefers-reduced-motion: reduce)",e,t)}function Jl(e=!1,t){const{onOpen:r,onClose:n}={},[o,s]=x.useState(e),a=x.useCallback(()=>{s(l=>l||(r==null||r(),!0))},[r]),i=x.useCallback(()=>{s(l=>l&&(n==null||n(),!1))},[n]),c=x.useCallback(()=>{o?i():a()},[i,a,o]);return[o,{open:a,close:i,toggle:c}]}function Ql(e){const t=x.useRef(void 0);return x.useEffect(()=>{t.current=e},[e]),t.current}var ft=function(){return ft=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},ft.apply(this,arguments)};function Za(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function eu(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}var qr="right-scroll-bar-position",Xr="width-before-scroll-bar",tu="with-scroll-bars-hidden",ru="--removed-body-scroll-bar-size";function Kn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function nu(e,t){var r=x.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var ou=typeof window<"u"?G.useLayoutEffect:G.useEffect,qs=new WeakMap;function su(e,t){var r=nu(null,function(n){return e.forEach(function(o){return Kn(o,n)})});return ou(function(){var n=qs.get(r);if(n){var o=new Set(n),s=new Set(e),a=r.current;o.forEach(function(i){s.has(i)||Kn(i,null)}),s.forEach(function(i){o.has(i)||Kn(i,a)})}qs.set(r,e)},[e]),r}function au(e){return e}function iu(e,t){t===void 0&&(t=au);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var a=t(s,n);return r.push(a),function(){r=r.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(n=!0;r.length;){var a=r;r=[],a.forEach(s)}r={push:function(i){return s(i)},filter:function(){return r}}},assignMedium:function(s){n=!0;var a=[];if(r.length){var i=r;r=[],i.forEach(s),a=r}var c=function(){var u=a;a=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){a.push(u),l()},filter:function(u){return a=a.filter(u),r}}}};return o}function cu(e){e===void 0&&(e={});var t=iu(null);return t.options=ft({async:!0,ssr:!1},e),t}var Ja=function(e){var t=e.sideCar,r=Za(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return G.createElement(n,ft({},r))};Ja.isSideCarExport=!0;function lu(e,t){return e.useMedium(t),Ja}var Qa=cu(),Zn=function(){},ln=G.forwardRef(function(e,t){var r=G.useRef(null),n=G.useState({onScrollCapture:Zn,onWheelCapture:Zn,onTouchMoveCapture:Zn}),o=n[0],s=n[1],a=e.forwardProps,i=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noIsolation,v=e.inert,p=e.allowPinchZoom,h=e.as,y=h===void 0?"div":h,w=e.gapMode,b=Za(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,D=su([r,t]),S=ft(ft({},b),o);return G.createElement(G.Fragment,null,u&&G.createElement(C,{sideCar:Qa,removeScrollBar:l,shards:d,noIsolation:m,inert:v,setCallbacks:s,allowPinchZoom:!!p,lockRef:r,gapMode:w}),a?G.cloneElement(G.Children.only(i),ft(ft({},S),{ref:D})):G.createElement(y,ft({},S,{className:c,ref:D}),i))});ln.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ln.classNames={fullWidth:Xr,zeroRight:qr};var uu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function du(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uu();return t&&e.setAttribute("nonce",t),e}function fu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pu=function(){var e=0,t=null;return{add:function(r){e==0&&(t=du())&&(fu(t,r),mu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hu=function(){var e=pu();return function(t,r){G.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ei=function(){var e=hu(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},vu={left:0,top:0,right:0,gap:0},Jn=function(e){return parseInt(e||"",10)||0},gu=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Jn(r),Jn(n),Jn(o)]},yu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vu;var t=gu(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},bu=ei(),qt="data-scroll-locked",xu=function(e,t,r,n){var o=e.left,s=e.top,a=e.right,i=e.gap;return r===void 0&&(r="margin"),`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
right: `).concat(i,"px ").concat(n,`;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
22
|
+
<%s key={someKey} {...props} />`,P,R,G,R),j[R+P]=!0)}if(R=null,A!==void 0&&(t(A),R=""+A),i(D)&&(t(D.key),R=""+D.key),"key"in D){A={};for(var oe in D)oe!=="key"&&(A[oe]=D[oe])}else A=D;return R&&l(A,typeof S=="function"?S.displayName||S.name||"Unknown":S),c(S,R,A,s(),U,de)}function d(S){f(S)?S._store&&(S._store.validated=1):typeof S=="object"&&S!==null&&S.$$typeof===N&&(S._payload.status==="fulfilled"?f(S._payload.value)&&S._payload.value._store&&(S._payload.value._store.validated=1):S._store&&(S._store.validated=1))}function f(S){return typeof S=="object"&&S!==null&&S.$$typeof===m}var h=E,m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),$=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,K=Array.isArray,ee=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(S){return S()}};var q,J={},H=h.react_stack_bottom_frame.bind(h,o)(),W=ee(r(o)),j={};Xn.Fragment=g,Xn.jsx=function(S,D,A){var P=1e4>$.recentlyCreatedOwnerStacks++;return u(S,D,A,!1,P?Error("react-stack-top-frame"):H,P?ee(r(S)):W)},Xn.jsxs=function(S,D,A){var P=1e4>$.recentlyCreatedOwnerStacks++;return u(S,D,A,!0,P?Error("react-stack-top-frame"):H,P?ee(r(S)):W)}}()),Xn}var fa;function Sh(){return fa||(fa=1,process.env.NODE_ENV==="production"?_r.exports=xh():_r.exports=kh()),_r.exports}var p=Sh();function vh(n){if(!/^[0-9a-zA-Z-]+$/.test(n))throw new Error(`[@mantine/use-form] Form name "${n}" is invalid, it should contain only letters, numbers and dashes`)}const Ch=typeof window<"u"?E.useLayoutEffect:E.useEffect;function Be(n,e){Ch(()=>{if(n)return window.addEventListener(n,e),()=>window.removeEventListener(n,e)},[n])}function Mh(n,e){n&&vh(n),Be(`mantine-form:${n}:set-field-value`,t=>e.setFieldValue(t.detail.path,t.detail.value)),Be(`mantine-form:${n}:set-values`,t=>e.setValues(t.detail)),Be(`mantine-form:${n}:set-initial-values`,t=>e.setInitialValues(t.detail)),Be(`mantine-form:${n}:set-errors`,t=>e.setErrors(t.detail)),Be(`mantine-form:${n}:set-field-error`,t=>e.setFieldError(t.detail.path,t.detail.error)),Be(`mantine-form:${n}:clear-field-error`,t=>e.clearFieldError(t.detail)),Be(`mantine-form:${n}:clear-errors`,e.clearErrors),Be(`mantine-form:${n}:reset`,e.reset),Be(`mantine-form:${n}:validate`,e.validate),Be(`mantine-form:${n}:validate-field`,t=>e.validateField(t.detail)),Be(`mantine-form:${n}:reorder-list-item`,t=>e.reorderListItem(t.detail.path,t.detail.payload)),Be(`mantine-form:${n}:remove-list-item`,t=>e.removeListItem(t.detail.path,t.detail.index)),Be(`mantine-form:${n}:insert-list-item`,t=>e.insertListItem(t.detail.path,t.detail.item,t.detail.index)),Be(`mantine-form:${n}:set-dirty`,t=>e.setDirty(t.detail)),Be(`mantine-form:${n}:set-touched`,t=>e.setTouched(t.detail)),Be(`mantine-form:${n}:reset-dirty`,t=>e.resetDirty(t.detail)),Be(`mantine-form:${n}:reset-touched`,e.resetTouched)}function wh(n){return e=>{if(!e)n(e);else if(typeof e=="function")n(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:t}=e;t instanceof HTMLInputElement?t.type==="checkbox"?n(t.checked):n(t.value):(t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&n(t.value)}else n(e)}}function Mi(n){return n===null||typeof n!="object"?{}:Object.keys(n).reduce((e,t)=>{const r=n[t];return r!=null&&r!==!1&&(e[t]=r),e},{})}function Eh(n){const[e,t]=E.useState(Mi(n)),r=E.useRef(e),s=E.useCallback(a=>{t(c=>{const u=Mi(typeof a=="function"?a(c):a);return r.current=u,u})},[]),o=E.useCallback(()=>s({}),[]),i=E.useCallback(a=>{r.current[a]!==void 0&&s(c=>{const u={...c};return delete u[a],u})},[e]),l=E.useCallback((a,c)=>{c==null||c===!1?i(a):r.current[a]!==c&&s(u=>({...u,[a]:c}))},[e]);return{errorsState:e,setErrors:s,clearErrors:o,setFieldError:l,clearFieldError:i}}function wi(n,e){if(e===null||typeof e!="object")return{};const t={...e};return Object.keys(e).forEach(r=>{r.includes(`${String(n)}.`)&&delete t[r]}),t}function ha(n,e){const t=n.substring(e.length+1).split(".")[0];return parseInt(t,10)}function pa(n,e,t,r){if(e===void 0)return t;const s=`${String(n)}`;let o=t;r===-1&&(o=wi(`${s}.${e}`,o));const i={...o},l=new Set;return Object.entries(o).filter(([a])=>{if(!a.startsWith(`${s}.`))return!1;const c=ha(a,s);return Number.isNaN(c)?!1:c>=e}).forEach(([a,c])=>{const u=ha(a,s),d=a.replace(`${s}.${u}`,`${s}.${u+r}`);i[d]=c,l.add(d),l.has(a)||delete i[a]}),i}function Th(n,{from:e,to:t},r){const s=`${n}.${e}`,o=`${n}.${t}`,i={...r},l=new Set;return Object.keys(r).forEach(a=>{if(l.has(a))return;let c,u;if(a.startsWith(s)?(c=a,u=a.replace(s,o)):a.startsWith(o)&&(c=a.replace(o,s),u=a),c&&u){const d=i[c],f=i[u];f===void 0?delete i[c]:i[c]=f,d===void 0?delete i[u]:i[u]=d,l.add(c),l.add(u)}}),i}function ma(n,e,t){typeof t.value=="object"&&(t.value=Bn(t.value)),!t.enumerable||t.get||t.set||!t.configurable||!t.writable||e==="__proto__"?Object.defineProperty(n,e,t):n[e]=t.value}function Bn(n){if(typeof n!="object")return n;var e=0,t,r,s,o=Object.prototype.toString.call(n);if(o==="[object Object]"?s=Object.create(n.__proto__||null):o==="[object Array]"?s=Array(n.length):o==="[object Set]"?(s=new Set,n.forEach(function(i){s.add(Bn(i))})):o==="[object Map]"?(s=new Map,n.forEach(function(i,l){s.set(Bn(l),Bn(i))})):o==="[object Date]"?s=new Date(+n):o==="[object RegExp]"?s=new RegExp(n.source,n.flags):o==="[object DataView]"?s=new n.constructor(Bn(n.buffer)):o==="[object ArrayBuffer]"?s=n.slice(0):o.slice(-6)==="Array]"&&(s=new n.constructor(n)),s){for(r=Object.getOwnPropertySymbols(n);e<r.length;e++)ma(s,r[e],Object.getOwnPropertyDescriptor(n,r[e]));for(e=0,r=Object.getOwnPropertyNames(n);e<r.length;e++)Object.hasOwnProperty.call(s,t=r[e])&&s[t]===n[t]||ma(s,t,Object.getOwnPropertyDescriptor(n,t))}return s||n}function nu(n){return typeof n!="string"?[]:n.split(".")}function Ne(n,e){const t=nu(n);if(t.length===0||typeof e!="object"||e===null)return;let r=e[t[0]];for(let s=1;s<t.length&&r!=null;s+=1)r=r[t[s]];return r}function Ar(n,e,t){const r=nu(n);if(r.length===0)return t;const s=Bn(t);if(r.length===1)return s[r[0]]=e,s;let o=s[r[0]];for(let i=1;i<r.length-1;i+=1){if(o===void 0)return s;o=o[r[i]]}return o[r[r.length-1]]=e,s}function Oh(n,{from:e,to:t},r){const s=Ne(n,r);if(!Array.isArray(s))return r;const o=[...s],i=s[e];return o.splice(e,1),o.splice(t,0,i),Ar(n,o,r)}function Dh(n,e,t,r){const s=Ne(n,r);if(!Array.isArray(s))return r;const o=[...s];return o.splice(typeof t=="number"?t:o.length,0,e),Ar(n,o,r)}function Ah(n,e,t){const r=Ne(n,t);return Array.isArray(r)?Ar(n,r.filter((s,o)=>o!==e),t):t}function Nh(n,e,t,r){const s=Ne(n,r);if(!Array.isArray(s)||s.length<=t)return r;const o=[...s];return o[t]=e,Ar(n,o,r)}function Rh({$values:n,$errors:e,$status:t}){const r=E.useCallback((l,a)=>{t.clearFieldDirty(l),e.setErrors(c=>Th(l,a,c)),n.setValues({values:Oh(l,a,n.refValues.current),updateState:!0})},[]),s=E.useCallback((l,a)=>{t.clearFieldDirty(l),e.setErrors(c=>pa(l,a,c,-1)),n.setValues({values:Ah(l,a,n.refValues.current),updateState:!0})},[]),o=E.useCallback((l,a,c)=>{t.clearFieldDirty(l),e.setErrors(u=>pa(l,c,u,1)),n.setValues({values:Dh(l,a,c,n.refValues.current),updateState:!0})},[]),i=E.useCallback((l,a,c)=>{t.clearFieldDirty(l),n.setValues({values:Nh(l,c,a,n.refValues.current),updateState:!0})},[]);return{reorderListItem:r,removeListItem:s,insertListItem:o,replaceListItem:i}}var Ho,ga;function Lh(){return ga||(ga=1,Ho=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),Ho}var Ih=Lh();const Br=ol(Ih);function Qn(n,e){const t=Object.keys(n);if(typeof e=="string"){const r=t.filter(s=>s.startsWith(`${e}.`));return n[e]||r.some(s=>n[s])||!1}return t.some(r=>n[r])}function jh({initialDirty:n,initialTouched:e,mode:t,$values:r}){const[s,o]=E.useState(e),[i,l]=E.useState(n),a=E.useRef(e),c=E.useRef(n),u=E.useCallback(v=>{const w=typeof v=="function"?v(a.current):v;a.current=w,t==="controlled"&&o(w)},[]),d=E.useCallback((v,w=!1)=>{const O=typeof v=="function"?v(c.current):v;c.current=O,(t==="controlled"||w)&&l(O)},[]),f=E.useCallback(()=>u({}),[]),h=E.useCallback(v=>{const w=v?{...r.refValues.current,...v}:r.refValues.current;r.setValuesSnapshot(w),d({})},[]),m=E.useCallback((v,w)=>{u(O=>Qn(O,v)===w?O:{...O,[v]:w})},[]),y=E.useCallback((v,w,O)=>{d(N=>Qn(N,v)===w?N:{...N,[v]:w},O)},[]),g=E.useCallback((v,w)=>{const O=Qn(c.current,v),N=!Br(Ne(v,r.getValuesSnapshot()),w),B=wi(v,c.current);B[v]=N,d(B,O!==N)},[]),b=E.useCallback(v=>Qn(a.current,v),[]),k=E.useCallback(v=>d(w=>{if(typeof v!="string")return w;const O=wi(v,w);return delete O[v],Br(O,w)?w:O}),[]),C=E.useCallback(v=>{if(v){const O=Ne(v,c.current);if(typeof O=="boolean")return O;const N=Ne(v,r.refValues.current),B=Ne(v,r.valuesSnapshot.current);return!Br(N,B)}return Object.keys(c.current).length>0?Qn(c.current):!Br(r.refValues.current,r.valuesSnapshot.current)},[]),T=E.useCallback(()=>c.current,[]),M=E.useCallback(()=>a.current,[]);return{touchedState:s,dirtyState:i,touchedRef:a,dirtyRef:c,setTouched:u,setDirty:d,resetDirty:h,resetTouched:f,isTouched:b,setFieldTouched:m,setFieldDirty:y,setTouchedState:o,setDirtyState:l,clearFieldDirty:k,isDirty:C,getDirty:T,getTouched:M,setCalculatedFieldDirty:g}}function Ph({initialValues:n,onValuesChange:e,mode:t}){const r=E.useRef(!1),[s,o]=E.useState(n||{}),i=E.useRef(s),l=E.useRef(s),a=E.useCallback(({values:g,subscribers:b,updateState:k=!0,mergeWithPreviousValues:C=!0})=>{const T=i.current,M=g instanceof Function?g(i.current):g,v=C?{...T,...M}:M;i.current=v,k&&(o(v),t==="uncontrolled"&&(i.current=v)),e==null||e(v,T),b==null||b.filter(Boolean).forEach(w=>w({updatedValues:v,previousValues:T}))},[e]),c=E.useCallback(g=>{var C;const b=Ne(g.path,i.current),k=g.value instanceof Function?g.value(b):g.value;if(b!==k){const T=i.current,M=Ar(g.path,k,i.current);a({values:M,updateState:g.updateState}),(C=g.subscribers)==null||C.filter(Boolean).forEach(v=>v({path:g.path,updatedValues:M,previousValues:T}))}},[a]),u=E.useCallback(g=>{l.current=g},[]),d=E.useCallback((g,b)=>{r.current||(r.current=!0,a({values:g,updateState:t==="controlled"}),u(g),b())},[a]),f=E.useCallback(()=>{a({values:l.current,updateState:!0,mergeWithPreviousValues:!1})},[a]),h=E.useCallback(()=>i.current,[]),m=E.useCallback(()=>l.current,[]),y=E.useCallback((g,b)=>{const k=Ne(g,l.current);typeof k>"u"||c({path:g,value:k,updateState:t==="controlled",subscribers:b})},[c,t]);return{initialized:r,stateValues:s,refValues:i,valuesSnapshot:l,setValues:a,setFieldValue:c,resetValues:f,setValuesSnapshot:u,initialize:d,getValues:h,getValuesSnapshot:m,resetField:y}}function _h({$status:n,cascadeUpdates:e}){const t=E.useRef({}),r=E.useCallback((o,i)=>{E.useEffect(()=>(t.current[o]=t.current[o]||[],t.current[o].push(i),()=>{t.current[o]=t.current[o].filter(l=>l!==i)}),[i])},[]),s=E.useCallback(o=>{var l;const i=((l=t.current[o])==null?void 0:l.map(a=>c=>a({previousValue:Ne(o,c.previousValues),value:Ne(o,c.updatedValues),touched:n.isTouched(o),dirty:n.isDirty(o)})))??[];if(e)for(const a in t.current)(a.startsWith(`${o}.`)||o.startsWith(`${a}.`))&&i.push(...t.current[a].map(c=>u=>c({previousValue:Ne(a,u.previousValues),value:Ne(a,u.updatedValues),touched:n.isTouched(a),dirty:n.isDirty(a)})));return i},[]);return{subscribers:t,watch:r,getFieldSubscribers:s}}function ya(n,e){return n?`${n}-${e.toString()}`:e.toString()}const Fr=Symbol("root-rule");function ba(n){const e=Mi(n);return{hasErrors:Object.keys(e).length>0,errors:e}}function Ei(n,e,t="",r={}){return typeof n!="object"||n===null?r:Object.keys(n).reduce((s,o)=>{const i=n[o],l=`${t===""?"":`${t}.`}${o}`,a=Ne(l,e);let c=!1;return typeof i=="function"&&(s[l]=i(a,e,l)),typeof i=="object"&&Array.isArray(a)&&(c=!0,a.forEach((u,d)=>Ei(i,e,`${l}.${d}`,s)),Fr in i&&(s[l]=i[Fr](a,e,l))),typeof i=="object"&&typeof a=="object"&&a!==null&&(c||Ei(i,e,l,s),Fr in i&&(s[l]=i[Fr](a,e,l))),s},r)}function Ti(n,e){return ba(typeof n=="function"?n(e):Ei(n,e))}function zr(n,e,t){if(typeof n!="string")return{hasError:!1,error:null};const r=Ti(e,t),s=Object.keys(r.errors).find(o=>n.split(".").every((i,l)=>i===o.split(".")[l]));return{hasError:!!s,error:s?r.errors[s]:null}}const Bh="__MANTINE_FORM_INDEX__";function xa(n,e){return e?typeof e=="boolean"?e:Array.isArray(e)?e.includes(n.replace(/[.][0-9]+/g,`.${Bh}`)):!1:!1}function Fh({name:n,mode:e="controlled",initialValues:t,initialErrors:r={},initialDirty:s={},initialTouched:o={},clearInputErrorOnChange:i=!0,validateInputOnChange:l=!1,validateInputOnBlur:a=!1,onValuesChange:c,transformValues:u=g=>g,enhanceGetInputProps:d,validate:f,onSubmitPreventDefault:h="always",touchTrigger:m="change",cascadeUpdates:y=!1}={}){const g=Eh(r),b=Ph({initialValues:t,onValuesChange:c,mode:e}),k=jh({initialDirty:s,initialTouched:o,$values:b,mode:e}),C=Rh({$values:b,$errors:g,$status:k}),T=_h({$status:k,cascadeUpdates:y}),[M,v]=E.useState(0),[w,O]=E.useState({}),[N,B]=E.useState(!1),Y=E.useCallback(()=>{b.resetValues(),g.clearErrors(),k.resetDirty(),k.resetTouched(),e==="uncontrolled"&&v(R=>R+1)},[]),$=E.useCallback(R=>{i&&g.clearErrors(),e==="uncontrolled"&&v(G=>G+1),Object.keys(T.subscribers.current).forEach(G=>{const oe=Ne(G,b.refValues.current),Z=Ne(G,R);oe!==Z&&T.getFieldSubscribers(G).forEach(me=>me({previousValues:R,updatedValues:b.refValues.current}))})},[i]),F=E.useCallback(R=>{const G=b.refValues.current;b.initialize(R,()=>e==="uncontrolled"&&v(oe=>oe+1)),$(G)},[$]),K=E.useCallback((R,G,oe)=>{const Z=xa(R,l),me=G instanceof Function?G(Ne(R,b.refValues.current)):G;k.setCalculatedFieldDirty(R,me),m==="change"&&k.setFieldTouched(R,!0),!Z&&i&&g.clearFieldError(R),b.setFieldValue({path:R,value:G,updateState:e==="controlled",subscribers:[...T.getFieldSubscribers(R),Z?pe=>{const ae=zr(R,f,pe.updatedValues);ae.hasError?g.setFieldError(R,ae.error):g.clearFieldError(R)}:null,(oe==null?void 0:oe.forceUpdate)!==!1&&e!=="controlled"?()=>O(pe=>({...pe,[R]:(pe[R]||0)+1})):null]})},[c,f]),ee=E.useCallback(R=>{const G=b.refValues.current;b.setValues({values:R,updateState:e==="controlled"}),$(G)},[c,$]),q=E.useCallback(()=>{const R=Ti(f,b.refValues.current);return g.setErrors(R.errors),R},[f]),J=E.useCallback(R=>{const G=zr(R,f,b.refValues.current);return G.hasError?g.setFieldError(R,G.error):g.clearFieldError(R),G},[f]),H=(R,{type:G="input",withError:oe=!0,withFocus:Z=!0,...me}={})=>{const ae={onChange:wh(re=>K(R,re,{forceUpdate:!1})),"data-path":ya(n,R)};return oe&&(ae.error=g.errorsState[R]),G==="checkbox"?ae[e==="controlled"?"checked":"defaultChecked"]=Ne(R,b.refValues.current):ae[e==="controlled"?"value":"defaultValue"]=Ne(R,b.refValues.current),Z&&(ae.onFocus=()=>k.setFieldTouched(R,!0),ae.onBlur=()=>{if(xa(R,a)){const re=zr(R,f,b.refValues.current);re.hasError?g.setFieldError(R,re.error):g.clearFieldError(R)}}),Object.assign(ae,d==null?void 0:d({inputProps:ae,field:R,options:{type:G,withError:oe,withFocus:Z,...me},form:de}))},W=(R,G)=>oe=>{h==="always"&&(oe==null||oe.preventDefault());const Z=q();if(Z.hasErrors)h==="validation-failed"&&(oe==null||oe.preventDefault()),G==null||G(Z.errors,b.refValues.current,oe);else{const me=R==null?void 0:R(u(b.refValues.current),oe);me instanceof Promise&&(B(!0),me.finally(()=>B(!1)))}},j=R=>u(R||b.refValues.current),S=E.useCallback(R=>{R.preventDefault(),Y()},[]),D=E.useCallback(R=>R?!zr(R,f,b.refValues.current).hasError:!Ti(f,b.refValues.current).hasErrors,[f]),A=R=>`${M}-${String(R)}-${w[String(R)]||0}`,P=E.useCallback(R=>document.querySelector(`[data-path="${ya(n,R)}"]`),[]),U=E.useCallback(R=>{b.resetField(R,[e!=="controlled"?()=>O(G=>({...G,[R]:(G[R]||0)+1})):null])},[b.resetField,e,O]),de={watch:T.watch,initialized:b.initialized.current,values:e==="uncontrolled"?b.refValues.current:b.stateValues,getValues:b.getValues,getInitialValues:b.getValuesSnapshot,setInitialValues:b.setValuesSnapshot,resetField:U,initialize:F,setValues:ee,setFieldValue:K,submitting:N,setSubmitting:B,errors:g.errorsState,setErrors:g.setErrors,setFieldError:g.setFieldError,clearFieldError:g.clearFieldError,clearErrors:g.clearErrors,resetDirty:k.resetDirty,setTouched:k.setTouched,setDirty:k.setDirty,isTouched:k.isTouched,resetTouched:k.resetTouched,isDirty:k.isDirty,getTouched:k.getTouched,getDirty:k.getDirty,reorderListItem:C.reorderListItem,insertListItem:C.insertListItem,removeListItem:C.removeListItem,replaceListItem:C.replaceListItem,reset:Y,validate:q,validateField:J,getInputProps:H,onSubmit:W,onReset:S,isValid:D,getTransformedValues:j,key:A,getInputNode:P};return Mh(n,de),de}const il={vertical:n=>p.jsx(x.Stack,{gap:"md",children:n}),horizontal:n=>p.jsx(x.Group,{wrap:"wrap",gap:"md",children:n}),grid:n=>p.jsx(x.Grid,{gutter:"md",children:n})},Oi=n=>{switch(n){case"number":return 0;case"array":return[];case"checkbox":return!1;case"object":return{};case"select":case"date":case"datetime":return null;default:return""}};function ar(n,e={}){const t={};for(const r of n)r.type==="object"&&r.fields?t[r.name]=ar(r.fields,e==null?void 0:e[r.name]):t[r.name]=(e==null?void 0:e[r.name])??r.initialValue??Oi(r.type);return t}function Di(n,e){const t={};for(const r of n){const s=(e==null?void 0:e[r.name])??Oi(r.type);if(r.required)if(r.type==="object"){Object.values(s).length||(t[r.name]=`${r.label||r.name} is required`);const o=Di(r.fields,s);for(const[i,l]of Object.entries(o))t[`${r.name}.${i}`]=l}else r.type==="array"?(s.length||(t[r.name]=`${r.label||r.name} is required`),s.forEach((o,i)=>{const l=Di(r.fields,o);for(const[a,c]of Object.entries(l))t[`${r.name}.${i}.${a}`]=c})):s===Oi(r.type)&&(t[r.name]=`${r.label||r.name} is required`)}return t}function so({field:n,layout:e,children:t}){if(e==="grid"){const r=n.column??6;return p.jsx(x.Grid.Col,{span:{base:12,md:r},children:t})}return e==="horizontal"?p.jsx(x.Box,{style:{display:"flex",alignItems:"center",gap:12},children:t}):p.jsx(x.Stack,{gap:"xs",children:t})}function zh({field:n,form:e,layout:t="grid"}){const r=n,s=e.getInputProps(r.name),o=s.value??[],i=r.readOnly===!0,l=r.disabled===!0;function a(){s.onFieldChange([...o,ar(r.fields)])}function c(u){s.onFieldChange(o.filter((d,f)=>f!==u))}return p.jsxs(x.Stack,{gap:"md",children:[o.map((u,d)=>{var f;return p.jsxs(x.Paper,{withBorder:!0,radius:"md",p:"md",shadow:"xs",children:[il[t]((f=r.fields)==null?void 0:f.map(h=>p.jsx(so,{field:h,layout:t,children:p.jsx(jo,{field:{...h,name:`${n.name}.${d}.${h.name}`,disabled:l||h.disabled,readOnly:i||h.readOnly},form:e,layout:t})},`${n.name}.${d}.${h.name}`))),!i&&!l&&p.jsx(x.Group,{justify:"flex-end",mt:"xs",children:p.jsx(x.Button,{color:"red",variant:"light",onClick:()=>c(d),children:"Remove"})})]},`${r.name}.${d}`)}),!i&&!l&&p.jsxs(p.Fragment,{children:[o.length>0&&p.jsx(x.Divider,{my:"sm"}),p.jsx(x.Button,{onClick:a,variant:"default",children:"Add Row"})]})]})}function Vh({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?p.jsx(x.Checkbox,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0,checked:t.value}):p.jsx(x.Checkbox,{...t,checked:t.value,onChange:o=>t.onFieldChange(o.target.checked),required:n.required,placeholder:n.placeholder,error:void 0})}function Hh({direction:n,levelIndex:e,rowIndex:t,cellIndex:r,size:s}){switch(n){case"up":return e===0&&t===0?null:t===0?{levelIndex:e-1,rowIndex:r<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:r}:{levelIndex:e,rowIndex:t-1,cellIndex:r};case"down":return t===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:r}:t===s[e].length-2&&r>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:r}:{levelIndex:e,rowIndex:t+1,cellIndex:r};case"left":return e===0&&t===0&&r===0?null:t===0&&r===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:r===0?{levelIndex:e,rowIndex:t-1,cellIndex:s[e][t-1]-1}:{levelIndex:e,rowIndex:t,cellIndex:r-1};case"right":return t===s[e].length-1&&r===s[e][t]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:r===s[e][t]-1?{levelIndex:e,rowIndex:t+1,cellIndex:0}:{levelIndex:e,rowIndex:t,cellIndex:r+1};default:return{levelIndex:e,rowIndex:t,cellIndex:r}}}function ru({controlsRef:n,direction:e,levelIndex:t,rowIndex:r,cellIndex:s,size:o}){var a,c,u;const i=Hh({direction:e,size:o,rowIndex:r,cellIndex:s,levelIndex:t});if(!i)return;const l=(u=(c=(a=n.current)==null?void 0:a[i.levelIndex])==null?void 0:c[i.rowIndex])==null?void 0:u[i.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?ru({controlsRef:n,direction:e,levelIndex:i.levelIndex,cellIndex:i.cellIndex,rowIndex:i.rowIndex,size:o}):l.focus())}function $h(n){switch(n){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Wh(n){var e;return(e=n.current)==null?void 0:e.map(t=>t.map(r=>r.length))}function ll({controlsRef:n,levelIndex:e,rowIndex:t,cellIndex:r,event:s}){const o=$h(s.key);if(o){s.preventDefault();const i=Wh(n);ru({controlsRef:n,direction:o,levelIndex:e,rowIndex:t,cellIndex:r,size:i})}}function ka(n,e){let t=n?L(n):L();if(e==="")return t.format("YYYY-MM-DD HH:mm:ss");const[r,s,o=0]=e.split(":").map(Number);return t=t.set("hour",r),t=t.set("minute",s),t=t.set("second",o),t=t.set("millisecond",0),t.format("YYYY-MM-DD HH:mm:ss")}function We(n){return n==null||n===""?n:L(n).format("YYYY-MM-DD")}function Fn(n){return n==null||n===""?n:L(n).format("YYYY-MM-DD HH:mm:ss")}function Yh({minDate:n,maxDate:e}){const t=L();return!n&&!e?We(t):n&&L(t).isBefore(n)?We(n):e&&L(t).isAfter(e)?We(e):We(t)}function $o(n,e,t){return!n&&!e?Fn(t):n&&L(t).isBefore(n)?Fn(n):e&&L(t).isAfter(e)?Fn(e):Fn(t)}const Uh={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},qh=E.createContext(Uh);function Lt(){const n=E.useContext(qh),e=E.useCallback(o=>o||n.locale,[n.locale]),t=E.useCallback(o=>typeof o=="number"?o:n.firstDayOfWeek,[n.firstDayOfWeek]),r=E.useCallback(o=>Array.isArray(o)?o:n.weekendDays,[n.weekendDays]),s=E.useCallback(o=>typeof o=="string"?o:n.labelSeparator,[n.labelSeparator]);return{...n,getLocale:e,getFirstDayOfWeek:t,getWeekendDays:r,getLabelSeparator:s}}function Kh({value:n,type:e,withTime:t}){const r=t?Fn:We;if(e==="range"&&Array.isArray(n)){const s=r(n[0]),o=r(n[1]);return s?o?`${s} – ${o}`:`${s} –`:""}return e==="multiple"&&Array.isArray(n)?n.filter(Boolean).join(", "):!Array.isArray(n)&&n?r(n):""}function al({value:n,type:e,name:t,form:r,withTime:s=!1}){return p.jsx("input",{type:"hidden",value:Kh({value:n,type:e,withTime:s}),name:t,form:r})}al.displayName="@mantine/dates/HiddenDatesInput";function su(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e<s;e++)n[e]&&(t=su(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function ou(){for(var n,e,t=0,r="",s=arguments.length;t<s;t++)(n=arguments[t])&&(e=su(n))&&(r&&(r+=" "),r+=e);return r}var Jh={input:"m_468e7eda"};const ds=x.factory((n,e)=>{const t=x.useProps("TimeInput",null,n),{classNames:r,styles:s,unstyled:o,vars:i,withSeconds:l,minTime:a,maxTime:c,value:u,onChange:d,step:f,...h}=t,{resolvedClassNames:m,resolvedStyles:y}=x.useResolvedStylesApi({classNames:r,styles:s,props:t}),g=k=>{if(a!==void 0||c!==void 0){const[C,T,M]=k.split(":").map(Number);if(a){const[v,w,O]=a.split(":").map(Number);if(C<v||C===v&&T<w||l&&C===v&&T===w&&M<O)return-1}if(c){const[v,w,O]=c.split(":").map(Number);if(C>v||C===v&&T>w||l&&C===v&&T===w&&M>O)return 1}}return 0},b=k=>{var C,T,M;if((C=t.onBlur)==null||C.call(t,k),a!==void 0||c!==void 0){const v=k.currentTarget.value;if(v){const w=g(v);w===1?(c&&(k.currentTarget.value=c),(T=t.onChange)==null||T.call(t,k)):w===-1&&(a&&(k.currentTarget.value=a),(M=t.onChange)==null||M.call(t,k))}}};return p.jsx(x.InputBase,{classNames:{...m,input:ou(Jh.input,m==null?void 0:m.input)},styles:y,unstyled:o,ref:e,value:u,step:f??(l?1:60),...h,onChange:d,onBlur:b,type:"time",__staticSelector:"TimeInput"})});ds.classes=x.InputBase.classes;ds.displayName="@mantine/dates/TimeInput";function Zr(n,e,t){return e===void 0&&t===void 0?n:e!==void 0&&t===void 0?Math.max(n,e):Math.min(e===void 0&&t!==void 0?n:Math.max(n,e),t)}function Gh(n="mantine-"){return`${n}${Math.random().toString(36).slice(2,11)}`}const Xh=["mousedown","touchstart"];function Qh(n,e,t){const r=E.useRef(null),s=Xh;return E.useEffect(()=>{const o=i=>{const{target:l}=i??{};if(Array.isArray(t)){const a=!document.body.contains(l)&&(l==null?void 0:l.tagName)!=="HTML";t.every(u=>!!u&&!i.composedPath().includes(u))&&!a&&n(i)}else r.current&&!r.current.contains(l)&&n(i)};return s.forEach(i=>document.addEventListener(i,o)),()=>{s.forEach(i=>document.removeEventListener(i,o))}},[r,n,t]),r}const Zh=typeof document<"u"?E.useLayoutEffect:E.useEffect;function fs(n,e){const t=E.useRef(!1);E.useEffect(()=>()=>{t.current=!1},[]),E.useEffect(()=>{if(t.current)return n();t.current=!0},e)}const ep=E.useId||(()=>{});function tp(){const n=ep();return n?`mantine-${n.replace(/:/g,"")}`:""}function np(n){const e=tp(),[t,r]=E.useState(e);return Zh(()=>{r(Gh())},[]),typeof window>"u"?e:t}function rp(n,e,t){E.useEffect(()=>(window.addEventListener(n,e,t),()=>window.removeEventListener(n,e,t)),[n,e])}function Sa(n,e){if(typeof n=="function")return n(e);typeof n=="object"&&n!==null&&"current"in n&&(n.current=e)}function sp(...n){const e=new Map;return t=>{if(n.forEach(r=>{const s=Sa(r,t);s&&e.set(r,s)}),e.size>0)return()=>{n.forEach(r=>{const s=e.get(r);s&&typeof s=="function"?s():Sa(r,null)}),e.clear()}}}function nr(...n){return E.useCallback(sp(...n),n)}function iu({value:n,defaultValue:e,finalValue:t,onChange:r=()=>{}}){const[s,o]=E.useState(e!==void 0?e:t),i=(l,...a)=>{o(l),r==null||r(l,...a)};return n!==void 0?[n,r,!0]:[s,i,!1]}function op(n){return e=>{if(!e)n(e);else if(typeof e=="function")n(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:t}=e;t.type==="checkbox"?n(t.checked):n(t.value)}else n(e)}}function ip(n){const[e,t]=E.useState(n);return[e,op(t)]}function cl(n=!1,e={}){const[t,r]=E.useState(n),s=E.useCallback(()=>{r(l=>{var a;return l||((a=e.onOpen)==null||a.call(e),!0)})},[e.onOpen]),o=E.useCallback(()=>{r(l=>{var a;return l&&((a=e.onClose)==null||a.call(e),!1)})},[e.onClose]),i=E.useCallback(()=>{t?o():s()},[o,s,t]);return[t,{open:s,close:o,toggle:i}]}function $e(n){return n<10?`0${n}`:`${n}`}const lp=n=>Number(n.toFixed(0)[0]),es=E.forwardRef(({value:n,min:e,max:t,onChange:r,focusable:s,step:o,onNextInput:i,onPreviousInput:l,onFocus:a,readOnly:c,allowTemporaryZero:u=!1,...d},f)=>{const h=lp(t),m=t+1-o,y=b=>{if(c)return;const k=b.replace(/\D/g,"");if(k!==""){const C=parseInt(k,10),T=u&&C===0&&e>0?0:Zr(C,e,t);r(T),(T>h||b.startsWith("00"))&&(i==null||i())}},g=b=>{if(!c){if((b.key==="0"||b.key==="Num0")&&n===0&&(b.preventDefault(),i==null||i()),b.key==="Home"&&(b.preventDefault(),r(e)),b.key==="End"&&(b.preventDefault(),r(t)),(b.key==="Backspace"||b.key==="Delete")&&(b.preventDefault(),n!==null?r(null):l==null||l()),b.key==="ArrowRight"&&(b.preventDefault(),i==null||i()),b.key==="ArrowLeft"&&(b.preventDefault(),l==null||l()),b.key==="ArrowUp"){b.preventDefault();const k=n===null?e:Zr(n+o,e,m);r(k)}if(b.key==="ArrowDown"){b.preventDefault();const k=n===null?m:Zr(n-o,e,m);r(k)}}};return p.jsx("input",{ref:f,type:"text",role:"spinbutton","aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":n===null?0:n,"data-empty":n===null||void 0,inputMode:"numeric",placeholder:"--",value:n===null?"":$e(n),onChange:b=>y(b.currentTarget.value),onKeyDown:g,onFocus:b=>{b.currentTarget.select(),a==null||a(b)},onClick:b=>{b.stopPropagation(),b.currentTarget.select()},onMouseDown:b=>b.stopPropagation(),...d})});es.displayName="@mantine/dates/SpinInput";const[ap,Mn]=x.createSafeContext("TimeInput component was not found in the component tree"),lu=E.forwardRef(({labels:n,value:e,onChange:t,className:r,style:s,onPreviousInput:o,readOnly:i,onMouseDown:l,onTouchStart:a,inputType:c,...u},d)=>{const f=Mn(),h=m=>{i||(m.key==="Home"&&(m.preventDefault(),t(n.am)),m.key==="End"&&(m.preventDefault(),t(n.pm)),(m.key==="Backspace"||m.key==="Delete")&&(m.preventDefault(),e===null?o==null||o():t(null)),m.key==="ArrowLeft"&&(m.preventDefault(),o==null||o()),(m.key==="ArrowUp"||m.key==="ArrowDown")&&(m.preventDefault(),t(e===n.am?n.pm:n.am)),m.code==="KeyA"&&(m.preventDefault(),t(n.am)),m.code==="KeyP"&&(m.preventDefault(),t(n.pm)))};if(c==="input"){const m=e||"--",y=m.length+1;return p.jsx("input",{...f.getStyles("field",{className:r,style:s}),ref:d,value:m,size:y,onChange:g=>!i&&t(g.target.value||null),onClick:g=>g.stopPropagation(),onKeyDown:h,onMouseDown:g=>{g.stopPropagation(),l==null||l(g)},"data-am-pm":!0,...u})}return p.jsxs("select",{...f.getStyles("field",{className:r,style:s}),ref:d,value:e||"",onChange:m=>!i&&t(m.target.value||null),onClick:m=>m.stopPropagation(),onKeyDown:h,onMouseDown:m=>{m.stopPropagation(),l==null||l(m)},"data-am-pm":!0,...u,children:[p.jsx("option",{value:"",children:"--"}),p.jsx("option",{value:n.am,children:n.am}),p.jsx("option",{value:n.pm,children:n.pm})]})});lu.displayName="@mantine/dates/AmPmInput";function ul({value:n,active:e,onSelect:t}){const r=Mn();return p.jsx(x.UnstyledButton,{mod:{active:e},onClick:()=>t(n),onMouseDown:s=>s.preventDefault(),"data-value":n,tabIndex:-1,...r.getStyles("control"),children:typeof n=="number"?$e(n):n})}ul.displayName="@mantine/dates/TimeControl";function au({labels:n,value:e,onSelect:t}){const r=Mn(),s=[n.am,n.pm].map(o=>p.jsx(ul,{value:o,active:e===o,onSelect:t},o));return p.jsx("div",{...r.getStyles("controlsList"),children:s})}au.displayName="@mantine/dates/AmPmControlsList";function cp(n,e){if(!n||!e)return!1;const t=n.getBoundingClientRect(),r=e.getBoundingClientRect();return t.top>=r.top&&t.bottom<=r.bottom&&t.left>=r.left&&t.right<=r.right}function up(n,e,t){const r=[];for(let s=n;s<=e;s+=t)r.push(s);return r}function ts({min:n,max:e,step:t,value:r,onSelect:s,reversed:o}){const i=Mn(),l=E.useRef(null),a=up(n,e,t),c=(o?a.reverse():a).map(u=>p.jsx(ul,{value:u,active:r===u,onSelect:s},u));return E.useEffect(()=>{r!==null&&requestAnimationFrame(()=>{var f;const d=(f=l.current)==null?void 0:f.querySelector(`[data-value="${r}"]`);cp(d,l.current)||d==null||d.scrollIntoView({block:"nearest"})})},[r]),p.jsx(x.ScrollArea,{h:i.maxDropdownContentHeight,type:"never",viewportRef:l,...i.getStyles("scrollarea"),...i.scrollAreaProps,children:p.jsx("div",{...i.getStyles("controlsList"),children:c})})}ts.displayName="@mantine/dates/TimeControlsList";function hs(n){const[e=null,t=null,r=null]=n.split(":").map(Number);return{hours:e,minutes:t,seconds:r}}function cu({time:n,compare:e,withSeconds:t}){const r=hs(n),s=hs(e);return t?r.hours===s.hours&&r.minutes===s.minutes&&r.seconds===s.seconds:r.hours===s.hours&&r.minutes===s.minutes}function dp(n,e){return`${n.getHours()}:${n.getMinutes()}${e?`:${n.getSeconds()}`:""}`}function fp({value:n,format:e,amPmLabels:t,withSeconds:r}){const s=hs(typeof n=="string"?n:dp(n,r));if(s.hours===null||s.minutes===null)return null;if(e==="24h")return`${$e(s.hours)}:${$e(s.minutes)}${r?`:${$e(s.seconds||0)}`:""}`;const o=s.hours>=12;return`${s.hours%12===0?12:s.hours%12}:${$e(s.minutes)}${r?`:${$e(s.seconds||0)}`:""} ${o?t.pm:t.am}`}function uu({value:n,format:e="24h",amPmLabels:t={am:"AM",pm:"PM"},withSeconds:r=!1}){return p.jsx(p.Fragment,{children:fp({value:n,format:e,amPmLabels:t,withSeconds:r})})}uu.displayName="@mantine/dates/TimeValue";function dl({value:n,active:e,onChange:t,format:r,amPmLabels:s,withSeconds:o}){const i=Mn();return p.jsx(x.UnstyledButton,{mod:{active:e},onClick:()=>t(n),...i.getStyles("presetControl"),children:p.jsx(uu,{withSeconds:o,value:n,format:r,amPmLabels:s})})}dl.displayName="@mantine/dates/TimePresetControl";function du({value:n,data:e,onChange:t,format:r,amPmLabels:s,withSeconds:o}){const i=Mn(),l=e.values.map(a=>p.jsx(dl,{value:a,format:r,amPmLabels:s,withSeconds:o,active:cu({time:a,compare:n,withSeconds:o}),onChange:t},a));return p.jsxs("div",{...i.getStyles("presetsGroup"),children:[p.jsx("div",{...i.getStyles("presetsGroupLabel"),children:e.label}),p.jsx(x.SimpleGrid,{cols:o?2:3,spacing:4,children:l})]})}du.displayName="@mantine/dates/TimePresetGroup";function fu({presets:n,format:e,amPmLabels:t,withSeconds:r,value:s,onChange:o}){const i=Mn();if(n.length===0)return null;if(typeof n[0]=="string"){const a=n.map(c=>p.jsx(dl,{value:c,format:e,amPmLabels:t,withSeconds:r,active:cu({time:c,compare:s,withSeconds:r}),onChange:o},c));return p.jsx(x.ScrollArea.Autosize,{mah:i.maxDropdownContentHeight,type:"never",...i.getStyles("scrollarea"),...i.scrollAreaProps,children:p.jsx("div",{...i.getStyles("presetsRoot"),children:p.jsx(x.SimpleGrid,{cols:r?2:3,spacing:4,children:a})})})}const l=n.map((a,c)=>p.jsx(du,{data:a,value:s,format:e,amPmLabels:t,withSeconds:r,onChange:o},c));return p.jsx(x.ScrollArea.Autosize,{mah:i.maxDropdownContentHeight,type:"never",...i.getStyles("scrollarea"),...i.scrollAreaProps,children:p.jsx("div",{...i.getStyles("presetsRoot"),children:l})})}fu.displayName="@mantine/dates/TimePresets";function Wo(n){const[e=0,t=0,r=0]=n.split(":").map(Number);return e*3600+t*60+r}function hp(n){const e=Math.floor(n/3600),t=Math.floor(n%3600/60),r=n%60;return{timeString:`${$e(e)}:${$e(t)}:${$e(r)}`,hours:e,minutes:t,seconds:r}}function hu(n,e,t){const r=Wo(n),s=Wo(e),o=Wo(t),i=Math.max(s,Math.min(r,o));return hp(i)}function pp({hours:n,minutes:e,seconds:t,amPmLabels:r}){if(n===null)return{hours:null,minutes:null,seconds:null,amPm:null};const s=n>=12?r.pm:r.am;return{hours:n%12===0?12:n%12,minutes:typeof e=="number"?e:null,seconds:typeof t=="number"?t:null,amPm:s}}function rr({time:n,format:e,amPmLabels:t}){if(n==="")return{hours:null,minutes:null,seconds:null,amPm:null};const{hours:r,minutes:s,seconds:o}=hs(n),i={hours:r,minutes:s,seconds:o};return e==="12h"?pp({...i,amPmLabels:t}):{...i,amPm:null}}function mp({hours:n,minutes:e,seconds:t,amPm:r,amPmLabels:s,withSeconds:o}){let i=n;return r===s.pm&&n!==12?i+=12:r===s.am&&n===12&&(i=0),`${$e(i)}:${$e(e)}${o?`:${$e(t||0)}`:""}`}function ns({hours:n,minutes:e,seconds:t,format:r,withSeconds:s,amPm:o,amPmLabels:i}){return n===null||e===null?{valid:!1,value:""}:s&&t===null?{valid:!1,value:""}:r==="24h"?{valid:!0,value:`${$e(n)}:${$e(e)}${s?`:${$e(t)}`:""}`}:o===null?{valid:!1,value:""}:{valid:!0,value:mp({hours:n,minutes:e,seconds:t,amPm:o,amPmLabels:i,withSeconds:s})}}function gp({value:n,defaultValue:e,onChange:t,format:r,amPmLabels:s,withSeconds:o=!1,min:i,max:l,clearable:a,readOnly:c,disabled:u,pasteSplit:d}){const f=rr({time:n||e||"",amPmLabels:s,format:r}),h=E.useRef(!0),[m,y]=E.useState(f.hours),[g,b]=E.useState(f.minutes),[k,C]=E.useState(f.seconds),[T,M]=E.useState(f.amPm),v=a&&!c&&!u&&(m!==null||g!==null||k!==null||T!==null),w=E.useRef(null),O=E.useRef(null),N=E.useRef(null),B=E.useRef(null),Y=S=>{var D,A,P,U;S==="hours"&&((D=w.current)==null||D.focus()),S==="minutes"&&((A=O.current)==null||A.focus()),S==="seconds"&&((P=N.current)==null||P.focus()),S==="amPm"&&((U=B.current)==null||U.focus())},$=(S,D)=>{const A={hours:m,minutes:g,seconds:k,amPm:T,[S]:D},P=ns({...A,format:r,withSeconds:o,amPmLabels:s});P.valid?(h.current=!1,S==="hours"&&y(D),S==="minutes"&&b(D),S==="seconds"&&C(D),S==="amPm"&&M(D),t==null||t(P.value)):(h.current=!1,typeof n=="string"&&n!==""&&(t==null||t("")))},F=S=>{h.current=!1;const D=rr({time:S,amPmLabels:s,format:r});y(D.hours),b(D.minutes),C(D.seconds),M(D.amPm),t==null||t(S)},K=S=>{let D=S;r==="12h"&&typeof S=="number"&&S>12&&(D=(S-1)%12+1),y(D),$("hours",D),Y("hours")},ee=S=>{b(S),$("minutes",S),Y("minutes")},q=S=>{C(S),$("seconds",S),Y("seconds")},J=S=>{M(S),$("amPm",S),Y("amPm")},H=()=>{h.current=!1,y(null),b(null),C(null),M(null),t==null||t(""),Y("hours")},W=S=>{S.preventDefault();const D=S.clipboardData.getData("text"),A=(d||rr)({time:D,format:r,amPmLabels:s}),P=ns({...A,format:r,withSeconds:o,amPmLabels:s});if(P.valid){h.current=!1;const U=hu(P.value,i||"00:00:00",l||"23:59:59");t==null||t(U.timeString),y(A.hours),b(A.minutes),C(A.seconds),M(A.amPm)}},j=ns({hours:m,minutes:g,seconds:k,format:r,withSeconds:o,amPm:T,amPmLabels:s});return fs(()=>{if(n===""){h.current=!1,y(null),b(null),C(null),M(null),h.current=!0;return}if(h.current&&typeof n=="string"){const S=rr({time:n||"",amPmLabels:s,format:r});y(S.hours),b(S.minutes),C(S.seconds),M(S.amPm)}h.current=!0},[n]),{refs:{hours:w,minutes:O,seconds:N,amPm:B},values:{hours:m,minutes:g,seconds:k,amPm:T},setHours:K,setMinutes:ee,setSeconds:q,setAmPm:J,focus:Y,clear:H,onPaste:W,setTimeString:F,isClearable:v,hiddenInputValue:j.value}}var pu={fieldsRoot:"m_7a8f1e6d",fieldsGroup:"m_d6bb0a54",controlsList:"m_b97ecb26",controlsListGroup:"m_31fe42f9",dropdown:"m_9c4817c3",control:"m_154c536b",presetControl:"m_7be09d0c",presetsGroup:"m_7d00001d",presetsGroupLabel:"m_d8d918d7",field:"m_6b43ba88"};const yp={hoursStep:1,minutesStep:1,secondsStep:1,format:"24h",amPmLabels:{am:"AM",pm:"PM"},pasteSplit:rr,maxDropdownContentHeight:200},bp=x.createVarsResolver((n,{size:e})=>({dropdown:{"--control-font-size":x.getFontSize(e)}})),fl=x.factory((n,e)=>{const t=x.useProps("TimePicker",yp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,onClick:c,format:u,value:d,defaultValue:f,onChange:h,hoursStep:m,minutesStep:y,secondsStep:g,withSeconds:b,hoursInputLabel:k,minutesInputLabel:C,secondsInputLabel:T,amPmInputLabel:M,amPmLabels:v,clearable:w,onMouseDown:O,onFocusCapture:N,onBlurCapture:B,min:Y,max:$,popoverProps:F,withDropdown:K,rightSection:ee,onFocus:q,onBlur:J,clearButtonProps:H,hoursInputProps:W,minutesInputProps:j,secondsInputProps:S,amPmSelectProps:D,readOnly:A,disabled:P,size:U,name:de,form:R,hiddenInputProps:G,labelProps:oe,pasteSplit:Z,hoursRef:me,minutesRef:pe,secondsRef:ae,amPmRef:re,presets:Ae,maxDropdownContentHeight:ue,scrollAreaProps:Se,attributes:ce,reverseTimeControlsList:Oe,...On}=t,{resolvedClassNames:nn,resolvedStyles:rn}=x.useResolvedStylesApi({classNames:r,styles:i,props:t}),et=x.useStyles({name:"TimePicker",classes:pu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:ce,vars:a,varsResolver:bp}),te=gp({value:d,defaultValue:f,onChange:h,format:u,amPmLabels:v,withSeconds:b,min:Y,max:$,clearable:w,disabled:P,readOnly:A,pasteSplit:Z}),sn=nr(te.refs.hours,me),on=nr(te.refs.minutes,pe),fe=nr(te.refs.seconds,ae),tt=nr(te.refs.amPm,re),qe=np(),Ct=E.useRef(!1),[Dn,jr]=E.useState(!1),An=se=>{Ct.current||(Ct.current=!0,q==null||q(se))},Po=se=>{if(!se.currentTarget.contains(se.relatedTarget)){const be=te.values,ln=ns({...be,format:u,amPmLabels:v,withSeconds:!!b});if(ln.valid&&Y&&$){const Ke=hu(ln.value,Y,$);Ke.timeString!==ln.value&&te.setTimeString(Ke.timeString)}Ct.current=!1,J==null||J(se)}};return p.jsx(ap,{value:{getStyles:et,scrollAreaProps:Se,maxDropdownContentHeight:ue},children:p.jsxs(x.Popover,{opened:Dn,transitionProps:{duration:0},position:"bottom-start",withRoles:!1,disabled:P||A||!K,...F,children:[p.jsx(x.Popover.Target,{children:p.jsxs(x.InputBase,{component:"div",size:U,disabled:P,ref:e,onClick:se=>{c==null||c(se),te.focus("hours")},onMouseDown:se=>{se.preventDefault(),O==null||O(se)},onFocusCapture:se=>{jr(!0),N==null||N(se)},onBlurCapture:se=>{jr(!1),B==null||B(se)},rightSection:ee||te.isClearable&&p.jsx(x.CloseButton,{...H,size:U,onClick:se=>{var be;te.clear(),(be=H==null?void 0:H.onClick)==null||be.call(H,se)},onMouseDown:se=>{var be;se.preventDefault(),(be=H==null?void 0:H.onMouseDown)==null||be.call(H,se)}}),labelProps:{htmlFor:qe,...oe},style:o,className:s,classNames:nn,styles:rn,__staticSelector:"TimePicker",...On,children:[p.jsx("div",{...et("fieldsRoot"),dir:"ltr",children:p.jsxs("div",{...et("fieldsGroup"),onBlur:Po,children:[p.jsx(es,{id:qe,...W,...et("field",{className:W==null?void 0:W.className,style:W==null?void 0:W.style}),value:te.values.hours,onChange:te.setHours,onNextInput:()=>te.focus("minutes"),min:u==="12h"?1:0,max:u==="12h"?12:23,allowTemporaryZero:u==="12h",focusable:!0,step:m,ref:sn,"aria-label":k,readOnly:A,disabled:P,onPaste:te.onPaste,onFocus:se=>{var be;An(se),(be=W==null?void 0:W.onFocus)==null||be.call(W,se)},onBlur:se=>{var Ke;const be=se.currentTarget.value,ln=be?parseInt(be,10):null;u==="12h"&&ln===0&&te.setHours(12),(Ke=W==null?void 0:W.onBlur)==null||Ke.call(W,se)}}),p.jsx("span",{children:":"}),p.jsx(es,{...j,...et("field",{className:j==null?void 0:j.className,style:j==null?void 0:j.style}),value:te.values.minutes,onChange:te.setMinutes,min:0,max:59,focusable:!0,step:y,ref:on,onPreviousInput:()=>te.focus("hours"),onNextInput:()=>b?te.focus("seconds"):te.focus("amPm"),"aria-label":C,tabIndex:-1,readOnly:A,disabled:P,onPaste:te.onPaste,onFocus:se=>{var be;An(se),(be=j==null?void 0:j.onFocus)==null||be.call(j,se)}}),b&&p.jsxs(p.Fragment,{children:[p.jsx("span",{children:":"}),p.jsx(es,{...S,...et("field",{className:S==null?void 0:S.className,style:S==null?void 0:S.style}),value:te.values.seconds,onChange:te.setSeconds,min:0,max:59,focusable:!0,step:g,ref:fe,onPreviousInput:()=>te.focus("minutes"),onNextInput:()=>te.focus("amPm"),"aria-label":T,tabIndex:-1,readOnly:A,disabled:P,onPaste:te.onPaste,onFocus:se=>{var be;An(se),(be=S==null?void 0:S.onFocus)==null||be.call(S,se)}})]}),u==="12h"&&p.jsx(lu,{...D,inputType:K?"input":"select",labels:v,value:te.values.amPm,onChange:te.setAmPm,ref:tt,"aria-label":M,onPreviousInput:()=>b?te.focus("seconds"):te.focus("minutes"),readOnly:A,disabled:P,tabIndex:-1,onPaste:te.onPaste,onFocus:se=>{var be;An(se),(be=D==null?void 0:D.onFocus)==null||be.call(D,se)}})]})}),p.jsx("input",{type:"hidden",name:de,form:R,value:te.hiddenInputValue,...G})]})}),p.jsx(x.Popover.Dropdown,{...et("dropdown"),onMouseDown:se=>se.preventDefault(),children:Ae?p.jsx(fu,{value:te.hiddenInputValue,onChange:te.setTimeString,format:u,presets:Ae,amPmLabels:v,withSeconds:b||!1}):p.jsxs("div",{...et("controlsListGroup"),children:[p.jsx(ts,{min:u==="12h"?1:0,max:u==="12h"?12:23,step:m,value:te.values.hours,onSelect:te.setHours,reversed:Oe}),p.jsx(ts,{min:0,max:59,step:y,value:te.values.minutes,onSelect:te.setMinutes,reversed:Oe}),b&&p.jsx(ts,{min:0,max:59,step:g,value:te.values.seconds,onSelect:te.setSeconds,reversed:Oe}),u==="12h"&&p.jsx(au,{labels:v,value:te.values.amPm,onSelect:te.setAmPm})]})})]})})});fl.displayName="@mantine/dates/TimePicker";fl.classes=pu;var mu={day:"m_396ce5cb"};const xp=x.createVarsResolver((n,{size:e})=>({day:{"--day-size":x.getSize(e,"day-size")}})),hl=x.factory((n,e)=>{const t=x.useProps("Day",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,date:c,disabled:u,__staticSelector:d,weekend:f,outside:h,selected:m,renderDay:y,inRange:g,firstInRange:b,lastInRange:k,hidden:C,static:T,highlightToday:M,attributes:v,...w}=t,O=x.useStyles({name:d||"Day",classes:mu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:v,vars:a,varsResolver:xp,rootSelector:"day"});return p.jsx(x.UnstyledButton,{...O("day",{style:C?{display:"none"}:void 0}),component:T?"div":"button",ref:e,disabled:u,"data-today":L(c).isSame(new Date,"day")||void 0,"data-hidden":C||void 0,"data-highlight-today":M||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!h&&f||void 0,"data-outside":!u&&h||void 0,"data-selected":!u&&m||void 0,"data-in-range":g&&!u||void 0,"data-first-in-range":b&&!u||void 0,"data-last-in-range":k&&!u||void 0,"data-static":T||void 0,unstyled:l,...w,children:(y==null?void 0:y(c))||L(c).date()})});hl.classes=mu;hl.displayName="@mantine/dates/Day";function kp({locale:n,format:e="dd",firstDayOfWeek:t=1}){const r=L().day(t),s=[];for(let o=0;o<7;o+=1)typeof e=="string"?s.push(L(r).add(o,"days").locale(n).format(e)):s.push(e(L(r).add(o,"days").format("YYYY-MM-DD")));return s}var gu={weekday:"m_18a3eca"};const Sp=x.createVarsResolver((n,{size:e})=>({weekdaysRow:{"--wr-fz":x.getFontSize(e),"--wr-spacing":x.getSpacing(e)}})),pl=x.factory((n,e)=>{const t=x.useProps("WeekdaysRow",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,locale:c,firstDayOfWeek:u,weekdayFormat:d,cellComponent:f="th",__staticSelector:h,withWeekNumbers:m,attributes:y,...g}=t,b=x.useStyles({name:h||"WeekdaysRow",classes:gu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:y,vars:a,varsResolver:Sp,rootSelector:"weekdaysRow"}),k=Lt(),C=kp({locale:k.getLocale(c),format:d,firstDayOfWeek:k.getFirstDayOfWeek(u)}).map((T,M)=>p.jsx(f,{...b("weekday"),children:T},M));return p.jsxs(x.Box,{component:"tr",ref:e,...b("weekdaysRow"),...g,children:[m&&p.jsx(f,{...b("weekday"),children:"#"}),C]})});pl.classes=gu;pl.displayName="@mantine/dates/WeekdaysRow";function vp(n,e=1){let t=L(n);if(!t.isValid())return t;const r=e===0?6:e-1;for(;t.day()!==r;)t=t.add(1,"day");return t.format("YYYY-MM-DD")}function Cp(n,e=1){let t=L(n);for(;t.day()!==e;)t=t.subtract(1,"day");return t.format("YYYY-MM-DD")}function Mp({month:n,firstDayOfWeek:e=1,consistentWeeks:t}){const r=L(n).subtract(L(n).date()-1,"day"),s=L(r.format("YYYY-M-D")),o=s.format("YYYY-MM-DD"),i=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),l=vp(i,e),a=[];let c=L(Cp(o,e));for(;L(c).isBefore(l,"day");){const u=[];for(let d=0;d<7;d+=1)u.push(c.format("YYYY-MM-DD")),c=c.add(1,"day");a.push(u)}if(t&&a.length<6){const u=a[a.length-1],d=u[u.length-1];let f=L(d).add(1,"day");for(;a.length<6;){const h=[];for(let m=0;m<7;m+=1)h.push(f.format("YYYY-MM-DD")),f=f.add(1,"day");a.push(h)}}return a}function oo(n,e){return L(n).format("YYYY-MM")===L(e).format("YYYY-MM")}function yu(n,e){return e?L(n).isAfter(L(e).subtract(1,"day"),"day"):!0}function bu(n,e){return e?L(n).isBefore(L(e).add(1,"day"),"day"):!0}function wp({dates:n,minDate:e,maxDate:t,getDayProps:r,excludeDate:s,hideOutsideDates:o,month:i}){const l=n.flat().filter(u=>{var d;return bu(u,t)&&yu(u,e)&&!(s!=null&&s(u))&&!((d=r==null?void 0:r(u))!=null&&d.disabled)&&(!o||oo(u,i))}),a=l.find(u=>{var d;return(d=r==null?void 0:r(u))==null?void 0:d.selected});if(a)return a;const c=l.find(u=>L().isSame(u,"date"));return c||l[0]}var rs={exports:{}},Ep=rs.exports,va;function Tp(){return va||(va=1,function(n,e){(function(t,r){n.exports=r()})(Ep,function(){var t="day";return function(r,s,o){var i=function(c){return c.add(4-c.isoWeekday(),t)},l=s.prototype;l.isoWeekYear=function(){return i(this).year()},l.isoWeek=function(c){if(!this.$utils().u(c))return this.add(7*(c-this.isoWeek()),t);var u,d,f,h,m=i(this),y=(u=this.isoWeekYear(),d=this.$u,f=(d?o.utc:o)().year(u).startOf("year"),h=4-f.isoWeekday(),f.isoWeekday()>4&&(h+=7),f.add(h,t));return m.diff(y,"week")+1},l.isoWeekday=function(c){return this.$utils().u(c)?this.day()||7:this.day(this.day()%7?c:c-7)};var a=l.startOf;l.startOf=function(c,u){var d=this.$utils(),f=!!d.u(u)||u;return d.p(c)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):a.bind(this)(c,u)}}})}(rs)),rs.exports}var Op=Tp();const Dp=ol(Op);L.extend(Dp);function Ap(n){const e=n.find(t=>L(t).day()===1);return L(e).isoWeek()}var xu={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Np={withCellSpacing:!0},Rp=x.createVarsResolver((n,{size:e})=>({weekNumber:{"--wn-fz":x.getFontSize(e),"--wn-size":x.getSize(e,"wn-size")}})),io=x.factory((n,e)=>{const t=x.useProps("Month",Np,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,locale:u,firstDayOfWeek:d,weekdayFormat:f,month:h,weekendDays:m,getDayProps:y,excludeDate:g,minDate:b,maxDate:k,renderDay:C,hideOutsideDates:T,hideWeekdays:M,getDayAriaLabel:v,static:w,__getDayRef:O,__onDayKeyDown:N,__onDayClick:B,__onDayMouseEnter:Y,__preventFocus:$,__stopPropagation:F,withCellSpacing:K,size:ee,highlightToday:q,withWeekNumbers:J,attributes:H,...W}=t,j=x.useStyles({name:c||"Month",classes:xu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:H,vars:a,varsResolver:Rp,rootSelector:"month"}),S=Lt(),D=Mp({month:h,firstDayOfWeek:S.getFirstDayOfWeek(d),consistentWeeks:S.consistentWeeks}),A=wp({dates:D,minDate:We(b),maxDate:We(k),getDayProps:y,excludeDate:g,hideOutsideDates:T,month:h}),{resolvedClassNames:P,resolvedStyles:U}=x.useResolvedStylesApi({classNames:r,styles:i,props:t}),de=D.map((R,G)=>{const oe=R.map((Z,me)=>{const pe=!oo(Z,h),ae=(v==null?void 0:v(Z))||L(Z).locale(u||S.locale).format("D MMMM YYYY"),re=y==null?void 0:y(Z),Ae=L(Z).isSame(A,"date");return p.jsx("td",{...j("monthCell"),"data-with-spacing":K||void 0,children:p.jsx(hl,{__staticSelector:c||"Month",classNames:P,styles:U,unstyled:l,"data-mantine-stop-propagation":F||void 0,highlightToday:q,renderDay:C,date:Z,size:ee,weekend:S.getWeekendDays(m).includes(L(Z).get("day")),outside:pe,hidden:T?pe:!1,"aria-label":ae,static:w,disabled:(g==null?void 0:g(Z))||!bu(Z,We(k))||!yu(Z,We(b)),ref:ue=>{ue&&(O==null||O(G,me,ue))},...re,onKeyDown:ue=>{var Se;(Se=re==null?void 0:re.onKeyDown)==null||Se.call(re,ue),N==null||N(ue,{rowIndex:G,cellIndex:me,date:Z})},onMouseEnter:ue=>{var Se;(Se=re==null?void 0:re.onMouseEnter)==null||Se.call(re,ue),Y==null||Y(ue,Z)},onClick:ue=>{var Se;(Se=re==null?void 0:re.onClick)==null||Se.call(re,ue),B==null||B(ue,Z)},onMouseDown:ue=>{var Se;(Se=re==null?void 0:re.onMouseDown)==null||Se.call(re,ue),$&&ue.preventDefault()},tabIndex:$||!Ae?-1:0})},Z.toString())});return p.jsxs("tr",{...j("monthRow"),children:[J&&p.jsx("td",{...j("weekNumber"),children:Ap(R)}),oe]},G)});return p.jsxs(x.Box,{component:"table",...j("month"),size:ee,ref:e,...W,children:[!M&&p.jsx("thead",{...j("monthThead"),children:p.jsx(pl,{__staticSelector:c||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:f,size:ee,classNames:P,styles:U,unstyled:l,withWeekNumbers:J})}),p.jsx("tbody",{...j("monthTbody"),children:de})]})});io.classes=xu;io.displayName="@mantine/dates/Month";var ku={pickerControl:"m_dc6a3c71"};const Lp=x.createVarsResolver((n,{size:e})=>({pickerControl:{"--dpc-fz":x.getFontSize(e),"--dpc-size":x.getSize(e,"dpc-size")}})),lo=x.factory((n,e)=>{const t=x.useProps("PickerControl",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,firstInRange:c,lastInRange:u,inRange:d,__staticSelector:f,selected:h,disabled:m,attributes:y,...g}=t,b=x.useStyles({name:f||"PickerControl",classes:ku,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:y,vars:a,varsResolver:Lp,rootSelector:"pickerControl"});return p.jsx(x.UnstyledButton,{...b("pickerControl"),ref:e,unstyled:l,"data-picker-control":!0,"data-selected":h&&!m||void 0,"data-disabled":m||void 0,"data-in-range":d&&!m&&!h||void 0,"data-first-in-range":c&&!m||void 0,"data-last-in-range":u&&!m||void 0,disabled:m,...g})});lo.classes=ku;lo.displayName="@mantine/dates/PickerControl";function Su({year:n,minDate:e,maxDate:t}){return!e&&!t?!1:!!(e&&L(n).isBefore(e,"year")||t&&L(n).isAfter(t,"year"))}function Ip({years:n,minDate:e,maxDate:t,getYearControlProps:r}){const s=n.flat().filter(l=>{var a;return!Su({year:l,minDate:e,maxDate:t})&&!((a=r==null?void 0:r(l))!=null&&a.disabled)}),o=s.find(l=>{var a;return(a=r==null?void 0:r(l))==null?void 0:a.selected});if(o)return o;const i=s.find(l=>L().isSame(l,"year"));return i||s[0]}function vu(n){const e=L(n).year(),t=e-e%10;let r=0;const s=[[],[],[],[]];for(let o=0;o<4;o+=1){const i=o===3?1:3;for(let l=0;l<i;l+=1)s[o].push(L(new Date(t+r,0)).format("YYYY-MM-DD")),r+=1}return s}var Cu={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const jp={yearsListFormat:"YYYY",withCellSpacing:!0},ao=x.factory((n,e)=>{const t=x.useProps("YearsList",jp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,decade:c,yearsListFormat:u,locale:d,minDate:f,maxDate:h,getYearControlProps:m,__staticSelector:y,__getControlRef:g,__onControlKeyDown:b,__onControlClick:k,__onControlMouseEnter:C,__preventFocus:T,__stopPropagation:M,withCellSpacing:v,size:w,attributes:O,...N}=t,B=x.useStyles({name:y||"YearsList",classes:Cu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:O,vars:a,rootSelector:"yearsList"}),Y=Lt(),$=vu(c),F=Ip({years:$,minDate:f,maxDate:h,getYearControlProps:m}),K=$.map((ee,q)=>{const J=ee.map((H,W)=>{const j=m==null?void 0:m(H),S=L(H).isSame(F,"year");return p.jsx("td",{...B("yearsListCell"),"data-with-spacing":v||void 0,children:p.jsx(lo,{...B("yearsListControl"),size:w,unstyled:l,"data-mantine-stop-propagation":M||void 0,disabled:Su({year:H,minDate:f,maxDate:h}),ref:D=>{D&&(g==null||g(q,W,D))},...j,onKeyDown:D=>{var A;(A=j==null?void 0:j.onKeyDown)==null||A.call(j,D),b==null||b(D,{rowIndex:q,cellIndex:W,date:H})},onClick:D=>{var A;(A=j==null?void 0:j.onClick)==null||A.call(j,D),k==null||k(D,H)},onMouseEnter:D=>{var A;(A=j==null?void 0:j.onMouseEnter)==null||A.call(j,D),C==null||C(D,H)},onMouseDown:D=>{var A;(A=j==null?void 0:j.onMouseDown)==null||A.call(j,D),T&&D.preventDefault()},tabIndex:T||!S?-1:0,children:L(H).locale(Y.getLocale(d)).format(u)})},W)});return p.jsx("tr",{...B("yearsListRow"),children:J},q)});return p.jsx(x.Box,{component:"table",ref:e,size:w,...B("yearsList"),...N,children:p.jsx("tbody",{children:K})})});ao.classes=Cu;ao.displayName="@mantine/dates/YearsList";function Mu({month:n,minDate:e,maxDate:t}){return!e&&!t?!1:!!(e&&L(n).isBefore(e,"month")||t&&L(n).isAfter(t,"month"))}function Pp({months:n,minDate:e,maxDate:t,getMonthControlProps:r}){const s=n.flat().filter(l=>{var a;return!Mu({month:l,minDate:e,maxDate:t})&&!((a=r==null?void 0:r(l))!=null&&a.disabled)}),o=s.find(l=>{var a;return(a=r==null?void 0:r(l))==null?void 0:a.selected});if(o)return o;const i=s.find(l=>L().isSame(l,"month"));return i||s[0]}function _p(n){const e=L(n).startOf("year").toDate(),t=[[],[],[],[]];let r=0;for(let s=0;s<4;s+=1)for(let o=0;o<3;o+=1)t[s].push(L(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return t}var wu={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Bp={monthsListFormat:"MMM",withCellSpacing:!0},co=x.factory((n,e)=>{const t=x.useProps("MonthsList",Bp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,year:u,monthsListFormat:d,locale:f,minDate:h,maxDate:m,getMonthControlProps:y,__getControlRef:g,__onControlKeyDown:b,__onControlClick:k,__onControlMouseEnter:C,__preventFocus:T,__stopPropagation:M,withCellSpacing:v,size:w,attributes:O,...N}=t,B=x.useStyles({name:c||"MonthsList",classes:wu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:O,vars:a,rootSelector:"monthsList"}),Y=Lt(),$=_p(u),F=Pp({months:$,minDate:We(h),maxDate:We(m),getMonthControlProps:y}),K=$.map((ee,q)=>{const J=ee.map((H,W)=>{const j=y==null?void 0:y(H),S=L(H).isSame(F,"month");return p.jsx("td",{...B("monthsListCell"),"data-with-spacing":v||void 0,children:p.jsx(lo,{...B("monthsListControl"),size:w,unstyled:l,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":M||void 0,disabled:Mu({month:H,minDate:We(h),maxDate:We(m)}),ref:D=>{D&&(g==null||g(q,W,D))},...j,onKeyDown:D=>{var A;(A=j==null?void 0:j.onKeyDown)==null||A.call(j,D),b==null||b(D,{rowIndex:q,cellIndex:W,date:H})},onClick:D=>{var A;(A=j==null?void 0:j.onClick)==null||A.call(j,D),k==null||k(D,H)},onMouseEnter:D=>{var A;(A=j==null?void 0:j.onMouseEnter)==null||A.call(j,D),C==null||C(D,H)},onMouseDown:D=>{var A;(A=j==null?void 0:j.onMouseDown)==null||A.call(j,D),T&&D.preventDefault()},tabIndex:T||!S?-1:0,children:L(H).locale(Y.getLocale(f)).format(d)})},W)});return p.jsx("tr",{...B("monthsListRow"),children:J},q)});return p.jsx(x.Box,{component:"table",ref:e,size:w,...B("monthsList"),...N,children:p.jsx("tbody",{children:K})})});co.classes=wu;co.displayName="@mantine/dates/MonthsList";var Eu={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Fp={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},zp=x.createVarsResolver((n,{size:e})=>({calendarHeader:{"--dch-control-size":x.getSize(e,"dch-control-size"),"--dch-fz":x.getFontSize(e)}})),Qt=x.factory((n,e)=>{const t=x.useProps("CalendarHeader",Fp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,nextIcon:c,previousIcon:u,nextLabel:d,previousLabel:f,onNext:h,onPrevious:m,onLevelClick:y,label:g,nextDisabled:b,previousDisabled:k,hasNextLevel:C,levelControlAriaLabel:T,withNext:M,withPrevious:v,headerControlsOrder:w,__staticSelector:O,__preventFocus:N,__stopPropagation:B,attributes:Y,...$}=t,F=x.useStyles({name:O||"CalendarHeader",classes:Eu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:Y,vars:a,varsResolver:zp,rootSelector:"calendarHeader"}),K=N?W=>W.preventDefault():void 0,ee=v&&E.createElement(x.UnstyledButton,{...F("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":f,onClick:m,unstyled:l,onMouseDown:K,disabled:k,"data-disabled":k||void 0,tabIndex:N||k?-1:0,"data-mantine-stop-propagation":B||void 0},u||p.jsx(x.AccordionChevron,{...F("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),q=E.createElement(x.UnstyledButton,{component:C?"button":"div",...F("calendarHeaderLevel"),key:"level",onClick:C?y:void 0,unstyled:l,onMouseDown:C?K:void 0,disabled:!C,"data-static":!C||void 0,"aria-label":T,tabIndex:N||!C?-1:0,"data-mantine-stop-propagation":B||void 0},g),J=M&&E.createElement(x.UnstyledButton,{...F("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":d,onClick:h,unstyled:l,onMouseDown:K,disabled:b,"data-disabled":b||void 0,tabIndex:N||b?-1:0,"data-mantine-stop-propagation":B||void 0},c||p.jsx(x.AccordionChevron,{...F("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),H=w.map(W=>W==="previous"?ee:W==="level"?q:W==="next"?J:null);return p.jsx(x.Box,{...F("calendarHeader"),ref:e,...$,children:H})});Qt.classes=Eu;Qt.displayName="@mantine/dates/CalendarHeader";function Vp(n){const e=vu(n);return[e[0][0],e[3][0]]}const Hp={decadeLabelFormat:"YYYY"},uo=x.factory((n,e)=>{const t=x.useProps("DecadeLevel",Hp,n),{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:y,previousIcon:g,nextLabel:b,previousLabel:k,onNext:C,onPrevious:T,nextDisabled:M,previousDisabled:v,levelControlAriaLabel:w,withNext:O,withPrevious:N,headerControlsOrder:B,decadeLabelFormat:Y,classNames:$,styles:F,unstyled:K,__staticSelector:ee,__stopPropagation:q,size:J,attributes:H,...W}=t,j=Lt(),[S,D]=Vp(r),A={__staticSelector:ee||"DecadeLevel",classNames:$,styles:F,unstyled:K,size:J,attributes:H},P=typeof M=="boolean"?M:i?!L(D).endOf("year").isBefore(i):!1,U=typeof v=="boolean"?v:o?!L(S).startOf("year").isAfter(o):!1,de=(R,G)=>L(R).locale(s||j.locale).format(G);return p.jsxs(x.Box,{"data-decade-level":!0,size:J,ref:e,...W,children:[p.jsx(Qt,{label:typeof Y=="function"?Y(S,D):`${de(S,Y)} – ${de(D,Y)}`,__preventFocus:m,__stopPropagation:q,nextIcon:y,previousIcon:g,nextLabel:b,previousLabel:k,onNext:C,onPrevious:T,nextDisabled:P,previousDisabled:U,hasNextLevel:!1,levelControlAriaLabel:w,withNext:O,withPrevious:N,headerControlsOrder:B,...A}),p.jsx(ao,{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:q,withCellSpacing:h,...A})]})});uo.classes={...ao.classes,...Qt.classes};uo.displayName="@mantine/dates/DecadeLevel";const $p={yearLabelFormat:"YYYY"},fo=x.factory((n,e)=>{const t=x.useProps("YearLevel",$p,n),{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:y,previousIcon:g,nextLabel:b,previousLabel:k,onNext:C,onPrevious:T,onLevelClick:M,nextDisabled:v,previousDisabled:w,hasNextLevel:O,levelControlAriaLabel:N,withNext:B,withPrevious:Y,headerControlsOrder:$,yearLabelFormat:F,__staticSelector:K,__stopPropagation:ee,size:q,classNames:J,styles:H,unstyled:W,attributes:j,...S}=t,D=Lt(),A={__staticSelector:K||"YearLevel",classNames:J,styles:H,unstyled:W,size:q,attributes:j},P=typeof v=="boolean"?v:i?!L(r).endOf("year").isBefore(i):!1,U=typeof w=="boolean"?w:o?!L(r).startOf("year").isAfter(o):!1;return p.jsxs(x.Box,{"data-year-level":!0,size:q,ref:e,...S,children:[p.jsx(Qt,{label:typeof F=="function"?F(r):L(r).locale(s||D.locale).format(F),__preventFocus:m,__stopPropagation:ee,nextIcon:y,previousIcon:g,nextLabel:b,previousLabel:k,onNext:C,onPrevious:T,onLevelClick:M,nextDisabled:P,previousDisabled:U,hasNextLevel:O,levelControlAriaLabel:N,withNext:B,withPrevious:Y,headerControlsOrder:$,...A}),p.jsx(co,{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:ee,withCellSpacing:h,...A})]})});fo.classes={...Qt.classes,...co.classes};fo.displayName="@mantine/dates/YearLevel";const Wp={monthLabelFormat:"MMMM YYYY"},ho=x.factory((n,e)=>{const t=x.useProps("MonthLevel",Wp,n),{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:y,__getDayRef:g,__onDayKeyDown:b,__onDayClick:k,__onDayMouseEnter:C,withCellSpacing:T,highlightToday:M,withWeekNumbers:v,__preventFocus:w,__stopPropagation:O,nextIcon:N,previousIcon:B,nextLabel:Y,previousLabel:$,onNext:F,onPrevious:K,onLevelClick:ee,nextDisabled:q,previousDisabled:J,hasNextLevel:H,levelControlAriaLabel:W,withNext:j,withPrevious:S,headerControlsOrder:D,monthLabelFormat:A,classNames:P,styles:U,unstyled:de,__staticSelector:R,size:G,static:oe,attributes:Z,...me}=t,pe=Lt(),ae={__staticSelector:R||"MonthLevel",classNames:P,styles:U,unstyled:de,size:G,attributes:Z},re=typeof q=="boolean"?q:d?!L(r).endOf("month").isBefore(d):!1,Ae=typeof J=="boolean"?J:u?!L(r).startOf("month").isAfter(u):!1;return p.jsxs(x.Box,{"data-month-level":!0,size:G,ref:e,...me,children:[p.jsx(Qt,{label:typeof A=="function"?A(r):L(r).locale(s||pe.locale).format(A),__preventFocus:w,__stopPropagation:O,nextIcon:N,previousIcon:B,nextLabel:Y,previousLabel:$,onNext:F,onPrevious:K,onLevelClick:ee,nextDisabled:re,previousDisabled:Ae,hasNextLevel:H,levelControlAriaLabel:W,withNext:j,withPrevious:S,headerControlsOrder:D,...ae}),p.jsx(io,{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:y,__getDayRef:g,__onDayKeyDown:b,__onDayClick:k,__onDayMouseEnter:C,__preventFocus:w,__stopPropagation:O,static:oe,withCellSpacing:T,highlightToday:M,withWeekNumbers:v,...ae})]})});ho.classes={...io.classes,...Qt.classes};ho.displayName="@mantine/dates/MonthLevel";var Tu={levelsGroup:"m_30b26e33"};const Zt=x.factory((n,e)=>{const t=x.useProps("LevelsGroup",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,attributes:u,...d}=t,f=x.useStyles({name:c||"LevelsGroup",classes:Tu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:u,vars:a,rootSelector:"levelsGroup"});return p.jsx(x.Box,{ref:e,...f("levelsGroup"),...d})});Zt.classes=Tu;Zt.displayName="@mantine/dates/LevelsGroup";const Yp={numberOfColumns:1},po=x.factory((n,e)=>{const t=x.useProps("DecadeLevelGroup",Yp,n),{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:h,previousIcon:m,nextLabel:y,previousLabel:g,onNext:b,onPrevious:k,nextDisabled:C,previousDisabled:T,headerControlsOrder:M,classNames:v,styles:w,unstyled:O,__staticSelector:N,__stopPropagation:B,numberOfColumns:Y,levelControlAriaLabel:$,decadeLabelFormat:F,size:K,vars:ee,attributes:q,...J}=t,H=E.useRef([]),W=Array(Y).fill(0).map((j,S)=>{const D=L(r).add(S*10,"years").format("YYYY-MM-DD");return p.jsx(uo,{size:K,yearsListFormat:l,decade:D,withNext:S===Y-1,withPrevious:S===0,decadeLabelFormat:F,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(A,P)=>ll({levelIndex:S,rowIndex:P.rowIndex,cellIndex:P.cellIndex,event:A,controlsRef:H}),__getControlRef:(A,P,U)=>{Array.isArray(H.current[S])||(H.current[S]=[]),Array.isArray(H.current[S][A])||(H.current[S][A]=[]),H.current[S][A][P]=U},levelControlAriaLabel:typeof $=="function"?$(D):$,locale:s,minDate:o,maxDate:i,__preventFocus:f,__stopPropagation:B,nextIcon:h,previousIcon:m,nextLabel:y,previousLabel:g,onNext:b,onPrevious:k,nextDisabled:C,previousDisabled:T,getYearControlProps:a,__staticSelector:N||"DecadeLevelGroup",classNames:v,styles:w,unstyled:O,withCellSpacing:d,headerControlsOrder:M,attributes:q},S)});return p.jsx(Zt,{classNames:v,styles:w,__staticSelector:N||"DecadeLevelGroup",ref:e,size:K,unstyled:O,attributes:q,...J,children:W})});po.classes={...Zt.classes,...uo.classes};po.displayName="@mantine/dates/DecadeLevelGroup";const Up={numberOfColumns:1},mo=x.factory((n,e)=>{const t=x.useProps("YearLevelGroup",Up,n),{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:h,previousIcon:m,nextLabel:y,previousLabel:g,onNext:b,onPrevious:k,onLevelClick:C,nextDisabled:T,previousDisabled:M,hasNextLevel:v,headerControlsOrder:w,classNames:O,styles:N,unstyled:B,__staticSelector:Y,__stopPropagation:$,numberOfColumns:F,levelControlAriaLabel:K,yearLabelFormat:ee,size:q,vars:J,attributes:H,...W}=t,j=E.useRef([]),S=Array(F).fill(0).map((D,A)=>{const P=L(r).add(A,"years").format("YYYY-MM-DD");return p.jsx(fo,{size:q,monthsListFormat:l,year:P,withNext:A===F-1,withPrevious:A===0,yearLabelFormat:ee,__stopPropagation:$,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(U,de)=>ll({levelIndex:A,rowIndex:de.rowIndex,cellIndex:de.cellIndex,event:U,controlsRef:j}),__getControlRef:(U,de,R)=>{Array.isArray(j.current[A])||(j.current[A]=[]),Array.isArray(j.current[A][U])||(j.current[A][U]=[]),j.current[A][U][de]=R},levelControlAriaLabel:typeof K=="function"?K(P):K,locale:s,minDate:o,maxDate:i,__preventFocus:f,nextIcon:h,previousIcon:m,nextLabel:y,previousLabel:g,onNext:b,onPrevious:k,onLevelClick:C,nextDisabled:T,previousDisabled:M,hasNextLevel:v,getMonthControlProps:a,classNames:O,styles:N,unstyled:B,__staticSelector:Y||"YearLevelGroup",withCellSpacing:d,headerControlsOrder:w,attributes:H},A)});return p.jsx(Zt,{classNames:O,styles:N,__staticSelector:Y||"YearLevelGroup",ref:e,size:q,unstyled:B,attributes:H,...W,children:S})});mo.classes={...fo.classes,...Zt.classes};mo.displayName="@mantine/dates/YearLevelGroup";const qp={numberOfColumns:1},go=x.factory((n,e)=>{const t=x.useProps("MonthLevelGroup",qp,n),{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:y,__onDayClick:g,__onDayMouseEnter:b,withCellSpacing:k,highlightToday:C,withWeekNumbers:T,__preventFocus:M,nextIcon:v,previousIcon:w,nextLabel:O,previousLabel:N,onNext:B,onPrevious:Y,onLevelClick:$,nextDisabled:F,previousDisabled:K,hasNextLevel:ee,headerControlsOrder:q,classNames:J,styles:H,unstyled:W,numberOfColumns:j,levelControlAriaLabel:S,monthLabelFormat:D,__staticSelector:A,__stopPropagation:P,size:U,static:de,vars:R,attributes:G,...oe}=t,Z=E.useRef([]),me=Array(j).fill(0).map((pe,ae)=>{const re=L(r).add(ae,"months").format("YYYY-MM-DD");return p.jsx(ho,{month:re,withNext:ae===j-1,withPrevious:ae===0,monthLabelFormat:D,__stopPropagation:P,__onDayClick:g,__onDayMouseEnter:b,__onDayKeyDown:(Ae,ue)=>ll({levelIndex:ae,rowIndex:ue.rowIndex,cellIndex:ue.cellIndex,event:Ae,controlsRef:Z}),__getDayRef:(Ae,ue,Se)=>{Array.isArray(Z.current[ae])||(Z.current[ae]=[]),Array.isArray(Z.current[ae][Ae])||(Z.current[ae][Ae]=[]),Z.current[ae][Ae][ue]=Se},levelControlAriaLabel:typeof S=="function"?S(re):S,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:y,__preventFocus:M,nextIcon:v,previousIcon:w,nextLabel:O,previousLabel:N,onNext:B,onPrevious:Y,onLevelClick:$,nextDisabled:F,previousDisabled:K,hasNextLevel:ee,classNames:J,styles:H,unstyled:W,__staticSelector:A||"MonthLevelGroup",size:U,static:de,withCellSpacing:k,highlightToday:C,withWeekNumbers:T,headerControlsOrder:q,attributes:G},ae)});return p.jsx(Zt,{classNames:J,styles:H,__staticSelector:A||"MonthLevelGroup",ref:e,size:U,attributes:G,...oe,children:me})});go.classes={...Zt.classes,...ho.classes};go.displayName="@mantine/dates/MonthLevelGroup";var Ou={input:"m_6fa5e2aa"};const yo=x.factory((n,e)=>{const{inputProps:t,wrapperProps:r,placeholder:s,classNames:o,styles:i,unstyled:l,popoverProps:a,modalProps:c,dropdownType:u,children:d,formattedValue:f,dropdownHandlers:h,dropdownOpened:m,onClick:y,clearable:g,onClear:b,clearButtonProps:k,rightSection:C,shouldClear:T,readOnly:M,disabled:v,value:w,name:O,form:N,type:B,onDropdownClose:Y,withTime:$,...F}=x.useInputProps("PickerInputBase",{size:"sm"},n),K=p.jsx(x.Input.ClearButton,{onClick:b,unstyled:l,...k}),ee=()=>{B==="range"&&Array.isArray(w)&&w[0]&&!w[1]&&b(),h.close()};return p.jsxs(p.Fragment,{children:[u==="modal"&&!M&&p.jsx(x.Modal,{opened:m,onClose:ee,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:l,...c,children:d}),p.jsx(x.Input.Wrapper,{...r,children:p.jsxs(x.Popover,{position:"bottom-start",opened:m,trapFocus:!0,returnFocus:!1,unstyled:l,onClose:Y,...a,disabled:(a==null?void 0:a.disabled)||u==="modal"||M,onChange:q=>{var J;q||((J=a==null?void 0:a.onClose)==null||J.call(a),ee())},children:[p.jsx(x.Popover.Target,{children:p.jsx(x.Input,{"data-dates-input":!0,"data-read-only":M||void 0,disabled:v,component:"button",type:"button",multiline:!0,onClick:q=>{y==null||y(q),h.toggle()},__clearSection:K,__clearable:g&&T&&!M&&!v,rightSection:C,...t,ref:e,classNames:{...o,input:ou(Ou.input,o==null?void 0:o.input)},...F,children:f||p.jsx(x.Input.Placeholder,{error:t.error,unstyled:l,className:o==null?void 0:o.placeholder,style:i==null?void 0:i.placeholder,children:s})})}),p.jsx(x.Popover.Dropdown,{"data-dates-dropdown":!0,children:d})]})}),p.jsx(al,{value:w,name:O,form:N,type:B,withTime:$})]})});yo.classes=Ou;yo.displayName="@mantine/dates/PickerInputBase";const Ca=n=>n==="range"?[null,null]:n==="multiple"?[]:null,Ma=(n,e)=>{const t=e?Fn:We;return Array.isArray(n)?n.map(t):t(n)};function br({type:n,value:e,defaultValue:t,onChange:r,withTime:s=!1}){const o=E.useRef(n),[i,l,a]=iu({value:Ma(e,s),defaultValue:Ma(t,s),finalValue:Ca(n),onChange:r});let c=i;return o.current!==n&&(o.current=n,e===void 0&&(c=t!==void 0?t:Ca(n),l(c))),[c,l,a]}function Yo(n,e){return n?n==="month"?0:n==="year"?1:2:e||0}function Kp(n){return n===0?"month":n===1?"year":"decade"}function Zn(n,e,t){return Kp(Zr(Yo(n,0),Yo(e,0),Yo(t,2)))}const Jp={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Kn=x.factory((n,e)=>{const t=x.useProps("Calendar",Jp,n),{vars:r,maxLevel:s,minLevel:o,defaultLevel:i,level:l,onLevelChange:a,date:c,defaultDate:u,onDateChange:d,numberOfColumns:f,columnsToScroll:h,ariaLabels:m,nextLabel:y,previousLabel:g,onYearSelect:b,onMonthSelect:k,onYearMouseEnter:C,onMonthMouseEnter:T,headerControlsOrder:M,__updateDateOnYearSelect:v,__updateDateOnMonthSelect:w,__setDateRef:O,__setLevelRef:N,firstDayOfWeek:B,weekdayFormat:Y,weekendDays:$,getDayProps:F,excludeDate:K,renderDay:ee,hideOutsideDates:q,hideWeekdays:J,getDayAriaLabel:H,monthLabelFormat:W,nextIcon:j,previousIcon:S,__onDayClick:D,__onDayMouseEnter:A,withCellSpacing:P,highlightToday:U,withWeekNumbers:de,monthsListFormat:R,getMonthControlProps:G,yearLabelFormat:oe,yearsListFormat:Z,getYearControlProps:me,decadeLabelFormat:pe,classNames:ae,styles:re,unstyled:Ae,minDate:ue,maxDate:Se,locale:ce,__staticSelector:Oe,size:On,__preventFocus:nn,__stopPropagation:rn,onNextDecade:et,onPreviousDecade:te,onNextYear:sn,onPreviousYear:on,onNextMonth:fe,onPreviousMonth:tt,static:qe,enableKeyboardNavigation:Ct,attributes:Dn,...jr}=t,{resolvedClassNames:An,resolvedStyles:Po}=x.useResolvedStylesApi({classNames:ae,styles:re,props:t}),[se,be]=iu({value:l?Zn(l,o,s):void 0,defaultValue:i?Zn(i,o,s):void 0,finalValue:Zn(void 0,o,s),onChange:a}),[ln,Ke]=br({type:"default",value:We(c),defaultValue:We(u),onChange:d});E.useImperativeHandle(O,()=>ye=>{Ke(ye)}),E.useImperativeHandle(N,()=>ye=>{be(ye)});const _o={__staticSelector:Oe||"Calendar",styles:Po,classNames:An,unstyled:Ae,size:On,attributes:Dn},Nn=h||f||1,oa=new Date,fh=ue&&L(oa).isAfter(ue)?ue:L(oa).format("YYYY-MM-DD"),Mt=ln||fh,hh=()=>{const ye=L(Mt).add(Nn,"month").format("YYYY-MM-DD");fe==null||fe(ye),Ke(ye)},ph=()=>{const ye=L(Mt).subtract(Nn,"month").format("YYYY-MM-DD");tt==null||tt(ye),Ke(ye)},Bo=()=>{const ye=L(Mt).add(Nn,"year").format("YYYY-MM-DD");sn==null||sn(ye),Ke(ye)},Fo=()=>{const ye=L(Mt).subtract(Nn,"year").format("YYYY-MM-DD");on==null||on(ye),Ke(ye)},zo=()=>{const ye=L(Mt).add(10*Nn,"year").format("YYYY-MM-DD");et==null||et(ye),Ke(ye)},Vo=()=>{const ye=L(Mt).subtract(10*Nn,"year").format("YYYY-MM-DD");te==null||te(ye),Ke(ye)},ia=E.useRef(null);E.useEffect(()=>{if(!Ct||qe)return;const ye=Je=>{var aa;if(!((aa=ia.current)!=null&&aa.contains(document.activeElement)))return;const Pr=Je.ctrlKey||Je.metaKey,la=Je.shiftKey;switch(Je.key){case"ArrowUp":Pr&&la?(Je.preventDefault(),Vo()):Pr&&(Je.preventDefault(),Fo());break;case"ArrowDown":Pr&&la?(Je.preventDefault(),zo()):Pr&&(Je.preventDefault(),Bo());break;case"y":case"Y":se==="month"&&(Je.preventDefault(),be("year"));break}};return document.addEventListener("keydown",ye),()=>{document.removeEventListener("keydown",ye)}},[Ct,qe,se,Bo,Fo,zo,Vo]);const mh=ye=>{ia.current=ye,typeof e=="function"?e(ye):e&&(e.current=ye)};return p.jsxs(x.Box,{ref:mh,size:On,"data-calendar":!0,...jr,children:[se==="month"&&p.jsx(go,{month:Mt,minDate:ue,maxDate:Se,firstDayOfWeek:B,weekdayFormat:Y,weekendDays:$,getDayProps:F,excludeDate:K,renderDay:ee,hideOutsideDates:q,hideWeekdays:J,getDayAriaLabel:H,onNext:hh,onPrevious:ph,hasNextLevel:s!=="month",onLevelClick:()=>be("year"),numberOfColumns:f,locale:ce,levelControlAriaLabel:m==null?void 0:m.monthLevelControl,nextLabel:(m==null?void 0:m.nextMonth)??y,nextIcon:j,previousLabel:(m==null?void 0:m.previousMonth)??g,previousIcon:S,monthLabelFormat:W,__onDayClick:D,__onDayMouseEnter:A,__preventFocus:nn,__stopPropagation:rn,static:qe,withCellSpacing:P,highlightToday:U,withWeekNumbers:de,headerControlsOrder:M,..._o}),se==="year"&&p.jsx(mo,{year:Mt,numberOfColumns:f,minDate:ue,maxDate:Se,monthsListFormat:R,getMonthControlProps:G,locale:ce,onNext:Bo,onPrevious:Fo,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>be("decade"),levelControlAriaLabel:m==null?void 0:m.yearLevelControl,nextLabel:(m==null?void 0:m.nextYear)??y,nextIcon:j,previousLabel:(m==null?void 0:m.previousYear)??g,previousIcon:S,yearLabelFormat:oe,__onControlMouseEnter:T,__onControlClick:(ye,Je)=>{w&&Ke(Je),be(Zn("month",o,s)),k==null||k(Je)},__preventFocus:nn,__stopPropagation:rn,withCellSpacing:P,headerControlsOrder:M,..._o}),se==="decade"&&p.jsx(po,{decade:Mt,minDate:ue,maxDate:Se,yearsListFormat:Z,getYearControlProps:me,locale:ce,onNext:zo,onPrevious:Vo,numberOfColumns:f,nextLabel:(m==null?void 0:m.nextDecade)??y,nextIcon:j,previousLabel:(m==null?void 0:m.previousDecade)??g,previousIcon:S,decadeLabelFormat:pe,__onControlMouseEnter:C,__onControlClick:(ye,Je)=>{v&&Ke(Je),be(Zn("year",o,s)),b==null||b(Je)},__preventFocus:nn,__stopPropagation:rn,withCellSpacing:P,headerControlsOrder:M,..._o})]})});Kn.classes={...po.classes,...mo.classes,...go.classes};Kn.displayName="@mantine/dates/Calendar";function ml(n){const{maxLevel:e,minLevel:t,defaultLevel:r,level:s,onLevelChange:o,nextIcon:i,previousIcon:l,date:a,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:h,nextLabel:m,previousLabel:y,onYearSelect:g,onMonthSelect:b,onYearMouseEnter:k,onMonthMouseEnter:C,onNextMonth:T,onPreviousMonth:M,onNextYear:v,onPreviousYear:w,onNextDecade:O,onPreviousDecade:N,withCellSpacing:B,highlightToday:Y,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:F,__setDateRef:K,__setLevelRef:ee,withWeekNumbers:q,headerControlsOrder:J,firstDayOfWeek:H,weekdayFormat:W,weekendDays:j,getDayProps:S,excludeDate:D,renderDay:A,hideOutsideDates:P,hideWeekdays:U,getDayAriaLabel:de,monthLabelFormat:R,monthsListFormat:G,getMonthControlProps:oe,yearLabelFormat:Z,yearsListFormat:me,getYearControlProps:pe,decadeLabelFormat:ae,allowSingleDateInRange:re,allowDeselect:Ae,minDate:ue,maxDate:Se,locale:ce,...Oe}=n;return{calendarProps:{maxLevel:e,minLevel:t,defaultLevel:r,level:s,onLevelChange:o,nextIcon:i,previousIcon:l,date:a,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:h,nextLabel:m,previousLabel:y,onYearSelect:g,onMonthSelect:b,onYearMouseEnter:k,onMonthMouseEnter:C,onNextMonth:T,onPreviousMonth:M,onNextYear:v,onPreviousYear:w,onNextDecade:O,onPreviousDecade:N,withCellSpacing:B,highlightToday:Y,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:F,__setDateRef:K,withWeekNumbers:q,headerControlsOrder:J,firstDayOfWeek:H,weekdayFormat:W,weekendDays:j,getDayProps:S,excludeDate:D,renderDay:A,hideOutsideDates:P,hideWeekdays:U,getDayAriaLabel:de,monthLabelFormat:R,monthsListFormat:G,getMonthControlProps:oe,yearLabelFormat:Z,yearsListFormat:me,getYearControlProps:pe,decadeLabelFormat:ae,allowSingleDateInRange:re,allowDeselect:Ae,minDate:ue,maxDate:Se,locale:ce},others:Oe}}function wa(n,e){const t=[...e].sort((r,s)=>L(r).isAfter(L(s))?1:-1);return L(t[0]).startOf("day").subtract(1,"ms").isBefore(n)&&L(t[1]).endOf("day").add(1,"ms").isAfter(n)}function Gp({type:n,level:e,value:t,defaultValue:r,onChange:s,allowSingleDateInRange:o,allowDeselect:i,onMouseLeave:l}){const[a,c]=br({type:n,value:t,defaultValue:r,onChange:s}),[u,d]=E.useState(n==="range"&&a[0]&&!a[1]?a[0]:null),[f,h]=E.useState(null),m=M=>{if(n==="range"){if(u&&!a[1]){if(L(M).isSame(u,e)&&!o){d(null),h(null),c([null,null]);return}const v=[M,u];v.sort((w,O)=>L(w).isAfter(L(O))?1:-1),c(v),h(null),d(null);return}if(a[0]&&!a[1]&&L(M).isSame(a[0],e)&&!o){d(null),h(null),c([null,null]);return}c([M,null]),h(null),d(M);return}if(n==="multiple"){a.some(v=>L(v).isSame(M,e))?c(a.filter(v=>!L(v).isSame(M,e))):c([...a,M]);return}a&&i&&L(M).isSame(a,e)?c(null):c(M)},y=M=>u&&f?wa(M,[f,u]):a[0]&&a[1]?wa(M,a):!1,g=n==="range"?M=>{l==null||l(M),h(null)}:l,b=M=>a[0]&&L(M).isSame(a[0],e)?!(f&&L(f).isBefore(a[0])):!1,k=M=>a[1]?L(M).isSame(a[1],e):!a[0]||!f?!1:L(f).isBefore(a[0])&&L(M).isSame(a[0],e),C=M=>{if(n==="range")return{selected:a.some(w=>w&&L(w).isSame(M,e)),inRange:y(M),firstInRange:b(M),lastInRange:k(M),"data-autofocus":!!a[0]&&L(a[0]).isSame(M,e)||void 0};if(n==="multiple")return{selected:a.some(w=>w&&L(w).isSame(M,e)),"data-autofocus":!!a[0]&&L(a[0]).isSame(M,e)||void 0};const v=L(a).isSame(M,e);return{selected:v,"data-autofocus":v||void 0}},T=n==="range"&&u?h:()=>{};return E.useEffect(()=>{if(n==="range")if(a[0]&&!a[1])d(a[0]);else{const M=a[0]==null&&a[1]==null,v=a[0]!=null&&a[1]!=null;(M||v)&&(d(null),h(null))}},[a]),{onDateChange:m,onRootMouseLeave:g,onHoveredDateChange:T,getControlProps:C,_value:a,setValue:c}}var Xp={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const Qp=x.createVarsResolver((n,{size:e})=>({datePickerRoot:{"--preset-font-size":x.getFontSize(e)}})),Zp={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},bo=x.factory((n,e)=>{const t=x.useProps("DatePicker",Zp,n),{allowDeselect:r,allowSingleDateInRange:s,value:o,defaultValue:i,onChange:l,onMouseLeave:a,classNames:c,styles:u,__staticSelector:d,__onDayClick:f,__onDayMouseEnter:h,__onPresetSelect:m,__stopPropagation:y,presets:g,className:b,style:k,unstyled:C,size:T,vars:M,attributes:v,...w}=t,{calendarProps:O,others:N}=ml(w),B=E.useRef(null),Y=E.useRef(null),$=x.useStyles({name:d||"DatePicker",classes:Xp,props:t,className:b,style:k,classNames:c,styles:u,unstyled:C,attributes:v,rootSelector:g?"datePickerRoot":void 0,varsResolver:Qp,vars:M}),{onDateChange:F,onRootMouseLeave:K,onHoveredDateChange:ee,getControlProps:q,_value:J,setValue:H}=Gp({type:N.type,level:"day",allowDeselect:r,allowSingleDateInRange:s,value:o,defaultValue:i,onChange:l,onMouseLeave:a}),{resolvedClassNames:W,resolvedStyles:j}=x.useResolvedStylesApi({classNames:c,styles:u,props:t}),S=p.jsx(Kn,{ref:e,classNames:W,styles:j,__staticSelector:d||"DatePicker",onMouseLeave:K,size:T,...O,...g?{}:N,__stopPropagation:y,__setDateRef:B,__setLevelRef:Y,minLevel:O.minLevel||"month",__onDayMouseEnter:(P,U)=>{ee(U),h==null||h(P,U)},__onDayClick:(P,U)=>{F(U),f==null||f(P,U)},getDayProps:P=>{var U;return{...q(P),...(U=O.getDayProps)==null?void 0:U.call(O,P)}},getMonthControlProps:P=>{var U;return{selected:typeof J=="string"?oo(P,J):!1,...(U=O.getMonthControlProps)==null?void 0:U.call(O,P)}},getYearControlProps:P=>{var U;return{selected:typeof J=="string"?L(P).isSame(J,"year"):!1,...(U=O.getYearControlProps)==null?void 0:U.call(O,P)}},hideOutsideDates:O.hideOutsideDates??O.numberOfColumns!==1,...g?{}:{className:b,style:k,attributes:v}});if(!g)return S;const D=P=>{var de,R;const U=Array.isArray(P)?P[0]:P;U!==void 0&&((de=B.current)==null||de.call(B,U),(R=Y.current)==null||R.call(Y,"month"),m?m(U):H(P))},A=g.map((P,U)=>p.jsx(x.UnstyledButton,{...$("presetButton"),onClick:()=>D(P.value),onMouseDown:de=>de.preventDefault(),"data-mantine-stop-propagation":y||void 0,children:P.label},U));return p.jsxs(x.Box,{...$("datePickerRoot"),size:T,...N,children:[p.jsx("div",{...$("presetsList"),children:A}),S]})});bo.classes=Kn.classes;bo.displayName="@mantine/dates/DatePicker";function em(n){if(n===null)return null;const e=new Date(n);return Number.isNaN(e.getTime())||!n?null:L(e).format("YYYY-MM-DD")}function tm({date:n,maxDate:e,minDate:t}){return!(n==null||Number.isNaN(new Date(n).getTime())||e&&L(n).isAfter(e,"date")||t&&L(n).isBefore(t,"date"))}const nm={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},ps=x.factory((n,e)=>{const t=x.useInputProps("DateInput",nm,n),{inputProps:r,wrapperProps:s,value:o,defaultValue:i,onChange:l,clearable:a,clearButtonProps:c,popoverProps:u,getDayProps:d,locale:f,valueFormat:h,dateParser:m,minDate:y,maxDate:g,fixOnBlur:b,onFocus:k,onBlur:C,onClick:T,onKeyDown:M,readOnly:v,name:w,form:O,rightSection:N,unstyled:B,classNames:Y,styles:$,allowDeselect:F,date:K,defaultDate:ee,onDateChange:q,getMonthControlProps:J,getYearControlProps:H,disabled:W,...j}=t,S=E.useRef(null),D=E.useRef(null),[A,P]=E.useState(!1),{calendarProps:U,others:de}=ml(j),R=Lt(),oe=m||(fe=>{const tt=L(fe,h,R.getLocale(f)).toDate();return Number.isNaN(tt.getTime())?em(fe):L(tt).format("YYYY-MM-DD")}),Z=F!==void 0?F:a,me=fe=>fe?L(fe).locale(R.getLocale(f)).format(h):"",[pe,ae,re]=br({type:"default",value:o,defaultValue:i,onChange:l}),[Ae,ue]=br({type:"default",value:K,defaultValue:i||ee,onChange:q});E.useEffect(()=>{re&&o!==null&&ue(o)},[re,o]);const[Se,ce]=E.useState(me(pe));E.useEffect(()=>{ce(me(pe))},[R.getLocale(f)]);const Oe=fe=>{const tt=fe.currentTarget.value;if(ce(tt),P(!0),tt.trim()===""&&(F||a))ae(null);else{const qe=oe(tt);qe&&tm({date:qe,minDate:y,maxDate:g})&&(ae(qe),ue(qe))}},On=fe=>{C==null||C(fe),P(!1),b&&ce(me(pe))},nn=fe=>{k==null||k(fe),P(!0)},rn=fe=>{T==null||T(fe),P(!0)},et=fe=>{fe.key==="Escape"&&P(!1),M==null||M(fe)},te=fe=>({...d==null?void 0:d(fe),selected:L(pe).isSame(fe,"day"),onClick:tt=>{var Ct,Dn;(Dn=d==null?void 0:(Ct=d(fe)).onClick)==null||Dn.call(Ct,tt);const qe=Z&&L(pe).isSame(fe,"day")?null:fe;ae(qe),!re&&qe&&ce(me(qe)),P(!1)}}),sn=p.jsx(x.Input.ClearButton,{onClick:()=>{ae(null),!re&&ce(""),P(!1)},unstyled:B,...c}),on=a&&!!pe&&!v&&!W;return fs(()=>{pe!==void 0&&!A&&ce(me(pe))},[pe]),Qh(()=>P(!1),void 0,[S.current,D.current]),p.jsxs(p.Fragment,{children:[p.jsx(x.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:S,children:p.jsxs(x.Popover,{opened:A,trapFocus:!1,position:"bottom-start",disabled:v||W,withRoles:!1,unstyled:B,...u,children:[p.jsx(x.Popover.Target,{children:p.jsx(x.Input,{"data-dates-input":!0,"data-read-only":v||void 0,autoComplete:"off",ref:e,value:Se,onChange:Oe,onBlur:On,onFocus:nn,onClick:rn,onKeyDown:et,readOnly:v,rightSection:N,__clearSection:sn,__clearable:on,...r,...de,disabled:W,__staticSelector:"DateInput"})}),p.jsx(x.Popover.Dropdown,{onMouseDown:fe=>fe.preventDefault(),"data-dates-dropdown":!0,ref:D,children:p.jsx(Kn,{__staticSelector:"DateInput",...U,classNames:Y,styles:$,unstyled:B,__preventFocus:!0,minDate:y,maxDate:g,locale:f,getDayProps:te,size:r.size,date:Ae,onDateChange:ue,getMonthControlProps:fe=>({selected:typeof pe=="string"?oo(fe,pe):!1,...J==null?void 0:J(fe)}),getYearControlProps:fe=>({selected:typeof pe=="string"?L(fe).isSame(pe,"year"):!1,...H==null?void 0:H(fe)}),attributes:s.attributes})})]})}),p.jsx(al,{name:w,form:O,value:pe,type:"default"})]})});ps.classes={...x.Input.classes,...Kn.classes};ps.displayName="@mantine/dates/DateInput";function rm({minDate:n,value:e}){const t=n?L(n).format("HH:mm:ss"):null;return e&&n&&e===n?t??void 0:void 0}function sm({maxDate:n,value:e}){const t=n?L(n).format("HH:mm:ss"):null;return e&&n&&e===n?t??void 0:void 0}var Du={timeWrapper:"m_208d2562",timeInput:"m_62ee059"};const om={dropdownType:"popover",size:"sm"},ms=x.factory((n,e)=>{const t=x.useProps("DateTimePicker",om,n),{value:r,defaultValue:s,onChange:o,valueFormat:i,locale:l,classNames:a,styles:c,unstyled:u,timePickerProps:d,submitButtonProps:f,withSeconds:h,level:m,defaultLevel:y,size:g,variant:b,dropdownType:k,vars:C,minDate:T,maxDate:M,defaultDate:v,defaultTimeValue:w,presets:O,attributes:N,onDropdownClose:B,...Y}=t,$=x.useStyles({name:"DateTimePicker",classes:Du,props:t,classNames:a,styles:c,unstyled:u,attributes:N,vars:C}),{resolvedClassNames:F,resolvedStyles:K}=x.useResolvedStylesApi({classNames:a,styles:c,props:t}),ee=i||(h?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),q=E.useRef(null),J=nr(q,d==null?void 0:d.hoursRef),{calendarProps:{allowSingleDateInRange:H,...W},others:j}=ml(Y),S=Lt(),[D,A]=br({type:"default",value:r,defaultValue:s,onChange:o,withTime:!0}),P=v||D,U=ce=>ce?L(ce).format(h?"HH:mm:ss":"HH:mm"):"",[de,R]=E.useState(w||U(D)),[G,oe]=E.useState(m||y||"month"),[Z,me]=cl(!1),pe=D?L(D).locale(S.getLocale(l)).format(ee):"",ae=ce=>{var Oe;(Oe=d==null?void 0:d.onChange)==null||Oe.call(d,ce),R(ce),ce&&A(ka(D,ce))},re=ce=>{var Oe;ce&&A(ka($o(T,M,ce),de||w||"")),(Oe=q.current)==null||Oe.focus()},Ae=ce=>{ce.key==="Enter"&&(ce.preventDefault(),me.close())};fs(()=>{Z||R(U(D))},[D,Z]),fs(()=>{Z&&oe("month")},[Z]);const ue=k==="popover",Se=()=>{const ce=$o(T,M,D);D&&D!==ce&&A($o(T,M,D)),B==null||B()};return p.jsxs(yo,{formattedValue:pe,dropdownOpened:Y.disabled?!1:Z,dropdownHandlers:me,classNames:F,styles:K,unstyled:u,ref:e,onClear:()=>A(null),shouldClear:!!D,value:D,size:g,variant:b,dropdownType:k,...j,type:"default",__staticSelector:"DateTimePicker",onDropdownClose:Se,withTime:!0,attributes:N,children:[p.jsx(bo,{...W,maxDate:M,minDate:T,size:g,variant:b,type:"default",value:D,defaultDate:P||Yh({maxDate:M,minDate:T}),onChange:re,locale:l,classNames:F,styles:K,unstyled:u,__staticSelector:"DateTimePicker",__stopPropagation:ue,level:m,defaultLevel:y,onLevelChange:ce=>{var Oe;oe(ce),(Oe=W.onLevelChange)==null||Oe.call(W,ce)},presets:O,__onPresetSelect:ce=>{A(ce),ce&&R(U(ce))},attributes:N}),G==="month"&&p.jsxs("div",{...$("timeWrapper"),children:[p.jsx(fl,{value:de,withSeconds:h,unstyled:u,min:rm({minDate:T,value:D}),max:sm({maxDate:M,value:D}),...d,...$("timeInput",{className:d==null?void 0:d.className,style:d==null?void 0:d.style}),onChange:ae,onKeyDown:Ae,size:g,"data-mantine-stop-propagation":ue||void 0,hoursRef:J,attributes:N}),p.jsx(x.ActionIcon,{variant:"default",size:`input-${g||"sm"}`,...$("submitButton",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),unstyled:u,"data-mantine-stop-propagation":ue||void 0,children:p.jsx(x.CheckIcon,{size:"30%"}),...f,onClick:ce=>{var Oe;(Oe=f==null?void 0:f.onClick)==null||Oe.call(f,ce),me.close(),Se()}})]})]})});ms.classes={...Du,...yo.classes,...bo.classes};ms.displayName="@mantine/dates/DateTimePicker";function im({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=t.value?typeof t.value=="string"?new Date(t.value):t.value:null,i=l=>{const a=l?l.toISOString():null;t.onFieldChange(a)};return r||s?p.jsx(ps,{valueFormat:"YYYY-MMM-DD",value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):p.jsx(ps,{valueFormat:"YYYY-MMM-DD",value:o,onChange:i,required:n.required,placeholder:n.placeholder,error:void 0})}function lm({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=t.value?typeof t.value=="string"?new Date(t.value):t.value:null,i=l=>{const a=l?l.toISOString():null;t.onFieldChange(a)};return r||s?p.jsx(ms,{valueFormat:"DD-MMM-YYYY hh:mm A",value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):p.jsx(ms,{value:o,valueFormat:"DD-MMM-YYYY hh:mm A",onChange:i,required:n.required,placeholder:n.placeholder,error:void 0})}function am({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?p.jsx(x.NumberInput,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):p.jsx(x.NumberInput,{...t,onChange:o=>t.onFieldChange(Number(o)),required:n.required,placeholder:n.placeholder,error:void 0})}function cm({field:n,form:e,layout:t="vertical"}){var s;const r=n;return il[t](p.jsx(p.Fragment,{children:(s=r.fields)==null?void 0:s.map(o=>p.jsx(so,{field:o,layout:t,children:p.jsx(jo,{field:{...o,name:`${n.name}.${o.name}`},form:e,layout:t})},`${n.name}.${o.name}`))}))}var Vr={exports:{}},Uo={};/**
|
|
23
|
+
* @license React
|
|
24
|
+
* use-sync-external-store-shim.production.js
|
|
25
|
+
*
|
|
26
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the MIT license found in the
|
|
29
|
+
* LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/var Ea;function um(){if(Ea)return Uo;Ea=1;var n=E;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,s=n.useEffect,o=n.useLayoutEffect,i=n.useDebugValue;function l(d,f){var h=f(),m=r({inst:{value:h,getSnapshot:f}}),y=m[0].inst,g=m[1];return o(function(){y.value=h,y.getSnapshot=f,a(y)&&g({inst:y})},[d,h,f]),s(function(){return a(y)&&g({inst:y}),d(function(){a(y)&&g({inst:y})})},[d]),i(h),h}function a(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!t(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return Uo.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:u,Uo}var qo={};/**
|
|
31
|
+
* @license React
|
|
32
|
+
* use-sync-external-store-shim.development.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/var Ta;function dm(){return Ta||(Ta=1,process.env.NODE_ENV!=="production"&&function(){function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function e(h,m){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=m();if(!d){var g=m();o(y,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}g=i({inst:{value:y,getSnapshot:m}});var b=g[0].inst,k=g[1];return a(function(){b.value=y,b.getSnapshot=m,t(b)&&k({inst:b})},[h,y,m]),l(function(){return t(b)&&k({inst:b}),h(function(){t(b)&&k({inst:b})})},[h]),c(y),y}function t(h){var m=h.getSnapshot;h=h.value;try{var y=m();return!o(h,y)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=E,o=typeof Object.is=="function"?Object.is:n,i=s.useState,l=s.useEffect,a=s.useLayoutEffect,c=s.useDebugValue,u=!1,d=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;qo.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),qo}var Oa;function gl(){return Oa||(Oa=1,process.env.NODE_ENV==="production"?Vr.exports=um():Vr.exports=dm()),Vr.exports}var Au=gl();function Fe(n){this.content=n}Fe.prototype={constructor:Fe,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),o=r.content.slice();return s==-1?o.push(t||n,e):(o[s+1]=e,t&&(o[s]=t)),new Fe(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Fe(t)},addToStart:function(n,e){return new Fe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Fe(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),o=r.find(n);return s.splice(o==-1?s.length:o,0,e,t),new Fe(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Fe.from(n),n.size?new Fe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Fe.from(n),n.size?new Fe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Fe.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Fe.from=function(n){if(n instanceof Fe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Fe(e)};function Nu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),o=e.child(r);if(s==o){t+=s.nodeSize;continue}if(!s.sameMarkup(o))return t;if(s.isText&&s.text!=o.text){for(let i=0;s.text[i]==o.text[i];i++)t++;return t}if(s.content.size||o.content.size){let i=Nu(s.content,o.content,t+1);if(i!=null)return i}t+=s.nodeSize}}function Ru(n,e,t,r){for(let s=n.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:t,b:r};let i=n.child(--s),l=e.child(--o),a=i.nodeSize;if(i==l){t-=a,r-=a;continue}if(!i.sameMarkup(l))return{a:t,b:r};if(i.isText&&i.text!=l.text){let c=0,u=Math.min(i.text.length,l.text.length);for(;c<u&&i.text[i.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(i.content.size||l.content.size){let c=Ru(i.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class I{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,o){for(let i=0,l=0;l<t;i++){let a=this.content[i],c=l+a.nodeSize;if(c>e&&r(a,s+l,o||null,i)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let o="",i=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(i?i=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new I(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let o=0,i=0;i<t;o++){let l=this.content[o],a=i+l.nodeSize;a>e&&((i<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-i),Math.min(l.text.length,t-i)):l=l.cut(Math.max(0,e-i-1),Math.min(l.content.size,t-i-1))),r.push(l),s+=l.nodeSize),i=a}return new I(r,s)}cutByIndex(e,t){return e==t?I.empty:e==0&&t==this.content.length?this:new I(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new I(s,o)}addToStart(e){return new I([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new I(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Nu(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Ru(this,e,t,r)}findIndex(e){if(e==0)return Hr(0,e);if(e==this.size)return Hr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),o=r+s.nodeSize;if(o>=e)return o==e?Hr(t+1,o):Hr(t,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return I.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new I(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return I.empty;let t,r=0;for(let s=0;s<e.length;s++){let o=e[s];r+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(t||(t=e.slice(0,s)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new I(t||e,r)}static from(e){if(!e)return I.empty;if(e instanceof I)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new I([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}I.empty=new I([],0);const Ko={index:0,offset:0};function Hr(n,e){return Ko.index=n,Ko.offset=e,Ko}function gs(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!gs(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!gs(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ke=class Ai{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&gs(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ai.none;if(e instanceof Ai)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};ke.none=[];class ys extends Error{}class V{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Iu(this.content,e+this.openStart,t);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(e,t){return new V(Lu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return V.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new V(I.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)s++;return new V(e,r,s)}}V.empty=new V(I.empty,0,0);function Lu(n,e,t){let{index:r,offset:s}=n.findIndex(e),o=n.maybeChild(r),{index:i,offset:l}=n.findIndex(t);if(s==e||o.isText){if(l!=t&&!n.child(i).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=i)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Lu(o.content,e-s-1,t-s-1)))}function Iu(n,e,t,r){let{index:s,offset:o}=n.findIndex(e),i=n.maybeChild(s);if(o==e||i.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Iu(i.content,e-o-1,t,i);return l&&n.replaceChild(s,i.copy(l))}function fm(n,e,t){if(t.openStart>n.depth)throw new ys("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ys("Inconsistent open depths");return ju(n,e,t,0)}function ju(n,e,t,r){let s=n.index(r),o=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let i=ju(n,e,t,r+1);return o.copy(o.content.replaceChild(s,i))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let i=n.parent,l=i.content;return mn(i,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:i,end:l}=hm(t,n);return mn(o,_u(n,i,l,e,r))}else return mn(o,bs(n,e,r))}function Pu(n,e){if(!e.type.compatibleContent(n.type))throw new ys("Cannot join "+e.type.name+" onto "+n.type.name)}function Ni(n,e,t){let r=n.node(t);return Pu(r,e.node(t)),r}function pn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function cr(n,e,t,r){let s=(e||n).node(t),o=0,i=e?e.index(t):s.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(pn(n.nodeAfter,r),o++));for(let l=o;l<i;l++)pn(s.child(l),r);e&&e.depth==t&&e.textOffset&&pn(e.nodeBefore,r)}function mn(n,e){return n.type.checkContent(e),n.copy(e)}function _u(n,e,t,r,s){let o=n.depth>s&&Ni(n,e,s+1),i=r.depth>s&&Ni(t,r,s+1),l=[];return cr(null,n,s,l),o&&i&&e.index(s)==t.index(s)?(Pu(o,i),pn(mn(o,_u(n,e,t,r,s+1)),l)):(o&&pn(mn(o,bs(n,e,s+1)),l),cr(e,t,s,l),i&&pn(mn(i,bs(t,r,s+1)),l)),cr(r,null,s,l),new I(l)}function bs(n,e,t){let r=[];if(cr(null,n,t,r),n.depth>t){let s=Ni(n,e,t+1);pn(mn(s,bs(n,e,t+1)),r)}return cr(e,null,t,r),new I(r)}function hm(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)s=e.node(o).copy(I.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class xr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)s+=r.child(o).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return ke.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new xs(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,o=t;for(let i=e;;){let{index:l,offset:a}=i.content.findIndex(o),c=o-a;if(r.push(i,l,s+a),!c||(i=i.child(l),i.isText))break;o=c-1,s+=a+1}return new xr(t,r,o)}static resolveCached(e,t){let r=Da.get(e);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==t)return i}else Da.set(e,r=new pm);let s=r.elts[r.i]=xr.resolve(e,t);return r.i=(r.i+1)%mm,s}}class pm{constructor(){this.elts=[],this.i=0}}const mm=12,Da=new WeakMap;class xs{constructor(e,t,r){this.$from=e,this.$to=t,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 gm=Object.create(null);class mt{constructor(e,t,r,s=ke.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||I.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&gs(this.attrs,t||e.defaultAttrs||gm)&&ke.sameSet(this.marks,r||ke.none)}copy(e=null){return e==this.content?this:new mt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new mt(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return V.empty;let s=this.resolve(e),o=this.resolve(t),i=r?0:s.sharedDepth(t),l=s.start(i),c=s.node(i).content.cut(s.pos-l,o.pos-l);return new V(c,s.depth-i,o.depth-i)}replace(e,t,r){return fm(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return xr.resolveCached(this,e)}resolveNoCache(e){return xr.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Bu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=I.empty,s=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,s,o),l=i&&i.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,t);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ke.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ke.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=I.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,s,r);return o.type.checkAttrs(o.attrs),o}}mt.prototype.text=void 0;class ks extends mt{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Bu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ks(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ks(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Bu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class xn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ym(e,t);if(r.next==null)return xn.empty;let s=Fu(r);r.next&&r.err("Unexpected trailing text");let o=Mm(Cm(s));return wm(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let o=t;s&&o<r;o++)s=s.matchType(e.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function o(i,l){let a=i.matchFragment(e,r);if(a&&(!t||a.validEnd))return I.from(l.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=o(d,l.concat(u));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let l=s;l.type;l=l.via)i.push(l.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:l,next:a}=o.next[i];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return o}).join(`
|
|
39
|
+
`)}}xn.empty=new xn(!0);class ym{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Fu(n){let e=[];do e.push(bm(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function bm(n){let e=[];do e.push(xm(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function xm(n){let e=vm(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=km(n,e);else break;return e}function Aa(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function km(n,e){let t=Aa(n),r=t;return n.eat(",")&&(n.next!="}"?r=Aa(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Sm(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let o in t){let i=t[o];i.isInGroup(e)&&s.push(i)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function vm(n){if(n.eat("(")){let e=Fu(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Sm(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Cm(n){let e=[[]];return s(o(n,0),t()),e;function t(){return e.push([])-1}function r(i,l,a){let c={term:a,to:l};return e[i].push(c),c}function s(i,l){i.forEach(a=>a.to=l)}function o(i,l){if(i.type=="choice")return i.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(i.type=="seq")for(let a=0;;a++){let c=o(i.exprs[a],l);if(a==i.exprs.length-1)return c;s(c,l=t())}else if(i.type=="star"){let a=t();return r(l,a),s(o(i.expr,a),a),[r(a)]}else if(i.type=="plus"){let a=t();return s(o(i.expr,l),a),s(o(i.expr,a),a),[r(a)]}else{if(i.type=="opt")return[r(l)].concat(o(i.expr,l));if(i.type=="range"){let a=l;for(let c=0;c<i.min;c++){let u=t();s(o(i.expr,a),u),a=u}if(i.max==-1)s(o(i.expr,a),a);else for(let c=i.min;c<i.max;c++){let u=t();r(a,u),s(o(i.expr,a),u),a=u}return[r(a)]}else{if(i.type=="name")return[r(l,void 0,i.value)];throw new Error("Unknown expr type")}}}}function zu(n,e){return e-n}function Na(n,e){let t=[];return r(e),t.sort(zu);function r(s){let o=n[s];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(s);for(let i=0;i<o.length;i++){let{term:l,to:a}=o[i];!l&&t.indexOf(a)==-1&&r(a)}}}function Mm(n){let e=Object.create(null);return t(Na(n,0));function t(r){let s=[];r.forEach(i=>{n[i].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Na(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new xn(r.indexOf(n.length-1)>-1);for(let i=0;i<s.length;i++){let l=s[i][1].sort(zu);o.next.push({type:s[i][0],next:e[l.join(",")]||t(l)})}return o}}function wm(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],o=!s.validEnd,i=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];i.push(a.name),o&&!(a.isText||a.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Vu(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Hu(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let o=n[r];if(o.hasDefault)s=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function $u(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let o=n[s];o.validate&&o.validate(e[s])}}function Wu(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Tm(n,r,e[r]);return t}let Ra=class Yu{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Wu(e,r.attrs),this.defaultAttrs=Vu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Hu(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new mt(this,this.computeAttrs(e),I.from(t),ke.setFrom(r))}createChecked(e=null,t,r){return t=I.from(t),this.checkContent(t),new mt(this,this.computeAttrs(e),t,ke.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=I.from(t),t.size){let i=this.contentMatch.fillBefore(t);if(!i)return null;t=i.append(t)}let s=this.contentMatch.matchFragment(t),o=s&&s.fillBefore(I.empty,!0);return o?new mt(this,e,t.append(o),ke.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){$u(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:ke.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,i)=>r[o]=new Yu(o,t,i));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Em(n,e,t){let r=t.split("|");return s=>{let o=s===null?"null":typeof s;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}class Tm{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Em(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class xo{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=Wu(e,s.attrs),this.excluded=null;let o=Vu(this.attrs);this.instance=o?new ke(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ke(this,Hu(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((o,i)=>r[o]=new xo(o,s++,t,i)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){$u(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Uu{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Fe.from(e.nodes),t.marks=Fe.from(e.marks||{}),this.nodes=Ra.compile(this.spec.nodes,this),this.marks=xo.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let o=this.nodes[s],i=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[i]||(r[i]=xn.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?La(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:La(this,i.split(" "))}this.nodeFromJSON=s=>mt.fromJSON(this,s),this.markFromJSON=s=>ke.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ra){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new ks(r,r.defaultAttrs,e,ke.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function La(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],o=n.marks[s],i=o;if(o)t.push(o);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(i=a)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Om(n){return n.tag!=null}function Dm(n){return n.style!=null}class Yt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Om(s))this.tags.push(s);else if(Dm(s)){let o=/[^=]*/.exec(s.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let o=e.nodes[s.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new ja(this,t,!1);return r.addAll(e,ke.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ja(this,t,!0);return r.addAll(e,ke.none,t.from,t.to),V.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let o=this.tags[s];if(Rm(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(e);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(e,t,r,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let i=this.styles[o],l=i.style;if(!(l.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(i.getAttrs){let a=i.getAttrs(t);if(a===!1)continue;i.attrs=a||void 0}return i}}}static schemaRules(e){let t=[];function r(s){let o=s.priority==null?50:s.priority,i=0;for(;i<t.length;i++){let l=t[i];if((l.priority==null?50:l.priority)<o)break}t.splice(i,0,s)}for(let s in e.marks){let o=e.marks[s].spec.parseDOM;o&&o.forEach(i=>{r(i=Pa(i)),i.mark||i.ignore||i.clearMark||(i.mark=s)})}for(let s in e.nodes){let o=e.nodes[s].spec.parseDOM;o&&o.forEach(i=>{r(i=Pa(i)),i.node||i.ignore||i.mark||(i.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Yt(e,Yt.schemaRules(e)))}}const qu={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},Am={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ku={ol:!0,ul:!0},kr=1,Ri=2,ss=4;function Ia(n,e,t){return e!=null?(e?kr:0)|(e==="full"?Ri:0):n&&n.whitespace=="pre"?kr|Ri:t&-5}class $r{constructor(e,t,r,s,o,i){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=i,this.content=[],this.activeMarks=ke.none,this.match=o||(i&ss?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(I.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&kr)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let t=I.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(I.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!qu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ja{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,o,i=Ia(null,t.preserveWhitespace,0)|(r?ss:0);s?o=new $r(s.type,s.attrs,ke.none,!0,t.topMatch||s.type.contentMatch,i):r?o=new $r(null,null,ke.none,!0,null,i):o=new $r(e.schema.topNodeType,null,ke.none,!0,null,i),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,o=s.options&Ri?"full":this.localPreserveWS||(s.options&kr)>0;if(o==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
40
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=s.content[s.content.length-1],l=e.previousSibling;(!i||l&&l.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),l;Ku.hasOwnProperty(i)&&this.parser.normalizeLists&&Nm(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Am.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(qu.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
41
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let o=this.parser.matchedStyles[s],i=r.getPropertyValue(o);if(i)for(let l=void 0;;){let a=this.parser.matchStyle(o,i,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(i,t.attrs||null,r,t.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,r,s){let o=r||0;for(let i=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];i!=l;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,r){let s,o;for(let i=this.open,l=0;i>=0;i--){let a=this.nodes[i],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,o=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(o);for(let i=0;i<s.length;i++)t=this.enterInner(s[i],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=ke.none;for(let l of s.concat(e.marks))(o.type?o.type.allowsMarkType(l.type):_a(l.type,e.type))&&(i=l.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,t,r,s){let o=this.findPlace(e.create(t),r,!1);return o&&(o=this.enterInner(e,t,r,!0,s)),o}enterInner(e,t,r,s=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let l=Ia(e,o,i.options);i.options&ss&&i.content.length==0&&(l|=ss);let a=ke.none;return r=r.filter(c=>(i.type?i.type.allowsMarkType(c.type):_a(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new $r(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=kr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(s?0:1),i=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(i(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Nm(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ku.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Rm(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Pa(n){let e={};for(let t in n)e[t]=n[t];return e}function _a(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let o=[],i=l=>{o.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||o.indexOf(u)<0&&i(u))return!0}};if(i(s.contentMatch))return!0}}class wn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Jo(t).createDocumentFragment());let s=r,o=[];return e.forEach(i=>{if(o.length||i.marks.length){let l=0,a=0;for(;l<o.length&&a<i.marks.length;){let c=i.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(o[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<o.length;)s=o.pop()[1];for(;a<i.marks.length;){let c=i.marks[a++],u=this.serializeMark(c,i.isInline,t);u&&(o.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(i,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=is(Jo(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let o=this.serializeMark(e.marks[s],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&is(Jo(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return is(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new wn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ba(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Ba(e.marks)}}function Ba(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Jo(n){return n.document||window.document}const Fa=new WeakMap;function Lm(n){let e=Fa.get(n);return e===void 0&&Fa.set(n,e=Im(n)),e}function Im(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function is(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],o;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Lm(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=s.indexOf(" ");i>0&&(t=s.slice(0,i),s=s.slice(i+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:m}=is(n,f,t,r);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Ju=65535,Gu=Math.pow(2,16);function jm(n,e){return n+e*Gu}function za(n){return n&Ju}function Pm(n){return(n-(n&Ju))/Gu}const Xu=1,Qu=2,ls=4,Zu=8;class Li{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Zu)>0}get deletedBefore(){return(this.delInfo&(Xu|ls))>0}get deletedAfter(){return(this.delInfo&(Qu|ls))>0}get deletedAcross(){return(this.delInfo&ls)>0}}class st{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&st.empty)return st.empty}recover(e){let t=0,r=za(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Pm(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+o],u=this.ranges[l+i],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let m=e==(t<0?a:d)?null:jm(l/3,e-a),y=e==a?Qu:e==d?Xu:ls;return(t<0?e!=a:e!=d)&&(y|=Zu),new Li(h,y,m)}s+=u-c}return r?e+s:new Li(e+s,0,null)}touches(e,t){let r=0,s=za(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+i]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let i=this.ranges[s],l=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),o+=u-c}}invert(){return new st(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?st.empty:new st(e<0?[0,-e,0]:[0,0,e])}}st.empty=new st([]);class Sr{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Sr(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new Sr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],l=i.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Li(e,s,null)}}const Go=Object.create(null);class Ue{getMap(){return st.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Go[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Go)throw new RangeError("Duplicate use of step JSON ID "+e);return Go[e]=t,t.prototype.jsonID=e,t}}class Re{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Re(e,null)}static fail(e){return new Re(null,e)}static fromReplace(e,t,r,s){try{return Re.ok(e.replace(t,r,s))}catch(o){if(o instanceof ys)return Re.fail(o.message);throw o}}}function yl(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let o=n.child(s);o.content.size&&(o=o.copy(yl(o.content,e,o))),o.isInline&&(o=e(o,t,s)),r.push(o)}return I.fromArray(r)}class Ht extends Ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),o=new V(yl(t.content,(i,l)=>!i.isAtom||!l.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),s),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,o)}invert(){return new pt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ht(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ht&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ht(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ht(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("addMark",Ht);class pt extends Ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new V(yl(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,r)}invert(){return new Ht(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new pt(t.pos,r.pos,this.mark)}merge(e){return e instanceof pt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new pt(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("removeMark",pt);class $t extends Ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new V(I.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new $t(this.pos,t.marks[s]);return new $t(this.pos,this.mark)}}return new kn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $t(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new $t(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("addNodeMark",$t);class kn extends Ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new V(I.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new $t(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new kn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new kn(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("removeNodeMark",kn);class Ie extends Ue{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&Ii(e,this.from,this.to)?Re.fail("Structure replace would overwrite content"):Re.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new st([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ie(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Ie(t.pos,Math.max(t.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ie)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?V.empty:new V(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ie(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?V.empty:new V(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ie(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ie(t.from,t.to,V.fromJSON(e,t.slice),!!t.structure)}}Ue.jsonID("replace",Ie);class je extends Ue{constructor(e,t,r,s,o,i,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=o,this.insert=i,this.structure=l}apply(e){if(this.structure&&(Ii(e,this.from,this.gapFrom)||Ii(e,this.gapTo,this.to)))return Re.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Re.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Re.fromReplace(e,this.from,this.to,r):Re.fail("Content does not fit in gap")}getMap(){return new st([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new je(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||o>r.pos?null:new je(t.pos,r.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new je(t.from,t.to,t.gapFrom,t.gapTo,V.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ue.jsonID("replaceAround",je);function Ii(n,e,t){let r=n.resolve(e),s=t-e,o=r.depth;for(;s>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,s--;if(s>0){let i=r.node(o).maybeChild(r.indexAfter(o));for(;s>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,s--}}return!1}function _m(n,e,t,r){let s=[],o=[],i,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),m=r.addToSet(d);for(let y=0;y<d.length;y++)d[y].isInSet(m)||(i&&i.to==f&&i.mark.eq(d[y])?i.to=h:s.push(i=new pt(f,h,d[y])));l&&l.to==f?l.to=h:o.push(l=new Ht(f,h,r))}}),s.forEach(a=>n.step(a)),o.forEach(a=>n.step(a))}function Bm(n,e,t,r){let s=[],o=0;n.doc.nodesBetween(e,t,(i,l)=>{if(!i.isInline)return;o++;let a=null;if(r instanceof xo){let c=i.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let c=Math.min(l+i.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let m=s[h];m.step==o-1&&d.eq(s[h].style)&&(f=m)}f?(f.to=c,f.step=o):s.push({style:d,from:Math.max(l,e),to:c,step:o})}}}),s.forEach(i=>n.step(new pt(i.from,i.to,i.style)))}function bl(n,e,t,r=t.contentMatch,s=!0){let o=n.doc.nodeAt(e),i=[],l=e+1;for(let a=0;a<o.childCount;a++){let c=o.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)i.push(new Ie(l,u,V.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new pt(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new V(I.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),i.push(new Ie(l+f.index,l+f.index+f[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(I.empty,!0);n.replace(l,l,new V(a,0,0))}for(let a=i.length-1;a>=0;a--)n.step(i[a])}function Fm(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Jn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let s=n.$from.node(r),o=n.$from.index(r),i=n.$to.indexAfter(r);if(r<n.depth&&s.canReplace(o,i,t))return r;if(r==0||s.type.spec.isolating||!Fm(s,o,i))break}return null}function zm(n,e,t){let{$from:r,$to:s,depth:o}=e,i=r.before(o+1),l=s.after(o+1),a=i,c=l,u=I.empty,d=0;for(let m=o,y=!1;m>t;m--)y||r.index(m)>0?(y=!0,u=I.from(r.node(m).copy(u)),d++):a--;let f=I.empty,h=0;for(let m=o,y=!1;m>t;m--)y||s.after(m+1)<s.end(m)?(y=!0,f=I.from(s.node(m).copy(f)),h++):c++;n.step(new je(a,c,i,l,new V(u.append(f),d,h),u.size-d,!0))}function xl(n,e,t=null,r=n){let s=Vm(n,e),o=s&&Hm(r,e);return o?s.map(Va).concat({type:e,attrs:t}).concat(o.map(Va)):null}function Va(n){return{type:n,attrs:null}}function Vm(n,e){let{parent:t,startIndex:r,endIndex:s}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let i=o.length?o[0]:e;return t.canReplaceWith(r,s,i)?o:null}function Hm(n,e){let{parent:t,startIndex:r,endIndex:s}=n,o=t.child(r),i=e.contentMatch.findWrapping(o.type);if(!i)return null;let a=(i.length?i[i.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:i}function $m(n,e,t){let r=I.empty;for(let i=t.length-1;i>=0;i--){if(r.size){let l=t[i].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=I.from(t[i].type.create(t[i].attrs,r))}let s=e.start,o=e.end;n.step(new je(s,o,s,o,new V(r,0,0),t.length,!0))}function Wm(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(i,l)=>{let a=typeof s=="function"?s(i):s;if(i.isTextblock&&!i.hasMarkup(r,a)&&Ym(n.doc,n.mapping.slice(o).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&td(n,i,l,o),bl(n,n.mapping.slice(o).map(l,1),r,void 0,c===null);let u=n.mapping.slice(o),d=u.map(l,1),f=u.map(l+i.nodeSize,1);return n.step(new je(d,f,d+1,f-1,new V(I.from(r.create(a,null,i.marks)),0,0),1,!0)),c===!0&&ed(n,i,l,o),!1}})}function ed(n,e,t,r){e.forEach((s,o)=>{if(s.isText){let i,l=/\r?\n|\r/g;for(;i=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+o+i.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function td(n,e,t,r){e.forEach((s,o)=>{if(s.type==s.type.schema.linebreakReplacement){let i=n.mapping.slice(r).map(t+1+o);n.replaceWith(i,i+1,e.type.schema.text(`
|
|
42
|
+
`))}})}function Ym(n,e,t){let r=n.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,t)}function Um(n,e,t,r,s){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let i=t.create(r,null,s||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new je(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new V(I.from(i),0,0),1,!0))}function Nt(n,e,t=1,r){let s=n.resolve(e),o=s.depth-t,i=r&&r[r.length-1]||s.parent;if(o<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!i.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=t-2;c>o;c--,u--){let d=s.node(c),f=s.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let y=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!y.type.validContent(h))return!1}let l=s.indexAfter(o),a=r&&r[0];return s.node(o).canReplaceWith(l,l,a?a.type:s.node(o+1).type)}function qm(n,e,t=1,r){let s=n.doc.resolve(e),o=I.empty,i=I.empty;for(let l=s.depth,a=s.depth-t,c=t-1;l>a;l--,c--){o=I.from(s.node(l).copy(o));let u=r&&r[c];i=I.from(u?u.type.create(u.attrs,i):s.node(l).copy(i))}n.step(new Ie(e,e,new V(o.append(i),t,t),!0))}function en(n,e){let t=n.resolve(e),r=t.index();return nd(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Km(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let s=0;s<e.childCount;s++){let o=e.child(s),i=o.type==r?n.type.schema.nodes.text:o.type;if(t=t.matchType(i),!t||!n.type.allowsMarks(o.marks))return!1}return t.validEnd}function nd(n,e){return!!(n&&e&&!n.isLeaf&&Km(n,e))}function ko(n,e,t=-1){let r=n.resolve(e);for(let s=r.depth;;s--){let o,i,l=r.index(s);if(s==r.depth?(o=r.nodeBefore,i=r.nodeAfter):t>0?(o=r.node(s+1),l++,i=r.node(s).maybeChild(l)):(o=r.node(s).maybeChild(l-1),i=r.node(s+1)),o&&!o.isTextblock&&nd(o,i)&&r.node(s).canReplace(l,l+1))return e;if(s==0)break;e=t<0?r.before(s):r.after(s)}}function Jm(n,e,t){let r=null,{linebreakReplacement:s}=n.doc.type.schema,o=n.doc.resolve(e-t),i=o.node().type;if(s&&i.inlineContent){let u=i.whitespace=="pre",d=!!i.contentMatch.matchType(s);u&&!d?r=!1:!u&&d&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);td(n,u.node(),u.before(),l)}i.inlineContent&&bl(n,e+t-1,i,o.node().contentMatchAt(o.index()),r==null);let a=n.mapping.slice(l),c=a.map(e-t);if(n.step(new Ie(c,a.map(e+t,-1),V.empty,!0)),r===!0){let u=n.doc.resolve(c);ed(n,u.node(),u.before(),n.steps.length)}return n}function Gm(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let o=r.index(s);if(r.node(s).canReplaceWith(o,o,t))return r.before(s+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let o=r.indexAfter(s);if(r.node(s).canReplaceWith(o,o,t))return r.after(s+1);if(o<r.node(s).childCount)return null}return null}function rd(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let s=t.content;for(let o=0;o<t.openStart;o++)s=s.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let i=r.depth;i>=0;i--){let l=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,a=r.index(i)+(l>0?1:0),c=r.node(i),u=!1;if(o==1)u=c.canReplace(a,a,s);else{let d=c.contentMatchAt(a).findWrapping(s.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(i+1):r.after(i+1)}return null}function So(n,e,t=e,r=V.empty){if(e==t&&!r.size)return null;let s=n.resolve(e),o=n.resolve(t);return sd(s,o,r)?new Ie(e,t,r):new Xm(s,o,r).fit()}function sd(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Xm{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=I.empty;for(let s=0;s<=e.depth;s++){let o=e.node(s);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=I.from(e.node(s).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 e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let o=this.placed,i=r.depth,l=s.depth;for(;i&&l&&o.childCount==1;)o=o.firstChild.content,i--,l--;let a=new V(o,i,l);return e>-1?new je(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new Ie(r.pos,s.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(s=0),o.type.spec.isolating&&s<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let s,o=null;r?(o=Xo(this.unplaced.content,r-1).firstChild,s=o.content):s=this.unplaced.content;let i=s.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(i?c.matchType(i.type)||(d=c.fillBefore(I.from(i),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:d};if(t==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,s=Xo(e,t);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new V(e,t+1,Math.max(r,s.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,s=Xo(e,t);if(s.childCount<=1&&t>0){let o=e.size-t<=t+s.size;this.unplaced=new V(sr(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new V(sr(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:s,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let y=0;y<o.length;y++)this.openFrontierNode(o[y]);let i=this.unplaced,l=r?r.content:i.content,a=i.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[t];if(s){for(let y=0;y<s.childCount;y++)u.push(s.child(y));d=d.matchFragment(s)}let h=l.size+e-(i.content.size-i.openEnd);for(;c<l.childCount;){let y=l.child(c),g=d.matchType(y.type);if(!g)break;c++,(c>1||a==0||y.content.size)&&(d=g,u.push(od(y.mark(f.allowedMarks(y.marks)),c==1?a:0,c==l.childCount?h:-1)))}let m=c==l.childCount;m||(h=-1),this.placed=or(this.placed,t,I.from(u)),this.frontier[t].match=d,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,g=l;y<h;y++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content}this.unplaced=m?e==0?V.empty:new V(sr(i.content,e-1,1),e-1,h<0?i.openEnd:e-1):new V(sr(i.content,e,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Qo(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:s}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=Qo(e,t,s,r,o);if(i){for(let l=t-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=Qo(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=or(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let s=e.node(r),o=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,o)}return e}openFrontierNode(e,t=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=or(this.placed,this.depth,I.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(I.empty,!0);t.childCount&&(this.placed=or(this.placed,this.frontier.length,t))}}function sr(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(sr(n.firstChild.content,e-1,t)))}function or(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(or(n.lastChild.content,e-1,t)))}function Xo(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function od(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,od(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(I.empty,!0)))),n.copy(r)}function Qo(n,e,t,r,s){let o=n.node(e),i=s?n.indexAfter(e):n.index(e);if(i==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,i);return l&&!Qm(t,o.content,i)?l:null}function Qm(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function Zm(n){return n.spec.defining||n.spec.definingForContent}function eg(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let s=n.doc.resolve(e),o=n.doc.resolve(t);if(sd(s,o,r))return n.step(new Ie(e,t,r));let i=ld(s,n.doc.resolve(t));i[i.length-1]==0&&i.pop();let l=-(s.depth+1);i.unshift(l);for(let f=s.depth,h=s.pos-1;f>0;f--,h--){let m=s.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;i.indexOf(f)>-1?l=f:s.before(f)==h&&i.splice(1,0,-f)}let a=i.indexOf(l),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(c.push(m),h==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let h=c[f],m=Zm(h.type);if(m&&!h.sameMarkup(s.node(Math.abs(l)-1)))u=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),m=c[h];if(m)for(let y=0;y<i.length;y++){let g=i[(y+a)%i.length],b=!0;g<0&&(b=!1,g=-g);let k=s.node(g-1),C=s.index(g-1);if(k.canReplaceWith(C,C,m.type,m.marks))return n.replace(s.before(g),b?o.after(g):t,new V(id(r.content,0,r.openStart,h),h,r.openEnd))}}let d=n.steps.length;for(let f=i.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let h=i[f];h<0||(e=s.before(h),t=o.after(h))}}function id(n,e,t,r,s){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(id(o.content,e+1,t,r,o)))}if(e>r){let o=s.contentMatchAt(0),i=o.fillBefore(n).append(n);n=i.append(o.matchFragment(i).fillBefore(I.empty,!0))}return n}function tg(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let s=Gm(n.doc,e,r.type);s!=null&&(e=t=s)}n.replaceRange(e,t,new V(I.from(r),0,0))}function ng(n,e,t){let r=n.doc.resolve(e),s=n.doc.resolve(t),o=ld(r,s);for(let i=0;i<o.length;i++){let l=o[i],a=i==o.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return n.delete(r.start(l),s.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),s.indexAfter(l-1))))return n.delete(r.before(l),s.after(l))}for(let i=1;i<=r.depth&&i<=s.depth;i++)if(e-r.start(i)==r.depth-i&&t>r.end(i)&&s.end(i)-t!=s.depth-i&&r.start(i-1)==s.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),s.index(i-1)))return n.delete(r.before(i),t);n.delete(e,t)}function ld(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let s=r;s>=0;s--){let o=n.start(s);if(o<n.pos-(n.depth-s)||e.end(s)>e.pos+(e.depth-s)||n.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(o==e.start(s)||s==n.depth&&s==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==o-1)&&t.push(s)}return t}class Vn extends Ue{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let s=t.type.create(r,null,t.marks);return Re.fromReplace(e,this.pos,this.pos+1,new V(I.from(s),0,t.isLeaf?0:1))}getMap(){return st.empty}invert(e){return new Vn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Vn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Vn(t.pos,t.attr,t.value)}}Ue.jsonID("attr",Vn);class vr extends Ue{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let s in e.attrs)t[s]=e.attrs[s];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Re.ok(r)}getMap(){return st.empty}invert(e){return new vr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new vr(t.attr,t.value)}}Ue.jsonID("docAttr",vr);let $n=class extends Error{};$n=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};$n.prototype=Object.create(Error.prototype);$n.prototype.constructor=$n;$n.prototype.name="TransformError";class ad{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Sr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new $n(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=V.empty){let s=So(this.doc,e,t,r);return s&&this.step(s),this}replaceWith(e,t,r){return this.replace(e,t,new V(I.from(r),0,0))}delete(e,t){return this.replace(e,t,V.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return eg(this,e,t,r),this}replaceRangeWith(e,t,r){return tg(this,e,t,r),this}deleteRange(e,t){return ng(this,e,t),this}lift(e,t){return zm(this,e,t),this}join(e,t=1){return Jm(this,e,t),this}wrap(e,t){return $m(this,e,t),this}setBlockType(e,t=e,r,s=null){return Wm(this,e,t,r,s),this}setNodeMarkup(e,t,r=null,s){return Um(this,e,t,r,s),this}setNodeAttribute(e,t,r){return this.step(new Vn(e,t,r)),this}setDocAttribute(e,t){return this.step(new vr(e,t)),this}addNodeMark(e,t){return this.step(new $t(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof ke)t.isInSet(r.marks)&&this.step(new kn(e,t));else{let s=r.marks,o,i=[];for(;o=t.isInSet(s);)i.push(new kn(e,o)),s=o.removeFromSet(s);for(let l=i.length-1;l>=0;l--)this.step(i[l])}return this}split(e,t=1,r){return qm(this,e,t,r),this}addMark(e,t,r){return _m(this,e,t,r),this}removeMark(e,t,r){return Bm(this,e,t,r),this}clearIncompatible(e,t,r){return bl(this,e,t,r),this}}const Zo=Object.create(null);class le{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new rg(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=V.empty){let r=t.content.lastChild,s=null;for(let l=0;l<t.openEnd;l++)s=r,r=r.lastChild;let o=e.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){let{$from:a,$to:c}=i[l],u=e.mapping.slice(o);e.replaceRange(u.map(a.pos),u.map(c.pos),l?V.empty:t),l==0&&Wa(e,o,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:i,$to:l}=s[o],a=e.mapping.slice(r),c=a.map(i.pos),u=a.map(l.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),Wa(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let s=e.parent.inlineContent?new ne(e):In(e.node(0),e.parent,e.pos,e.index(),t,r);if(s)return s;for(let o=e.depth-1;o>=0;o--){let i=t<0?In(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):In(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ot(e.node(0))}static atStart(e){return In(e,e,0,0,1)||new ot(e)}static atEnd(e){return In(e,e,e.content.size,e.childCount,-1)||new ot(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zo[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Zo)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zo[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ne.between(this.$anchor,this.$head).getBookmark()}}le.prototype.visible=!0;class rg{constructor(e,t){this.$from=e,this.$to=t}}let Ha=!1;function $a(n){!Ha&&!n.parent.inlineContent&&(Ha=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ne extends le{constructor(e,t=e){$a(e),$a(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return le.near(r);let s=e.resolve(t.map(this.anchor));return new ne(s.parent.inlineContent?s:r,r)}replace(e,t=V.empty){if(super.replace(e,t),t==V.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ne&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ne(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let s=e.resolve(t);return new this(s,r==t?s:e.resolve(r))}static between(e,t,r){let s=e.pos-t.pos;if((!r||s)&&(r=s>=0?1:-1),!t.parent.inlineContent){let o=le.findFrom(t,r,!0)||le.findFrom(t,-r,!0);if(o)t=o.$head;else return le.near(t,r)}return e.parent.inlineContent||(s==0?e=t:(e=(le.findFrom(e,-r,!0)||le.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=s<0&&(e=t))),new ne(e,t)}}le.jsonID("text",ne);class vo{constructor(e,t){this.anchor=e,this.head=t}map(e){return new vo(e.map(this.anchor),e.map(this.head))}resolve(e){return ne.between(e.resolve(this.anchor),e.resolve(this.head))}}class Q extends le{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:s}=t.mapResult(this.anchor),o=e.resolve(s);return r?le.near(o):new Q(o)}content(){return new V(I.from(this.node),0,0)}eq(e){return e instanceof Q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new kl(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Q(e.resolve(t.anchor))}static create(e,t){return new Q(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Q.prototype.visible=!1;le.jsonID("node",Q);class kl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new vo(r,r):new kl(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Q.isSelectable(r)?new Q(t):le.near(t)}}class ot extends le{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=V.empty){if(t==V.empty){e.delete(0,e.doc.content.size);let r=le.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new ot(e)}map(e){return new ot(e)}eq(e){return e instanceof ot}getBookmark(){return sg}}le.jsonID("all",ot);const sg={map(){return this},resolve(n){return new ot(n)}};function In(n,e,t,r,s,o=!1){if(e.inlineContent)return ne.create(n,t);for(let i=r-(s>0?0:1);s>0?i<e.childCount:i>=0;i+=s){let l=e.child(i);if(l.isAtom){if(!o&&Q.isSelectable(l))return Q.create(n,t-(s<0?l.nodeSize:0))}else{let a=In(n,l,t+s,s<0?l.childCount:0,s,o);if(a)return a}t+=l.nodeSize*s}return null}function Wa(n,e,t){let r=n.steps.length-1;if(r<e)return;let s=n.steps[r];if(!(s instanceof Ie||s instanceof je))return;let o=n.mapping.maps[r],i;o.forEach((l,a,c,u)=>{i==null&&(i=u)}),n.setSelection(le.near(n.doc.resolve(i),t))}const Ya=1,Ua=2,qa=4;class og extends ad{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ya)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ya)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ua,this}ensureMarks(e){return ke.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ua)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ke.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let s=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let i=this.doc.resolve(t);o=r==t?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,s.text(e,o)),this.selection.empty||this.setSelection(le.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qa,this}get scrolledIntoView(){return(this.updated&qa)>0}}function Ka(n,e){return!e||!n?n:n.bind(e)}class ir{constructor(e,t,r){this.name=e,this.init=Ka(t.init,r),this.apply=Ka(t.apply,r)}}const ig=[new ir("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new ir("selection",{init(n,e){return n.selection||le.atStart(e.doc)},apply(n){return n.selection}}),new ir("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new ir("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class ei{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ig.slice(),t&&t.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 ir(r.key,r.spec.state,r))})}}class zn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),s=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let l=this.config.plugins[i];if(l.spec.appendTransaction){let a=s?s[i].n:0,c=s?s[i].state:this,u=a<t.length&&l.spec.appendTransaction.call(l,a?t.slice(a):t,c,r);if(u&&r.filterTransaction(u,i)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let d=0;d<this.config.plugins.length;d++)s.push(d<i?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),o=!0}s&&(s[i]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new zn(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let o=r[s];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new og(this)}static create(e){let t=new ei(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new zn(t);for(let s=0;s<t.fields.length;s++)r[t.fields[s].name]=t.fields[s].init(e,r);return r}reconfigure(e){let t=new ei(this.schema,e.plugins),r=t.fields,s=new zn(t);for(let o=0;o<r.length;o++){let i=r[o].name;s[i]=this.hasOwnProperty(i)?this[i]:r[o].init(e,s)}return s}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],o=s.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(s,this[s.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new ei(e.schema,e.plugins),o=new zn(s);return s.fields.forEach(i=>{if(i.name=="doc")o.doc=mt.fromJSON(e.schema,t.doc);else if(i.name=="selection")o.selection=le.fromJSON(o.doc,t.selection);else if(i.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[i.name]=c.fromJSON.call(a,e,t[l],o);return}}o[i.name]=i.init(e,o)}}),o}}function cd(n,e,t){for(let r in n){let s=n[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=cd(s,e,{})),t[r]=s}return t}class Te{constructor(e){this.spec=e,this.props={},e.props&&cd(e.props,this,this.props),this.key=e.key?e.key.key:ud("plugin")}getState(e){return e[this.key]}}const ti=Object.create(null);function ud(n){return n in ti?n+"$"+ ++ti[n]:(ti[n]=0,n+"$")}class _e{constructor(e="key"){this.key=ud(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ze=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Wn=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let ji=null;const Dt=function(n,e,t){let r=ji||(ji=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},lg=function(){ji=null},Sn=function(n,e,t,r){return t&&(Ja(n,e,t,r,-1)||Ja(n,e,t,r,1))},ag=/^(img|br|input|textarea|hr)$/i;function Ja(n,e,t,r,s){for(var o;;){if(n==t&&e==r)return!0;if(e==(s<0?0:ut(n))){let i=n.parentNode;if(!i||i.nodeType!=1||Nr(n)||ag.test(n.nodeName)||n.contentEditable=="false")return!1;e=ze(n)+(s<0?0:1),n=i}else if(n.nodeType==1){let i=n.childNodes[e+(s<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((o=i.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=s;else return!1;else n=i,e=s<0?ut(n):0}else return!1}}function ut(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function cg(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=ut(n)}else if(n.parentNode&&!Nr(n))e=ze(n),n=n.parentNode;else return null}}function ug(n,e){for(;;){if(n.nodeType==3&&e<n.nodeValue.length)return n;if(n.nodeType==1&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!Nr(n))e=ze(n)+1,n=n.parentNode;else return null}}function dg(n,e,t){for(let r=e==0,s=e==ut(n);r||s;){if(n==t)return!0;let o=ze(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,s=s&&o==ut(n)}}function Nr(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Co=function(n){return n.focusNode&&Sn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function cn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function fg(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function hg(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:Math.min(ut(r.offsetNode),r.offset)}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:Math.min(ut(r.startContainer),r.startOffset)}}}const xt=typeof navigator<"u"?navigator:null,Ga=typeof document<"u"?document:null,tn=xt&&xt.userAgent||"",Pi=/Edge\/(\d+)/.exec(tn),dd=/MSIE \d/.exec(tn),_i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tn),rt=!!(dd||_i||Pi),Ut=dd?document.documentMode:_i?+_i[1]:Pi?+Pi[1]:0,dt=!rt&&/gecko\/(\d+)/i.test(tn);dt&&+(/Firefox\/(\d+)/.exec(tn)||[0,0])[1];const Bi=!rt&&/Chrome\/(\d+)/.exec(tn),Ye=!!Bi,fd=Bi?+Bi[1]:0,Xe=!rt&&!!xt&&/Apple Computer/.test(xt.vendor),Yn=Xe&&(/Mobile\/\w+/.test(tn)||!!xt&&xt.maxTouchPoints>2),ct=Yn||(xt?/Mac/.test(xt.platform):!1),pg=xt?/Win/.test(xt.platform):!1,At=/Android \d/.test(tn),Rr=!!Ga&&"webkitFontSmoothing"in Ga.documentElement.style,mg=Rr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function gg(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function wt(n,e){return typeof n=="number"?n:n[e]}function yg(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Xa(n,e,t){let r=n.someProp("scrollThreshold")||0,s=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let i=t||n.dom;i;){if(i.nodeType!=1){i=Wn(i);continue}let l=i,a=l==o.body,c=a?gg(o):yg(l),u=0,d=0;if(e.top<c.top+wt(r,"top")?d=-(c.top-e.top+wt(s,"top")):e.bottom>c.bottom-wt(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+wt(s,"top")-c.top:e.bottom-c.bottom+wt(s,"bottom")),e.left<c.left+wt(r,"left")?u=-(c.left-e.left+wt(s,"left")):e.right>c.right-wt(r,"right")&&(u=e.right-c.right+wt(s,"right")),u||d)if(a)o.defaultView.scrollBy(u,d);else{let h=l.scrollLeft,m=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let y=l.scrollLeft-h,g=l.scrollTop-m;e={left:e.left-y,top:e.top-g,right:e.right-y,bottom:e.bottom-g}}let f=a?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(f))break;i=f=="absolute"?i.offsetParent:Wn(i)}}function bg(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,s;for(let o=(e.left+e.right)/2,i=t+1;i<Math.min(innerHeight,e.bottom);i+=5){let l=n.root.elementFromPoint(o,i);if(!l||l==n.dom||!n.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=t-20){r=l,s=a.top;break}}return{refDOM:r,refTop:s,stack:hd(n.dom)}}function hd(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Wn(r));return e}function xg({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;pd(t,r==0?0:r-e)}function pd(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:s,left:o}=n[t];r.scrollTop!=s+e&&(r.scrollTop=s+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Rn=null;function kg(n){if(n.setActive)return n.setActive();if(Rn)return n.focus(Rn);let e=hd(n);n.focus(Rn==null?{get preventScroll(){return Rn={preventScroll:!0},!0}}:void 0),Rn||(Rn=!1,pd(e,0))}function md(n,e){let t,r=2e8,s,o=0,i=e.top,l=e.top,a,c;for(let u=n.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Dt(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=i&&m.bottom>=l){i=Math.max(m.bottom,i),l=Math.min(m.top,l);let y=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(y<r){t=u,r=y,s=y&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&y&&(o=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!a&&m.left<=e.left&&m.right>=e.left&&(a=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=d+1)}}return!t&&a&&(t=a,s=c,r=0),t&&t.nodeType==3?Sg(t,s):!t||r&&t.nodeType==1?{node:n,offset:o}:md(t,s)}function Sg(n,e){let t=n.nodeValue.length,r=document.createRange();for(let s=0;s<t;s++){r.setEnd(n,s+1),r.setStart(n,s);let o=Pt(r,1);if(o.top!=o.bottom&&Sl(e,o))return{node:n,offset:s+(e.left>=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Sl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function vg(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function Cg(n,e,t){let{node:r,offset:s}=md(e,t),o=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();o=i.left!=i.right&&t.left>(i.left+i.right)/2?1:-1}return n.docView.posFromDOM(r,s,o)}function Mg(n,e,t,r){let s=-1;for(let o=e,i=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!i&&a.left>r.left||a.top>r.top?s=l.posBefore:(!i&&a.right<r.left||a.bottom<r.top)&&(s=l.posAfter),i=!0),!l.contentDOM&&s<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;o=l.dom.parentNode}return s>-1?s:n.docView.posFromDOM(e,t,-1)}function gd(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=s;;){let i=n.childNodes[o];if(i.nodeType==1){let l=i.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(Sl(e,c))return gd(i,e,c)}}if((o=(o+1)%r)==s)break}return n}function wg(n,e){let t=n.dom.ownerDocument,r,s=0,o=hg(t,e.left,e.top);o&&({node:r,offset:s}=o);let i=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),l;if(!i||!n.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=n.dom.getBoundingClientRect();if(!Sl(e,c)||(i=gd(n.dom,e,c),!i))return null}if(Xe)for(let c=i;r&&c;c=Wn(c))c.draggable&&(r=void 0);if(i=vg(i,e),r){if(dt&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let u=r.childNodes[s],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&s++}let c;Rr&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,r==n.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(l=Mg(n,r,s,e))}l==null&&(l=Cg(n,i,e));let a=n.docView.nearestDesc(i,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Qa(n){return n.top<n.bottom||n.left<n.right}function Pt(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Qa(r))return r}return Array.prototype.find.call(t,Qa)||n.getBoundingClientRect()}const Eg=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function yd(n,e,t){let{node:r,offset:s,atom:o}=n.docView.domFromPos(e,t<0?-1:1),i=Rr||dt;if(r.nodeType==3)if(i&&(Eg.test(r.nodeValue)||(t<0?!s:s==r.nodeValue.length))){let a=Pt(Dt(r,s,s),t);if(dt&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let c=Pt(Dt(r,s-1,s-1),-1);if(c.top==a.top){let u=Pt(Dt(r,s,s+1),-1);if(u.top!=a.top)return er(u,u.left<c.left)}}return a}else{let a=s,c=s,u=t<0?1:-1;return t<0&&!s?(c++,u=-1):t>=0&&s==r.nodeValue.length?(a--,u=1):t<0?a--:c++,er(Pt(Dt(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&s&&(t<0||s==ut(r))){let a=r.childNodes[s-1];if(a.nodeType==1)return ni(a.getBoundingClientRect(),!1)}if(o==null&&s<ut(r)){let a=r.childNodes[s];if(a.nodeType==1)return ni(a.getBoundingClientRect(),!0)}return ni(r.getBoundingClientRect(),t>=0)}if(o==null&&s&&(t<0||s==ut(r))){let a=r.childNodes[s-1],c=a.nodeType==3?Dt(a,ut(a)-(i?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return er(Pt(c,1),!1)}if(o==null&&s<ut(r)){let a=r.childNodes[s];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?Dt(a,0,i?0:1):a.nodeType==1?a:null:null;if(c)return er(Pt(c,-1),!0)}return er(Pt(r.nodeType==3?Dt(r):r,-t),t>=0)}function er(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ni(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function bd(n,e,t){let r=n.state,s=n.root.activeElement;r!=e&&n.updateState(e),s!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),s!=n.dom&&s&&s.focus()}}function Tg(n,e,t){let r=e.selection,s=t=="up"?r.$from:r.$to;return bd(n,e,()=>{let{node:o}=n.docView.domFromPos(s.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let i=yd(n,s.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Dt(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(t=="up"?i.top-u.top>(u.bottom-i.top)*2:u.bottom-i.bottom>(i.bottom-u.top)*2))return!1}}return!0})}const Og=/[\u0590-\u08ac]/;function Dg(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,o=!s,i=s==r.parent.content.size,l=n.domSelection();return l?!Og.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:i:bd(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:y}=n.domSelectionRange(),g=m&&!h.contains(m.nodeType==1?m:m.parentNode)||a==m&&c==y;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g}):r.pos==r.start()||r.pos==r.end()}let Za=null,ec=null,tc=!1;function Ag(n,e,t){return Za==e&&ec==t?tc:(Za=e,ec=t,tc=t=="up"||t=="down"?Tg(n,e,t):Dg(n,e,t))}const ft=0,nc=1,un=2,kt=3;class Lr{constructor(e,t,r,s){this.parent=e,this.children=t,this.dom=r,this.contentDOM=s,this.dirty=ft,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let s=this.children[t];if(s==e)return r;r+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,i;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}else{let o,i;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(i):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=t>ze(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){s=!1;break}if(o.previousSibling)break}if(s==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){s=!0;break}if(o.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,s=e;s;s=s.parentNode){let o=this.getDesc(s),i;if(o&&(!t||o.node))if(r&&(i=o.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let s=e;s;s=s.parentNode){let o=this.getDesc(s);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let s=this.children[t],o=r+s.size;if(r==e&&o!=r){for(;!s.border&&s.children.length;)for(let i=0;i<s.children.length;i++){let l=s.children[i];if(l.size){s=l;break}}return s}if(e<o)return s.descAt(e-r-s.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,s=0;for(let o=0;r<this.children.length;r++){let i=this.children[r],l=o+i.size;if(l>e||i instanceof kd){s=e-o;break}o=l}if(s)return this.children[r].domFromPos(s-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof xd&&o.side>=0;r--);if(t<=0){let o,i=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,i=!1);return o&&t&&i&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?ze(o.dom)+1:0}}else{let o,i=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,i=!1);return o&&i&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?ze(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,o=-1;for(let i=r,l=0;;l++){let a=this.children[l],c=i+a.size;if(s==-1&&e<=c){let u=i+a.border;if(e>=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=i;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=ze(f.dom)+1;break}e-=f.size}s==-1&&(s=0)}if(s>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=ze(d.dom);break}t+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:t,fromOffset:s,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,s=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let h=0,m=0;h<this.children.length;h++){let y=this.children[h],g=m+y.size;if(o>m&&i<g)return y.setSelection(e-m-y.border,t-m-y.border,r,s);m=g}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((dt||Xe)&&e==t){let{node:h,offset:m}=l;if(h.nodeType==3){if(d=!!(m&&h.nodeValue[m-1]==`
|
|
43
|
+
`),d&&m==h.nodeValue.length)for(let y=h,g;y;y=y.parentNode){if(g=y.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:ze(g)+1});break}let b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let y=h.childNodes[m-1];d=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(dt&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(s=!0)}if(!(s||d&&Xe)&&Sn(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Sn(a.node,a.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==t)&&!(d&&dt)){c.collapse(l.node,l.offset);try{e!=t&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>t){let m=l;l=a,a=m}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,s=0;s<this.children.length;s++){let o=this.children[s],i=r+o.size;if(r==i?e<=i&&t>=r:e<i&&t>r){let l=r+o.border,a=i-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==i?un:nc,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=kt:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?un:kt}r=i}this.dirty=un}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?un:nc;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class xd extends Lr{constructor(e,t,r,s){let o,i=t.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!o)return s;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(i.nodeType!=1){let l=document.createElement("span");l.appendChild(i),i=l}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==ft&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Ng extends Lr{constructor(e,t,r,s){super(e,[],t,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class vn extends Lr{constructor(e,t,r,s,o){super(e,[],r,s),this.mark=t,this.spec=o}static create(e,t,r,s){let o=s.nodeViews[t.type.name],i=o&&o(t,s,r);return(!i||!i.dom)&&(i=wn.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new vn(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&kt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=kt&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ft){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ft}}slice(e,t,r){let s=vn.create(this.parent,this.mark,!0,r),o=this.children,i=this.size;t<i&&(o=zi(o,t,i,r)),e>0&&(o=zi(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=s;return s.children=o,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class qt extends Lr{constructor(e,t,r,s,o,i,l,a,c){super(e,[],o,i),this.node=t,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=l}static create(e,t,r,s,o,i){let l=o.nodeViews[t.type.name],a,c=l&&l(t,o,()=>{if(!a)return i;if(a.parent)return a.parent.posBeforeChild(a)},r,s),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=wn.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Cd(u,r,t),c?a=new Rg(e,t,r,s,u,d||null,f,c,o,i+1):t.isText?new Mo(e,t,r,s,u,f,o):new qt(e,t,r,s,u,d||null,f,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>I.empty)}return e}matchesNode(e,t,r){return this.dirty==ft&&e.eq(this.node)&&Ss(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,s=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new Ig(this,i&&i.node,e);_g(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?ke.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,s)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let h;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(h=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(c,u,d,h,e)||a.updateNextNode(c,u,d,e,f,s)||a.addNode(c,u,d,e,s),s+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==un)&&(i&&this.protectLocalComposition(e,i),Sd(this.contentDOM,this.children,e),Yn&&Bg(this.dom))}localCompositionInfo(e,t){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof ne)||r<t||s>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let i=o.nodeValue,l=Fg(this.node.content,i,r-t,s-t);return l<0?null:{node:o,pos:l,text:i}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:s}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Ng(this,o,t,s);e.input.compositionNodes.push(i),this.children=zi(this.children,r,r+s.length,e,i)}update(e,t,r,s){return this.dirty==kt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,s),!0)}updateInner(e,t,r,s){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=ft}updateOuterDeco(e){if(Ss(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=vd(this.dom,this.nodeDOM,Fi(this.outerDeco,this.node,t),Fi(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function rc(n,e,t,r,s){Cd(r,e,n);let o=new qt(void 0,n,e,t,r,r,r,s,0);return o.contentDOM&&o.updateChildren(s,0),o}class Mo extends qt{constructor(e,t,r,s,o,i,l){super(e,t,r,s,o,null,i,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,s){return this.dirty==kt||this.dirty!=ft&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=ft||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=ft,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let s=this.node.cut(e,t),o=document.createTextNode(s.text);return new Mo(this.parent,s,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=kt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class kd extends Lr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ft&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Rg extends qt{constructor(e,t,r,s,o,i,l,a,c,u){super(e,t,r,s,o,i,l,c,u),this.spec=a}update(e,t,r,s){if(this.dirty==kt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,s),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,s){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Sd(n,e,t){let r=n.firstChild,s=!1;for(let o=0;o<e.length;o++){let i=e[o],l=i.dom;if(l.parentNode==n){for(;l!=r;)r=sc(r),s=!0;r=r.nextSibling}else s=!0,n.insertBefore(l,r);if(i instanceof vn){let a=r?r.previousSibling:n.lastChild;Sd(i.contentDOM,i.children,t),r=a?a.nextSibling:n.firstChild}}for(;r;)r=sc(r),s=!0;s&&t.trackWrites==n&&(t.trackWrites=null)}const ur=function(n){n&&(this.nodeName=n)};ur.prototype=Object.create(null);const dn=[new ur];function Fi(n,e,t){if(n.length==0)return dn;let r=t?dn[0]:new ur,s=[r];for(let o=0;o<n.length;o++){let i=n[o].type.attrs;if(i){i.nodeName&&s.push(r=new ur(i.nodeName));for(let l in i){let a=i[l];a!=null&&(t&&s.length==1&&s.push(r=new ur(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return s}function vd(n,e,t,r){if(t==dn&&r==dn)return e;let s=e;for(let o=0;o<r.length;o++){let i=r[o],l=t[o];if(o){let a;l&&l.nodeName==i.nodeName&&s!=n&&(a=s.parentNode)&&a.nodeName.toLowerCase()==i.nodeName||(a=document.createElement(i.nodeName),a.pmIsDeco=!0,a.appendChild(s),l=dn[0]),s=a}Lg(s,l||dn[0],i)}return s}function Lg(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],s=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)s.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<s.length;o++)r.indexOf(s[o])==-1&&n.classList.add(s[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(e.style);)n.style.removeProperty(s[1])}t.style&&(n.style.cssText+=t.style)}}function Cd(n,e,t){return vd(n,n,dn,Fi(e,t,n.nodeType!=1))}function Ss(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function sc(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Ig{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=jg(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let s=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;s<i&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=ft,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=vn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,s){let o=-1,i;if(s>=this.preMatch.index&&(i=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,r))o=this.top.children.indexOf(i,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,t,r)&&!this.preMatch.matched.has(c)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,r,s,o){let i=this.top.children[s];return i.dirty==kt&&i.dom==i.contentDOM&&(i.dirty=un),i.update(e,t,r,o)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}e=t}}updateNextNode(e,t,r,s,o,i){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof qt){let c=this.preMatch.matched.get(a);if(c!=null&&c!=o)return!1;let u=a.dom,d,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=kt&&Ss(t,a.outerDeco));if(!f&&a.update(e,t,r,s))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,t,r,s,i)))return this.destroyBetween(this.index,l),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=un,d.updateChildren(s,i+1),d.dirty=ft),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,s,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Ss(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let l=qt.create(this.top,t,r,s,o,i);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,t,r,s,o){let i=qt.create(this.top,e,t,r,s,o);i.contentDOM&&i.updateChildren(s,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let o=new xd(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof vn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Mo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Xe||Ye)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new kd(this.top,[],r,null);t!=this.top?t.children.push(s):t.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function jg(n,e){let t=e,r=t.children.length,s=n.childCount,o=new Map,i=[];e:for(;s>0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof vn)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(s-1))break;--s,o.set(l,s),i.push(l)}}return{index:s,matched:o,matches:i.reverse()}}function Pg(n,e){return n.type.side-e.type.side}function _g(n,e,t,r){let s=e.locals(n),o=0;if(s.length==0){for(let c=0;c<n.childCount;c++){let u=n.child(c);r(u,s,e.forChild(o,u),c),o+=u.nodeSize}return}let i=0,l=[],a=null;for(let c=0;;){let u,d;for(;i<s.length&&s[i].to==o;){let g=s[i++];g.widget&&(u?(d||(d=[u])).push(g):u=g)}if(u)if(d){d.sort(Pg);for(let g=0;g<d.length;g++)t(d[g],c,!!a)}else t(u,c,!!a);let f,h;if(a)h=-1,f=a,a=null;else if(c<n.childCount)h=c,f=n.child(c++);else break;for(let g=0;g<l.length;g++)l[g].to<=o&&l.splice(g--,1);for(;i<s.length&&s[i].from<=o&&s[i].to>o;)l.push(s[i++]);let m=o+f.nodeSize;if(f.isText){let g=m;i<s.length&&s[i].from<g&&(g=s[i].from);for(let b=0;b<l.length;b++)l[b].to<g&&(g=l[b].to);g<m&&(a=f.cut(g-o),f=f.cut(0,g-o),m=g,h=-1)}else for(;i<s.length&&s[i].to<m;)i++;let y=f.isInline&&!f.isLeaf?l.filter(g=>!g.inline):l.slice();r(f,y,e.forChild(o,f),h),o=m}}function Bg(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Fg(n,e,t,r){for(let s=0,o=0;s<n.childCount&&o<=r;){let i=n.child(s++),l=o;if(o+=i.nodeSize,!i.isText)continue;let a=i.text;for(;s<n.childCount;){let c=n.child(s++);if(o+=c.nodeSize,!c.isText)break;a+=c.text}if(o>=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function zi(n,e,t,r,s){let o=[];for(let i=0,l=0;i<n.length;i++){let a=n[i],c=l,u=l+=a.size;c>=t||u<=e?o.push(a):(c<e&&o.push(a.slice(0,e-c,r)),s&&(o.push(s),s=void 0),u>t&&o.push(a.slice(t-c,a.size,r)))}return o}function vl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let s=n.docView.nearestDesc(t.focusNode),o=s&&s.size==0,i=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(i<0)return null;let l=r.resolve(i),a,c;if(Co(t)){for(a=i;s&&!s.node;)s=s.parent;let d=s.node;if(s&&d.isAtom&&Q.isSelectable(d)&&s.parent&&!(d.isInline&&dg(t.focusNode,t.focusOffset,s.dom))){let f=s.posBefore;c=new Q(i==f?l:r.resolve(f))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=i,f=i;for(let h=0;h<t.rangeCount;h++){let m=t.getRangeAt(h);d=Math.min(d,n.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,n.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[a,i]=f==n.state.selection.anchor?[f,d]:[d,f],l=r.resolve(i)}else a=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let d=e=="pointer"||n.state.selection.head<l.pos&&!o?1:-1;c=Cl(n,u,l,d)}return c}function Md(n){return n.editable?n.hasFocus():Ed(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Rt(n,e=!1){let t=n.state.selection;if(wd(n,t),!!Md(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Ye){let r=n.domSelectionRange(),s=n.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&Sn(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Vg(n);else{let{anchor:r,head:s}=t,o,i;oc&&!(t instanceof ne)&&(t.$from.parent.inlineContent||(o=ic(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(i=ic(n,t.to))),n.docView.setSelection(r,s,n,e),oc&&(o&&lc(o),i&&lc(i)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&zg(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const oc=Xe||Ye&&fd<63;function ic(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),s=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Xe&&s&&s.contentEditable=="false")return ri(s);if((!s||s.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(s)return ri(s);if(o)return ri(o)}}function ri(n){return n.contentEditable="true",Xe&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function lc(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function zg(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,s=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=s)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Md(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Vg(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,ze(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&rt&&Ut<=11&&(t.disabled=!0,t.disabled=!1)}function wd(n,e){if(e instanceof Q){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(ac(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else ac(n)}function ac(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Cl(n,e,t,r){return n.someProp("createSelectionBetween",s=>s(n,e,t))||ne.between(e,t,r)}function cc(n){return n.editable&&!n.hasFocus()?!1:Ed(n)}function Ed(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Hg(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Sn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Vi(n,e){let{$anchor:t,$head:r}=n.selection,s=e>0?t.max(r):t.min(r),o=s.parent.inlineContent?s.depth?n.doc.resolve(e>0?s.after():s.before()):null:s;return o&&le.findFrom(o,e)}function _t(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function uc(n,e,t){let r=n.state.selection;if(r instanceof ne)if(t.indexOf("s")>-1){let{$head:s}=r,o=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=n.state.doc.resolve(s.pos+o.nodeSize*(e<0?-1:1));return _t(n,new ne(r.$anchor,i))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let s=Vi(n.state,e);return s&&s instanceof Q?_t(n,s):!1}else if(!(ct&&t.indexOf("m")>-1)){let s=r.$head,o=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,i;if(!o||o.isText)return!1;let l=e<0?s.pos-o.nodeSize:s.pos;return o.isAtom||(i=n.docView.descAt(l))&&!i.contentDOM?Q.isSelectable(o)?_t(n,new Q(e<0?n.state.doc.resolve(s.pos-o.nodeSize):s)):Rr?_t(n,new ne(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Q&&r.node.isInline)return _t(n,new ne(e>0?r.$to:r.$from));{let s=Vi(n.state,e);return s?_t(n,s):!1}}}function vs(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function dr(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Ln(n,e){return e<0?$g(n):Wg(n)}function $g(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s,o,i=!1;for(dt&&t.nodeType==1&&r<vs(t)&&dr(t.childNodes[r],-1)&&(i=!0);;)if(r>0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(dr(l,-1))s=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(Td(t))break;{let l=t.previousSibling;for(;l&&dr(l,-1);)s=t.parentNode,o=ze(l),l=l.previousSibling;if(l)t=l,r=vs(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}i?Hi(n,t,r):s&&Hi(n,s,o)}function Wg(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s=vs(t),o,i;for(;;)if(r<s){if(t.nodeType!=1)break;let l=t.childNodes[r];if(dr(l,1))o=t,i=++r;else break}else{if(Td(t))break;{let l=t.nextSibling;for(;l&&dr(l,1);)o=l.parentNode,i=ze(l)+1,l=l.nextSibling;if(l)t=l,r=0,s=vs(t);else{if(t=t.parentNode,t==n.dom)break;r=s=0}}}o&&Hi(n,o,i)}function Td(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Yg(n,e){for(;n&&e==n.childNodes.length&&!Nr(n);)e=ze(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Ug(n,e){for(;n&&!e&&!Nr(n);)e=ze(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function Hi(n,e,t){if(e.nodeType!=3){let o,i;(i=Yg(e,t))?(e=i,t=0):(o=Ug(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(!r)return;if(Co(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:s}=n;setTimeout(()=>{n.state==s&&Rt(n)},50)}function dc(n,e){let t=n.state.doc.resolve(e);if(!(Ye||pg)&&t.parent.inlineContent){let s=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),i=(o.top+o.bottom)/2;if(i>s.top&&i<s.bottom&&Math.abs(o.left-s.left)>1)return o.left<s.left?"ltr":"rtl"}if(e<t.end()){let o=n.coordsAtPos(e+1),i=(o.top+o.bottom)/2;if(i>s.top&&i<s.bottom&&Math.abs(o.left-s.left)>1)return o.left>s.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function fc(n,e,t){let r=n.state.selection;if(r instanceof ne&&!r.empty||t.indexOf("s")>-1||ct&&t.indexOf("m")>-1)return!1;let{$from:s,$to:o}=r;if(!s.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let i=Vi(n.state,e);if(i&&i instanceof Q)return _t(n,i)}if(!s.parent.inlineContent){let i=e<0?s:o,l=r instanceof ot?le.near(i,e):le.findFrom(i,e);return l?_t(n,l):!1}return!1}function hc(n,e){if(!(n.state.selection instanceof ne))return!0;let{$head:t,$anchor:r,empty:s}=n.state.selection;if(!t.sameParent(r))return!0;if(!s)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let i=n.state.tr;return e<0?i.delete(t.pos-o.nodeSize,t.pos):i.delete(t.pos,t.pos+o.nodeSize),n.dispatch(i),!0}return!1}function pc(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function qg(n){if(!Xe||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;pc(n,r,"true"),setTimeout(()=>pc(n,r,"false"),20)}return!1}function Kg(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Jg(n,e){let t=e.keyCode,r=Kg(e);if(t==8||ct&&t==72&&r=="c")return hc(n,-1)||Ln(n,-1);if(t==46&&!e.shiftKey||ct&&t==68&&r=="c")return hc(n,1)||Ln(n,1);if(t==13||t==27)return!0;if(t==37||ct&&t==66&&r=="c"){let s=t==37?dc(n,n.state.selection.from)=="ltr"?-1:1:-1;return uc(n,s,r)||Ln(n,s)}else if(t==39||ct&&t==70&&r=="c"){let s=t==39?dc(n,n.state.selection.from)=="ltr"?1:-1:1;return uc(n,s,r)||Ln(n,s)}else{if(t==38||ct&&t==80&&r=="c")return fc(n,-1,r)||Ln(n,-1);if(t==40||ct&&t==78&&r=="c")return qg(n)||fc(n,1,r)||Ln(n,1);if(r==(ct?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Ml(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:s,openEnd:o}=e;for(;s>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,o--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let i=n.someProp("clipboardSerializer")||wn.fromSchema(n.state.schema),l=Ld(),a=l.createElement("div");a.appendChild(i.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Rd[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=l.createElement(u[h]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
|
|
44
|
+
|
|
45
|
+
`);return{dom:a,text:f,slice:e}}function Od(n,e,t,r,s){let o=s.parent.type.spec.code,i,l;if(!t&&!e)return null;let a=!!e&&(r||o||!t);if(a){if(n.someProp("transformPastedText",f=>{e=f(e,o||r,n)}),o)return l=new V(I.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
46
|
+
`))),0,0),n.someProp("transformPasted",f=>{l=f(l,n,!0)}),l;let d=n.someProp("clipboardTextParser",f=>f(e,s,r,n));if(d)l=d;else{let f=s.marks(),{schema:h}=n.state,m=wn.fromSchema(h);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let g=i.appendChild(document.createElement("p"));y&&g.appendChild(m.serializeNode(h.text(y,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),i=Zg(t),Rr&&ey(i);let c=i&&i.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=i.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;i=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Yt.fromSchema(n.state.schema)).parseSlice(i,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!Gg.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=ty(mc(l,+u[1],+u[2]),u[4]);else if(l=V.maxOpen(Xg(l.content,s),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=mc(l,d,f)}return n.someProp("transformPasted",d=>{l=d(l,n,a)}),l}const Gg=/^(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 Xg(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.index(t)),o,i=[];if(n.forEach(l=>{if(!i)return;let a=s.findWrapping(l.type),c;if(!a)return i=null;if(c=i.length&&o.length&&Ad(a,o,l,i[i.length-1],0))i[i.length-1]=c;else{i.length&&(i[i.length-1]=Nd(i[i.length-1],o.length));let u=Dd(l,a);i.push(u),s=s.matchType(u.type),o=a}}),i)return I.from(i)}return n}function Dd(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,I.from(n));return n}function Ad(n,e,t,r,s){if(s<n.length&&s<e.length&&n[s]==e[s]){let o=Ad(n,e,t,r.lastChild,s+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(s==n.length-1?t.type:n[s+1]))return r.copy(r.content.append(I.from(Dd(t,n,s+1))))}}function Nd(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Nd(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(I.empty,!0);return n.copy(t.append(r))}function $i(n,e,t,r,s,o){let i=e<0?n.firstChild:n.lastChild,l=i.content;return n.childCount>1&&(o=0),s<r-1&&(l=$i(l,e,t,r,s+1,o)),s>=t&&(l=e<0?i.contentMatchAt(0).fillBefore(l,o<=s).append(l):l.append(i.contentMatchAt(i.childCount).fillBefore(I.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,i.copy(l))}function mc(n,e,t){return e<n.openStart&&(n=new V($i(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new V($i(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Rd={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 gc=null;function Ld(){return gc||(gc=document.implementation.createHTMLDocument("title"))}let si=null;function Qg(n){let e=window.trustedTypes;return e?(si||(si=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),si.createHTML(n)):n}function Zg(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Ld().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),s;if((s=r&&Rd[r[1].toLowerCase()])&&(n=s.map(o=>"<"+o+">").join("")+n+s.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=Qg(n),s)for(let o=0;o<s.length;o++)t=t.querySelector(s[o])||t;return t}function ey(n){let e=n.querySelectorAll(Ye?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function ty(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:s,openStart:o,openEnd:i}=n;for(let l=r.length-2;l>=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=I.from(a.create(r[l+1],s)),o++,i++}return new V(s,o,i)}const Qe={},Ze={},ny={touchstart:!0,touchmove:!0};class ry{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function sy(n){for(let e in Qe){let t=Qe[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{iy(n,r)&&!wl(n,r)&&(n.editable||!(r.type in Ze))&&t(n,r)},ny[e]?{passive:!0}:void 0)}Xe&&n.dom.addEventListener("input",()=>null),Wi(n)}function Wt(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function oy(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Wi(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>wl(n,r))})}function wl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function iy(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function ly(n,e){!wl(n,e)&&Qe[e.type]&&(n.editable||!(e.type in Ze))&&Qe[e.type](n,e)}Ze.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!jd(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(At&&Ye&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Yn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",s=>s(n,cn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Jg(n,t)?t.preventDefault():Wt(n,"key")};Ze.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ze.keypress=(n,e)=>{let t=e;if(jd(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||ct&&t.metaKey)return;if(n.someProp("handleKeyPress",s=>s(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ne)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(t.charCode),o=()=>n.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!n.someProp("handleTextInput",i=>i(n,r.$from.pos,r.$to.pos,s,o))&&n.dispatch(o()),t.preventDefault()}};function wo(n){return{left:n.clientX,top:n.clientY}}function ay(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function El(n,e,t,r,s){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let i=o.depth+1;i>0;i--)if(n.someProp(e,l=>i>o.depth?l(n,t,o.nodeAfter,o.before(i),s,!0):l(n,t,o.node(i),o.before(i),s,!1)))return!0;return!1}function Hn(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function cy(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Q.isSelectable(r)?(Hn(n,new Q(t)),!0):!1}function uy(n,e){if(e==-1)return!1;let t=n.state.selection,r,s;t instanceof Q&&(r=t.node);let o=n.state.doc.resolve(e);for(let i=o.depth+1;i>0;i--){let l=i>o.depth?o.nodeAfter:o.node(i);if(Q.isSelectable(l)){r&&t.$from.depth>0&&i>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?s=o.before(t.$from.depth):s=o.before(i);break}}return s!=null?(Hn(n,Q.create(n.state.doc,s)),!0):!1}function dy(n,e,t,r,s){return El(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(s?uy(n,t):cy(n,t))}function fy(n,e,t,r){return El(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",s=>s(n,e,r))}function hy(n,e,t,r){return El(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",s=>s(n,e,r))||py(n,t,r)}function py(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Hn(n,ne.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let o=s.depth+1;o>0;o--){let i=o>s.depth?s.nodeAfter:s.node(o),l=s.before(o);if(i.inlineContent)Hn(n,ne.create(r,l+1,l+1+i.content.size));else if(Q.isSelectable(i))Hn(n,Q.create(r,l));else continue;return!0}}function Tl(n){return Cs(n)}const Id=ct?"metaKey":"ctrlKey";Qe.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Tl(n),s=Date.now(),o="singleClick";s-n.input.lastClick.time<500&&ay(t,n.input.lastClick)&&!t[Id]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:o,button:t.button};let i=n.posAtCoords(wo(t));i&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new my(n,i,t,!!r)):(o=="doubleClick"?fy:hy)(n,i.pos,i.inside,t)?t.preventDefault():Wt(n,"pointer"))};class my{constructor(e,t,r,s){this.view=e,this.pos=t,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Id],this.allowDefault=r.shiftKey;let o,i;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,i=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Q&&c.from<=i&&c.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&dt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Wt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Rt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(wo(e))),this.updateAllowDefault(e),this.allowDefault||!t?Wt(this.view,"pointer"):dy(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Xe&&this.mightDrag&&!this.mightDrag.node.isAtom||Ye&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Hn(this.view,le.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Wt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Wt(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Qe.touchstart=n=>{n.input.lastTouch=Date.now(),Tl(n),Wt(n,"pointer")};Qe.touchmove=n=>{n.input.lastTouch=Date.now(),Wt(n,"pointer")};Qe.contextmenu=n=>Tl(n);function jd(n,e){return n.composing?!0:Xe&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const gy=At?5e3:-1;Ze.compositionstart=Ze.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof ne&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Cs(n,!0),n.markCursor=null;else if(Cs(n,!e.selection.empty),dt&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let s=r.focusNode,o=r.focusOffset;s&&s.nodeType==1&&o!=0;){let i=o<0?s.lastChild:s.childNodes[o-1];if(!i)break;if(i.nodeType==3){let l=n.domSelection();l&&l.collapse(i,i.nodeValue.length);break}else s=i,o=-1}}n.input.composing=!0}Pd(n,gy)};Ze.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Pd(n,20))};function Pd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Cs(n),e))}function _d(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=by());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function yy(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=cg(e.focusNode,e.focusOffset),r=ug(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let s=r.pmViewDesc,o=n.domObserver.lastChangedTextNode;if(t==o||r==o)return o;if(!s||!s.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let i=t.pmViewDesc;if(!(!i||!i.isText(t.nodeValue)))return r}}return t||r}function by(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Cs(n,e=!1){if(!(At&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),_d(n),e||n.docView&&n.docView.dirty){let t=vl(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function xy(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Cr=rt&&Ut<15||Yn&&mg<604;Qe.copy=Ze.cut=(n,e)=>{let t=e,r=n.state.selection,s=t.type=="cut";if(r.empty)return;let o=Cr?null:t.clipboardData,i=r.content(),{dom:l,text:a}=Ml(n,i);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):xy(n,l),s&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ky(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Sy(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Mr(n,r.value,null,s,e):Mr(n,r.textContent,r.innerHTML,s,e)},50)}function Mr(n,e,t,r,s){let o=Od(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,s,o||V.empty)))return!0;if(!o)return!1;let i=ky(o),l=i?n.state.tr.replaceSelectionWith(i,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Bd(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ze.paste=(n,e)=>{let t=e;if(n.composing&&!At)return;let r=Cr?null:t.clipboardData,s=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Mr(n,Bd(r),r.getData("text/html"),s,t)?t.preventDefault():Sy(n,t)};class Fd{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const vy=ct?"altKey":"ctrlKey";function zd(n,e){let t=n.someProp("dragCopies",r=>!r(e));return t??!e[vy]}Qe.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let s=n.state.selection,o=s.empty?null:n.posAtCoords(wo(t)),i;if(!(o&&o.pos>=s.from&&o.pos<=(s instanceof Q?s.to-1:s.to))){if(r&&r.mightDrag)i=Q.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(i=Q.create(n.state.doc,d.posBefore))}}let l=(i||n.state.selection).content(),{dom:a,text:c,slice:u}=Ml(n,l);(!t.dataTransfer.files.length||!Ye||fd>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Cr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Cr||t.dataTransfer.setData("text/plain",c),n.dragging=new Fd(u,zd(n,t),i)};Qe.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ze.dragover=Ze.dragenter=(n,e)=>e.preventDefault();Ze.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let s=n.posAtCoords(wo(t));if(!s)return;let o=n.state.doc.resolve(s.pos),i=r&&r.slice;i?n.someProp("transformPasted",m=>{i=m(i,n,!1)}):i=Od(n,Bd(t.dataTransfer),Cr?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&zd(n,t));if(n.someProp("handleDrop",m=>m(n,t,i||V.empty,l))){t.preventDefault();return}if(!i)return;t.preventDefault();let a=i?rd(n.state.doc,o.pos,i):o.pos;a==null&&(a=o.pos);let c=n.state.tr;if(l){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&Q.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Q(h));else{let m=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((y,g,b,k)=>m=k),c.setSelection(Cl(n,h,c.doc.resolve(m)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Qe.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Rt(n)},20))};Qe.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Qe.beforeinput=(n,e)=>{if(Ye&&At&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,cn(8,"Backspace")))))return;let{$cursor:s}=n.state.selection;s&&s.pos>0&&n.dispatch(n.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let n in Ze)Qe[n]=Ze[n];function wr(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Ms{constructor(e,t){this.toDOM=e,this.spec=t||gn,this.side=this.spec.side||0}map(e,t,r,s){let{pos:o,deleted:i}=e.mapResult(t.from+s,this.side<0?-1:1);return i?null:new Ge(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ms&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&wr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Kt{constructor(e,t){this.attrs=e,this.spec=t||gn}map(e,t,r,s){let o=e.map(t.from+s,this.spec.inclusiveStart?-1:1)-r,i=e.map(t.to+s,this.spec.inclusiveEnd?1:-1)-r;return o>=i?null:new Ge(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Kt&&wr(this.attrs,e.attrs)&&wr(this.spec,e.spec)}static is(e){return e.type instanceof Kt}destroy(){}}class Ol{constructor(e,t){this.attrs=e,this.spec=t||gn}map(e,t,r,s){let o=e.mapResult(t.from+s,1);if(o.deleted)return null;let i=e.mapResult(t.to+s,-1);return i.deleted||i.pos<=o.pos?null:new Ge(o.pos-r,i.pos-r,this)}valid(e,t){let{index:r,offset:s}=e.content.findIndex(t.from),o;return s==t.from&&!(o=e.child(r)).isText&&s+o.nodeSize==t.to}eq(e){return this==e||e instanceof Ol&&wr(this.attrs,e.attrs)&&wr(this.spec,e.spec)}destroy(){}}class Ge{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ge(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ge(e,e,new Ms(t,r))}static inline(e,t,r,s){return new Ge(e,t,new Kt(r,s))}static node(e,t,r,s){return new Ge(e,t,new Ol(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof Kt}get widget(){return this.type instanceof Ms}}const jn=[],gn={};class Ce{constructor(e,t){this.local=e.length?e:jn,this.children=t.length?t:jn}static create(e,t){return t.length?ws(t,e,0,gn):He}find(e,t,r){let s=[];return this.findInner(e??0,t??1e9,s,0,r),s}findInner(e,t,r,s,o){for(let i=0;i<this.local.length;i++){let l=this.local[i];l.from<=t&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let l=this.children[i]+1;this.children[i+2].findInner(e-l,t-l,r,s+l,o)}}map(e,t,r){return this==He||e.maps.length==0?this:this.mapInner(e,t,0,0,r||gn)}mapInner(e,t,r,s,o){let i;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,s);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?Cy(this.children,i||[],e,t,r,s,o):i?new Ce(i.sort(yn),jn):He}add(e,t){return t.length?this==He?Ce.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let s,o=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Hd(t,l,c)){for(s||(s=this.children.slice());o<s.length&&s[o]<a;)o+=3;s[o]==a?s[o+2]=s[o+2].addInner(l,u,c+1):s.splice(o,0,a,a+l.nodeSize,ws(u,l,c+1,gn)),o+=3}});let i=Vd(o?$d(t):t,-r);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||i.splice(l--,1);return new Ce(i.length?this.local.concat(i).sort(yn):this.local,s||this.children)}remove(e){return e.length==0||this==He?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,s=this.local;for(let o=0;o<r.length;o+=3){let i,l=r[o]+t,a=r[o+1]+t;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(i||(i=[])).push(d));if(!i)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(i,l+1);c!=He?r[o+2]=c:(r.splice(o,3),o-=3)}if(s.length){for(let o=0,i;o<e.length;o++)if(i=e[o])for(let l=0;l<s.length;l++)s[l].eq(i,t)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new Ce(s,r):He}forChild(e,t){if(this==He)return this;if(t.isLeaf)return Ce.empty;let r,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,i=o+t.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<i&&a.to>o&&a.type instanceof Kt){let c=Math.max(o,a.from)-o,u=Math.min(i,a.to)-o;c<u&&(s||(s=[])).push(a.copy(c,u))}}if(s){let l=new Ce(s.sort(yn),jn);return r?new zt([l,r]):l}return r||He}eq(e){if(this==e)return!0;if(!(e instanceof Ce)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Dl(this.localsInner(e))}localsInner(e){if(this==He)return jn;if(e.inlineContent||!this.local.some(Kt.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Kt||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ce.empty=new Ce([],[]);Ce.removeOverlap=Dl;const He=Ce.empty;class zt{constructor(e){this.members=e}map(e,t){const r=this.members.map(s=>s.map(e,t,gn));return zt.from(r)}forChild(e,t){if(t.isLeaf)return Ce.empty;let r=[];for(let s=0;s<this.members.length;s++){let o=this.members[s].forChild(e,t);o!=He&&(o instanceof zt?r=r.concat(o.members):r.push(o))}return zt.from(r)}eq(e){if(!(e instanceof zt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let s=0;s<this.members.length;s++){let o=this.members[s].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let i=0;i<o.length;i++)t.push(o[i])}}return t?Dl(r?t:t.sort(yn)):jn}static from(e){switch(e.length){case 0:return He;case 1:return e[0];default:return new zt(e.every(t=>t instanceof Ce)?e:e.reduce((t,r)=>t.concat(r instanceof Ce?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Cy(n,e,t,r,s,o,i){let l=n.slice();for(let c=0,u=o;c<t.maps.length;c++){let d=0;t.maps[c].forEach((f,h,m,y)=>{let g=y-m-(h-f);for(let b=0;b<l.length;b+=3){let k=l[b+1];if(k<0||f>k+u-d)continue;let C=l[b]+u-d;h>=C?l[b+1]=f<=C?-2:-1:f>=u&&g&&(l[b]+=g,l[b+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=t.map(n[c]+o),d=u-s;if(d<0||d>=r.content.size){a=!0;continue}let f=t.map(n[c+1]+o,-1),h=f-s,{index:m,offset:y}=r.content.findIndex(d),g=r.maybeChild(m);if(g&&y==d&&y+g.nodeSize==h){let b=l[c+2].mapInner(t,g,u+1,n[c]+o+1,i);b!=He?(l[c]=d,l[c+1]=h,l[c+2]=b):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=My(l,n,e,t,s,o,i),u=ws(c,r,0,i);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new Ce(e.sort(yn),l)}function Vd(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let s=n[r];t.push(new Ge(s.from+e,s.to+e,s.type))}return t}function My(n,e,t,r,s,o,i){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,s,c);d?t.push(d):i.onRemove&&i.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<n.length;a+=3)n[a+1]==-1&&l(n[a+2],e[a]+o+1);return t}function Hd(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,s=null;for(let o=0,i;o<n.length;o++)(i=n[o])&&i.from>t&&i.to<r&&((s||(s=[])).push(i),n[o]=null);return s}function $d(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ws(n,e,t,r){let s=[],o=!1;e.forEach((l,a)=>{let c=Hd(n,l,a+t);if(c){o=!0;let u=ws(c,l,t+a+1,r);u!=He&&s.push(a,a+l.nodeSize,u)}});let i=Vd(o?$d(n):n,-t).sort(yn);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1));return i.length||s.length?new Ce(i,s):He}function yn(n,e){return n.from-e.from||n.to-e.to}function Dl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let s=t+1;s<e.length;s++){let o=e[s];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[s]=o.copy(o.from,r.to),yc(e,s+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),yc(e,s,r.copy(o.from,r.to)));break}}}return e}function yc(n,e,t){for(;e<n.length&&yn(t,n[e])>0;)e++;n.splice(e,0,t)}function oi(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=He&&e.push(r)}),n.cursorWrapper&&e.push(Ce.create(n.state.doc,[n.cursorWrapper.deco])),zt.from(e)}const wy={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ey=rt&&Ut<=11;class Ty{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Oy{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ty,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);rt&&Ut<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),Ey&&(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,wy)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);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(cc(this.view)){if(this.suppressingSelectionUpdates)return Rt(this.view);if(rt&&Ut<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Sn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=Wn(o))t.add(o);for(let o=e.anchorNode;o;o=Wn(o))if(t.has(o)){r=o;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&cc(e)&&!this.ignoreSelectionChange(r),o=-1,i=-1,l=!1,a=[];if(e.editable)for(let u=0;u<t.length;u++){let d=this.registerMutation(t[u],a);d&&(o=o<0?d.from:Math.min(d.from,o),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(l=!0))}if(dt&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||Ny(e,d)!=h)&&f.remove()}}}let c=null;o<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Co(r)&&(c=vl(e))&&c.eq(le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Rt(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||s)&&(o>-1&&(e.docView.markDirty(o,i),Dy(e)),this.handleDOMChange(o,i,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Rt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];t.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,o=e.nextSibling;if(rt&&Ut<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(s=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f)}let i=s&&s.parentNode==e.target?ze(s)+1:0,l=r.localPosFromDOM(e.target,i,-1),a=o&&o.parentNode==e.target?ze(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let bc=new WeakMap,xc=!1;function Dy(n){if(!bc.has(n)&&(bc.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=dt,xc)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."),xc=!0}}function kc(n,e){let t=e.startContainer,r=e.startOffset,s=e.endContainer,o=e.endOffset,i=n.domAtPos(n.state.selection.anchor);return Sn(i.node,i.offset,s,o)&&([t,r,s,o]=[s,o,t,r]),{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:o}}function Ay(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return kc(n,s)}let t;function r(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?kc(n,t):null}function Ny(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let r=n.docView.nearestDesc(t,!0);if(r&&r.node.isBlock)return t}return null}function Ry(n,e,t){let{node:r,fromOffset:s,toOffset:o,from:i,to:l}=n.docView.parseRange(e,t),a=n.domSelectionRange(),c,u=a.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],Co(a)||c.push({node:a.focusNode,offset:a.focusOffset})),Ye&&n.input.lastKeyCode===8)for(let g=o;g>s;g--){let b=r.childNodes[g-1],k=b.pmViewDesc;if(b.nodeName=="BR"&&!k){o=g;break}if(!k||k.size)break}let d=n.state.doc,f=n.someProp("domParser")||Yt.fromSchema(n.state.schema),h=d.resolve(i),m=null,y=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:s,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Ly,context:h});if(c&&c[0].pos!=null){let g=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=g),m={anchor:g+i,head:b+i}}return{doc:y,sel:m,from:i,to:l}}function Ly(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Xe&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Xe&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Iy=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function jy(n,e,t,r,s){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let w=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,O=vl(n,w);if(O&&!n.state.selection.eq(O)){if(Ye&&At&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",B=>B(n,cn(13,"Enter"))))return;let N=n.state.tr.setSelection(O);w=="pointer"?N.setMeta("pointer",!0):w=="key"&&N.scrollIntoView(),o&&N.setMeta("composition",o),n.dispatch(N)}return}let i=n.state.doc.resolve(e),l=i.sharedDepth(t);e=i.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Ry(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),f,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(f=n.state.selection.to,h="end"):(f=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=By(d.content,c.doc.content,c.from,f,h);if(m&&n.input.domChangeCount++,(Yn&&n.input.lastIOSEnter>Date.now()-225||At)&&s.some(w=>w.nodeType==1&&!Iy.test(w.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",w=>w(n,cn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&a instanceof ne&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let w=Sc(n,n.state.doc,c.sel);if(w&&!w.eq(n.state.selection)){let O=n.state.tr.setSelection(w);o&&O.setMeta("composition",o),n.dispatch(O)}}return}n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof ne&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=c.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),rt&&Ut<=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 y=c.doc.resolveNoCache(m.start-c.from),g=c.doc.resolveNoCache(m.endB-c.from),b=u.resolve(m.start),k=y.sameParent(g)&&y.parent.inlineContent&&b.end()>=m.endA;if((Yn&&n.input.lastIOSEnter>Date.now()-225&&(!k||s.some(w=>w.nodeName=="DIV"||w.nodeName=="P"))||!k&&y.pos<c.doc.content.size&&(!y.sameParent(g)||!y.parent.inlineContent)&&y.pos<g.pos&&!/\S/.test(c.doc.textBetween(y.pos,g.pos,"","")))&&n.someProp("handleKeyDown",w=>w(n,cn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&_y(u,m.start,m.endA,y,g)&&n.someProp("handleKeyDown",w=>w(n,cn(8,"Backspace")))){At&&Ye&&n.domObserver.suppressSelectionUpdates();return}Ye&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),At&&!k&&y.start()!=g.start()&&g.parentOffset==0&&y.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,g=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(w){return w(n,cn(13,"Enter"))})},20));let C=m.start,T=m.endA,M=w=>{let O=w||n.state.tr.replace(C,T,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let N=Sc(n,O.doc,c.sel);N&&!(Ye&&n.composing&&N.empty&&(m.start!=m.endB||n.input.lastChromeDelete<Date.now()-100)&&(N.head==C||N.head==O.mapping.map(T)-1)||rt&&N.empty&&N.head==C)&&O.setSelection(N)}return o&&O.setMeta("composition",o),O.scrollIntoView()},v;if(k)if(y.pos==g.pos){rt&&Ut<=11&&y.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Rt(n),20));let w=M(n.state.tr.delete(C,T)),O=u.resolve(m.start).marksAcross(u.resolve(m.endA));O&&w.ensureMarks(O),n.dispatch(w)}else if(m.endA==m.endB&&(v=Py(y.parent.content.cut(y.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let w=M(n.state.tr);v.type=="add"?w.addMark(C,T,v.mark):w.removeMark(C,T,v.mark),n.dispatch(w)}else if(y.parent.child(y.index()).isText&&y.index()==g.index()-(g.textOffset?0:1)){let w=y.parent.textBetween(y.parentOffset,g.parentOffset),O=()=>M(n.state.tr.insertText(w,C,T));n.someProp("handleTextInput",N=>N(n,C,T,w,O))||n.dispatch(O())}else n.dispatch(M());else n.dispatch(M())}function Sc(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Cl(n,e.resolve(t.anchor),e.resolve(t.head))}function Py(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,s=t,o=r,i,l,a;for(let u=0;u<r.length;u++)s=r[u].removeFromSet(s);for(let u=0;u<t.length;u++)o=t[u].removeFromSet(o);if(s.length==1&&o.length==0)l=s[0],i="add",a=u=>u.mark(l.addToSet(u.marks));else if(s.length==0&&o.length==1)l=o[0],i="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(I.from(c).eq(n))return{mark:l,type:i}}function _y(n,e,t,r,s){if(t-e<=s.pos-r.pos||ii(r,!0,!1)<s.pos)return!1;let o=n.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&t==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let i=n.resolve(ii(o,!0,!0));return!i.parent.isTextblock||i.pos>t||ii(i,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function ii(n,e,t){let r=n.depth,s=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,s++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,s++}return s}function By(n,e,t,r,s){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:i,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(s=="end"){let a=Math.max(0,o-Math.min(i,l));r-=i+a-o}if(i<o&&n.size<e.size){let a=r<=o&&r>=i?o-r:0;o-=a,o&&o<e.size&&vc(e.textBetween(o-1,o+1))&&(o+=a?1:-1),l=o+(l-i),i=o}else if(l<o){let a=r<=o&&r>=l?o-r:0;o-=a,o&&o<n.size&&vc(n.textBetween(o-1,o+1))&&(o+=a?1:-1),i=o+(i-l),l=o}return{start:o,endA:i,endB:l}}function vc(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class Wd{constructor(e,t){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 ry,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Tc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=wc(this),Mc(this),this.nodeViews=Ec(this),this.docView=rc(this.state.doc,Cc(this),oi(this),this.dom,this),this.domObserver=new Oy(this,(r,s,o,i)=>jy(this,r,s,o,i)),this.domObserver.start(),sy(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Wi(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Tc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let s=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(_d(this),i=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Ec(this);zy(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Wi(this),this.editable=wc(this),Mc(this);let a=oi(this),c=Cc(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(s.selection))&&(i=!0);let f=u=="preserve"&&i&&this.dom.style.overflowAnchor==null&&bg(this);if(i){this.domObserver.stop();let h=d&&(rt||Ye)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&Fy(s.selection,e.selection);if(d){let m=Ye?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=yy(this)),(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=rc(e.doc,c,a,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Hg(this))?Rt(this,h):(wd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&xg(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof Q){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Xa(this,t.getBoundingClientRect(),e)}else Xa(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){let r=e.node,s=-1;if(this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(s=o)}this.dragging=new Fd(e.slice,e.move,s<0?void 0:Q.create(this.state.doc,s))}someProp(e,t){let r=this._props&&this._props[e],s;if(r!=null&&(s=t?t(r):r))return s;for(let i=0;i<this.directPlugins.length;i++){let l=this.directPlugins[i].props[e];if(l!=null&&(s=t?t(l):l))return s}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let l=o[i].props[e];if(l!=null&&(s=t?t(l):l))return s}}hasFocus(){if(rt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&kg(this.dom),Rt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return wg(this,e)}coordsAtPos(e,t=1){return yd(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let s=this.docView.posFromDOM(e,t,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,t){return Ag(this,t||this.state,e)}pasteHTML(e,t){return Mr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Mr(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ml(this,e)}destroy(){this.docView&&(oy(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],oi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,lg())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ly(this,e)}domSelectionRange(){let e=this.domSelection();return e?Xe&&this.root.nodeType===11&&fg(this.dom.ownerDocument)==this.dom&&Ay(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Wd.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Cc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ge.node(0,n.state.doc.content.size,e)]}function Mc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ge.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function wc(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Fy(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Ec(n){let e=Object.create(null);function t(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function zy(n,e){let t=0,r=0;for(let s in n){if(n[s]!=e[s])return!0;t++}for(let s in e)r++;return t!=r}function Tc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Jt={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:"'"},Es={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Vy=typeof navigator<"u"&&/Mac/.test(navigator.platform),Hy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ve=0;Ve<10;Ve++)Jt[48+Ve]=Jt[96+Ve]=String(Ve);for(var Ve=1;Ve<=24;Ve++)Jt[Ve+111]="F"+Ve;for(var Ve=65;Ve<=90;Ve++)Jt[Ve]=String.fromCharCode(Ve+32),Es[Ve]=String.fromCharCode(Ve);for(var li in Jt)Es.hasOwnProperty(li)||(Es[li]=Jt[li]);function $y(n){var e=Vy&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Hy&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Es:Jt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Wy=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Yy=typeof navigator<"u"&&/Win/.test(navigator.platform);function Uy(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,s,o,i;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))Wy?i=!0:s=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(t="Alt-"+t),s&&(t="Ctrl-"+t),i&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function qy(n){let e=Object.create(null);for(let t in n)e[Uy(t)]=n[t];return e}function ai(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function Ky(n){return new Te({props:{handleKeyDown:Yd(n)}})}function Yd(n){let e=qy(n);return function(t,r){let s=$y(r),o,i=e[ai(s,r)];if(i&&i(t.state,t.dispatch,t))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let l=e[ai(s,r,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(Yy&&r.ctrlKey&&r.altKey)&&(o=Jt[r.keyCode])&&o!=s){let l=e[ai(o,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const Al=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Ud(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const qd=(n,e,t)=>{let r=Ud(n,t);if(!r)return!1;let s=Nl(r);if(!s){let i=r.blockRange(),l=i&&Jn(i);return l==null?!1:(e&&e(n.tr.lift(i,l).scrollIntoView()),!0)}let o=s.nodeBefore;if(nf(n,s,e,-1))return!0;if(r.parent.content.size==0&&(Un(o,"end")||Q.isSelectable(o)))for(let i=r.depth;;i--){let l=So(n.doc,r.before(i),r.after(i),V.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=n.tr.step(l);a.setSelection(Un(o,"end")?le.findFrom(a.doc.resolve(a.mapping.map(s.pos,-1)),-1):Q.create(a.doc,s.pos-o.nodeSize)),e(a.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return o.isAtom&&s.depth==r.depth-1?(e&&e(n.tr.delete(s.pos-o.nodeSize,s.pos).scrollIntoView()),!0):!1},Jy=(n,e,t)=>{let r=Ud(n,t);if(!r)return!1;let s=Nl(r);return s?Kd(n,s,e):!1},Gy=(n,e,t)=>{let r=Gd(n,t);if(!r)return!1;let s=Rl(r);return s?Kd(n,s,e):!1};function Kd(n,e,t){let r=e.nodeBefore,s=r,o=e.pos-1;for(;!s.isTextblock;o--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let i=e.nodeAfter,l=i,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=So(n.doc,o,a,V.empty);if(!c||c.from!=o||c instanceof Ie&&c.slice.size>=a-o)return!1;if(t){let u=n.tr.step(c);u.setSelection(ne.create(u.doc,o)),t(u.scrollIntoView())}return!0}function Un(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const Jd=(n,e,t)=>{let{$head:r,empty:s}=n.selection,o=r;if(!s)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=Nl(r)}let i=o&&o.nodeBefore;return!i||!Q.isSelectable(i)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,o.pos-i.nodeSize)).scrollIntoView()),!0)};function Nl(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function Gd(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const Xd=(n,e,t)=>{let r=Gd(n,t);if(!r)return!1;let s=Rl(r);if(!s)return!1;let o=s.nodeAfter;if(nf(n,s,e,1))return!0;if(r.parent.content.size==0&&(Un(o,"start")||Q.isSelectable(o))){let i=So(n.doc,r.before(),r.after(),V.empty);if(i&&i.slice.size<i.to-i.from){if(e){let l=n.tr.step(i);l.setSelection(Un(o,"start")?le.findFrom(l.doc.resolve(l.mapping.map(s.pos)),1):Q.create(l.doc,l.mapping.map(s.pos))),e(l.scrollIntoView())}return!0}}return o.isAtom&&s.depth==r.depth-1?(e&&e(n.tr.delete(s.pos,s.pos+o.nodeSize).scrollIntoView()),!0):!1},Qd=(n,e,t)=>{let{$head:r,empty:s}=n.selection,o=r;if(!s)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Rl(r)}let i=o&&o.nodeAfter;return!i||!Q.isSelectable(i)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,o.pos)).scrollIntoView()),!0)};function Rl(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const Xy=(n,e)=>{let t=n.selection,r=t instanceof Q,s;if(r){if(t.node.isTextblock||!en(n.doc,t.from))return!1;s=t.from}else if(s=ko(n.doc,t.from,-1),s==null)return!1;if(e){let o=n.tr.join(s);r&&o.setSelection(Q.create(o.doc,s-n.doc.resolve(s).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Qy=(n,e)=>{let t=n.selection,r;if(t instanceof Q){if(t.node.isTextblock||!en(n.doc,t.to))return!1;r=t.to}else if(r=ko(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},Zy=(n,e)=>{let{$from:t,$to:r}=n.selection,s=t.blockRange(r),o=s&&Jn(s);return o==null?!1:(e&&e(n.tr.lift(s,o).scrollIntoView()),!0)},Zd=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
47
|
+
`).scrollIntoView()),!0)};function Ll(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const e0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let s=t.node(-1),o=t.indexAfter(-1),i=Ll(s.contentMatchAt(o));if(!i||!s.canReplaceWith(o,o,i))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,i.createAndFill());a.setSelection(le.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},ef=(n,e)=>{let t=n.selection,{$from:r,$to:s}=t;if(t instanceof ot||r.parent.inlineContent||s.parent.inlineContent)return!1;let o=Ll(s.parent.contentMatchAt(s.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let i=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,l=n.tr.insert(i,o.createAndFill());l.setSelection(ne.create(l.doc,i+1)),e(l.scrollIntoView())}return!0},tf=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(Nt(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),s=r&&Jn(r);return s==null?!1:(e&&e(n.tr.lift(r,s).scrollIntoView()),!0)};function t0(n){return(e,t)=>{let{$from:r,$to:s}=e.selection;if(e.selection instanceof Q&&e.selection.node.isBlock)return!r.parentOffset||!Nt(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],i,l,a=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=Ll(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),o.unshift(a&&l?{type:l}:null),i=h;break}else{if(h==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof ne||e.selection instanceof ot)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Nt(u.doc,d,o.length,o);if(f||(o[0]=l?{type:l}:null,f=Nt(u.doc,d,o.length,o)),!f)return!1;if(u.split(d,o.length,o),!a&&c&&r.node(i).type!=l){let h=u.mapping.map(r.before(i)),m=u.doc.resolve(h);l&&r.node(i-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(i)),l)}return t&&t(u.scrollIntoView()),!0}}const n0=t0(),r0=(n,e)=>{let{$from:t,to:r}=n.selection,s,o=t.sharedDepth(r);return o==0?!1:(s=t.before(o),e&&e(n.tr.setSelection(Q.create(n.doc,s))),!0)};function s0(n,e,t){let r=e.nodeBefore,s=e.nodeAfter,o=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(s.isTextblock||en(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function nf(n,e,t,r){let s=e.nodeBefore,o=e.nodeAfter,i,l,a=s.type.spec.isolating||o.type.spec.isolating;if(!a&&s0(n,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(i=(l=s.contentMatchAt(s.childCount)).findWrapping(o.type))&&l.matchType(i[0]||o.type).validEnd){if(t){let h=e.pos+o.nodeSize,m=I.empty;for(let b=i.length-1;b>=0;b--)m=I.from(i[b].create(null,m));m=I.from(s.copy(m));let y=n.tr.step(new je(e.pos-1,h,e.pos,h,new V(m,1,0),i.length,!0)),g=y.doc.resolve(h+2*i.length);g.nodeAfter&&g.nodeAfter.type==s.type&&en(y.doc,g.pos)&&y.join(g.pos),t(y.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&a?null:le.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Jn(d);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(d,f).scrollIntoView()),!0;if(c&&Un(o,"start",!0)&&Un(s,"end")){let h=s,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let y=o,g=1;for(;!y.isTextblock;y=y.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,y.content)){if(t){let b=I.empty;for(let C=m.length-1;C>=0;C--)b=I.from(m[C].copy(b));let k=n.tr.step(new je(e.pos-m.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new V(b,m.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function rf(n){return function(e,t){let r=e.selection,s=n<0?r.$from:r.$to,o=s.depth;for(;s.node(o).isInline;){if(!o)return!1;o--}return s.node(o).isTextblock?(t&&t(e.tr.setSelection(ne.create(e.doc,n<0?s.start(o):s.end(o)))),!0):!1}}const o0=rf(-1),i0=rf(1);function l0(n,e=null){return function(t,r){let{$from:s,$to:o}=t.selection,i=s.blockRange(o),l=i&&xl(i,n,e);return l?(r&&r(t.tr.wrap(i,l).scrollIntoView()),!0):!1}}function Oc(n,e=null){return function(t,r){let s=!1;for(let o=0;o<t.selection.ranges.length&&!s;o++){let{$from:{pos:i},$to:{pos:l}}=t.selection.ranges[o];t.doc.nodesBetween(i,l,(a,c)=>{if(s)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)s=!0;else{let u=t.doc.resolve(c),d=u.index();s=u.parent.canReplaceWith(d,d+1,n)}})}if(!s)return!1;if(r){let o=t.tr;for(let i=0;i<t.selection.ranges.length;i++){let{$from:{pos:l},$to:{pos:a}}=t.selection.ranges[i];o.setBlockType(l,a,n,e)}r(o.scrollIntoView())}return!0}}function Il(...n){return function(e,t,r){for(let s=0;s<n.length;s++)if(n[s](e,t,r))return!0;return!1}}Il(Al,qd,Jd);Il(Al,Xd,Qd);Il(Zd,ef,tf,n0);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function a0(n,e=null){return function(t,r){let{$from:s,$to:o}=t.selection,i=s.blockRange(o);if(!i)return!1;let l=r?t.tr:null;return c0(l,i,n,e)?(r&&r(l.scrollIntoView()),!0):!1}}function c0(n,e,t,r=null){let s=!1,o=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=i.resolve(e.start-2);o=new xs(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new xs(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let l=xl(o,t,r,e);return l?(n&&u0(n,e,l,s,t),!0):!1}function u0(n,e,t,r,s){let o=I.empty;for(let u=t.length-1;u>=0;u--)o=I.from(t[u].type.create(t[u].attrs,o));n.step(new je(e.start-(r?2:0),e.end,e.start,e.end,new V(o,0,0),t.length,!0));let i=0;for(let u=0;u<t.length;u++)t[u].type==s&&(i=u+1);let l=t.length-i,a=e.start+t.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Nt(n.doc,a,l)&&(n.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return n}function d0(n){return function(e,t){let{$from:r,$to:s}=e.selection,o=r.blockRange(s,i=>i.childCount>0&&i.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?f0(e,t,n,o):h0(e,t,o):!0:!1}}function f0(n,e,t,r){let s=n.tr,o=r.end,i=r.$to.end(r.depth);o<i&&(s.step(new je(o-1,i,o,i,new V(I.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new xs(s.doc.resolve(r.$from.pos),s.doc.resolve(i),r.depth));const l=Jn(r);if(l==null)return!1;s.lift(r,l);let a=s.doc.resolve(s.mapping.map(o,-1)-1);return en(s.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&s.join(a.pos),e(s.scrollIntoView()),!0}function h0(n,e,t){let r=n.tr,s=t.parent;for(let h=t.end,m=t.endIndex-1,y=t.startIndex;m>y;m--)h-=s.child(m).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(t.start),i=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==s.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(l?0:1),u+1,i.content.append(a?I.empty:I.from(s))))return!1;let d=o.pos,f=d+i.nodeSize;return r.step(new je(d-(l?1:0),f+(a?1:0),d+1,f-1,new V((l?I.empty:I.from(s.copy(I.empty))).append(a?I.empty:I.from(s.copy(I.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function p0(n){return function(e,t){let{$from:r,$to:s}=e.selection,o=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let i=o.startIndex;if(i==0)return!1;let l=o.parent,a=l.child(i-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=I.from(c?n.create():null),d=new V(I.from(n.create(null,I.from(l.type.create(null,u)))),c?3:1,0),f=o.start,h=o.end;t(e.tr.step(new je(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}var m0=Object.defineProperty,sf=(n,e)=>{for(var t in e)m0(n,t,{get:e[t],enumerable:!0})};function Eo(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:s}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return s},get tr(){return r=t.selection,s=t.doc,o=t.storedMarks,t}}}var To=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:t}=this,{view:r}=e,{tr:s}=t,o=this.buildProps(s);return Object.fromEntries(Object.entries(n).map(([i,l])=>[i,(...c)=>{const u=l(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:t,editor:r,state:s}=this,{view:o}=r,i=[],l=!!n,a=n||s.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(a),i.every(d=>d===!0)),u={...Object.fromEntries(Object.entries(t).map(([d,f])=>[d,(...m)=>{const y=this.buildProps(a,e),g=f(...m)(y);return i.push(g),u}])),run:c};return u}createCan(n){const{rawCommands:e,state:t}=this,r=!1,s=n||t.tr,o=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(n,e=!0){const{rawCommands:t,editor:r,state:s}=this,{view:o}=r,i={tr:n,editor:r,view:o,state:Eo({state:s,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...c)=>a(...c)(i)]))}};return i}},g0=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function of(n,e){const t=new ad(n);return e.forEach(r=>{r.steps.forEach(s=>{t.step(s)})}),t}var lf=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&lf(r)}return n};function Wr(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return lf(t)}function Er(n,e,t){if(n instanceof mt||n instanceof I)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,s=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return I.fromArray(n.map(l=>e.nodeFromJSON(l)));const i=e.nodeFromJSON(n);return t.errorOnInvalidContent&&i.check(),i}catch(o){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",o),Er("",e,t)}if(s){if(t.errorOnInvalidContent){let i=!1,l="";const a=new Uu({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(i=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?Yt.fromSchema(a).parseSlice(Wr(n),t.parseOptions):Yt.fromSchema(a).parse(Wr(n),t.parseOptions),t.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=Yt.fromSchema(e);return t.slice?o.parseSlice(Wr(n),t.parseOptions).content:o.parse(Wr(n),t.parseOptions)}return Er("",e,t)}function Yi(n,e,t={},r={}){return Er(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}function y0(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function b0(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(s,o)=>{t(s)&&r.push({node:s,pos:o})}),r}function x0(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Oo(n){return e=>x0(e.$from,n)}function X(n,e,t){return n.config[e]===void 0&&n.parent?X(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?X(n.parent,e,t):null}):n.config[e]}function jl(n){return n.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},r=X(e,"addExtensions",t);return r?[e,...jl(r())]:e}).flat(10)}function Pl(n,e){const t=wn.fromSchema(e).serializeFragment(n),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(t),s.innerHTML}function af(n){return typeof n=="function"}function xe(n,e=void 0,...t){return af(n)?e?n.bind(e)(...t):n(...t):n}function k0(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Tr(n){const e=n.filter(s=>s.type==="extension"),t=n.filter(s=>s.type==="node"),r=n.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function cf(n){const e=[],{nodeExtensions:t,markExtensions:r}=Tr(n),s=[...t,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(i=>{const l={name:i.name,options:i.options,storage:i.storage,extensions:s},a=X(i,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,h])=>{e.push({type:d,name:f,attribute:{...o,...h}})})})})}),s.forEach(i=>{const l={name:i.name,options:i.options,storage:i.storage},a=X(i,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...o,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:i.name,name:u,attribute:f})})}),e}function Me(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([s,o])=>{if(!r[s]){r[s]=o;return}if(s==="class"){const l=o?String(o).split(" "):[],a=r[s]?r[s].split(" "):[],c=l.filter(u=>!a.includes(u));r[s]=[...a,...c].join(" ")}else if(s==="style"){const l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],a=r[s]?r[s].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;a.forEach(u=>{const[d,f]=u.split(":").map(h=>h.trim());c.set(d,f)}),l.forEach(u=>{const[d,f]=u.split(":").map(h=>h.trim());c.set(d,f)}),r[s]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[s]=o}),r},{})}function Ts(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Me(t,r),{})}function S0(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Dc(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const s=e.reduce((o,i)=>{const l=i.attribute.parseHTML?i.attribute.parseHTML(t):S0(t.getAttribute(i.name));return l==null?o:{...o,[i.name]:l}},{});return{...r,...s}}}}function Ac(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&k0(t)?!1:t!=null))}function v0(n,e){var t;const r=cf(n),{nodeExtensions:s,markExtensions:o}=Tr(n),i=(t=s.find(c=>X(c,"topNode")))==null?void 0:t.name,l=Object.fromEntries(s.map(c=>{const u=r.filter(b=>b.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((b,k)=>{const C=X(k,"extendNodeSchema",d);return{...b,...C?C(c):{}}},{}),h=Ac({...f,content:xe(X(c,"content",d)),marks:xe(X(c,"marks",d)),group:xe(X(c,"group",d)),inline:xe(X(c,"inline",d)),atom:xe(X(c,"atom",d)),selectable:xe(X(c,"selectable",d)),draggable:xe(X(c,"draggable",d)),code:xe(X(c,"code",d)),whitespace:xe(X(c,"whitespace",d)),linebreakReplacement:xe(X(c,"linebreakReplacement",d)),defining:xe(X(c,"defining",d)),isolating:xe(X(c,"isolating",d)),attrs:Object.fromEntries(u.map(b=>{var k,C;return[b.name,{default:(k=b==null?void 0:b.attribute)==null?void 0:k.default,validate:(C=b==null?void 0:b.attribute)==null?void 0:C.validate}]}))}),m=xe(X(c,"parseHTML",d));m&&(h.parseDOM=m.map(b=>Dc(b,u)));const y=X(c,"renderHTML",d);y&&(h.toDOM=b=>y({node:b,HTMLAttributes:Ts(b,u)}));const g=X(c,"renderText",d);return g&&(h.toText=g),[c.name,h]})),a=Object.fromEntries(o.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((g,b)=>{const k=X(b,"extendMarkSchema",d);return{...g,...k?k(c):{}}},{}),h=Ac({...f,inclusive:xe(X(c,"inclusive",d)),excludes:xe(X(c,"excludes",d)),group:xe(X(c,"group",d)),spanning:xe(X(c,"spanning",d)),code:xe(X(c,"code",d)),attrs:Object.fromEntries(u.map(g=>{var b,k;return[g.name,{default:(b=g==null?void 0:g.attribute)==null?void 0:b.default,validate:(k=g==null?void 0:g.attribute)==null?void 0:k.validate}]}))}),m=xe(X(c,"parseHTML",d));m&&(h.parseDOM=m.map(g=>Dc(g,u)));const y=X(c,"renderHTML",d);return y&&(h.toDOM=g=>y({mark:g,HTMLAttributes:Ts(g,u)})),[c.name,h]}));return new Uu({topNode:i,nodes:l,marks:a})}function C0(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function _l(n){return n.sort((t,r)=>{const s=X(t,"priority")||100,o=X(r,"priority")||100;return s>o?-1:s<o?1:0})}function uf(n){const e=_l(jl(n)),t=C0(e.map(r=>r.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function df(n,e,t){const{from:r,to:s}=e,{blockSeparator:o=`
|
|
48
|
+
|
|
49
|
+
`,textSerializers:i={}}=t||{};let l="";return n.nodesBetween(r,s,(a,c,u,d)=>{var f;a.isBlock&&c>r&&(l+=o);const h=i==null?void 0:i[a.type.name];if(h)return u&&(l+=h({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)==null?void 0:f.slice(Math.max(r,c)-c,s-c))}),l}function M0(n,e){const t={from:0,to:n.content.size};return df(n,t,e)}function ff(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function It(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}function hf(n,e){const t=It(e,n.schema),{from:r,to:s,empty:o}=n.selection,i=[];o?(n.storedMarks&&i.push(...n.storedMarks),i.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,s,a=>{i.push(...a.marks)});const l=i.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function Le(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function w0(n,e){const t=Le(e,n.schema),{from:r,to:s}=n.selection,o=[];n.doc.nodesBetween(r,s,l=>{o.push(l)});const i=o.reverse().find(l=>l.type.name===t.name);return i?{...i.attrs}:{}}function Do(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function pf(n,e){const t=Do(typeof e=="string"?e:e.name,n.schema);return t==="node"?w0(n,e):t==="mark"?hf(n,e):{}}function E0(n,e=JSON.stringify){const t={};return n.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(t,s)?!1:t[s]=!0})}function T0(n){const e=E0(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,i)=>i!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function mf(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((s,o)=>{const i=[];if(s.ranges.length)s.forEach((l,a)=>{i.push({from:l,to:a})});else{const{from:l,to:a}=t[o];if(l===void 0||a===void 0)return;i.push({from:l,to:a})}i.forEach(({from:l,to:a})=>{const c=e.slice(o).map(l,-1),u=e.slice(o).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),T0(r)}function Bl(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function Os(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>t.strict?e[s]===n[s]:Bl(e[s])?e[s].test(n[s]):e[s]===n[s]):!0}function gf(n,e,t={}){return n.find(r=>r.type===e&&Os(Object.fromEntries(Object.keys(t).map(s=>[s,r.attrs[s]])),t))}function Nc(n,e,t={}){return!!gf(n,e,t)}function Fl(n,e,t){var r;if(!n||!e)return;let s=n.parent.childAfter(n.parentOffset);if((!s.node||!s.node.marks.some(u=>u.type===e))&&(s=n.parent.childBefore(n.parentOffset)),!s.node||!s.node.marks.some(u=>u.type===e)||(t=t||((r=s.node.marks[0])==null?void 0:r.attrs),!gf([...s.node.marks],e,t)))return;let i=s.index,l=n.start()+s.offset,a=i+1,c=l+s.node.nodeSize;for(;i>0&&Nc([...n.parent.child(i-1).marks],e,t);)i-=1,l-=n.parent.child(i).nodeSize;for(;a<n.parent.childCount&&Nc([...n.parent.child(a).marks],e,t);)c+=n.parent.child(a).nodeSize,a+=1;return{from:l,to:c}}function zl(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(s=>{const o=t.resolve(n),i=Fl(o,s.type);i&&r.push({mark:s,...i})}):t.nodesBetween(n,e,(s,o)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(i=>({from:o,to:o+s.nodeSize,mark:i})))}),r}var O0=(n,e,t,r=20)=>{const s=n.doc.resolve(t);let o=r,i=null;for(;o>0&&i===null;){const l=s.node(o);(l==null?void 0:l.type.name)===e?i=l:o-=1}return[i,o]};function ci(n,e){return e.nodes[n]||e.marks[n]||null}function as(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const s=n.find(o=>o.type===e&&o.name===r);return s?s.attribute.keepOnSplit:!1}))}var D0=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(s,o,i,l)=>{var a,c;const u=((c=(a=s.type.spec).toText)==null?void 0:c.call(a,{node:s,pos:o,parent:i,index:l}))||s.textContent||"%leaf%";t+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-o))}),t};function Ui(n,e,t={}){const{empty:r,ranges:s}=n.selection,o=e?It(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>Os(d.attrs,t,{strict:!1}));let i=0;const l=[];if(s.forEach(({$from:d,$to:f})=>{const h=d.pos,m=f.pos;n.doc.nodesBetween(h,m,(y,g)=>{if(!y.isText&&!y.marks.length)return;const b=Math.max(h,g),k=Math.min(m,g+y.nodeSize),C=k-b;i+=C,l.push(...y.marks.map(T=>({mark:T,from:b,to:k})))})}),i===0)return!1;const a=l.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>Os(d.mark.attrs,t,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=i}function Gt(n,e,t={}){const{from:r,to:s,empty:o}=n.selection,i=e?Le(e,n.schema):null,l=[];n.doc.nodesBetween(r,s,(d,f)=>{if(d.isText)return;const h=Math.max(r,f),m=Math.min(s,f+d.nodeSize);l.push({node:d,from:h,to:m})});const a=s-r,c=l.filter(d=>i?i.name===d.node.type.name:!0).filter(d=>Os(d.node.attrs,t,{strict:!1}));return o?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}function A0(n,e,t={}){if(!e)return Gt(n,null,t)||Ui(n,null,t);const r=Do(e,n.schema);return r==="node"?Gt(n,e,t):r==="mark"?Ui(n,e,t):!1}var N0=(n,e)=>{const{$from:t,$to:r,$anchor:s}=n.selection;if(e){const o=Oo(l=>l.type.name===e)(n.selection);if(!o)return!1;const i=n.doc.resolve(o.pos+1);return s.pos+1===i.end()}return!(r.parentOffset<r.parent.nodeSize-2||t.pos!==r.pos)},R0=n=>{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Rc(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Lc(n,e){const{nodeExtensions:t}=Tr(e),r=t.find(i=>i.name===n);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},o=xe(X(r,"group",s));return typeof o!="string"?!1:o.split(" ").includes("list")}function Ao(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!=null?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let s=!0;return n.content.forEach(o=>{s!==!1&&(Ao(o,{ignoreWhitespace:t,checkChildren:e})||(s=!1))}),s}return!1}function yf(n){return n instanceof Q}function bf(n){return n instanceof ne}function fn(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function xf(n,e=null){if(!e)return null;const t=le.atStart(n),r=le.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const s=t.from,o=r.to;return e==="all"?ne.create(n,fn(0,s,o),fn(n.content.size,s,o)):ne.create(n,fn(e,s,o),fn(e,s,o))}function L0(n,e,t){const r=n.steps.length-1;if(r<e)return;const s=n.steps[r];if(!(s instanceof Ie||s instanceof je))return;const o=n.mapping.maps[r];let i=0;o.forEach((l,a,c,u)=>{i===0&&(i=u)}),n.setSelection(le.near(n.doc.resolve(i),t))}var No=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!=null?e:!0}},I0=(n,e)=>{if(Bl(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Yr(n){var e;const{editor:t,from:r,to:s,text:o,rules:i,plugin:l}=n,{view:a}=t;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=D0(c)+o;return i.forEach(f=>{if(u)return;const h=I0(d,f.find);if(!h)return;const m=a.state.tr,y=Eo({state:a.state,transaction:m}),g={from:r-(h[0].length-o.length),to:s},{commands:b,chain:k,can:C}=new To({editor:t,state:y});f.handler({state:y,range:g,match:h,commands:b,chain:k,can:C})===null||!m.steps.length||(f.undoable&&m.setMeta(l,{transform:m,from:r,to:s,text:o}),a.dispatch(m),u=!0)}),u}function j0(n){const{editor:e,rules:t}=n,r=new Te({state:{init(){return null},apply(s,o,i){const l=s.getMeta(r);if(l)return l;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=Pl(I.from(u),i.schema);const{from:d}=a,f=d+u.length;Yr({editor:e,from:d,to:f,text:u,rules:t,plugin:r})}),s.selectionSet||s.docChanged?null:o}},props:{handleTextInput(s,o,i,l){return Yr({editor:e,from:o,to:i,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:o}=s.state.selection;o&&Yr({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(s,o){if(o.key!=="Enter")return!1;const{$cursor:i}=s.state.selection;return i?Yr({editor:e,from:i.pos,to:i.pos,text:`
|
|
50
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function P0(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ur(n){return P0(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function kf(n,e){const t={...n};return Ur(n)&&Ur(e)&&Object.keys(e).forEach(r=>{Ur(e[r])&&Ur(n[r])?t[r]=kf(n[r],e[r]):t[r]=e[r]}),t}var Vl=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...xe(X(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...xe(X(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>kf(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},St=class Sf extends Vl{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new Sf(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!!!i.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=i.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function _0(n){return typeof n=="number"}var B0=class{constructor(n){this.find=n.find,this.handler=n.handler}},F0=(n,e,t)=>{if(Bl(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(s=>{const o=[s.text];return o.index=s.index,o.input=n,o.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(s.replaceWith)),o}):[]};function z0(n){const{editor:e,state:t,from:r,to:s,rule:o,pasteEvent:i,dropEvent:l}=n,{commands:a,chain:c,can:u}=new To({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,s,(h,m)=>{var y,g,b,k,C;if((g=(y=h.type)==null?void 0:y.spec)!=null&&g.code||!(h.isText||h.isTextblock||h.isInline))return;const T=(C=(k=(b=h.content)==null?void 0:b.size)!=null?k:h.nodeSize)!=null?C:0,M=Math.max(r,m),v=Math.min(s,m+T);if(M>=v)return;const w=h.isText?h.text||"":h.textBetween(M-m,v-m,void 0,"");F0(w,o.find,i).forEach(N=>{if(N.index===void 0)return;const B=M+N.index+1,Y=B+N[0].length,$={from:t.tr.mapping.map(B),to:t.tr.mapping.map(Y)},F=o.handler({state:t,range:$,match:N,commands:a,chain:c,can:u,pasteEvent:i,dropEvent:l});d.push(F)})}),d.every(h=>h!==null)}var qr=null,V0=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function H0(n){const{editor:e,rules:t}=n;let r=null,s=!1,o=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:u,from:d,to:f,rule:h,pasteEvt:m})=>{const y=u.tr,g=Eo({state:u,transaction:y});if(!(!z0({editor:e,state:g,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:l})||!y.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y}};return t.map(u=>new Te({view(d){const f=m=>{var y;r=(y=d.dom.parentElement)!=null&&y.contains(m.target)?d.dom.parentElement:null,r&&(qr=e)},h=()=>{qr&&(qr=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(o=r===d.dom.parentElement,l=f,!o){const h=qr;h!=null&&h.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(d,f)=>{var h;const m=(h=f.clipboardData)==null?void 0:h.getData("text/html");return i=f,s=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,h)=>{const m=d[0],y=m.getMeta("uiEvent")==="paste"&&!s,g=m.getMeta("uiEvent")==="drop"&&!o,b=m.getMeta("applyPasteRules"),k=!!b;if(!y&&!g&&!k)return;if(k){let{text:M}=b;typeof M=="string"?M=M:M=Pl(I.from(M),h.schema);const{from:v}=b,w=v+M.length,O=V0(M);return a({rule:u,state:h,from:v,to:{b:w},pasteEvt:O})}const C=f.doc.content.findDiffStart(h.doc.content),T=f.doc.content.findDiffEnd(h.doc.content);if(!(!_0(C)||!T||C===T.b))return a({rule:u,state:h,from:C,to:T,pasteEvt:i})}}))}var Ro=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.extensions=uf(n),this.schema=v0(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ci(e.name,this.schema)},r=X(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){const{editor:n}=this;return _l([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:ci(r.name,this.schema)},o=[],i=X(r,"addKeyboardShortcuts",s);let l={};if(r.type==="mark"&&X(r,"exitable",s)&&(l.ArrowRight=()=>St.handleExit({editor:n,mark:r})),i){const f=Object.fromEntries(Object.entries(i()).map(([h,m])=>[h,()=>m({editor:n})]));l={...l,...f}}const a=Ky(l);o.push(a);const c=X(r,"addInputRules",s);if(Rc(r,n.options.enableInputRules)&&c){const f=c();if(f&&f.length){const h=j0({editor:n,rules:f}),m=Array.isArray(h)?h:[h];o.push(...m)}}const u=X(r,"addPasteRules",s);if(Rc(r,n.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const h=H0({editor:n,rules:f});o.push(...h)}}const d=X(r,"addProseMirrorPlugins",s);if(d){const f=d();o.push(...f)}return o})}get attributes(){return cf(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=Tr(this.extensions);return Object.fromEntries(e.filter(t=>!!X(t,"addNodeView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),s={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Le(t.name,this.schema)},o=X(t,"addNodeView",s);if(!o)return[];const i=(l,a,c,u,d)=>{const f=Ts(l,r);return o()({node:l,view:a,getPos:c,decorations:u,innerDecorations:d,editor:n,extension:t,HTMLAttributes:f})};return[t.name,i]}))}get markViews(){const{editor:n}=this,{markExtensions:e}=Tr(this.extensions);return Object.fromEntries(e.filter(t=>!!X(t,"addMarkView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),s={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:It(t.name,this.schema)},o=X(t,"addMarkView",s);if(!o)return[];const i=(l,a,c)=>{const u=Ts(l,r);return o()({mark:l,view:a,inline:c,editor:n,extension:t,HTMLAttributes:u,updateAttributes:d=>{s1(l,n,d)}})};return[t.name,i]}))}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ci(e.name,this.schema)};e.type==="mark"&&((t=xe(X(e,"keepOnSplit",r)))==null||t)&&this.splittableMarks.push(e.name);const s=X(e,"onBeforeCreate",r),o=X(e,"onCreate",r),i=X(e,"onUpdate",r),l=X(e,"onSelectionUpdate",r),a=X(e,"onTransaction",r),c=X(e,"onFocus",r),u=X(e,"onBlur",r),d=X(e,"onDestroy",r);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),i&&this.editor.on("update",i),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}};Ro.resolve=uf;Ro.sort=_l;Ro.flatten=jl;var $0={};sf($0,{ClipboardTextSerializer:()=>Cf,Commands:()=>Ef,Delete:()=>Tf,Drop:()=>Of,Editable:()=>Df,FocusEvents:()=>Nf,Keymap:()=>Rf,Paste:()=>Lf,Tabindex:()=>If,focusEventsPluginKey:()=>Af});var De=class vf extends Vl{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new vf(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Cf=De.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Te({key:new _e("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:s}=e,{ranges:o}=s,i=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),a=ff(t);return df(r,{from:i,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Mf={};sf(Mf,{blur:()=>W0,clearContent:()=>Y0,clearNodes:()=>U0,command:()=>q0,createParagraphNear:()=>K0,cut:()=>J0,deleteCurrentNode:()=>G0,deleteNode:()=>X0,deleteRange:()=>Q0,deleteSelection:()=>Z0,enter:()=>eb,exitCode:()=>tb,extendMarkRange:()=>nb,first:()=>rb,focus:()=>ob,forEach:()=>ib,insertContent:()=>lb,insertContentAt:()=>cb,joinBackward:()=>fb,joinDown:()=>db,joinForward:()=>hb,joinItemBackward:()=>pb,joinItemForward:()=>mb,joinTextblockBackward:()=>gb,joinTextblockForward:()=>yb,joinUp:()=>ub,keyboardShortcut:()=>xb,lift:()=>kb,liftEmptyBlock:()=>Sb,liftListItem:()=>vb,newlineInCode:()=>Cb,resetAttributes:()=>Mb,scrollIntoView:()=>wb,selectAll:()=>Eb,selectNodeBackward:()=>Tb,selectNodeForward:()=>Ob,selectParentNode:()=>Db,selectTextblockEnd:()=>Ab,selectTextblockStart:()=>Nb,setContent:()=>Rb,setMark:()=>Ib,setMeta:()=>jb,setNode:()=>Pb,setNodeSelection:()=>_b,setTextSelection:()=>Bb,sinkListItem:()=>Fb,splitBlock:()=>zb,splitListItem:()=>Vb,toggleList:()=>Hb,toggleMark:()=>$b,toggleNode:()=>Wb,toggleWrap:()=>Yb,undoInputRule:()=>Ub,unsetAllMarks:()=>qb,unsetMark:()=>Kb,updateAttributes:()=>Jb,wrapIn:()=>Gb,wrapInList:()=>Xb});var W0=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())==null||t.removeAllRanges())}),!0),Y0=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),U0=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:s}=r;return t&&s.forEach(({$from:o,$to:i})=>{n.doc.nodesBetween(o.pos,i.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const m=Jn(h);if(l.type.isTextblock){const{defaultType:y}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,y)}(m||m===0)&&e.lift(h,m)})}),!0},q0=n=>e=>n(e),K0=()=>({state:n,dispatch:e})=>ef(n,e),J0=(n,e)=>({editor:t,tr:r})=>{const{state:s}=t,o=s.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const i=r.mapping.map(e);return r.insert(i,o.content),r.setSelection(new ne(r.doc.resolve(Math.max(i-1,0)))),!0},G0=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const s=n.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===r.type){if(e){const l=s.before(o),a=s.after(o);n.delete(l,a).scrollIntoView()}return!0}return!1},X0=n=>({tr:e,state:t,dispatch:r})=>{const s=Le(n,t.schema),o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===s){if(r){const a=o.before(i),c=o.after(i);e.delete(a,c).scrollIntoView()}return!0}return!1},Q0=n=>({tr:e,dispatch:t})=>{const{from:r,to:s}=n;return t&&e.delete(r,s),!0},Z0=()=>({state:n,dispatch:e})=>Al(n,e),eb=()=>({commands:n})=>n.keyboardShortcut("Enter"),tb=()=>({state:n,dispatch:e})=>e0(n,e),nb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{const o=It(n,r.schema),{doc:i,selection:l}=t,{$from:a,from:c,to:u}=l;if(s){const d=Fl(a,o,e);if(d&&d.from<=c&&d.to>=u){const f=ne.create(i,d.from,d.to);t.setSelection(f)}}return!0},rb=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function sb(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Hl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var ob=(n=null,e={})=>({editor:t,view:r,tr:s,dispatch:o})=>{e={scrollIntoView:!0,...e};const i=()=>{(Hl()||sb())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!bf(t.state.selection))return i(),!0;const l=xf(s.doc,n)||t.state.selection,a=t.state.selection.eq(l);return o&&(a||s.setSelection(l),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),i()),!0},ib=(n,e)=>t=>n.every((r,s)=>e(r,{...t,index:s})),lb=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),ab=n=>!("type"in n),cb=(n,e,t)=>({tr:r,dispatch:s,editor:o})=>{var i;if(s){t={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{o.emit("contentError",{editor:o,error:g,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Er(e,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){a(g)}try{l=Er(e,o.schema,{parseOptions:c,errorOnInvalidContent:(i=t.errorOnInvalidContent)!=null?i:o.options.enableContentCheck})}catch(g){return a(g),!1}let{from:u,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,h=!0;if((ab(l)?l:[l]).forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),u===d&&h){const{parent:g}=r.doc.resolve(u);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(u-=1,d+=1)}let y;if(f){if(Array.isArray(e))y=e.map(g=>g.text||"").join("");else if(e instanceof I){let g="";e.forEach(b=>{b.text&&(g+=b.text)}),y=g}else typeof e=="object"&&e&&e.text?y=e.text:y=e;r.insertText(y,u,d)}else{y=l;const g=r.doc.resolve(u),b=g.node(),k=g.parentOffset===0,C=b.isText||b.isTextblock,T=b.content.size>0;k&&C&&T&&(u=Math.max(0,u-1)),r.replaceWith(u,d,y)}t.updateSelection&&L0(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:y}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:y})}return!0},ub=()=>({state:n,dispatch:e})=>Xy(n,e),db=()=>({state:n,dispatch:e})=>Qy(n,e),fb=()=>({state:n,dispatch:e})=>qd(n,e),hb=()=>({state:n,dispatch:e})=>Xd(n,e),pb=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ko(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},mb=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ko(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},gb=()=>({state:n,dispatch:e})=>Jy(n,e),yb=()=>({state:n,dispatch:e})=>Gy(n,e);function wf(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function bb(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,s,o,i;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))Hl()||wf()?i=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(t=`Alt-${t}`),s&&(t=`Ctrl-${t}`),i&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}var xb=n=>({editor:e,view:t,tr:r,dispatch:s})=>{const o=bb(n).split(/-(?!$)/),i=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0},kb=(n,e={})=>({state:t,dispatch:r})=>{const s=Le(n,t.schema);return Gt(t,s,e)?Zy(t,r):!1},Sb=()=>({state:n,dispatch:e})=>tf(n,e),vb=n=>({state:e,dispatch:t})=>{const r=Le(n,e.schema);return d0(r)(e,t)},Cb=()=>({state:n,dispatch:e})=>Zd(n,e);function Ic(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,s)=>(t.includes(s)||(r[s]=n[s]),r),{})}var Mb=(n,e)=>({tr:t,state:r,dispatch:s})=>{let o=null,i=null;const l=Do(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=Le(n,r.schema)),l==="mark"&&(i=It(n,r.schema)),s&&t.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{o&&o===c.type&&t.setNodeMarkup(u,void 0,Ic(c.attrs,e)),i&&c.marks.length&&c.marks.forEach(d=>{i===d.type&&t.addMark(u,u+c.nodeSize,i.create(Ic(d.attrs,e)))})})}),!0):!1},wb=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Eb=()=>({tr:n,dispatch:e})=>{if(e){const t=new ot(n.doc);n.setSelection(t)}return!0},Tb=()=>({state:n,dispatch:e})=>Jd(n,e),Ob=()=>({state:n,dispatch:e})=>Qd(n,e),Db=()=>({state:n,dispatch:e})=>r0(n,e),Ab=()=>({state:n,dispatch:e})=>i0(n,e),Nb=()=>({state:n,dispatch:e})=>o0(n,e),Rb=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:s,tr:o,dispatch:i,commands:l})=>{const{doc:a}=o;if(r.preserveWhitespace!=="full"){const c=Yi(n,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return i&&o.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!t),!0}return i&&o.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},n,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function Lb(n,e,t){var r;const{selection:s}=e;let o=null;if(bf(s)&&(o=s.$cursor),o){const l=(r=n.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(c=>c.type.excludes(t)))}const{ranges:i}=s;return i.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(y=>y.type.excludes(t));c=h&&m}return!c}),c})}var Ib=(n,e={})=>({tr:t,state:r,dispatch:s})=>{const{selection:o}=t,{empty:i,ranges:l}=o,a=It(n,r.schema);if(s)if(i){const c=hf(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const m=Math.max(h,u),y=Math.min(h+f.nodeSize,d);f.marks.find(b=>b.type===a)?f.marks.forEach(b=>{a===b.type&&t.addMark(m,y,a.create({...b.attrs,...e}))}):t.addMark(m,y,a.create(e))})});return Lb(r,t,a)},jb=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Pb=(n,e={})=>({state:t,dispatch:r,chain:s})=>{const o=Le(n,t.schema);let i;return t.selection.$anchor.sameParent(t.selection.$head)&&(i=t.selection.$anchor.parent.attrs),o.isTextblock?s().command(({commands:l})=>Oc(o,{...i,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Oc(o,{...i,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},_b=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,s=fn(n,0,r.content.size),o=Q.create(r,s);e.setSelection(o)}return!0},Bb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:s,to:o}=typeof n=="number"?{from:n,to:n}:n,i=ne.atStart(r).from,l=ne.atEnd(r).to,a=fn(s,i,l),c=fn(o,i,l),u=ne.create(r,a,c);e.setSelection(u)}return!0},Fb=n=>({state:e,dispatch:t})=>{const r=Le(n,e.schema);return p0(r)(e,t)};function jc(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(s=>e==null?void 0:e.includes(s.type.name));n.tr.ensureMarks(r)}}var zb=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:s})=>{const{selection:o,doc:i}=e,{$from:l,$to:a}=o,c=s.extensionManager.attributes,u=as(c,l.node().type.name,l.node().attrs);if(o instanceof Q&&o.node.isBlock)return!l.parentOffset||!Nt(i,l.pos)?!1:(r&&(n&&jc(t,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:y0(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,m=Nt(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!m&&Nt(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(m&&(o instanceof ne&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const y=e.mapping.map(l.before()),g=e.doc.resolve(y);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}n&&jc(t,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},Vb=(n,e={})=>({tr:t,state:r,dispatch:s,editor:o})=>{var i;const l=Le(n,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){let b=I.empty;const k=a.index(-1)?1:a.index(-2)?2:3;for(let O=a.depth-k;O>=a.depth-3;O-=1)b=I.from(a.node(O).copy(b));const C=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,T={...as(f,a.node().type.name,a.node().attrs),...e},M=((i=l.contentMatch.defaultType)==null?void 0:i.createAndFill(T))||void 0;b=b.append(I.from(l.createAndFill(null,M)||void 0));const v=a.before(a.depth-(k-1));t.replace(v,a.after(-C),new V(b,4-k,0));let w=-1;t.doc.nodesBetween(v,t.doc.content.size,(O,N)=>{if(w>-1)return!1;O.isTextblock&&O.content.size===0&&(w=N+1)}),w>-1&&t.setSelection(ne.near(t.doc.resolve(w))),t.scrollIntoView()}return!0}const h=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,m={...as(f,d.type.name,d.attrs),...e},y={...as(f,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,c.pos);const g=h?[{type:l,attrs:m},{type:h,attrs:y}]:[{type:l,attrs:m}];if(!Nt(t.doc,a.pos,2))return!1;if(s){const{selection:b,storedMarks:k}=r,{splittableMarks:C}=o.extensionManager,T=k||b.$to.parentOffset&&b.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!T||!s)return!0;const M=T.filter(v=>C.includes(v.type.name));t.ensureMarks(M)}return!0},ui=(n,e)=>{const t=Oo(i=>i.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const s=n.doc.nodeAt(r);return t.node.type===(s==null?void 0:s.type)&&en(n.doc,t.pos)&&n.join(t.pos),!0},di=(n,e)=>{const t=Oo(i=>i.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const s=n.doc.nodeAt(r);return t.node.type===(s==null?void 0:s.type)&&en(n.doc,r)&&n.join(r),!0},Hb=(n,e,t,r={})=>({editor:s,tr:o,state:i,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=s.extensionManager,h=Le(n,i.schema),m=Le(e,i.schema),{selection:y,storedMarks:g}=i,{$from:b,$to:k}=y,C=b.blockRange(k),T=g||y.$to.parentOffset&&y.$from.marks();if(!C)return!1;const M=Oo(v=>Lc(v.type.name,d))(y);if(C.depth>=1&&M&&C.depth-M.depth<=1){if(M.node.type===h)return c.liftListItem(m);if(Lc(M.node.type.name,d)&&h.validContent(M.node.content)&&l)return a().command(()=>(o.setNodeMarkup(M.pos,h),!0)).command(()=>ui(o,h)).command(()=>di(o,h)).run()}return!t||!T||!l?a().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>ui(o,h)).command(()=>di(o,h)).run():a().command(()=>{const v=u().wrapInList(h,r),w=T.filter(O=>f.includes(O.type.name));return o.ensureMarks(w),v?!0:c.clearNodes()}).wrapInList(h,r).command(()=>ui(o,h)).command(()=>di(o,h)).run()},$b=(n,e={},t={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:o=!1}=t,i=It(n,r.schema);return Ui(r,i,e)?s.unsetMark(i,{extendEmptyMarkRange:o}):s.setMark(i,e)},Wb=(n,e,t={})=>({state:r,commands:s})=>{const o=Le(n,r.schema),i=Le(e,r.schema),l=Gt(r,o,t);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?s.setNode(i,a):s.setNode(o,{...a,...t})},Yb=(n,e={})=>({state:t,commands:r})=>{const s=Le(n,t.schema);return Gt(t,s,e)?r.lift(s):r.wrapIn(s,e)},Ub=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const s=t[r];let o;if(s.spec.isInputRules&&(o=s.getState(n))){if(e){const i=n.tr,l=o.transform;for(let a=l.steps.length-1;a>=0;a-=1)i.step(l.steps[a].invert(l.docs[a]));if(o.text){const a=i.doc.resolve(o.from).marks();i.replaceWith(o.from,o.to,n.schema.text(o.text,a))}else i.delete(o.from,o.to)}return!0}}return!1},qb=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:s}=t;return r||e&&s.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},Kb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{var o;const{extendEmptyMarkRange:i=!1}=e,{selection:l}=t,a=It(n,r.schema),{$from:c,empty:u,ranges:d}=l;if(!s)return!0;if(u&&i){let{from:f,to:h}=l;const m=(o=c.marks().find(g=>g.type===a))==null?void 0:o.attrs,y=Fl(c,a,m);y&&(f=y.from,h=y.to),t.removeMark(f,h,a)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},Jb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{let o=null,i=null;const l=Do(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=Le(n,r.schema)),l==="mark"&&(i=It(n,r.schema)),s&&t.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;let d,f,h,m;t.selection.empty?r.doc.nodesBetween(c,u,(y,g)=>{o&&o===y.type&&(h=Math.max(g,c),m=Math.min(g+y.nodeSize,u),d=g,f=y)}):r.doc.nodesBetween(c,u,(y,g)=>{g<c&&o&&o===y.type&&(h=Math.max(g,c),m=Math.min(g+y.nodeSize,u),d=g,f=y),g>=c&&g<=u&&(o&&o===y.type&&t.setNodeMarkup(g,void 0,{...y.attrs,...e}),i&&y.marks.length&&y.marks.forEach(b=>{if(i===b.type){const k=Math.max(g,c),C=Math.min(g+y.nodeSize,u);t.addMark(k,C,i.create({...b.attrs,...e}))}}))}),f&&(d!==void 0&&t.setNodeMarkup(d,void 0,{...f.attrs,...e}),i&&f.marks.length&&f.marks.forEach(y=>{i===y.type&&t.addMark(h,m,i.create({...y.attrs,...e}))}))}),!0):!1},Gb=(n,e={})=>({state:t,dispatch:r})=>{const s=Le(n,t.schema);return l0(s,e)(t,r)},Xb=(n,e={})=>({state:t,dispatch:r})=>{const s=Le(n,t.schema);return a0(s,e)(t,r)},Ef=De.create({name:"commands",addCommands(){return{...Mf}}}),Tf=De.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,s;const o=()=>{var i,l,a,c;if((c=(a=(l=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,n))!=null?c:n.getMeta("y-sync$"))return;const u=of(n.before,[n,...e]);mf(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(m,y)=>{const g=y+m.nodeSize-2,b=h.oldRange.from<=y&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:y,to:g,newFrom:u.mapping.map(y),newTo:u.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!b,editor:this.editor,transaction:n,combinedTransform:u})})});const f=u.mapping;u.steps.forEach((h,m)=>{var y,g;if(h instanceof pt){const b=f.slice(m).map(h.from,-1),k=f.slice(m).map(h.to),C=f.invert().map(b,-1),T=f.invert().map(k),M=(y=u.doc.nodeAt(b-1))==null?void 0:y.marks.some(w=>w.eq(h.mark)),v=(g=u.doc.nodeAt(k))==null?void 0:g.marks.some(w=>w.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:C,to:T},newRange:{from:b,to:k},partial:!!(v||M),editor:this.editor,transaction:n,combinedTransform:u})}})};(s=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||s?setTimeout(o,0):o()}}),Of=De.create({name:"drop",addProseMirrorPlugins(){return[new Te({key:new _e("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Df=De.create({name:"editable",addProseMirrorPlugins(){return[new Te({key:new _e("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Af=new _e("focusEvents"),Nf=De.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Te({key:Af,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Rf=De.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:h}=d,m=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,y=m.parent.type.spec.isolating,g=d.pos-d.parentOffset,b=y&&m.parent.childCount===1?g===d.pos:le.atStart(c).from===f;return!u||!h.type.isTextblock||h.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hl()||wf()?o:s},addProseMirrorPlugins(){return[new Te({key:new _e("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(y=>y.getMeta("composition")))return;const r=n.some(y=>y.docChanged)&&!e.doc.eq(t.doc),s=n.some(y=>y.getMeta("preventClearDocument"));if(!r||s)return;const{empty:o,from:i,to:l}=e.selection,a=le.atStart(e.doc).from,c=le.atEnd(e.doc).to;if(o||!(i===a&&l===c)||!Ao(t.doc))return;const f=t.tr,h=Eo({state:t,transaction:f}),{commands:m}=new To({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),Lf=De.create({name:"paste",addProseMirrorPlugins(){return[new Te({key:new _e("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),If=De.create({name:"tabindex",addProseMirrorPlugins(){return[new Te({key:new _e("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Qb=class Pn{constructor(e,t,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Pn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Pn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Pn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const s=t.isBlock&&!t.isTextblock,o=t.isAtom&&!t.isText,i=this.pos+r+(o?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(i);if(!s&&l.depth<=this.depth)return;const a=new Pn(l,this.editor,s,s?t:null);s&&(a.actualDepth=this.depth+1),e.push(new Pn(l,this.editor,s,s?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(t).length>0){const o=s.node.attrs,i=Object.keys(t);for(let l=0;l<i.length;l+=1){const a=i[l];if(o[a]!==t[a])break}}else r=s;s=s.parent}return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const o=Object.keys(t);return this.children.forEach(i=>{r&&s.length>0||(i.node.type.name===e&&o.every(a=>t[a]===i.node.attrs[a])&&s.push(i),!(r&&s.length>0)&&(s=s.concat(i.querySelectorAll(e,t,r))))}),s}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Zb=`.ProseMirror {
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ProseMirror {
|
|
55
|
+
word-wrap: break-word;
|
|
56
|
+
white-space: pre-wrap;
|
|
57
|
+
white-space: break-spaces;
|
|
58
|
+
-webkit-font-variant-ligatures: none;
|
|
59
|
+
font-variant-ligatures: none;
|
|
60
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ProseMirror [contenteditable="false"] {
|
|
64
|
+
white-space: normal;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
68
|
+
white-space: pre-wrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ProseMirror pre {
|
|
72
|
+
white-space: pre-wrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
img.ProseMirror-separator {
|
|
76
|
+
display: inline !important;
|
|
77
|
+
border: none !important;
|
|
78
|
+
margin: 0 !important;
|
|
79
|
+
width: 0 !important;
|
|
80
|
+
height: 0 !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ProseMirror-gapcursor {
|
|
84
|
+
display: none;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
position: absolute;
|
|
87
|
+
margin: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ProseMirror-gapcursor:after {
|
|
91
|
+
content: "";
|
|
92
|
+
display: block;
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: -2px;
|
|
95
|
+
width: 20px;
|
|
96
|
+
border-top: 1px solid black;
|
|
97
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes ProseMirror-cursor-blink {
|
|
101
|
+
to {
|
|
102
|
+
visibility: hidden;
|
|
66
103
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`)},$u=0,Ut=[];function ju(e){var t=G.useRef([]),r=G.useRef([0,0]),n=G.useRef(),o=G.useState($u++)[0],s=G.useState(ei)[0],a=G.useRef(e);G.useEffect(function(){a.current=e},[e]),G.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=eu([e.lockRef.current],(e.shards||[]).map(Js),!0).filter(Boolean);return p.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=G.useCallback(function(p,h){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=Hr(p),w=r.current,b="deltaX"in p?p.deltaX:w[0]-y[0],C="deltaY"in p?p.deltaY:w[1]-y[1],D,S=p.target,O=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in p&&O==="h"&&S.type==="range")return!1;var k=Ks(O,S);if(!k)return!0;if(k?D=O:(D=O==="v"?"h":"v",k=Ks(O,S)),!k)return!1;if(!n.current&&"changedTouches"in p&&(b||C)&&(n.current=D),!D)return!0;var j=n.current||D;return Tu(j,h,p,j==="h"?b:C)},[]),c=G.useCallback(function(p){var h=p;if(!(!Ut.length||Ut[Ut.length-1]!==s)){var y="deltaY"in h?Zs(h):Hr(h),w=t.current.filter(function(D){return D.name===h.type&&(D.target===h.target||h.target===D.shadowParent)&&Ou(D.delta,y)})[0];if(w&&w.should){h.cancelable&&h.preventDefault();return}if(!w){var b=(a.current.shards||[]).map(Js).filter(Boolean).filter(function(D){return D.contains(h.target)}),C=b.length>0?i(h,b[0]):!a.current.noIsolation;C&&h.cancelable&&h.preventDefault()}}},[]),l=G.useCallback(function(p,h,y,w){var b={name:p,delta:h,target:y,should:w,shadowParent:Au(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),u=G.useCallback(function(p){r.current=Hr(p),n.current=void 0},[]),d=G.useCallback(function(p){l(p.type,Zs(p),p.target,i(p,e.lockRef.current))},[]),f=G.useCallback(function(p){l(p.type,Hr(p),p.target,i(p,e.lockRef.current))},[]);G.useEffect(function(){return Ut.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ht),document.addEventListener("touchmove",c,Ht),document.addEventListener("touchstart",u,Ht),function(){Ut=Ut.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,Ht),document.removeEventListener("touchmove",c,Ht),document.removeEventListener("touchstart",u,Ht)}},[]);var m=e.removeScrollBar,v=e.inert;return G.createElement(G.Fragment,null,v?G.createElement(s,{styles:ku(o)}):null,m?G.createElement(Su,{gapMode:e.gapMode}):null)}function Au(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pu=lu(Qa,ju);var oi=G.forwardRef(function(e,t){return G.createElement(ln,ft({},e,{ref:t,sideCar:Pu}))});oi.classNames=ln.classNames;function Ao(e){return Object.keys(e)}function Mu(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Qn(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function si(e,{shouldScale:t=!1}={}){function r(n){if(n===0||n==="0")return`0${e}`;if(typeof n=="number"){const o=`${n/16}${e}`;return t?Qn(o):o}if(typeof n=="string"){if(n===""||n.startsWith("calc(")||n.startsWith("clamp(")||n.includes("rgba("))return n;if(n.includes(","))return n.split(",").map(s=>r(s)).join(",");if(n.includes(" "))return n.split(" ").map(s=>r(s)).join(" ");if(n.includes(e))return t?Qn(n):n;const o=n.replace("px","");if(!Number.isNaN(Number(o))){const s=`${Number(o)/16}${e}`;return t?Qn(s):s}}return n}return r}const _e=si("rem",{shouldScale:!0});si("em");function Po(e){return Object.keys(e).reduce((t,r)=>(e[r]!==void 0&&(t[r]=e[r]),t),{})}function ai(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(n=>t.test(n))}return!1}function kr(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==x.Fragment:!1}function or(e){const t=x.createContext(null);return[({children:o,value:s})=>g.jsx(t.Provider,{value:s,children:o}),()=>{const o=x.useContext(t);if(o===null)throw new Error(e);return o}]}function un(e=null){const t=x.createContext(e);return[({children:o,value:s})=>g.jsx(t.Provider,{value:s,children:o}),()=>x.useContext(t)]}const Lu={app:100,modal:200,popover:300,overlay:400,max:9999};function Ft(e){return Lu[e]}const vo=()=>{};function Iu(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||vo:r=>{var n;r.key==="Escape"&&(e(r),(n=t.onTrigger)==null||n.call(t))}}function Ne(e,t="size",r=!0){if(e!==void 0)return ai(e)?r?_e(e):e:`var(--${t}-${e})`}function ii(e){return Ne(e,"mantine-spacing")}function Je(e){return e===void 0?"var(--mantine-radius-default)":Ne(e,"mantine-radius")}function Ie(e){return Ne(e,"mantine-font-size")}function Fu(e){return Ne(e,"mantine-line-height",!1)}function Mo(e){if(e)return Ne(e,"mantine-shadow",!1)}function Vu(){return typeof process<"u"&&process.env&&process.env.NODE_ENV?process.env.NODE_ENV:"development"}function ci(e){var r;const t=x.version;return typeof x.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(r=e==null?void 0:e.props)==null?void 0:r.ref}function li(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=li(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Fe(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=li(e))&&(n&&(n+=" "),n+=t);return n}const zu={};function Bu(e){const t={};return e.forEach(r=>{Object.entries(r).forEach(([n,o])=>{t[n]?t[n]=Fe(t[n],o):t[n]=o})}),t}function dn({theme:e,classNames:t,props:r,stylesCtx:n}){const s=(Array.isArray(t)?t:[t]).map(a=>typeof a=="function"?a(e,r,n):a||zu);return Bu(s)}function nn({theme:e,styles:t,props:r,stylesCtx:n}){return(Array.isArray(t)?t:[t]).reduce((s,a)=>typeof a=="function"?{...s,...a(e,r,n)}:{...s,...a},{})}const Wu=x.createContext(null);function Vt(){const e=x.useContext(Wu);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function Yu(){return Vt().classNamesPrefix}function Hu(){return Vt().getStyleNonce}function Uu(){return Vt().withStaticClasses}function Gu(){return Vt().headless}function qu(){var e;return(e=Vt().stylesTransform)==null?void 0:e.sx}function Xu(){var e;return(e=Vt().stylesTransform)==null?void 0:e.styles}function ui(){return Vt().env||"default"}function Ku(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function Zu(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}if(t.length===8){const a=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a}}const r=parseInt(t,16),n=r>>16&255,o=r>>8&255,s=r&255;return{r:n,g:o,b:s,a:1}}function Ju(e){const[t,r,n,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:r,b:n,a:o||1}}function Qu(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,r=e.match(t);if(!r)return{r:0,g:0,b:0,a:1};const n=parseInt(r[1],10),o=parseInt(r[2],10)/100,s=parseInt(r[3],10)/100,a=r[5]?parseFloat(r[5]):void 0,i=(1-Math.abs(2*s-1))*o,c=n/60,l=i*(1-Math.abs(c%2-1)),u=s-i/2;let d,f,m;return c>=0&&c<1?(d=i,f=l,m=0):c>=1&&c<2?(d=l,f=i,m=0):c>=2&&c<3?(d=0,f=i,m=l):c>=3&&c<4?(d=0,f=l,m=i):c>=4&&c<5?(d=l,f=0,m=i):(d=i,f=0,m=l),{r:Math.round((d+u)*255),g:Math.round((f+u)*255),b:Math.round((m+u)*255),a:a||1}}function di(e){return Ku(e)?Zu(e):e.startsWith("rgb")?Ju(e):e.startsWith("hsl")?Qu(e):{r:0,g:0,b:0,a:1}}function ed(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function eo(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function td(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function rd(e){if(e.startsWith("oklch("))return(td(e)||0)/100;const{r:t,g:r,b:n}=di(e),o=t/255,s=r/255,a=n/255,i=eo(o),c=eo(s),l=eo(a);return .2126*i+.7152*c+.0722*l}function xr(e,t=.179){return e.startsWith("var(")?!1:rd(e)>t}function sr({color:e,theme:t,colorScheme:r}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:r==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:xr(r==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:r==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:xr(r==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:xr(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[n,o]=e.split("."),s=o?Number(o):void 0,a=n in t.colors;if(a){const i=s!==void 0?t.colors[n][s]:t.colors[n][ed(t,r||"light")];return{color:n,value:i,shade:s,isThemeColor:a,isLight:xr(i,t.luminanceThreshold),variable:o?`--mantine-color-${n}-${s}`:`--mantine-color-${n}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:xr(e,t.luminanceThreshold),shade:s,variable:void 0}}function xt(e,t){const r=sr({color:e||t.primaryColor,theme:t});return r.variable?`var(${r.variable})`:e}function nd(e,t){const r={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)??t.defaultGradient.deg??0},n=xt(r.from,t),o=xt(r.to,t);return`linear-gradient(${r.deg}deg, ${n} 0%, ${o} 100%)`}function od(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r,g:n,b:o}=di(e);return`rgba(${r}, ${n}, ${o}, ${t})`}const sd=x.createContext(null);function ar(){const e=x.useContext(sd);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function fi({color:e,theme:t,autoContrast:r}){return(typeof r=="boolean"?r:t.autoContrast)&&sr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function St({classNames:e,styles:t,props:r,stylesCtx:n}){const o=ar();return{resolvedClassNames:dn({theme:o,classNames:e,props:r,stylesCtx:n||void 0}),resolvedStyles:nn({theme:o,styles:t,props:r,stylesCtx:n||void 0})}}const ad={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function id({theme:e,options:t,unstyled:r}){return Fe((t==null?void 0:t.focusable)&&!r&&(e.focusClassName||ad[e.focusRing]),(t==null?void 0:t.active)&&!r&&e.activeClassName)}function cd({selector:e,stylesCtx:t,options:r,props:n,theme:o}){return dn({theme:o,classNames:r==null?void 0:r.classNames,props:(r==null?void 0:r.props)||n,stylesCtx:t})[e]}function Qs({selector:e,stylesCtx:t,theme:r,classNames:n,props:o}){return dn({theme:r,classNames:n,props:o,stylesCtx:t})[e]}function ld({rootSelector:e,selector:t,className:r}){return e===t?r:void 0}function ud({selector:e,classes:t,unstyled:r}){return r?void 0:t[e]}function dd({themeName:e,classNamesPrefix:t,selector:r,withStaticClass:n}){return n===!1?[]:e.map(o=>`${t}-${o}-${r}`)}function fd({themeName:e,theme:t,selector:r,props:n,stylesCtx:o}){return e.map(s=>{var a,i;return(i=dn({theme:t,classNames:(a=t.components[s])==null?void 0:a.classNames,props:n,stylesCtx:o}))==null?void 0:i[r]})}function md({options:e,classes:t,selector:r,unstyled:n}){return e!=null&&e.variant&&!n?t[`${r}--${e.variant}`]:void 0}function pd({theme:e,options:t,themeName:r,selector:n,classNamesPrefix:o,classNames:s,classes:a,unstyled:i,className:c,rootSelector:l,props:u,stylesCtx:d,withStaticClasses:f,headless:m,transformedStyles:v}){return Fe(id({theme:e,options:t,unstyled:i||m}),fd({theme:e,themeName:r,selector:n,props:u,stylesCtx:d}),md({options:t,classes:a,selector:n,unstyled:i}),Qs({selector:n,stylesCtx:d,theme:e,classNames:s,props:u}),Qs({selector:n,stylesCtx:d,theme:e,classNames:v,props:u}),cd({selector:n,stylesCtx:d,options:t,props:u,theme:e}),ld({rootSelector:l,selector:n,className:c}),ud({selector:n,classes:a,unstyled:i||m}),f&&!m&&dd({themeName:r,classNamesPrefix:o,selector:n,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function hd({theme:e,themeName:t,props:r,stylesCtx:n,selector:o}){return t.map(s=>{var a;return nn({theme:e,styles:(a=e.components[s])==null?void 0:a.styles,props:r,stylesCtx:n})[o]}).reduce((s,a)=>({...s,...a}),{})}function go({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((r,n)=>({...r,...go({style:n,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function vd(e){return e.reduce((t,r)=>(r&&Object.keys(r).forEach(n=>{t[n]={...t[n],...Po(r[n])}}),t),{})}function gd({vars:e,varsResolver:t,theme:r,props:n,stylesCtx:o,selector:s,themeName:a,headless:i}){var c;return(c=vd([i?{}:t==null?void 0:t(r,n,o),...a.map(l=>{var u,d,f;return(f=(d=(u=r.components)==null?void 0:u[l])==null?void 0:d.vars)==null?void 0:f.call(d,r,n,o)}),e==null?void 0:e(r,n,o)]))==null?void 0:c[s]}function yd({theme:e,themeName:t,selector:r,options:n,props:o,stylesCtx:s,rootSelector:a,styles:i,style:c,vars:l,varsResolver:u,headless:d,withStylesTransform:f}){return{...!f&&hd({theme:e,themeName:t,props:o,stylesCtx:s,selector:r}),...!f&&nn({theme:e,styles:i,props:o,stylesCtx:s})[r],...!f&&nn({theme:e,styles:n==null?void 0:n.styles,props:(n==null?void 0:n.props)||o,stylesCtx:s})[r],...gd({theme:e,props:o,stylesCtx:s,vars:l,varsResolver:u,selector:r,themeName:t,headless:d}),...a===r?go({style:c,theme:e}):null,...go({style:n==null?void 0:n.style,theme:e})}}function bd({props:e,stylesCtx:t,themeName:r}){var a;const n=ar(),o=(a=Xu())==null?void 0:a();return{getTransformedStyles:i=>o?[...i.map(l=>o(l,{props:e,theme:n,ctx:t})),...r.map(l=>{var u;return o((u=n.components[l])==null?void 0:u.styles,{props:e,theme:n,ctx:t})})].filter(Boolean):[],withStylesTransform:!!o}}function ye({name:e,classes:t,props:r,stylesCtx:n,className:o,style:s,rootSelector:a="root",unstyled:i,classNames:c,styles:l,vars:u,varsResolver:d}){const f=ar(),m=Yu(),v=Uu(),p=Gu(),h=(Array.isArray(e)?e:[e]).filter(b=>b),{withStylesTransform:y,getTransformedStyles:w}=bd({props:r,stylesCtx:n,themeName:h});return(b,C)=>({className:pd({theme:f,options:C,themeName:h,selector:b,classNamesPrefix:m,classNames:c,classes:t,unstyled:i,className:o,rootSelector:a,props:r,stylesCtx:n,withStaticClasses:v,headless:p,transformedStyles:w([C==null?void 0:C.styles,l])}),style:yd({theme:f,themeName:h,selector:b,options:C,props:r,stylesCtx:n,rootSelector:a,styles:l,style:s,vars:u,varsResolver:d,headless:p,withStylesTransform:y})})}function mi(e,t){return typeof e=="boolean"?e:t.autoContrast}function K(e,t,r){var a;const n=ar(),o=(a=n.components[e])==null?void 0:a.defaultProps,s=typeof o=="function"?o(n):o;return{...t,...s,...Po(r)}}function to(e){return Ao(e).reduce((t,r)=>e[r]!==void 0?`${t}${Mu(r)}:${e[r]};`:t,"").trim()}function xd({selector:e,styles:t,media:r,container:n}){const o=t?to(t):"",s=Array.isArray(r)?r.map(i=>`@media${i.query}{${e}{${to(i.styles)}}}`):[],a=Array.isArray(n)?n.map(i=>`@container ${i.query}{${e}{${to(i.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${s.join("")}${a.join("")}`.trim()}function wd(e){const t=Hu();return g.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:xd(e)}})}function fn(e){const{m:t,mx:r,my:n,mt:o,mb:s,ml:a,mr:i,me:c,ms:l,p:u,px:d,py:f,pt:m,pb:v,pl:p,pr:h,pe:y,ps:w,bd:b,bg:C,c:D,opacity:S,ff:O,fz:k,fw:j,lts:P,ta:L,lh:V,fs:z,tt:M,td:$,w:_,miw:E,maw:T,h:N,mih:I,mah:A,bgsz:B,bgp:Y,bgr:te,bga:F,pos:Q,top:re,left:ae,bottom:Z,right:le,inset:ie,display:pe,flex:X,hiddenFrom:me,visibleFrom:fe,lightHidden:ge,darkHidden:U,sx:J,...ee}=e;return{styleProps:Po({m:t,mx:r,my:n,mt:o,mb:s,ml:a,mr:i,me:c,ms:l,p:u,px:d,py:f,pt:m,pb:v,pl:p,pr:h,pe:y,ps:w,bd:b,bg:C,c:D,opacity:S,ff:O,fz:k,fw:j,lts:P,ta:L,lh:V,fs:z,tt:M,td:$,w:_,miw:E,maw:T,h:N,mih:I,mah:A,bgsz:B,bgp:Y,bgr:te,bga:F,pos:Q,top:re,left:ae,bottom:Z,right:le,inset:ie,display:pe,flex:X,hiddenFrom:me,visibleFrom:fe,lightHidden:ge,darkHidden:U,sx:J}),rest:ee}}const Sd={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function Lo(e,t){const r=sr({color:e,theme:t});return r.color==="dimmed"?"var(--mantine-color-dimmed)":r.color==="bright"?"var(--mantine-color-bright)":r.variable?`var(${r.variable})`:r.color}function Cd(e,t){const r=sr({color:e,theme:t});return r.isThemeColor&&r.shade===void 0?`var(--mantine-color-${r.color}-text)`:Lo(e,t)}function Dd(e,t){if(typeof e=="number")return _e(e);if(typeof e=="string"){const[r,n,...o]=e.split(" ").filter(a=>a.trim()!=="");let s=`${_e(r)}`;return n&&(s+=` ${n}`),o.length>0&&(s+=` ${Lo(o.join(" "),t)}`),s.trim()}return e}const ea={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function _d(e){return typeof e=="string"&&e in ea?ea[e]:e}const Rd=["h1","h2","h3","h4","h5","h6"];function Ed(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&Rd.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?_e(e):e}function Nd(e){return e}const Td=["h1","h2","h3","h4","h5","h6"];function Od(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&Td.includes(e)?`var(--mantine-${e}-line-height)`:e}function kd(e){return typeof e=="number"?_e(e):e}function $d(e,t){if(typeof e=="number")return _e(e);if(typeof e=="string"){const r=e.replace("-","");if(!(r in t.spacing))return _e(e);const n=`--mantine-spacing-${r}`;return e.startsWith("-")?`calc(var(${n}) * -1)`:`var(${n})`}return e}const ro={color:Lo,textColor:Cd,fontSize:Ed,spacing:$d,identity:Nd,size:kd,lineHeight:Od,fontFamily:_d,border:Dd};function ta(e){return e.replace("(min-width: ","").replace("em)","")}function jd({media:e,...t}){const n=Object.keys(e).sort((o,s)=>Number(ta(o))-Number(ta(s))).map(o=>({query:o,styles:e[o]}));return{...t,media:n}}function Ad(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function Pd(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function Md(e){return typeof e=="object"&&e!==null?Ao(e).filter(t=>t!=="base"):[]}function Ld(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function Id({styleProps:e,data:t,theme:r}){return jd(Ao(e).reduce((n,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return n;const s=t[o],a=Array.isArray(s.property)?s.property:[s.property],i=Pd(e[o]);if(!Ad(e[o]))return a.forEach(l=>{n.inlineStyles[l]=ro[s.type](i,r)}),n;n.hasResponsiveStyles=!0;const c=Md(e[o]);return a.forEach(l=>{i&&(n.styles[l]=ro[s.type](i,r)),c.forEach(u=>{const d=`(min-width: ${r.breakpoints[u]})`;n.media[d]={...n.media[d],[l]:ro[s.type](Ld(e[o],u),r)}})}),n},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Fd(){return`__m__-${x.useId().replace(/:/g,"")}`}function pi(e){return e.startsWith("data-")?e:`data-${e}`}function Vd(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return n===void 0||n===""||n===!1||n===null||(t[pi(r)]=e[r]),t},{})}function hi(e){return e?typeof e=="string"?{[pi(e)]:!0}:Array.isArray(e)?[...e].reduce((t,r)=>({...t,...hi(r)}),{}):Vd(e):null}function yo(e,t){return Array.isArray(e)?[...e].reduce((r,n)=>({...r,...yo(n,t)}),{}):typeof e=="function"?e(t):e??{}}function zd({theme:e,style:t,vars:r,styleProps:n}){const o=yo(t,e),s=yo(r,e);return{...o,...s,...n}}const vi=x.forwardRef(({component:e,style:t,__vars:r,className:n,variant:o,mod:s,size:a,hiddenFrom:i,visibleFrom:c,lightHidden:l,darkHidden:u,renderRoot:d,__size:f,...m},v)=>{var k;const p=ar(),h=e||"div",{styleProps:y,rest:w}=fn(m),b=qu(),C=(k=b==null?void 0:b())==null?void 0:k(y.sx),D=Fd(),S=Id({styleProps:y,theme:p,data:Sd}),O={ref:v,style:zd({theme:p,style:t,vars:r,styleProps:S.inlineStyles}),className:Fe(n,C,{[D]:S.hasResponsiveStyles,"mantine-light-hidden":l,"mantine-dark-hidden":u,[`mantine-hidden-from-${i}`]:i,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":ai(a)?void 0:a||void 0,size:f,...hi(s),...w};return g.jsxs(g.Fragment,{children:[S.hasResponsiveStyles&&g.jsx(wd,{selector:`.${D}`,styles:S.styles,media:S.media}),typeof d=="function"?d(O):g.jsx(h,{...O})]})});vi.displayName="@mantine/core/Box";const ue=vi;function gi(e){return e}function se(e){const t=x.forwardRef(e);return t.extend=gi,t.withProps=r=>{const n=x.forwardRef((o,s)=>g.jsx(t,{...r,...o,ref:s}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function Ct(e){const t=x.forwardRef(e);return t.withProps=r=>{const n=x.forwardRef((o,s)=>g.jsx(t,{...r,...o,ref:s}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=gi,t}const Bd=x.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Io(){return x.useContext(Bd)}function mn(){return typeof window<"u"}function ir(e){return yi(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(yi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yi(e){return mn()?e instanceof Node||e instanceof et(e).Node:!1}function Ye(e){return mn()?e instanceof Element||e instanceof et(e).Element:!1}function vt(e){return mn()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function ra(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}function $r(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function Wd(e){return["table","td","th"].includes(ir(e))}function pn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Fo(e){const t=Vo(),r=Ye(e)?ct(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function Yd(e){let t=Ot(e);for(;vt(t)&&!Zt(t);){if(Fo(t))return t;if(pn(t))return null;t=Ot(t)}return null}function Vo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zt(e){return["html","body","#document"].includes(ir(e))}function ct(e){return et(e).getComputedStyle(e)}function hn(e){return Ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ot(e){if(ir(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ra(e)&&e.host||gt(e);return ra(t)?t.host:t}function bi(e){const t=Ot(e);return Zt(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&$r(t)?t:bi(t)}function Dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=bi(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),a=et(o);if(s){const i=bo(a);return t.concat(a,a.visualViewport||[],$r(o)?o:[],i&&r?Dr(i):[])}return t.concat(o,Dr(o,[],r))}function bo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const lt=Math.min,We=Math.max,on=Math.round,Ur=Math.floor,mt=e=>({x:e,y:e}),Hd={left:"right",right:"left",bottom:"top",top:"bottom"},Ud={start:"end",end:"start"};function xo(e,t,r){return We(e,lt(t,r))}function wt(e,t){return typeof e=="function"?e(t):e}function ut(e){return e.split("-")[0]}function cr(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function Bo(e){return e==="y"?"height":"width"}function pt(e){return["top","bottom"].includes(ut(e))?"y":"x"}function Wo(e){return zo(pt(e))}function Gd(e,t,r){r===void 0&&(r=!1);const n=cr(e),o=Wo(e),s=Bo(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=sn(a)),[a,sn(a)]}function qd(e){const t=sn(e);return[wo(e),t,wo(t)]}function wo(e){return e.replace(/start|end/g,t=>Ud[t])}function Xd(e,t,r){const n=["left","right"],o=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?s:a;default:return[]}}function Kd(e,t,r,n){const o=cr(e);let s=Xd(ut(e),r==="start",n);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(wo)))),s}function sn(e){return e.replace(/left|right|bottom|top/g,t=>Hd[t])}function Zd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yo(e){return typeof e!="number"?Zd(e):{top:e,right:e,bottom:e,left:e}}function Jt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function na(e,t,r){let{reference:n,floating:o}=e;const s=pt(t),a=Wo(t),i=Bo(a),c=ut(t),l=s==="y",u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[i]/2-o[i]/2;let m;switch(c){case"top":m={x:u,y:n.y-o.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-o.width,y:d};break;default:m={x:n.x,y:n.y}}switch(cr(t)){case"start":m[a]-=f*(r&&l?-1:1);break;case"end":m[a]+=f*(r&&l?-1:1);break}return m}const Jd=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:a}=r,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=na(l,n,c),f=n,m={},v=0;for(let p=0;p<i.length;p++){const{name:h,fn:y}=i[p],{x:w,y:b,data:C,reset:D}=await y({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=w??u,d=b??d,m={...m,[h]:{...m[h],...C}},D&&v<=50&&(v++,typeof D=="object"&&(D.placement&&(f=D.placement),D.rects&&(l=D.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:u,y:d}=na(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}};async function Ho(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=wt(t,e),v=Yo(m),h=i[f?d==="floating"?"reference":"floating":d],y=Jt(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(h)))==null||r?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},D=Jt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:b,strategy:c}):w);return{top:(y.top-D.top+v.top)/C.y,bottom:(D.bottom-y.bottom+v.bottom)/C.y,left:(y.left-D.left+v.left)/C.x,right:(D.right-y.right+v.right)/C.x}}const Qd=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:l,padding:u=0}=wt(e,t)||{};if(l==null)return{};const d=Yo(u),f={x:r,y:n},m=Wo(o),v=Bo(m),p=await a.getDimensions(l),h=m==="y",y=h?"top":"left",w=h?"bottom":"right",b=h?"clientHeight":"clientWidth",C=s.reference[v]+s.reference[m]-f[m]-s.floating[v],D=f[m]-s.reference[m],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let O=S?S[b]:0;(!O||!await(a.isElement==null?void 0:a.isElement(S)))&&(O=i.floating[b]||s.floating[v]);const k=C/2-D/2,j=O/2-p[v]/2-1,P=lt(d[y],j),L=lt(d[w],j),V=P,z=O-p[v]-L,M=O/2-p[v]/2+k,$=xo(V,M,z),_=!c.arrow&&cr(o)!=null&&M!==$&&s.reference[v]/2-(M<V?P:L)-p[v]/2<0,E=_?M<V?M-V:M-z:0;return{[m]:f[m]+E,data:{[m]:$,centerOffset:M-$-E,..._&&{alignmentOffset:E}},reset:_}}}),ef=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...h}=wt(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const y=ut(o),w=pt(i),b=ut(i)===i,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),D=f||(b||!p?[sn(i)]:qd(i)),S=v!=="none";!f&&S&&D.push(...Kd(i,p,v,C));const O=[i,...D],k=await Ho(t,h),j=[];let P=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&j.push(k[y]),d){const $=Gd(o,a,C);j.push(k[$[0]],k[$[1]])}if(P=[...P,{placement:o,overflows:j}],!j.every($=>$<=0)){var L,V;const $=(((L=s.flip)==null?void 0:L.index)||0)+1,_=O[$];if(_){var z;const T=d==="alignment"?w!==pt(_):!1,N=((z=P[0])==null?void 0:z.overflows[0])>0;if(!T||N)return{data:{index:$,overflows:P},reset:{placement:_}}}let E=(V=P.filter(T=>T.overflows[0]<=0).sort((T,N)=>T.overflows[1]-N.overflows[1])[0])==null?void 0:V.placement;if(!E)switch(m){case"bestFit":{var M;const T=(M=P.filter(N=>{if(S){const I=pt(N.placement);return I===w||I==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(I=>I>0).reduce((I,A)=>I+A,0)]).sort((N,I)=>N[1]-I[1])[0])==null?void 0:M[0];T&&(E=T);break}case"initialPlacement":E=i;break}if(o!==E)return{reset:{placement:E}}}return{}}}};function xi(e){const t=lt(...e.map(s=>s.left)),r=lt(...e.map(s=>s.top)),n=We(...e.map(s=>s.right)),o=We(...e.map(s=>s.bottom));return{x:t,y:r,width:n-t,height:o-r}}function tf(e){const t=e.slice().sort((o,s)=>o.y-s.y),r=[];let n=null;for(let o=0;o<t.length;o++){const s=t[o];!n||s.y-n.y>n.height/2?r.push([s]):r[r.length-1].push(s),n=s}return r.map(o=>Jt(xi(o)))}const rf=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:s,strategy:a}=t,{padding:i=2,x:c,y:l}=wt(e,t),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),d=tf(u),f=Jt(xi(u)),m=Yo(i);function v(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(h=>c>h.left-m.left&&c<h.right+m.right&&l>h.top-m.top&&l<h.bottom+m.bottom)||f;if(d.length>=2){if(pt(r)==="y"){const P=d[0],L=d[d.length-1],V=ut(r)==="top",z=P.top,M=L.bottom,$=V?P.left:L.left,_=V?P.right:L.right,E=_-$,T=M-z;return{top:z,bottom:M,left:$,right:_,width:E,height:T,x:$,y:z}}const h=ut(r)==="left",y=We(...d.map(P=>P.right)),w=lt(...d.map(P=>P.left)),b=d.filter(P=>h?P.left===w:P.right===y),C=b[0].top,D=b[b.length-1].bottom,S=w,O=y,k=O-S,j=D-C;return{top:C,bottom:D,left:S,right:O,width:k,height:j,x:S,y:C}}return f}const p=await s.getElementRects({reference:{getBoundingClientRect:v},floating:n.floating,strategy:a});return o.reference.x!==p.reference.x||o.reference.y!==p.reference.y||o.reference.width!==p.reference.width||o.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}};async function nf(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=ut(r),i=cr(r),c=pt(r)==="y",l=["left","top"].includes(a)?-1:1,u=s&&c?-1:1,d=wt(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof v=="number"&&(m=i==="end"?v*-1:v),c?{x:m*u,y:f*l}:{x:f*l,y:m*u}}const of=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:a,middlewareData:i}=t,c=await nf(t,e);return a===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:a}}}}},sf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:h=>{let{x:y,y:w}=h;return{x:y,y:w}}},...c}=wt(e,t),l={x:r,y:n},u=await Ho(t,c),d=pt(ut(o)),f=zo(d);let m=l[f],v=l[d];if(s){const h=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=m+u[h],b=m-u[y];m=xo(w,m,b)}if(a){const h=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=v+u[h],b=v-u[y];v=xo(w,v,b)}const p=i.fn({...t,[f]:m,[d]:v});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[f]:s,[d]:a}}}}}},af=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:l=!0}=wt(e,t),u={x:r,y:n},d=pt(o),f=zo(d);let m=u[f],v=u[d];const p=wt(i,t),h=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const b=f==="y"?"height":"width",C=s.reference[f]-s.floating[b]+h.mainAxis,D=s.reference[f]+s.reference[b]-h.mainAxis;m<C?m=C:m>D&&(m=D)}if(l){var y,w;const b=f==="y"?"width":"height",C=["top","left"].includes(ut(o)),D=s.reference[d]-s.floating[b]+(C&&((y=a.offset)==null?void 0:y[d])||0)+(C?0:h.crossAxis),S=s.reference[d]+s.reference[b]+(C?0:((w=a.offset)==null?void 0:w[d])||0)-(C?h.crossAxis:0);v<D?v=D:v>S&&(v=S)}return{[f]:m,[d]:v}}}},cf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:c=()=>{},...l}=wt(e,t),u=await Ho(t,l),d=ut(o),f=cr(o),m=pt(o)==="y",{width:v,height:p}=s.floating;let h,y;d==="top"||d==="bottom"?(h=d,y=f===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(y=d,h=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,b=v-u.left-u.right,C=lt(p-u[h],w),D=lt(v-u[y],b),S=!t.middlewareData.shift;let O=C,k=D;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(O=w),S&&!f){const P=We(u.left,0),L=We(u.right,0),V=We(u.top,0),z=We(u.bottom,0);m?k=v-2*(P!==0||L!==0?P+L:We(u.left,u.right)):O=p-2*(V!==0||z!==0?V+z:We(u.top,u.bottom))}await c({...t,availableWidth:k,availableHeight:O});const j=await a.getDimensions(i.floating);return v!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function wi(e){const t=ct(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=vt(e),s=o?e.offsetWidth:r,a=o?e.offsetHeight:n,i=on(r)!==s||on(n)!==a;return i&&(r=s,n=a),{width:r,height:n,$:i}}function Uo(e){return Ye(e)?e:e.contextElement}function Xt(e){const t=Uo(e);if(!vt(t))return mt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=wi(t);let a=(s?on(r.width):r.width)/n,i=(s?on(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const lf=mt(0);function Si(e){const t=et(e);return!Vo()||!t.visualViewport?lf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uf(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==et(e)?!1:t}function It(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Uo(e);let a=mt(1);t&&(n?Ye(n)&&(a=Xt(n)):a=Xt(e));const i=uf(s,r,n)?Si(s):mt(0);let c=(o.left+i.x)/a.x,l=(o.top+i.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(s){const f=et(s),m=n&&Ye(n)?et(n):n;let v=f,p=bo(v);for(;p&&n&&m!==v;){const h=Xt(p),y=p.getBoundingClientRect(),w=ct(p),b=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*h.x,C=y.top+(p.clientTop+parseFloat(w.paddingTop))*h.y;c*=h.x,l*=h.y,u*=h.x,d*=h.y,c+=b,l+=C,v=et(p),p=bo(v)}}return Jt({width:u,height:d,x:c,y:l})}function Go(e,t){const r=hn(e).scrollLeft;return t?t.left+r:It(gt(e)).left+r}function Ci(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Go(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function df(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",a=gt(n),i=t?pn(t.floating):!1;if(n===a||i&&s)return r;let c={scrollLeft:0,scrollTop:0},l=mt(1);const u=mt(0),d=vt(n);if((d||!d&&!s)&&((ir(n)!=="body"||$r(a))&&(c=hn(n)),vt(n))){const m=It(n);l=Xt(n),u.x=m.x+n.clientLeft,u.y=m.y+n.clientTop}const f=a&&!d&&!s?Ci(a,c,!0):mt(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:r.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ff(e){return Array.from(e.getClientRects())}function mf(e){const t=gt(e),r=hn(e),n=e.ownerDocument.body,o=We(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=We(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Go(e);const i=-r.scrollTop;return ct(n).direction==="rtl"&&(a+=We(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:a,y:i}}function pf(e,t){const r=et(e),n=gt(e),o=r.visualViewport;let s=n.clientWidth,a=n.clientHeight,i=0,c=0;if(o){s=o.width,a=o.height;const l=Vo();(!l||l&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}return{width:s,height:a,x:i,y:c}}function hf(e,t){const r=It(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=vt(e)?Xt(e):mt(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=o*s.x,l=n*s.y;return{width:a,height:i,x:c,y:l}}function oa(e,t,r){let n;if(t==="viewport")n=pf(e,r);else if(t==="document")n=mf(gt(e));else if(Ye(t))n=hf(t,r);else{const o=Si(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jt(n)}function Di(e,t){const r=Ot(e);return r===t||!Ye(r)||Zt(r)?!1:ct(r).position==="fixed"||Di(r,t)}function vf(e,t){const r=t.get(e);if(r)return r;let n=Dr(e,[],!1).filter(i=>Ye(i)&&ir(i)!=="body"),o=null;const s=ct(e).position==="fixed";let a=s?Ot(e):e;for(;Ye(a)&&!Zt(a);){const i=ct(a),c=Fo(a);!c&&i.position==="fixed"&&(o=null),(s?!c&&!o:!c&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||$r(a)&&!c&&Di(e,a))?n=n.filter(u=>u!==a):o=i,a=Ot(a)}return t.set(e,n),n}function gf(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?pn(t)?[]:vf(t,this._c):[].concat(r),n],i=a[0],c=a.reduce((l,u)=>{const d=oa(t,u,o);return l.top=We(d.top,l.top),l.right=lt(d.right,l.right),l.bottom=lt(d.bottom,l.bottom),l.left=We(d.left,l.left),l},oa(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yf(e){const{width:t,height:r}=wi(e);return{width:t,height:r}}function bf(e,t,r){const n=vt(t),o=gt(t),s=r==="fixed",a=It(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=mt(0);function l(){c.x=Go(o)}if(n||!n&&!s)if((ir(t)!=="body"||$r(o))&&(i=hn(t)),n){const m=It(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&l();s&&!n&&o&&l();const u=o&&!n&&!s?Ci(o,i):mt(0),d=a.left+i.scrollLeft-c.x-u.x,f=a.top+i.scrollTop-c.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function no(e){return ct(e).position==="static"}function sa(e,t){if(!vt(e)||ct(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return gt(e)===r&&(r=r.ownerDocument.body),r}function _i(e,t){const r=et(e);if(pn(e))return r;if(!vt(e)){let o=Ot(e);for(;o&&!Zt(o);){if(Ye(o)&&!no(o))return o;o=Ot(o)}return r}let n=sa(e,t);for(;n&&Wd(n)&&no(n);)n=sa(n,t);return n&&Zt(n)&&no(n)&&!Fo(n)?r:n||Yd(e)||r}const xf=async function(e){const t=this.getOffsetParent||_i,r=this.getDimensions,n=await r(e.floating);return{reference:bf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function wf(e){return ct(e).direction==="rtl"}const Sf={convertOffsetParentRelativeRectToViewportRelativeRect:df,getDocumentElement:gt,getClippingRect:gf,getOffsetParent:_i,getElementRects:xf,getClientRects:ff,getDimensions:yf,getScale:Xt,isElement:Ye,isRTL:wf};function Ri(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cf(e,t){let r=null,n;const o=gt(e);function s(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=l;if(i||t(),!f||!m)return;const v=Ur(d),p=Ur(o.clientWidth-(u+f)),h=Ur(o.clientHeight-(d+m)),y=Ur(u),b={rootMargin:-v+"px "+-p+"px "+-h+"px "+-y+"px",threshold:We(0,lt(1,c))||1};let C=!0;function D(S){const O=S[0].intersectionRatio;if(O!==c){if(!C)return a();O?a(!1,O):n=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!Ri(l,e.getBoundingClientRect())&&a(),C=!1}try{r=new IntersectionObserver(D,{...b,root:o.ownerDocument})}catch{r=new IntersectionObserver(D,b)}r.observe(e)}return a(!0),s}function Df(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=Uo(e),u=o||s?[...l?Dr(l):[],...Dr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const d=l&&i?Cf(l,r):null;let f=-1,m=null;a&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),r()}),l&&!c&&m.observe(l),m.observe(t));let v,p=c?It(e):null;c&&h();function h(){const y=It(e);p&&!Ri(p,y)&&r(),p=y,v=requestAnimationFrame(h)}return r(),()=>{var y;u.forEach(w=>{o&&w.removeEventListener("scroll",r),s&&w.removeEventListener("resize",r)}),d==null||d(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const _f=of,Rf=sf,Ef=ef,Nf=cf,aa=Qd,Tf=rf,Of=af,kf=(e,t,r)=>{const n=new Map,o={platform:Sf,...r},s={...o.platform,_c:n};return Jd(e,t,{...o,platform:s})};var Kr=typeof document<"u"?x.useLayoutEffect:x.useEffect;function an(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!an(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!an(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ei(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ia(e,t){const r=Ei(e);return Math.round(t*r)/r}function oo(e){const t=G.useRef(e);return Kr(()=>{t.current=e}),t}function $f(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:c,open:l}=e,[u,d]=G.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=G.useState(n);an(f,n)||m(n);const[v,p]=G.useState(null),[h,y]=G.useState(null),w=G.useCallback(T=>{T!==S.current&&(S.current=T,p(T))},[]),b=G.useCallback(T=>{T!==O.current&&(O.current=T,y(T))},[]),C=s||v,D=a||h,S=G.useRef(null),O=G.useRef(null),k=G.useRef(u),j=c!=null,P=oo(c),L=oo(o),V=oo(l),z=G.useCallback(()=>{if(!S.current||!O.current)return;const T={placement:t,strategy:r,middleware:f};L.current&&(T.platform=L.current),kf(S.current,O.current,T).then(N=>{const I={...N,isPositioned:V.current!==!1};M.current&&!an(k.current,I)&&(k.current=I,pl.flushSync(()=>{d(I)}))})},[f,t,r,L,V]);Kr(()=>{l===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[l]);const M=G.useRef(!1);Kr(()=>(M.current=!0,()=>{M.current=!1}),[]),Kr(()=>{if(C&&(S.current=C),D&&(O.current=D),C&&D){if(P.current)return P.current(C,D,z);z()}},[C,D,z,P,j]);const $=G.useMemo(()=>({reference:S,floating:O,setReference:w,setFloating:b}),[w,b]),_=G.useMemo(()=>({reference:C,floating:D}),[C,D]),E=G.useMemo(()=>{const T={position:r,left:0,top:0};if(!_.floating)return T;const N=ia(_.floating,u.x),I=ia(_.floating,u.y);return i?{...T,transform:"translate("+N+"px, "+I+"px)",...Ei(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:I}},[r,i,_.floating,u.x,u.y]);return G.useMemo(()=>({...u,update:z,refs:$,elements:_,floatingStyles:E}),[u,z,$,_,E])}const jf=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?aa({element:n.current,padding:o}).fn(r):{}:n?aa({element:n,padding:o}).fn(r):{}}}},Af=(e,t)=>({..._f(e),options:[e,t]}),Pf=(e,t)=>({...Rf(e),options:[e,t]}),ca=(e,t)=>({...Of(e),options:[e,t]}),la=(e,t)=>({...Ef(e),options:[e,t]}),Mf=(e,t)=>({...Nf(e),options:[e,t]}),ua=(e,t)=>({...Tf(e),options:[e,t]}),Lf=(e,t)=>({...jf(e),options:[e,t]});function If(e){return G.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})},e)}const Ni={...G},Ff=Ni.useInsertionEffect,Vf=Ff||(e=>e());function zf(e){const t=G.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Vf(()=>{t.current=e}),G.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}var So=typeof document<"u"?x.useLayoutEffect:x.useEffect;let da=!1,Bf=0;const fa=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bf++;function Wf(){const[e,t]=G.useState(()=>da?fa():void 0);return So(()=>{e==null&&t(fa())},[]),G.useEffect(()=>{da=!0},[]),e}const Yf=Ni.useId,Hf=Yf||Wf;let Co;process.env.NODE_ENV!=="production"&&(Co=new Set);function Uf(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=Co)!=null&&e.has(o))){var s;(s=Co)==null||s.add(o),console.error(o)}}function Gf(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,((n=e.get(t))==null?void 0:n.filter(o=>o!==r))||[])}}}const qf=G.createContext(null),Xf=G.createContext(null),Kf=()=>{var e;return((e=G.useContext(qf))==null?void 0:e.id)||null},Zf=()=>G.useContext(Xf);function Jf(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=Hf(),s=G.useRef({}),[a]=G.useState(()=>Gf()),i=Kf()!=null;if(process.env.NODE_ENV!=="production"){const m=n.reference;m&&!Ye(m)&&Uf("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,l]=G.useState(n.reference),u=zf((m,v,p)=>{s.current.openEvent=m?v:void 0,a.emit("openchange",{open:m,event:v,reason:p,nested:i}),r==null||r(m,v,p)}),d=G.useMemo(()=>({setPositionReference:l}),[]),f=G.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return G.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:f,events:a,floatingId:o,refs:d}),[t,u,f,a,o,d])}function Qf(e){e===void 0&&(e={});const{nodeId:t}=e,r=Jf({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[s,a]=G.useState(null),[i,c]=G.useState(null),u=(o==null?void 0:o.domReference)||s,d=G.useRef(null),f=Zf();So(()=>{u&&(d.current=u)},[u]);const m=$f({...e,elements:{...o,...i&&{reference:i}}}),v=G.useCallback(b=>{const C=Ye(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),contextElement:b}:b;c(C),m.refs.setReference(C)},[m.refs]),p=G.useCallback(b=>{(Ye(b)||b===null)&&(d.current=b,a(b)),(Ye(m.refs.reference.current)||m.refs.reference.current===null||b!==null&&!Ye(b))&&m.refs.setReference(b)},[m.refs]),h=G.useMemo(()=>({...m.refs,setReference:p,setPositionReference:v,domReference:d}),[m.refs,p,v]),y=G.useMemo(()=>({...m.elements,domReference:u}),[m.elements,u]),w=G.useMemo(()=>({...m,...n,refs:h,elements:y,nodeId:t}),[m,h,y,t,n]);return So(()=>{n.dataRef.current.floatingContext=w;const b=f==null?void 0:f.nodesRef.current.find(C=>C.id===t);b&&(b.context=w)}),G.useMemo(()=>({...m,context:w,refs:h,elements:y}),[m,h,y,w])}const[em,nt]=or("ScrollArea.Root component was not found in tree");function Qt(e,t){const r=Pt(t);jo(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}const tm=x.forwardRef((e,t)=>{const{style:r,...n}=e,o=nt(),[s,a]=x.useState(0),[i,c]=x.useState(0),l=!!(s&&i);return Qt(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),c(u)}),Qt(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),a(u)}),l?g.jsx("div",{...n,ref:t,style:{...r,width:s,height:i}}):null}),rm=x.forwardRef((e,t)=>{const r=nt(),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?g.jsx(tm,{...e,ref:t}):null}),nm={scrollHideDelay:1e3,type:"hover"},Ti=x.forwardRef((e,t)=>{const r=K("ScrollAreaRoot",nm,e),{type:n,scrollHideDelay:o,scrollbars:s,...a}=r,[i,c]=x.useState(null),[l,u]=x.useState(null),[d,f]=x.useState(null),[m,v]=x.useState(null),[p,h]=x.useState(null),[y,w]=x.useState(0),[b,C]=x.useState(0),[D,S]=x.useState(!1),[O,k]=x.useState(!1),j=Ze(t,P=>c(P));return g.jsx(em,{value:{type:n,scrollHideDelay:o,scrollArea:i,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:D,onScrollbarXEnabledChange:S,scrollbarY:p,onScrollbarYChange:h,scrollbarYEnabled:O,onScrollbarYEnabledChange:k,onCornerWidthChange:w,onCornerHeightChange:C},children:g.jsx(ue,{...a,ref:j,__vars:{"--sa-corner-width":s!=="xy"?"0px":`${y}px`,"--sa-corner-height":s!=="xy"?"0px":`${b}px`}})})});Ti.displayName="@mantine/core/ScrollAreaRoot";function Oi(e,t){const r=e/t;return Number.isNaN(r)?0:r}function vn(e){const t=Oi(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function ki(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function om(e,[t,r]){return Math.min(r,Math.max(t,e))}function ma(e,t,r="ltr"){const n=vn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,a=t.content-t.viewport,i=s-n,c=r==="ltr"?[0,a]:[a*-1,0],l=om(e,c);return ki([0,a],[0,i])(l)}function sm(e,t,r,n="ltr"){const o=vn(r),s=o/2,a=t||s,i=o-a,c=r.scrollbar.paddingStart+a,l=r.scrollbar.size-r.scrollbar.paddingEnd-i,u=r.content-r.viewport,d=n==="ltr"?[0,u]:[u*-1,0];return ki([c,l],d)(e)}function $i(e,t){return e>0&&e<t}function cn(e){return e?parseInt(e,10):0}function Lt(e,t,{checkForDefaultPrevented:r=!0}={}){return n=>{e==null||e(n),(r===!1||!n.defaultPrevented)&&(t==null||t(n))}}const[am,ji]=or("ScrollAreaScrollbar was not found in tree"),Ai=x.forwardRef((e,t)=>{const{sizes:r,hasThumb:n,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:i,onDragScroll:c,onWheelScroll:l,onResize:u,...d}=e,f=nt(),[m,v]=x.useState(null),p=Ze(t,k=>v(k)),h=x.useRef(null),y=x.useRef(""),{viewport:w}=f,b=r.content-r.viewport,C=Pt(l),D=Pt(i),S=Or(u,10),O=k=>{if(h.current){const j=k.clientX-h.current.left,P=k.clientY-h.current.top;c({x:j,y:P})}};return x.useEffect(()=>{const k=j=>{const P=j.target;(m==null?void 0:m.contains(P))&&C(j,b)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[w,m,b,C]),x.useEffect(D,[r,D]),Qt(m,S),Qt(f.content,S),g.jsx(am,{value:{scrollbar:m,hasThumb:n,onThumbChange:Pt(o),onThumbPointerUp:Pt(s),onThumbPositionChange:D,onThumbPointerDown:Pt(a)},children:g.jsx("div",{...d,ref:p,"data-mantine-scrollbar":!0,style:{position:"absolute",...d.style},onPointerDown:Lt(e.onPointerDown,k=>{k.preventDefault(),k.button===0&&(k.target.setPointerCapture(k.pointerId),h.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",O(k))}),onPointerMove:Lt(e.onPointerMove,O),onPointerUp:Lt(e.onPointerUp,k=>{const j=k.target;j.hasPointerCapture(k.pointerId)&&(k.preventDefault(),j.releasePointerCapture(k.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=y.current,h.current=null}})})}),Pi=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,style:o,...s}=e,a=nt(),[i,c]=x.useState(),l=x.useRef(null),u=Ze(t,l,a.onScrollbarXChange);return x.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),g.jsx(Ai,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{...o,"--sa-thumb-width":`${vn(r)}px`},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(a.viewport){const m=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),$i(m,f)&&d.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:cn(i.paddingLeft),paddingEnd:cn(i.paddingRight)}})}})});Pi.displayName="@mantine/core/ScrollAreaScrollbarX";const Mi=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,style:o,...s}=e,a=nt(),[i,c]=x.useState(),l=x.useRef(null),u=Ze(t,l,a.onScrollbarYChange);return x.useEffect(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),g.jsx(Ai,{...s,"data-orientation":"vertical",ref:u,sizes:r,style:{"--sa-thumb-height":`${vn(r)}px`,...o},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(a.viewport){const m=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),$i(m,f)&&d.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:cn(i.paddingTop),paddingEnd:cn(i.paddingBottom)}})}})});Mi.displayName="@mantine/core/ScrollAreaScrollbarY";const gn=x.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,{dir:o}=Io(),s=nt(),a=x.useRef(null),i=x.useRef(0),[c,l]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Oi(c.viewport,c.content),d={...n,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:m=>{a.current=m},onThumbPointerUp:()=>{i.current=0},onThumbPointerDown:m=>{i.current=m}},f=(m,v)=>sm(m,i.current,c,v);return r==="horizontal"?g.jsx(Pi,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const m=s.viewport.scrollLeft,v=ma(m,c,o);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=f(m,o))}}):r==="vertical"?g.jsx(Mi,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const m=s.viewport.scrollTop,v=ma(m,c);c.scrollbar.size===0?a.current.style.setProperty("--thumb-opacity","0"):a.current.style.setProperty("--thumb-opacity","1"),a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=f(m))}}):null});gn.displayName="@mantine/core/ScrollAreaScrollbarVisible";const qo=x.forwardRef((e,t)=>{const r=nt(),{forceMount:n,...o}=e,[s,a]=x.useState(!1),i=e.orientation==="horizontal",c=Or(()=>{if(r.viewport){const l=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;a(i?l:u)}},10);return Qt(r.viewport,c),Qt(r.content,c),n||s?g.jsx(gn,{"data-state":s?"visible":"hidden",...o,ref:t}):null});qo.displayName="@mantine/core/ScrollAreaScrollbarAuto";const Li=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=nt(),[s,a]=x.useState(!1);return x.useEffect(()=>{const{scrollArea:i}=o;let c=0;if(i){const l=()=>{window.clearTimeout(c),a(!0)},u=()=>{c=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",l),i.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",l),i.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),r||s?g.jsx(qo,{"data-state":s?"visible":"hidden",...n,ref:t}):null});Li.displayName="@mantine/core/ScrollAreaScrollbarHover";const im=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=nt(),s=e.orientation==="horizontal",[a,i]=x.useState("hidden"),c=Or(()=>i("idle"),100);return x.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>i("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,o.scrollHideDelay]),x.useEffect(()=>{const{viewport:l}=o,u=s?"scrollLeft":"scrollTop";if(l){let d=l[u];const f=()=>{const m=l[u];d!==m&&(i("scrolling"),c()),d=m};return l.addEventListener("scroll",f),()=>l.removeEventListener("scroll",f)}},[o.viewport,s,c]),r||a!=="hidden"?g.jsx(gn,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Lt(e.onPointerEnter,()=>i("interacting")),onPointerLeave:Lt(e.onPointerLeave,()=>i("idle"))}):null}),Do=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=nt(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=o,i=e.orientation==="horizontal";return x.useEffect(()=>(i?s(!0):a(!0),()=>{i?s(!1):a(!1)}),[i,s,a]),o.type==="hover"?g.jsx(Li,{...n,ref:t,forceMount:r}):o.type==="scroll"?g.jsx(im,{...n,ref:t,forceMount:r}):o.type==="auto"?g.jsx(qo,{...n,ref:t,forceMount:r}):o.type==="always"?g.jsx(gn,{...n,ref:t}):null});Do.displayName="@mantine/core/ScrollAreaScrollbar";function cm(e,t=()=>{}){let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},a=r.left!==s.left,i=r.top!==s.top;(a||i)&&t(),r=s,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)}const Ii=x.forwardRef((e,t)=>{const{style:r,...n}=e,o=nt(),s=ji(),{onThumbPositionChange:a}=s,i=Ze(t,u=>s.onThumbChange(u)),c=x.useRef(void 0),l=Or(()=>{c.current&&(c.current(),c.current=void 0)},100);return x.useEffect(()=>{const{viewport:u}=o;if(u){const d=()=>{if(l(),!c.current){const f=cm(u,a);c.current=f,a()}};return a(),u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[o.viewport,l,a]),g.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...n,ref:i,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...r},onPointerDownCapture:Lt(e.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),m=u.clientX-f.left,v=u.clientY-f.top;s.onThumbPointerDown({x:m,y:v})}),onPointerUp:Lt(e.onPointerUp,s.onThumbPointerUp)})});Ii.displayName="@mantine/core/ScrollAreaThumb";const _o=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ji();return r||o.hasThumb?g.jsx(Ii,{ref:t,...n}):null});_o.displayName="@mantine/core/ScrollAreaThumb";const Fi=x.forwardRef(({children:e,style:t,...r},n)=>{const o=nt(),s=Ze(n,o.onViewportChange);return g.jsx(ue,{...r,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:g.jsx("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});Fi.displayName="@mantine/core/ScrollAreaViewport";var Xo={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const Vi={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},lm=(e,{scrollbarSize:t,overscrollBehavior:r})=>({root:{"--scrollarea-scrollbar-size":_e(t),"--scrollarea-over-scroll-behavior":r}}),jr=se((e,t)=>{const r=K("ScrollArea",Vi,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,scrollbarSize:c,vars:l,type:u,scrollHideDelay:d,viewportProps:f,viewportRef:m,onScrollPositionChange:v,children:p,offsetScrollbars:h,scrollbars:y,onBottomReached:w,onTopReached:b,overscrollBehavior:C,...D}=r,[S,O]=x.useState(!1),[k,j]=x.useState(!1),[P,L]=x.useState(!1),V=ye({name:"ScrollArea",props:r,classes:Xo,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:l,varsResolver:lm}),z=x.useRef(null),M=If([m,z]);return x.useEffect(()=>{if(!z.current||h!=="present")return;const $=z.current,_=new ResizeObserver(()=>{const{scrollHeight:E,clientHeight:T,scrollWidth:N,clientWidth:I}=$;j(E>T),L(N>I)});return _.observe($),()=>_.disconnect()},[z,h]),g.jsxs(Ti,{type:u==="never"?"always":u,scrollHideDelay:d,ref:t,scrollbars:y,...V("root"),...D,children:[g.jsx(Fi,{...f,...V("viewport",{style:f==null?void 0:f.style}),ref:M,"data-offset-scrollbars":h===!0?"xy":h||void 0,"data-scrollbars":y||void 0,"data-horizontal-hidden":h==="present"&&!P?"true":void 0,"data-vertical-hidden":h==="present"&&!k?"true":void 0,onScroll:$=>{var N;(N=f==null?void 0:f.onScroll)==null||N.call(f,$),v==null||v({x:$.currentTarget.scrollLeft,y:$.currentTarget.scrollTop});const{scrollTop:_,scrollHeight:E,clientHeight:T}=$.currentTarget;_-(E-T)>=0&&(w==null||w()),_===0&&(b==null||b())},children:p}),(y==="xy"||y==="x")&&g.jsx(Do,{...V("scrollbar"),orientation:"horizontal","data-hidden":u==="never"||h==="present"&&!P?!0:void 0,forceMount:!0,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),children:g.jsx(_o,{...V("thumb")})}),(y==="xy"||y==="y")&&g.jsx(Do,{...V("scrollbar"),orientation:"vertical","data-hidden":u==="never"||h==="present"&&!k?!0:void 0,forceMount:!0,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),children:g.jsx(_o,{...V("thumb")})}),g.jsx(rm,{...V("corner"),"data-hovered":S||void 0,"data-hidden":u==="never"||void 0})]})});jr.displayName="@mantine/core/ScrollArea";const Ko=se((e,t)=>{const{children:r,classNames:n,styles:o,scrollbarSize:s,scrollHideDelay:a,type:i,dir:c,offsetScrollbars:l,viewportRef:u,onScrollPositionChange:d,unstyled:f,variant:m,viewportProps:v,scrollbars:p,style:h,vars:y,onBottomReached:w,onTopReached:b,...C}=K("ScrollAreaAutosize",Vi,e);return g.jsx(ue,{...C,ref:t,style:[{display:"flex",overflow:"auto"},h],children:g.jsx(ue,{style:{display:"flex",flexDirection:"column",flex:1},children:g.jsx(jr,{classNames:n,styles:o,scrollHideDelay:a,scrollbarSize:s,type:i,dir:c,offsetScrollbars:l,viewportRef:u,onScrollPositionChange:d,unstyled:f,variant:m,viewportProps:v,vars:y,scrollbars:p,onBottomReached:w,onTopReached:b,children:r})})})});jr.classes=Xo;Ko.displayName="@mantine/core/ScrollAreaAutosize";Ko.classes=Xo;jr.Autosize=Ko;var zi={root:"m_87cf2631"};const um={__staticSelector:"UnstyledButton"},tt=Ct((e,t)=>{const r=K("UnstyledButton",um,e),{className:n,component:o="button",__staticSelector:s,unstyled:a,classNames:i,styles:c,style:l,...u}=r,d=ye({name:s,props:r,classes:zi,className:n,style:l,classNames:i,styles:c,unstyled:a});return g.jsx(ue,{...d("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...u})});tt.classes=zi;tt.displayName="@mantine/core/UnstyledButton";var Bi={root:"m_515a97f8"};const dm={},Zo=se((e,t)=>{const r=K("VisuallyHidden",dm,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,...l}=r,u=ye({name:"VisuallyHidden",classes:Bi,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i});return g.jsx(ue,{component:"span",ref:t,...u("root"),...l})});Zo.classes=Bi;Zo.displayName="@mantine/core/VisuallyHidden";var Wi={root:"m_1b7284a3"};const fm={},mm=(e,{radius:t,shadow:r})=>({root:{"--paper-radius":t===void 0?void 0:Je(t),"--paper-shadow":Mo(r)}}),Jo=Ct((e,t)=>{const r=K("Paper",fm,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:m,...v}=r,p=ye({name:"Paper",props:r,classes:Wi,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:l,varsResolver:mm});return g.jsx(ue,{ref:t,mod:[{"data-with-border":c},m],...p("root"),variant:f,...v})});Jo.classes=Wi;Jo.displayName="@mantine/core/Paper";function pm(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[r,n]=t.split("-"),o=r==="right"?"left":"right";return n===void 0?o:`${o}-${n}`}return t}function pa(e,t,r,n){return e==="center"||n==="center"?{top:t}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function ha(e,t,r,n,o){return e==="center"||n==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:r}:e==="start"?{[o==="ltr"?"left":"right"]:r}:{}}const hm={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function vm({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,arrowX:s,arrowY:a,dir:i}){const[c,l="center"]=e.split("-"),u={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[hm[c]]:n},d=-t/2;return c==="left"?{...u,...pa(l,a,r,o),right:d,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:c==="right"?{...u,...pa(l,a,r,o),left:d,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:c==="top"?{...u,...ha(l,s,r,o,i),bottom:d,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:c==="bottom"?{...u,...ha(l,s,r,o,i),top:d,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Yi=x.forwardRef(({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,visible:s,arrowX:a,arrowY:i,style:c,...l},u)=>{const{dir:d}=Io();return s?g.jsx("div",{...l,ref:u,style:{...c,...vm({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,dir:d,arrowX:a,arrowY:i})}}):null});Yi.displayName="@mantine/core/FloatingArrow";var Hi={root:"m_9814e45f"};const gm={zIndex:Ft("modal")},ym=(e,{gradient:t,color:r,backgroundOpacity:n,blur:o,radius:s,zIndex:a})=>({root:{"--overlay-bg":t||(r!==void 0||n!==void 0)&&od(r||"#000",n??.6)||void 0,"--overlay-filter":o?`blur(${_e(o)})`:void 0,"--overlay-radius":s===void 0?void 0:Je(s),"--overlay-z-index":a==null?void 0:a.toString()}}),yn=Ct((e,t)=>{const r=K("Overlay",gm,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,fixed:l,center:u,children:d,radius:f,zIndex:m,gradient:v,blur:p,color:h,backgroundOpacity:y,mod:w,...b}=r,C=ye({name:"Overlay",props:r,classes:Hi,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:ym});return g.jsx(ue,{ref:t,...C("root"),mod:[{center:u,fixed:l},w],...b,children:d})});yn.classes=Hi;yn.displayName="@mantine/core/Overlay";function so(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}function bm({target:e,reuseTargetNode:t,...r}){if(e)return typeof e=="string"?document.querySelector(e)||so(r):e;if(t){const n=document.querySelector("[data-mantine-shared-portal-node]");if(n)return n;const o=so(r);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return so(r)}const xm={},Ui=se((e,t)=>{const{children:r,target:n,reuseTargetNode:o,...s}=K("Portal",xm,e),[a,i]=x.useState(!1),c=x.useRef(null);return jo(()=>(i(!0),c.current=bm({target:n,reuseTargetNode:o,...s}),rn(t,c.current),!n&&!o&&c.current&&document.body.appendChild(c.current),()=>{!n&&!o&&c.current&&document.body.removeChild(c.current)}),[n]),!a||!c.current?null:$o.createPortal(g.jsx(g.Fragment,{children:r}),c.current)});Ui.displayName="@mantine/core/Portal";const bn=se(({withinPortal:e=!0,children:t,...r},n)=>ui()==="test"||!e?g.jsx(g.Fragment,{children:t}):g.jsx(Ui,{ref:n,...r,children:t}));bn.displayName="@mantine/core/OptionalPortal";const wr=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Gr={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...wr("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...wr("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...wr("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...wr("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...wr("top"),common:{transformOrigin:"top right"}}},va={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function wm({transition:e,state:t,duration:r,timingFunction:n}){const o={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${r}ms`,transitionTimingFunction:n};return typeof e=="string"?e in Gr?{transitionProperty:Gr[e].transitionProperty,...o,...Gr[e].common,...Gr[e][va[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[va[t]]}}function Sm({duration:e,exitDuration:t,timingFunction:r,mounted:n,onEnter:o,onExit:s,onEntered:a,onExited:i,enterDelay:c,exitDelay:l}){const u=ar(),d=Ka(),f=u.respectReducedMotion?d:!1,[m,v]=x.useState(f?0:e),[p,h]=x.useState(n?"entered":"exited"),y=x.useRef(-1),w=x.useRef(-1),b=x.useRef(-1),C=S=>{const O=S?o:s,k=S?a:i;window.clearTimeout(y.current);const j=f?0:S?e:t;v(j),j===0?(typeof O=="function"&&O(),typeof k=="function"&&k(),h(S?"entered":"exited")):b.current=requestAnimationFrame(()=>{$o.flushSync(()=>{h(S?"pre-entering":"pre-exiting")}),b.current=requestAnimationFrame(()=>{typeof O=="function"&&O(),h(S?"entering":"exiting"),y.current=window.setTimeout(()=>{typeof k=="function"&&k(),h(S?"entered":"exited")},j)})})},D=S=>{if(window.clearTimeout(w.current),typeof(S?c:l)!="number"){C(S);return}w.current=window.setTimeout(()=>{C(S)},S?c:l)};return yt(()=>{D(n)},[n]),x.useEffect(()=>()=>{window.clearTimeout(y.current),cancelAnimationFrame(b.current)},[]),{transitionDuration:m,transitionStatus:p,transitionTimingFunction:r||"ease"}}function zt({keepMounted:e,transition:t="fade",duration:r=250,exitDuration:n=r,mounted:o,children:s,timingFunction:a="ease",onExit:i,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f}){const m=ui(),{transitionDuration:v,transitionStatus:p,transitionTimingFunction:h}=Sm({mounted:o,exitDuration:n,duration:r,timingFunction:a,onExit:i,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f});return v===0||m==="test"?o?g.jsx(g.Fragment,{children:s({})}):e?s({display:"none"}):null:p==="exited"?e?s({display:"none"}):null:g.jsx(g.Fragment,{children:s(wm({transition:t,duration:v,state:p,timingFunction:h}))})}zt.displayName="@mantine/core/Transition";const[Cm,Gi]=or("Popover component was not found in the tree");function xn({children:e,active:t=!0,refProp:r="ref",innerRef:n}){const o=Gl(t),s=Ze(o,n);return kr(e)?x.cloneElement(e,{[r]:s}):e}function qi(e){return g.jsx(Zo,{tabIndex:-1,"data-autofocus":!0,...e})}xn.displayName="@mantine/core/FocusTrap";qi.displayName="@mantine/core/FocusTrapInitialFocus";xn.InitialFocus=qi;var Xi={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const Dm={},Qo=se((e,t)=>{var h,y,w,b;const r=K("PopoverDropdown",Dm,e),{className:n,style:o,vars:s,children:a,onKeyDownCapture:i,variant:c,classNames:l,styles:u,...d}=r,f=Gi(),m=Ua({opened:f.opened,shouldReturnFocus:f.returnFocus}),v=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:"dialog",tabIndex:-1}:{},p=Ze(t,f.floating);return f.disabled?null:g.jsx(bn,{...f.portalProps,withinPortal:f.withinPortal,children:g.jsx(zt,{mounted:f.opened,...f.transitionProps,transition:((h=f.transitionProps)==null?void 0:h.transition)||"fade",duration:((y=f.transitionProps)==null?void 0:y.duration)??150,keepMounted:f.keepMounted,exitDuration:typeof((w=f.transitionProps)==null?void 0:w.exitDuration)=="number"?f.transitionProps.exitDuration:(b=f.transitionProps)==null?void 0:b.duration,children:C=>g.jsx(xn,{active:f.trapFocus&&f.opened,innerRef:p,children:g.jsxs(ue,{...v,...d,variant:c,onKeyDownCapture:Iu(()=>{var D,S;(D=f.onClose)==null||D.call(f),(S=f.onDismiss)==null||S.call(f)},{active:f.closeOnEscape,onTrigger:m,onKeyDown:i}),"data-position":f.placement,"data-fixed":f.floatingStrategy==="fixed"||void 0,...f.getStyles("dropdown",{className:n,props:r,classNames:l,styles:u,style:[{...C,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width==="target"?void 0:_e(f.width)},f.resolvedStyles.dropdown,u==null?void 0:u.dropdown,o]}),children:[a,g.jsx(Yi,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles("arrow",{props:r,classNames:l,styles:u})})]})})})})});Qo.classes=Xi;Qo.displayName="@mantine/core/PopoverDropdown";const _m={refProp:"ref",popupType:"dialog"},Ki=se((e,t)=>{const{children:r,refProp:n,popupType:o,...s}=K("PopoverTarget",_m,e);if(!kr(r))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const a=s,i=Gi(),c=Ze(i.reference,ci(r),t),l=i.withRoles?{"aria-haspopup":o,"aria-expanded":i.opened,"aria-controls":i.getDropdownId(),id:i.getTargetId()}:{};return x.cloneElement(r,{...a,...l,...i.targetProps,className:Fe(i.targetProps.className,a.className,r.props.className),[n]:c,...i.controlled?null:{onClick:i.onToggle}})});Ki.displayName="@mantine/core/PopoverTarget";function Rm({opened:e,floating:t,position:r,positionDependencies:n}){const[o,s]=x.useState(0);x.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return Df(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,r]),yt(()=>{t.update()},n),yt(()=>{s(a=>a+1)},[e])}function Em(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Nm(e,t){const r=Em(e.middlewares),n=[Af(e.offset)];return r.shift&&n.push(Pf(typeof r.shift=="boolean"?{limiter:ca(),padding:5}:{limiter:ca(),padding:5,...r.shift})),r.flip&&n.push(typeof r.flip=="boolean"?la():la(r.flip)),r.inline&&n.push(typeof r.inline=="boolean"?ua():ua(r.inline)),n.push(Lf({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&n.push(Mf({...typeof r.size=="boolean"?{}:r.size,apply({rects:o,availableWidth:s,availableHeight:a,...i}){var u;const l=((u=t().refs.floating.current)==null?void 0:u.style)??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:o,availableWidth:s,availableHeight:a,...i}):Object.assign(l,{maxWidth:`${s}px`,maxHeight:`${a}px`})),e.width==="target"&&Object.assign(l,{width:`${o.reference.width}px`})}})),n}function Tm(e){const[t,r]=bt({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),n=x.useRef(t),o=()=>{t&&r(!1)},s=()=>r(!t),a=Qf({strategy:e.strategy,placement:e.position,middleware:Nm(e,()=>a)});return Rm({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:a}),yt(()=>{var i;(i=e.onPositionChange)==null||i.call(e,a.placement)},[a.placement]),yt(()=>{var i,c;t!==n.current&&(t?(c=e.onOpen)==null||c.call(e):(i=e.onClose)==null||i.call(e)),n.current=t},[t,e.onClose,e.onOpen]),{floating:a,controlled:typeof e.opened=="boolean",opened:t,onClose:o,onToggle:s}}const Om={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Ft("popover"),__staticSelector:"Popover",width:"max-content"},km=(e,{radius:t,shadow:r})=>({dropdown:{"--popover-radius":t===void 0?void 0:Je(t),"--popover-shadow":Mo(r)}});function Xe(e){var ce,we,Oe,De,je,Pe;const t=K("Popover",Om,e),{children:r,position:n,offset:o,onPositionChange:s,positionDependencies:a,opened:i,transitionProps:c,onExitTransitionEnd:l,onEnterTransitionEnd:u,width:d,middlewares:f,withArrow:m,arrowSize:v,arrowOffset:p,arrowRadius:h,arrowPosition:y,unstyled:w,classNames:b,styles:C,closeOnClickOutside:D,withinPortal:S,portalProps:O,closeOnEscape:k,clickOutsideEvents:j,trapFocus:P,onClose:L,onDismiss:V,onOpen:z,onChange:M,zIndex:$,radius:_,shadow:E,id:T,defaultOpened:N,__staticSelector:I,withRoles:A,disabled:B,returnFocus:Y,variant:te,keepMounted:F,vars:Q,floatingStrategy:re,withOverlay:ae,overlayProps:Z,...le}=t,ie=ye({name:I,props:t,classes:Xi,classNames:b,styles:C,unstyled:w,rootSelector:"dropdown",vars:Q,varsResolver:km}),{resolvedStyles:pe}=St({classNames:b,styles:C,props:t}),X=x.useRef(null),[me,fe]=x.useState(null),[ge,U]=x.useState(null),{dir:J}=Io(),ee=nr(T),de=Tm({middlewares:f,width:d,position:pm(J,n),offset:typeof o=="number"?o+(m?v/2:0):o,arrowRef:X,arrowOffset:p,onPositionChange:s,positionDependencies:a,opened:i,defaultOpened:N,onChange:M,onOpen:z,onClose:L,onDismiss:V,strategy:re});Ha(()=>{D&&(de.onClose(),V==null||V())},j,[me,ge]);const be=x.useCallback(Re=>{fe(Re),de.floating.refs.setReference(Re)},[de.floating.refs.setReference]),oe=x.useCallback(Re=>{U(Re),de.floating.refs.setFloating(Re)},[de.floating.refs.setFloating]),he=x.useCallback(()=>{var Re;(Re=c==null?void 0:c.onExited)==null||Re.call(c),l==null||l()},[c==null?void 0:c.onExited,l]),H=x.useCallback(()=>{var Re;(Re=c==null?void 0:c.onEntered)==null||Re.call(c),u==null||u()},[c==null?void 0:c.onEntered,u]);return g.jsxs(Cm,{value:{returnFocus:Y,disabled:B,controlled:de.controlled,reference:be,floating:oe,x:de.floating.x,y:de.floating.y,arrowX:(Oe=(we=(ce=de.floating)==null?void 0:ce.middlewareData)==null?void 0:we.arrow)==null?void 0:Oe.x,arrowY:(Pe=(je=(De=de.floating)==null?void 0:De.middlewareData)==null?void 0:je.arrow)==null?void 0:Pe.y,opened:de.opened,arrowRef:X,transitionProps:{...c,onExited:he,onEntered:H},width:d,withArrow:m,arrowSize:v,arrowOffset:p,arrowRadius:h,arrowPosition:y,placement:de.floating.placement,trapFocus:P,withinPortal:S,portalProps:O,zIndex:$,radius:_,shadow:E,closeOnEscape:k,onDismiss:V,onClose:de.onClose,onToggle:de.onToggle,getTargetId:()=>`${ee}-target`,getDropdownId:()=>`${ee}-dropdown`,withRoles:A,targetProps:le,__staticSelector:I,classNames:b,styles:C,unstyled:w,variant:te,keepMounted:F,getStyles:ie,resolvedStyles:pe,floatingStrategy:re},children:[r,ae&&g.jsx(zt,{transition:"fade",mounted:de.opened,duration:(c==null?void 0:c.duration)||250,exitDuration:(c==null?void 0:c.exitDuration)||250,children:Re=>g.jsx(bn,{withinPortal:S,children:g.jsx(yn,{...Z,...ie("overlay",{className:Z==null?void 0:Z.className,style:[Re,Z==null?void 0:Z.style]})})})})]})}Xe.Target=Ki;Xe.Dropdown=Qo;Xe.displayName="@mantine/core/Popover";Xe.extend=e=>e;var it={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const Zi=x.forwardRef(({className:e,...t},r)=>g.jsxs(ue,{component:"span",className:Fe(it.barsLoader,e),...t,ref:r,children:[g.jsx("span",{className:it.bar}),g.jsx("span",{className:it.bar}),g.jsx("span",{className:it.bar})]}));Zi.displayName="@mantine/core/Bars";const Ji=x.forwardRef(({className:e,...t},r)=>g.jsxs(ue,{component:"span",className:Fe(it.dotsLoader,e),...t,ref:r,children:[g.jsx("span",{className:it.dot}),g.jsx("span",{className:it.dot}),g.jsx("span",{className:it.dot})]}));Ji.displayName="@mantine/core/Dots";const Qi=x.forwardRef(({className:e,...t},r)=>g.jsx(ue,{component:"span",className:Fe(it.ovalLoader,e),...t,ref:r}));Qi.displayName="@mantine/core/Oval";const ec={bars:Zi,oval:Qi,dots:Ji},$m={loaders:ec,type:"oval"},jm=(e,{size:t,color:r})=>({root:{"--loader-size":Ne(t,"loader-size"),"--loader-color":r?xt(r,e):void 0}}),Ar=se((e,t)=>{const r=K("Loader",$m,e),{size:n,color:o,type:s,vars:a,className:i,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:m,children:v,...p}=r,h=ye({name:"Loader",props:r,classes:it,className:i,style:c,classNames:l,styles:u,unstyled:d,vars:a,varsResolver:jm});return v?g.jsx(ue,{...h("root"),ref:t,...p,children:v}):g.jsx(ue,{...h("root"),ref:t,component:f[s],variant:m,size:n,...p})});Ar.defaultLoaders=ec;Ar.classes=it;Ar.displayName="@mantine/core/Loader";var lr={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const ga={orientation:"horizontal"},Am=(e,{borderWidth:t})=>({group:{"--ai-border-width":_e(t)}}),es=se((e,t)=>{const r=K("ActionIconGroup",ga,e),{className:n,style:o,classNames:s,styles:a,unstyled:i,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,...m}=K("ActionIconGroup",ga,e),v=ye({name:"ActionIconGroup",props:r,classes:lr,className:n,style:o,classNames:s,styles:a,unstyled:i,vars:l,varsResolver:Am,rootSelector:"group"});return g.jsx(ue,{...v("group"),ref:t,variant:d,mod:[{"data-orientation":c},f],role:"group",...m})});es.classes=lr;es.displayName="@mantine/core/ActionIconGroup";const ya={},Pm=(e,{radius:t,color:r,gradient:n,variant:o,autoContrast:s,size:a})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:n,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":Ne(a,"section-height"),"--section-padding-x":Ne(a,"section-padding-x"),"--section-fz":Ie(a),"--section-radius":t===void 0?void 0:Je(t),"--section-bg":r||o?i.background:void 0,"--section-color":i.color,"--section-bd":r||o?i.border:void 0}}},ts=se((e,t)=>{const r=K("ActionIconGroupSection",ya,e),{className:n,style:o,classNames:s,styles:a,unstyled:i,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,...m}=K("ActionIconGroupSection",ya,e),v=ye({name:"ActionIconGroupSection",props:r,classes:lr,className:n,style:o,classNames:s,styles:a,unstyled:i,vars:c,varsResolver:Pm,rootSelector:"groupSection"});return g.jsx(ue,{...v("groupSection"),ref:t,variant:l,...m})});ts.classes=lr;ts.displayName="@mantine/core/ActionIconGroupSection";const Mm={},Lm=(e,{size:t,radius:r,variant:n,gradient:o,color:s,autoContrast:a})=>{const i=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:n||"filled",autoContrast:a});return{root:{"--ai-size":Ne(t,"ai-size"),"--ai-radius":r===void 0?void 0:Je(r),"--ai-bg":s||n?i.background:void 0,"--ai-hover":s||n?i.hover:void 0,"--ai-hover-color":s||n?i.hoverColor:void 0,"--ai-color":i.color,"--ai-bd":s||n?i.border:void 0}}},ur=Ct((e,t)=>{const r=K("ActionIcon",Mm,e),{className:n,unstyled:o,variant:s,classNames:a,styles:i,style:c,loading:l,loaderProps:u,size:d,color:f,radius:m,__staticSelector:v,gradient:p,vars:h,children:y,disabled:w,"data-disabled":b,autoContrast:C,mod:D,...S}=r,O=ye({name:["ActionIcon",v],props:r,className:n,style:c,classes:lr,classNames:a,styles:i,unstyled:o,vars:h,varsResolver:Lm});return g.jsxs(tt,{...O("root",{active:!w&&!l&&!b}),...S,unstyled:o,variant:s,size:d,disabled:w||l,ref:t,mod:[{loading:l,disabled:w||b},D],children:[g.jsx(zt,{mounted:!!l,transition:"slide-down",duration:150,children:k=>g.jsx(ue,{component:"span",...O("loader",{style:k}),"aria-hidden":!0,children:g.jsx(Ar,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...u})})}),g.jsx(ue,{component:"span",mod:{loading:l},...O("icon"),children:y})]})});ur.classes=lr;ur.displayName="@mantine/core/ActionIcon";ur.Group=es;ur.GroupSection=ts;const tc=x.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...r},n)=>g.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:n,...r,children:g.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));tc.displayName="@mantine/core/CloseIcon";var rc={root:"m_86a44da5","root--subtle":"m_220c80f2"};const Im={variant:"subtle"},Fm=(e,{size:t,radius:r,iconSize:n})=>({root:{"--cb-size":Ne(t,"cb-size"),"--cb-radius":r===void 0?void 0:Je(r),"--cb-icon-size":_e(n)}}),Pr=Ct((e,t)=>{const r=K("CloseButton",Im,e),{iconSize:n,children:o,vars:s,radius:a,className:i,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:m,variant:v,icon:p,mod:h,__staticSelector:y,...w}=r,b=ye({name:y||"CloseButton",props:r,className:i,style:l,classes:rc,classNames:c,styles:u,unstyled:d,vars:s,varsResolver:Fm});return g.jsxs(tt,{ref:t,...w,unstyled:d,variant:v,disabled:m,mod:[{disabled:m||f},h],...b("root",{variant:v,active:!m&&!f}),children:[p||g.jsx(tc,{}),o]})});Pr.classes=rc;Pr.displayName="@mantine/core/CloseButton";const[Vm,Dt]=or("ModalBase component was not found in tree");function zm({opened:e,transitionDuration:t}){const[r,n]=x.useState(e),o=x.useRef(-1),a=Ka()?0:t;return x.useEffect(()=>(e?(n(!0),window.clearTimeout(o.current)):a===0?n(!1):o.current=window.setTimeout(()=>n(!1),a),()=>window.clearTimeout(o.current)),[e,a]),r}function Bm({id:e,transitionProps:t,opened:r,trapFocus:n,closeOnEscape:o,onClose:s,returnFocus:a}){const i=nr(e),[c,l]=x.useState(!1),[u,d]=x.useState(!1),f=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,m=zm({opened:r,transitionDuration:f});return Kl("keydown",v=>{var p;v.key==="Escape"&&o&&!v.isComposing&&r&&((p=v.target)==null?void 0:p.getAttribute("data-mantine-stop-propagation"))!=="true"&&s()},{capture:!0}),Ua({opened:r,shouldReturnFocus:n&&a}),{_id:i,titleMounted:c,bodyMounted:u,shouldLockScroll:m,setTitleMounted:l,setBodyMounted:d}}const nc=x.forwardRef(({keepMounted:e,opened:t,onClose:r,id:n,transitionProps:o,onExitTransitionEnd:s,onEnterTransitionEnd:a,trapFocus:i,closeOnEscape:c,returnFocus:l,closeOnClickOutside:u,withinPortal:d,portalProps:f,lockScroll:m,children:v,zIndex:p,shadow:h,padding:y,__vars:w,unstyled:b,removeScrollProps:C,...D},S)=>{const{_id:O,titleMounted:k,bodyMounted:j,shouldLockScroll:P,setTitleMounted:L,setBodyMounted:V}=Bm({id:n,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:c,onClose:r,returnFocus:l}),{key:z,...M}=C||{};return g.jsx(bn,{...f,withinPortal:d,children:g.jsx(Vm,{value:{opened:t,onClose:r,closeOnClickOutside:u,onExitTransitionEnd:s,onEnterTransitionEnd:a,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${O}-title`,getBodyId:()=>`${O}-body`,titleMounted:k,bodyMounted:j,setTitleMounted:L,setBodyMounted:V,trapFocus:i,closeOnEscape:c,zIndex:p,unstyled:b},children:g.jsx(oi,{enabled:P&&m,...M,children:g.jsx(ue,{ref:S,...D,__vars:{...w,"--mb-z-index":(p||Ft("modal")).toString(),"--mb-shadow":Mo(h),"--mb-padding":ii(y)},children:v})},z)})})});nc.displayName="@mantine/core/ModalBase";function Wm(){const e=Dt();return x.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var er={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const oc=x.forwardRef(({className:e,...t},r)=>{const n=Wm(),o=Dt();return g.jsx(ue,{ref:r,...t,id:n,className:Fe({[er.body]:!o.unstyled},e)})});oc.displayName="@mantine/core/ModalBaseBody";const sc=x.forwardRef(({className:e,onClick:t,...r},n)=>{const o=Dt();return g.jsx(Pr,{ref:n,...r,onClick:s=>{o.onClose(),t==null||t(s)},className:Fe({[er.close]:!o.unstyled},e),unstyled:o.unstyled})});sc.displayName="@mantine/core/ModalBaseCloseButton";const ac=x.forwardRef(({transitionProps:e,className:t,innerProps:r,onKeyDown:n,style:o,...s},a)=>{const i=Dt();return g.jsx(zt,{mounted:i.opened,transition:"pop",...i.transitionProps,onExited:()=>{var c,l,u;(c=i.onExitTransitionEnd)==null||c.call(i),(u=(l=i.transitionProps)==null?void 0:l.onExited)==null||u.call(l)},onEntered:()=>{var c,l,u;(c=i.onEnterTransitionEnd)==null||c.call(i),(u=(l=i.transitionProps)==null?void 0:l.onEntered)==null||u.call(l)},...e,children:c=>g.jsx("div",{...r,className:Fe({[er.inner]:!i.unstyled},r.className),children:g.jsx(xn,{active:i.opened&&i.trapFocus,innerRef:a,children:g.jsx(Jo,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":i.bodyMounted?i.getBodyId():void 0,"aria-labelledby":i.titleMounted?i.getTitleId():void 0,style:[o,c],className:Fe({[er.content]:!i.unstyled},t),unstyled:i.unstyled,children:s.children})})})})});ac.displayName="@mantine/core/ModalBaseContent";const ic=x.forwardRef(({className:e,...t},r)=>{const n=Dt();return g.jsx(ue,{component:"header",ref:r,className:Fe({[er.header]:!n.unstyled},e),...t})});ic.displayName="@mantine/core/ModalBaseHeader";const Ym={duration:200,timingFunction:"ease",transition:"fade"};function Hm(e){const t=Dt();return{...Ym,...t.transitionProps,...e}}const cc=x.forwardRef(({onClick:e,transitionProps:t,style:r,visible:n,...o},s)=>{const a=Dt(),i=Hm(t);return g.jsx(zt,{mounted:n!==void 0?n:a.opened,...i,transition:"fade",children:c=>g.jsx(yn,{ref:s,fixed:!0,style:[r,c],zIndex:a.zIndex,unstyled:a.unstyled,onClick:l=>{e==null||e(l),a.closeOnClickOutside&&a.onClose()},...o})})});cc.displayName="@mantine/core/ModalBaseOverlay";function Um(){const e=Dt();return x.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const lc=x.forwardRef(({className:e,...t},r)=>{const n=Um(),o=Dt();return g.jsx(ue,{component:"h2",ref:r,className:Fe({[er.title]:!o.unstyled},e),...t,id:n})});lc.displayName="@mantine/core/ModalBaseTitle";function Gm({children:e}){return g.jsx(g.Fragment,{children:e})}const[qm,Xm]=un({size:"sm"}),Km={},uc=se((e,t)=>{const r=K("InputClearButton",Km,e),{size:n,variant:o,vars:s,classNames:a,styles:i,...c}=r,l=Xm(),{resolvedClassNames:u,resolvedStyles:d}=St({classNames:a,styles:i,props:r});return g.jsx(Pr,{variant:o||"transparent",ref:t,size:n||(l==null?void 0:l.size)||"sm",classNames:u,styles:d,__staticSelector:"InputClearButton",...c})});uc.displayName="@mantine/core/InputClearButton";const[Zm,Mr]=un({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var ot={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const ba={},Jm=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Ie(t)} - ${_e(2)})`}}),wn=se((e,t)=>{const r=K("InputDescription",ba,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,size:l,__staticSelector:u,__inheritStyles:d=!0,variant:f,...m}=K("InputDescription",ba,r),v=Mr(),p=ye({name:["InputWrapper",u],props:r,classes:ot,className:o,style:s,classNames:n,styles:a,unstyled:i,rootSelector:"description",vars:c,varsResolver:Jm}),h=d&&(v==null?void 0:v.getStyles)||p;return g.jsx(ue,{component:"p",ref:t,variant:f,size:l,...h("description",v!=null&&v.getStyles?{className:o,style:s}:void 0),...m})});wn.classes=ot;wn.displayName="@mantine/core/InputDescription";const Qm={},ep=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Ie(t)} - ${_e(2)})`}}),Sn=se((e,t)=>{const r=K("InputError",Qm,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,size:l,__staticSelector:u,__inheritStyles:d=!0,variant:f,...m}=r,v=ye({name:["InputWrapper",u],props:r,classes:ot,className:o,style:s,classNames:n,styles:a,unstyled:i,rootSelector:"error",vars:c,varsResolver:ep}),p=Mr(),h=d&&(p==null?void 0:p.getStyles)||v;return g.jsx(ue,{component:"p",ref:t,variant:f,size:l,...h("error",p!=null&&p.getStyles?{className:o,style:s}:void 0),...m})});Sn.classes=ot;Sn.displayName="@mantine/core/InputError";const xa={labelElement:"label"},tp=(e,{size:t})=>({label:{"--input-label-size":Ie(t),"--input-asterisk-color":void 0}}),Cn=se((e,t)=>{const r=K("InputLabel",xa,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,labelElement:l,size:u,required:d,htmlFor:f,onMouseDown:m,children:v,__staticSelector:p,variant:h,mod:y,...w}=K("InputLabel",xa,r),b=ye({name:["InputWrapper",p],props:r,classes:ot,className:o,style:s,classNames:n,styles:a,unstyled:i,rootSelector:"label",vars:c,varsResolver:tp}),C=Mr(),D=(C==null?void 0:C.getStyles)||b;return g.jsxs(ue,{...D("label",C!=null&&C.getStyles?{className:o,style:s}:void 0),component:l,variant:h,size:u,ref:t,htmlFor:l==="label"?f:void 0,mod:[{required:d},y],onMouseDown:S=>{m==null||m(S),!S.defaultPrevented&&S.detail>1&&S.preventDefault()},...w,children:[v,d&&g.jsx("span",{...D("required"),"aria-hidden":!0,children:" *"})]})});Cn.classes=ot;Cn.displayName="@mantine/core/InputLabel";const wa={},rs=se((e,t)=>{const r=K("InputPlaceholder",wa,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,__staticSelector:l,variant:u,error:d,mod:f,...m}=K("InputPlaceholder",wa,r),v=ye({name:["InputPlaceholder",l],props:r,classes:ot,className:o,style:s,classNames:n,styles:a,unstyled:i,rootSelector:"placeholder"});return g.jsx(ue,{...v("placeholder"),mod:[{error:!!d},f],component:"span",variant:u,ref:t,...m})});rs.classes=ot;rs.displayName="@mantine/core/InputPlaceholder";function rp(e,{hasDescription:t,hasError:r}){const n=e.findIndex(c=>c==="input"),o=e.slice(0,n),s=e.slice(n+1),a=t&&o.includes("description")||r&&o.includes("error");return{offsetBottom:t&&s.includes("description")||r&&s.includes("error"),offsetTop:a}}const np={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},op=(e,{size:t})=>({label:{"--input-label-size":Ie(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Ie(t)} - ${_e(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Ie(t)} - ${_e(2)})`}}),ns=se((e,t)=>{const r=K("InputWrapper",np,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,size:l,variant:u,__staticSelector:d,inputContainer:f,inputWrapperOrder:m,label:v,error:p,description:h,labelProps:y,descriptionProps:w,errorProps:b,labelElement:C,children:D,withAsterisk:S,id:O,required:k,__stylesApiProps:j,mod:P,...L}=r,V=ye({name:["InputWrapper",d],props:j||r,classes:ot,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:op}),z={size:l,variant:u,__staticSelector:d},M=nr(O),$=typeof S=="boolean"?S:k,_=(b==null?void 0:b.id)||`${M}-error`,E=(w==null?void 0:w.id)||`${M}-description`,T=M,N=!!p&&typeof p!="boolean",I=!!h,A=`${N?_:""} ${I?E:""}`,B=A.trim().length>0?A.trim():void 0,Y=(y==null?void 0:y.id)||`${M}-label`,te=v&&g.jsx(Cn,{labelElement:C,id:Y,htmlFor:T,required:$,...z,...y,children:v},"label"),F=I&&g.jsx(wn,{...w,...z,size:(w==null?void 0:w.size)||z.size,id:(w==null?void 0:w.id)||E,children:h},"description"),Q=g.jsx(x.Fragment,{children:f(D)},"input"),re=N&&x.createElement(Sn,{...b,...z,size:(b==null?void 0:b.size)||z.size,key:"error",id:(b==null?void 0:b.id)||_},p),ae=m.map(Z=>{switch(Z){case"label":return te;case"input":return Q;case"description":return F;case"error":return re;default:return null}});return g.jsx(Zm,{value:{getStyles:V,describedBy:B,inputId:T,labelId:Y,...rp(m,{hasDescription:I,hasError:N})},children:g.jsx(ue,{ref:t,variant:u,size:l,mod:[{error:!!p},P],...V("root"),...L,children:ae})})});ns.classes=ot;ns.displayName="@mantine/core/InputWrapper";const sp={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},ap=(e,t,r)=>({wrapper:{"--input-margin-top":r.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":r.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":Ne(t.size,"input-height"),"--input-fz":Ie(t.size),"--input-radius":t.radius===void 0?void 0:Je(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?_e(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?_e(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Ne(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),$e=Ct((e,t)=>{const r=K("Input",sp,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,required:c,__staticSelector:l,__stylesApiProps:u,size:d,wrapperProps:f,error:m,disabled:v,leftSection:p,leftSectionProps:h,leftSectionWidth:y,rightSection:w,rightSectionProps:b,rightSectionWidth:C,rightSectionPointerEvents:D,leftSectionPointerEvents:S,variant:O,vars:k,pointer:j,multiline:P,radius:L,id:V,withAria:z,withErrorStyles:M,mod:$,inputSize:_,__clearSection:E,__clearable:T,__defaultRightSection:N,...I}=r,{styleProps:A,rest:B}=fn(I),Y=Mr(),te={offsetBottom:Y==null?void 0:Y.offsetBottom,offsetTop:Y==null?void 0:Y.offsetTop},F=ye({name:["Input",l],props:u||r,classes:ot,className:o,style:s,classNames:n,styles:a,unstyled:i,stylesCtx:te,rootSelector:"wrapper",vars:k,varsResolver:ap}),Q=z?{required:c,disabled:v,"aria-invalid":!!m,"aria-describedby":Y==null?void 0:Y.describedBy,id:(Y==null?void 0:Y.inputId)||V}:{},re=w||T&&E||N;return g.jsx(qm,{value:{size:d||"sm"},children:g.jsxs(ue,{...F("wrapper"),...A,...f,mod:[{error:!!m&&M,pointer:j,disabled:v,multiline:P,"data-with-right-section":!!re,"data-with-left-section":!!p},$],variant:O,size:d,children:[p&&g.jsx("div",{...h,"data-position":"left",...F("section",{className:h==null?void 0:h.className,style:h==null?void 0:h.style}),children:p}),g.jsx(ue,{component:"input",...B,...Q,ref:t,required:c,mod:{disabled:v,error:!!m&&M},variant:O,__size:_,...F("input")}),re&&g.jsx("div",{...b,"data-position":"right",...F("section",{className:b==null?void 0:b.className,style:b==null?void 0:b.style}),children:re})]})})});$e.classes=ot;$e.Wrapper=ns;$e.Label=Cn;$e.Error=Sn;$e.Description=wn;$e.Placeholder=rs;$e.ClearButton=uc;$e.displayName="@mantine/core/Input";function os(e,t,r){const n=K(e,t,r),{label:o,description:s,error:a,required:i,classNames:c,styles:l,className:u,unstyled:d,__staticSelector:f,__stylesApiProps:m,errorProps:v,labelProps:p,descriptionProps:h,wrapperProps:y,id:w,size:b,style:C,inputContainer:D,inputWrapperOrder:S,withAsterisk:O,variant:k,vars:j,mod:P,...L}=n,{styleProps:V,rest:z}=fn(L),M={label:o,description:s,error:a,required:i,classNames:c,className:u,__staticSelector:f,__stylesApiProps:m||n,errorProps:v,labelProps:p,descriptionProps:h,unstyled:d,styles:l,size:b,style:C,inputContainer:D,inputWrapperOrder:S,withAsterisk:O,variant:k,id:w,mod:P,...y};return{...z,classNames:c,styles:l,unstyled:d,wrapperProps:{...M,...V},inputProps:{required:i,classNames:c,styles:l,unstyled:d,size:b,__staticSelector:f,__stylesApiProps:m||n,error:a,variant:k,id:w}}}const ip={__staticSelector:"InputBase",withAria:!0},st=Ct((e,t)=>{const{inputProps:r,wrapperProps:n,...o}=os("InputBase",ip,e);return g.jsx($e.Wrapper,{...n,children:g.jsx($e,{...r,...o,ref:t})})});st.classes={...$e.classes,...$e.Wrapper.classes};st.displayName="@mantine/core/InputBase";function Ro({style:e,size:t=16,...r}){return g.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:_e(t),height:_e(t),display:"block"},...r,children:g.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}Ro.displayName="@mantine/core/AccordionChevron";var dc={root:"m_b6d8b162"};function cp(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const lp={inherit:!1},up=(e,{variant:t,lineClamp:r,gradient:n,size:o,color:s})=>({root:{"--text-fz":Ie(o),"--text-lh":Fu(o),"--text-gradient":t==="gradient"?nd(n,e):void 0,"--text-line-clamp":typeof r=="number"?r.toString():void 0,"--text-color":s?xt(s,e):void 0}}),Dn=Ct((e,t)=>{const r=K("Text",lp,e),{lineClamp:n,truncate:o,inline:s,inherit:a,gradient:i,span:c,__staticSelector:l,vars:u,className:d,style:f,classNames:m,styles:v,unstyled:p,variant:h,mod:y,size:w,...b}=r,C=ye({name:["Text",l],props:r,classes:dc,className:d,style:f,classNames:m,styles:v,unstyled:p,vars:u,varsResolver:up});return g.jsx(ue,{...C("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:h,mod:[{"data-truncate":cp(o),"data-line-clamp":typeof n=="number","data-inline":s,"data-inherit":a},y],size:w,...b})});Dn.classes=dc;Dn.displayName="@mantine/core/Text";function fc(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(t=>fc(t))}:e}function dp(e){return e?e.map(t=>fc(t)):[]}function mc(e){return e.reduce((t,r)=>"group"in r?{...t,...mc(r.items)}:(t[r.value]=r,t),{})}var Ke={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const fp={error:null},mp=(e,{size:t,color:r})=>({chevron:{"--combobox-chevron-size":Ne(t,"combobox-chevron-size"),"--combobox-chevron-color":r?xt(r,e):void 0}}),ss=se((e,t)=>{const r=K("ComboboxChevron",fp,e),{size:n,error:o,style:s,className:a,classNames:i,styles:c,unstyled:l,vars:u,mod:d,...f}=r,m=ye({name:"ComboboxChevron",classes:Ke,props:r,style:s,className:a,classNames:i,styles:c,unstyled:l,vars:u,varsResolver:mp,rootSelector:"chevron"});return g.jsx(ue,{component:"svg",...f,...m("chevron"),size:n,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},d],ref:t,children:g.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});ss.classes=Ke;ss.displayName="@mantine/core/ComboboxChevron";const[pp,at]=or("Combobox component was not found in tree"),pc=x.forwardRef(({size:e,onMouseDown:t,onClick:r,onClear:n,...o},s)=>g.jsx($e.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:a=>{a.preventDefault(),t==null||t(a)},onClick:a=>{n(),r==null||r(a)}}));pc.displayName="@mantine/core/ComboboxClearButton";const hp={},as=se((e,t)=>{const{classNames:r,styles:n,className:o,style:s,hidden:a,...i}=K("ComboboxDropdown",hp,e),c=at();return g.jsx(Xe.Dropdown,{...i,ref:t,role:"presentation","data-hidden":a||void 0,...c.getStyles("dropdown",{className:o,style:s,classNames:r,styles:n})})});as.classes=Ke;as.displayName="@mantine/core/ComboboxDropdown";const vp={refProp:"ref"},hc=se((e,t)=>{const{children:r,refProp:n}=K("ComboboxDropdownTarget",vp,e);if(at(),!kr(r))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return g.jsx(Xe.Target,{ref:t,refProp:n,children:r})});hc.displayName="@mantine/core/ComboboxDropdownTarget";const gp={},is=se((e,t)=>{const{classNames:r,className:n,style:o,styles:s,vars:a,...i}=K("ComboboxEmpty",gp,e),c=at();return g.jsx(ue,{ref:t,...c.getStyles("empty",{className:n,classNames:r,styles:s,style:o}),...i})});is.classes=Ke;is.displayName="@mantine/core/ComboboxEmpty";function cs({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:r,withExpandedAttribute:n,targetType:o,autoComplete:s}){const a=at(),[i,c]=x.useState(null),l=d=>{if(e==null||e(d),!a.readOnly&&t){if(d.nativeEvent.isComposing)return;if(d.nativeEvent.code==="ArrowDown"&&(d.preventDefault(),a.store.dropdownOpened?c(a.store.selectNextOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()),a.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),d.nativeEvent.code==="ArrowUp"&&(d.preventDefault(),a.store.dropdownOpened?c(a.store.selectPreviousOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()),a.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),d.nativeEvent.code==="Enter"||d.nativeEvent.code==="NumpadEnter"){if(d.nativeEvent.keyCode===229)return;const f=a.store.getSelectedOptionIndex();a.store.dropdownOpened&&f!==-1?(d.preventDefault(),a.store.clickSelectedOption()):o==="button"&&(d.preventDefault(),a.store.openDropdown("keyboard"))}d.key==="Escape"&&a.store.closeDropdown("keyboard"),d.nativeEvent.code==="Space"&&o==="button"&&(d.preventDefault(),a.store.toggleDropdown("keyboard"))}};return{...r?{"aria-haspopup":"listbox","aria-expanded":n&&!!(a.store.listId&&a.store.dropdownOpened)||void 0,"aria-controls":a.store.dropdownOpened?a.store.listId:void 0,"aria-activedescendant":a.store.dropdownOpened&&i||void 0,autoComplete:s,"data-expanded":a.store.dropdownOpened||void 0,"data-mantine-stop-propagation":a.store.dropdownOpened||void 0}:{},onKeyDown:l}}const yp={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},vc=se((e,t)=>{const{children:r,refProp:n,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:a,targetType:i,autoComplete:c,...l}=K("ComboboxEventsTarget",yp,e);if(!kr(r))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=at(),d=cs({targetType:i,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:r.props.onKeyDown,autoComplete:c});return x.cloneElement(r,{...d,...l,[n]:Ze(t,u.store.targetRef,ci(r))})});vc.displayName="@mantine/core/ComboboxEventsTarget";const bp={},ls=se((e,t)=>{const{classNames:r,className:n,style:o,styles:s,vars:a,...i}=K("ComboboxFooter",bp,e),c=at();return g.jsx(ue,{ref:t,...c.getStyles("footer",{className:n,classNames:r,style:o,styles:s}),...i,onMouseDown:l=>{l.preventDefault()}})});ls.classes=Ke;ls.displayName="@mantine/core/ComboboxFooter";const xp={},us=se((e,t)=>{const{classNames:r,className:n,style:o,styles:s,vars:a,children:i,label:c,...l}=K("ComboboxGroup",xp,e),u=at();return g.jsxs(ue,{ref:t,...u.getStyles("group",{className:n,classNames:r,style:o,styles:s}),...l,children:[c&&g.jsx("div",{...u.getStyles("groupLabel",{classNames:r,styles:s}),children:c}),i]})});us.classes=Ke;us.displayName="@mantine/core/ComboboxGroup";const wp={},ds=se((e,t)=>{const{classNames:r,className:n,style:o,styles:s,vars:a,...i}=K("ComboboxHeader",wp,e),c=at();return g.jsx(ue,{ref:t,...c.getStyles("header",{className:n,classNames:r,style:o,styles:s}),...i,onMouseDown:l=>{l.preventDefault()}})});ds.classes=Ke;ds.displayName="@mantine/core/ComboboxHeader";function gc({value:e,valuesDivider:t=",",...r}){return g.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...r})}gc.displayName="@mantine/core/ComboboxHiddenInput";const Sp={},fs=se((e,t)=>{const r=K("ComboboxOption",Sp,e),{classNames:n,className:o,style:s,styles:a,vars:i,onClick:c,id:l,active:u,onMouseDown:d,onMouseOver:f,disabled:m,selected:v,mod:p,...h}=r,y=at(),w=x.useId(),b=l||w;return g.jsx(ue,{...y.getStyles("option",{className:o,classNames:n,styles:a,style:s}),...h,ref:t,id:b,mod:["combobox-option",{"combobox-active":u,"combobox-disabled":m,"combobox-selected":v},p],role:"option",onClick:C=>{var D;m?C.preventDefault():((D=y.onOptionSubmit)==null||D.call(y,r.value,r),c==null||c(C))},onMouseDown:C=>{C.preventDefault(),d==null||d(C)},onMouseOver:C=>{y.resetSelectionOnOptionHover&&y.store.resetSelectedOption(),f==null||f(C)}})});fs.classes=Ke;fs.displayName="@mantine/core/ComboboxOption";const Cp={},ms=se((e,t)=>{const r=K("ComboboxOptions",Cp,e),{classNames:n,className:o,style:s,styles:a,id:i,onMouseDown:c,labelledBy:l,...u}=r,d=at(),f=nr(i);return x.useEffect(()=>{d.store.setListId(f)},[f]),g.jsx(ue,{ref:t,...d.getStyles("options",{className:o,style:s,classNames:n,styles:a}),...u,id:f,role:"listbox","aria-labelledby":l,onMouseDown:m=>{m.preventDefault(),c==null||c(m)}})});ms.classes=Ke;ms.displayName="@mantine/core/ComboboxOptions";const Dp={withAriaAttributes:!0,withKeyboardNavigation:!0},ps=se((e,t)=>{const r=K("ComboboxSearch",Dp,e),{classNames:n,styles:o,unstyled:s,vars:a,withAriaAttributes:i,onKeyDown:c,withKeyboardNavigation:l,size:u,...d}=r,f=at(),m=f.getStyles("search"),v=cs({targetType:"input",withAriaAttributes:i,withKeyboardNavigation:l,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return g.jsx($e,{ref:Ze(t,f.store.searchRef),classNames:[{input:m.className},n],styles:[{input:m.style},o],size:u||f.size,...v,...d,__staticSelector:"Combobox"})});ps.classes=Ke;ps.displayName="@mantine/core/ComboboxSearch";const _p={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},yc=se((e,t)=>{const{children:r,refProp:n,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:a,targetType:i,autoComplete:c,...l}=K("ComboboxTarget",_p,e);if(!kr(r))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=at(),d=cs({targetType:i,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:r.props.onKeyDown,autoComplete:c}),f=x.cloneElement(r,{...d,...l});return g.jsx(Xe.Target,{ref:Ze(t,u.store.targetRef),children:f})});yc.displayName="@mantine/core/ComboboxTarget";function Rp(e,t,r){for(let n=e-1;n>=0;n-=1)if(!t[n].hasAttribute("data-combobox-disabled"))return n;if(r){for(let n=t.length-1;n>-1;n-=1)if(!t[n].hasAttribute("data-combobox-disabled"))return n}return e}function Ep(e,t,r){for(let n=e+1;n<t.length;n+=1)if(!t[n].hasAttribute("data-combobox-disabled"))return n;if(r){for(let n=0;n<t.length;n+=1)if(!t[n].hasAttribute("data-combobox-disabled"))return n}return e}function Np(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function bc({defaultOpened:e,opened:t,onOpenedChange:r,onDropdownClose:n,onDropdownOpen:o,loop:s=!0,scrollBehavior:a="instant"}={}){const[i,c]=bt({value:t,defaultValue:e,finalValue:!1,onChange:r}),l=x.useRef(null),u=x.useRef(-1),d=x.useRef(null),f=x.useRef(null),m=x.useRef(-1),v=x.useRef(-1),p=x.useRef(-1),h=x.useCallback((_="unknown")=>{i||(c(!0),o==null||o(_))},[c,o,i]),y=x.useCallback((_="unknown")=>{i&&(c(!1),n==null||n(_))},[c,n,i]),w=x.useCallback((_="unknown")=>{i?y(_):h(_)},[y,h,i]),b=x.useCallback(()=>{const _=document.querySelector(`#${l.current} [data-combobox-selected]`);_==null||_.removeAttribute("data-combobox-selected"),_==null||_.removeAttribute("aria-selected")},[]),C=x.useCallback(_=>{const E=document.getElementById(l.current),T=E==null?void 0:E.querySelectorAll("[data-combobox-option]");if(!T)return null;const N=_>=T.length?0:_<0?T.length-1:_;return u.current=N,T!=null&&T[N]&&!T[N].hasAttribute("data-combobox-disabled")?(b(),T[N].setAttribute("data-combobox-selected","true"),T[N].setAttribute("aria-selected","true"),T[N].scrollIntoView({block:"nearest",behavior:a}),T[N].id):null},[a,b]),D=x.useCallback(()=>{const _=document.querySelector(`#${l.current} [data-combobox-active]`);if(_){const E=document.querySelectorAll(`#${l.current} [data-combobox-option]`),T=Array.from(E).findIndex(N=>N===_);return C(T)}return C(0)},[C]),S=x.useCallback(()=>C(Ep(u.current,document.querySelectorAll(`#${l.current} [data-combobox-option]`),s)),[C,s]),O=x.useCallback(()=>C(Rp(u.current,document.querySelectorAll(`#${l.current} [data-combobox-option]`),s)),[C,s]),k=x.useCallback(()=>C(Np(document.querySelectorAll(`#${l.current} [data-combobox-option]`))),[C]),j=x.useCallback((_="selected",E)=>{p.current=window.setTimeout(()=>{var I;const T=document.querySelectorAll(`#${l.current} [data-combobox-option]`),N=Array.from(T).findIndex(A=>A.hasAttribute(`data-combobox-${_}`));u.current=N,E!=null&&E.scrollIntoView&&((I=T[N])==null||I.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),P=x.useCallback(()=>{u.current=-1,b()},[b]),L=x.useCallback(()=>{const _=document.querySelectorAll(`#${l.current} [data-combobox-option]`),E=_==null?void 0:_[u.current];E==null||E.click()},[]),V=x.useCallback(_=>{l.current=_},[]),z=x.useCallback(()=>{m.current=window.setTimeout(()=>d.current.focus(),0)},[]),M=x.useCallback(()=>{v.current=window.setTimeout(()=>f.current.focus(),0)},[]),$=x.useCallback(()=>u.current,[]);return x.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(v.current),window.clearTimeout(p.current)},[]),{dropdownOpened:i,openDropdown:h,closeDropdown:y,toggleDropdown:w,selectedOptionIndex:u.current,getSelectedOptionIndex:$,selectOption:C,selectFirstOption:k,selectActiveOption:D,selectNextOption:S,selectPreviousOption:O,resetSelectedOption:P,updateSelectedOptionIndex:j,listId:l.current,setListId:V,clickSelectedOption:L,searchRef:d,focusSearchInput:z,targetRef:f,focusTarget:M}}const Tp={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},Op=(e,{size:t,dropdownPadding:r})=>({options:{"--combobox-option-fz":Ie(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")},dropdown:{"--combobox-padding":r===void 0?void 0:_e(r),"--combobox-option-fz":Ie(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")}});function Ee(e){const t=K("Combobox",Tp,e),{classNames:r,styles:n,unstyled:o,children:s,store:a,vars:i,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:m,readOnly:v,...p}=t,h=bc(),y=a||h,w=ye({name:m||"Combobox",classes:Ke,props:t,classNames:r,styles:n,unstyled:o,vars:i,varsResolver:Op}),b=()=>{l==null||l(),y.closeDropdown()};return g.jsx(pp,{value:{getStyles:w,store:y,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:v},children:g.jsx(Xe,{opened:y.dropdownOpened,...p,onChange:C=>!C&&b(),withRoles:!1,unstyled:o,children:s})})}const kp=e=>e;Ee.extend=kp;Ee.classes=Ke;Ee.displayName="@mantine/core/Combobox";Ee.Target=yc;Ee.Dropdown=as;Ee.Options=ms;Ee.Option=fs;Ee.Search=ps;Ee.Empty=is;Ee.Chevron=ss;Ee.Footer=ls;Ee.Header=ds;Ee.EventsTarget=vc;Ee.DropdownTarget=hc;Ee.Group=us;Ee.ClearButton=pc;Ee.HiddenInput=gc;var xc={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const $p=xc,wc=x.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:r,classNames:n,styles:o,unstyled:s,children:a,label:i,description:c,id:l,disabled:u,error:d,size:f,labelPosition:m="left",bodyElement:v="div",labelElement:p="label",variant:h,style:y,vars:w,mod:b,...C},D)=>{const S=ye({name:e,props:t,className:r,style:y,classes:xc,classNames:n,styles:o,unstyled:s});return g.jsx(ue,{...S("root"),ref:D,__vars:{"--label-fz":Ie(f),"--label-lh":Ne(f,"label-lh")},mod:[{"label-position":m},b],variant:h,size:f,...C,children:g.jsxs(ue,{component:v,htmlFor:v==="label"?l:void 0,...S("body"),children:[a,g.jsxs("div",{...S("labelWrapper"),"data-disabled":u||void 0,children:[i&&g.jsx(ue,{component:p,htmlFor:p==="label"?l:void 0,...S("label"),"data-disabled":u||void 0,children:i}),c&&g.jsx($e.Description,{size:f,__inheritStyles:!1,...S("description"),children:c}),d&&typeof d!="boolean"&&g.jsx($e.Error,{size:f,__inheritStyles:!1,...S("error"),children:d})]})]})})});wc.displayName="@mantine/core/InlineInput";const Sc=x.createContext(null),jp=Sc.Provider,Cc=()=>x.useContext(Sc),[Ap,Pp]=un();var Dc={card:"m_26775b0a"};const Mp={withBorder:!0},Lp=(e,{radius:t})=>({card:{"--card-radius":Je(t)}}),hs=se((e,t)=>{const r=K("CheckboxCard",Mp,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,checked:l,mod:u,withBorder:d,value:f,onClick:m,defaultChecked:v,onChange:p,...h}=r,y=ye({name:"CheckboxCard",classes:Dc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:Lp,rootSelector:"card"}),w=Cc(),b=typeof l=="boolean"?l:w?w.value.includes(f||""):void 0,[C,D]=bt({value:b,defaultValue:v,finalValue:!1,onChange:p});return g.jsx(Ap,{value:{checked:C},children:g.jsx(tt,{ref:t,mod:[{"with-border":d,checked:C},u],...y("card"),...h,role:"checkbox","aria-checked":C,onClick:S=>{m==null||m(S),w==null||w.onChange(f||""),D(!C)}})})});hs.displayName="@mantine/core/CheckboxCard";hs.classes=Dc;function Ip({children:e,role:t}){const r=Mr();return r?g.jsx("div",{role:t,"aria-labelledby":r.labelId,"aria-describedby":r.describedBy,children:e}):g.jsx(g.Fragment,{children:e})}const Fp={},vs=se((e,t)=>{const{value:r,defaultValue:n,onChange:o,size:s,wrapperProps:a,children:i,readOnly:c,...l}=K("CheckboxGroup",Fp,e),[u,d]=bt({value:r,defaultValue:n,finalValue:[],onChange:o}),f=m=>{const v=typeof m=="string"?m:m.currentTarget.value;!c&&d(u.includes(v)?u.filter(p=>p!==v):[...u,v])};return g.jsx(jp,{value:{value:u,onChange:f,size:s},children:g.jsx($e.Wrapper,{size:s,ref:t,...a,...l,labelElement:"div",__staticSelector:"CheckboxGroup",children:g.jsx(Ip,{role:"group",children:i})})})});vs.classes=$e.Wrapper.classes;vs.displayName="@mantine/core/CheckboxGroup";function gs({size:e,style:t,...r}){const n=e!==void 0?{width:_e(e),height:_e(e),...t}:t;return g.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:n,"aria-hidden":!0,...r,children:g.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function _c({indeterminate:e,...t}){return e?g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:g.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):g.jsx(gs,{...t})}var Rc={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const Vp={icon:_c},zp=(e,{radius:t,color:r,size:n,iconColor:o,variant:s,autoContrast:a})=>{const i=sr({color:r||e.primaryColor,theme:e}),c=i.isThemeColor&&i.shade===void 0?`var(--mantine-color-${i.color}-outline)`:i.color;return{indicator:{"--checkbox-size":Ne(n,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Je(t),"--checkbox-color":s==="outline"?c:xt(r,e),"--checkbox-icon-color":o?xt(o,e):mi(a,e)?fi({color:r,theme:e,autoContrast:a}):void 0}}},ys=se((e,t)=>{const r=K("CheckboxIndicator",Vp,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,icon:l,indeterminate:u,radius:d,color:f,iconColor:m,autoContrast:v,checked:p,mod:h,variant:y,disabled:w,...b}=r,C=l,D=ye({name:"CheckboxIndicator",classes:Rc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:zp,rootSelector:"indicator"}),S=Pp(),O=typeof p=="boolean"||typeof u=="boolean"?p||u:(S==null?void 0:S.checked)||!1;return g.jsx(ue,{ref:t,...D("indicator",{variant:y}),variant:y,mod:[{checked:O,disabled:w},h],...b,children:g.jsx(C,{indeterminate:u,...D("icon")})})});ys.displayName="@mantine/core/CheckboxIndicator";ys.classes=Rc;var Ec={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const Bp={labelPosition:"right",icon:_c},Wp=(e,{radius:t,color:r,size:n,iconColor:o,variant:s,autoContrast:a})=>{const i=sr({color:r||e.primaryColor,theme:e}),c=i.isThemeColor&&i.shade===void 0?`var(--mantine-color-${i.color}-outline)`:i.color;return{root:{"--checkbox-size":Ne(n,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Je(t),"--checkbox-color":s==="outline"?c:xt(r,e),"--checkbox-icon-color":o?xt(o,e):mi(a,e)?fi({color:r,theme:e,autoContrast:a}):void 0}}},dr=se((e,t)=>{const r=K("Checkbox",Bp,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,color:l,label:u,id:d,size:f,radius:m,wrapperProps:v,checked:p,labelPosition:h,description:y,error:w,disabled:b,variant:C,indeterminate:D,icon:S,rootRef:O,iconColor:k,onChange:j,autoContrast:P,mod:L,...V}=r,z=Cc(),M=f||(z==null?void 0:z.size),$=S,_=ye({name:"Checkbox",props:r,classes:Ec,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:Wp}),{styleProps:E,rest:T}=fn(V),N=nr(d),I=z?{checked:z.value.includes(T.value),onChange:Y=>{z.onChange(Y),j==null||j(Y)}}:{},A=x.useRef(null),B=t||A;return x.useEffect(()=>{B&&"current"in B&&B.current&&(B.current.indeterminate=D||!1)},[D,B]),g.jsx(wc,{..._("root"),__staticSelector:"Checkbox",__stylesApiProps:r,id:N,size:M,labelPosition:h,label:u,description:y,error:w,disabled:b,classNames:n,styles:a,unstyled:i,"data-checked":I.checked||p||void 0,variant:C,ref:O,mod:L,...E,...v,children:g.jsxs(ue,{..._("inner"),mod:{"data-label-position":h},children:[g.jsx(ue,{component:"input",id:N,ref:B,checked:p,disabled:b,mod:{error:!!w,indeterminate:D},..._("input",{focusable:!0,variant:C}),onChange:j,...T,...I,type:"checkbox"}),g.jsx($,{indeterminate:D,..._("icon")})]})})});dr.classes={...Ec,...$p};dr.displayName="@mantine/core/Checkbox";dr.Group=vs;dr.Indicator=ys;dr.Card=hs;function _r(e){return"group"in e}function Nc({options:e,search:t,limit:r}){const n=t.trim().toLowerCase(),o=[];for(let s=0;s<e.length;s+=1){const a=e[s];if(o.length===r)return o;_r(a)&&o.push({group:a.group,items:Nc({options:a.items,search:t,limit:r-o.length})}),_r(a)||a.label.toLowerCase().includes(n)&&o.push(a)}return o}function Yp(e){if(e.length===0)return!0;for(const t of e)if(!("group"in t)||t.items.length>0)return!1;return!0}function Tc(e,t=new Set){if(Array.isArray(e))for(const r of e)if(_r(r))Tc(r.items,t);else{if(typeof r.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof r.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof r.value}`);if(t.has(r.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${r.value}" was provided more than once`);t.add(r.value)}}function Hp(e,t){return Array.isArray(e)?e.includes(t):e===t}function Oc({data:e,withCheckIcon:t,value:r,checkIconPosition:n,unstyled:o,renderOption:s}){if(!_r(e)){const i=Hp(r,e.value),c=t&&i&&g.jsx(gs,{className:Ke.optionsDropdownCheckIcon}),l=g.jsxs(g.Fragment,{children:[n==="left"&&c,g.jsx("span",{children:e.label}),n==="right"&&c]});return g.jsx(Ee.Option,{value:e.value,disabled:e.disabled,className:Fe({[Ke.optionsDropdownOption]:!o}),"data-reverse":n==="right"||void 0,"data-checked":i||void 0,"aria-selected":i,active:i,children:typeof s=="function"?s({option:e,checked:i}):l})}const a=e.items.map(i=>g.jsx(Oc,{data:i,value:r,unstyled:o,withCheckIcon:t,checkIconPosition:n,renderOption:s},i.value));return g.jsx(Ee.Group,{label:e.group,children:a})}function Up({data:e,hidden:t,hiddenWhenEmpty:r,filter:n,search:o,limit:s,maxDropdownHeight:a,withScrollArea:i=!0,filterOptions:c=!0,withCheckIcon:l=!1,value:u,checkIconPosition:d,nothingFoundMessage:f,unstyled:m,labelId:v,renderOption:p,scrollAreaProps:h,"aria-label":y}){Tc(e);const b=typeof o=="string"?(n||Nc)({options:e,search:c?o:"",limit:s??1/0}):e,C=Yp(b),D=b.map(S=>g.jsx(Oc,{data:S,withCheckIcon:l,value:u,checkIconPosition:d,unstyled:m,renderOption:p},_r(S)?S.group:S.value));return g.jsx(Ee.Dropdown,{hidden:t||r&&C,"data-composed":!0,children:g.jsxs(Ee.Options,{labelledBy:v,"aria-label":y,children:[i?g.jsx(jr.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...h,children:D}):D,C&&f&&g.jsx(Ee.Empty,{children:f})]})})}var fr={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const Sa={orientation:"horizontal"},Gp=(e,{borderWidth:t})=>({group:{"--button-border-width":_e(t)}}),bs=se((e,t)=>{const r=K("ButtonGroup",Sa,e),{className:n,style:o,classNames:s,styles:a,unstyled:i,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,...m}=K("ButtonGroup",Sa,e),v=ye({name:"ButtonGroup",props:r,classes:fr,className:n,style:o,classNames:s,styles:a,unstyled:i,vars:l,varsResolver:Gp,rootSelector:"group"});return g.jsx(ue,{...v("group"),ref:t,variant:d,mod:[{"data-orientation":c},f],role:"group",...m})});bs.classes=fr;bs.displayName="@mantine/core/ButtonGroup";const Ca={},qp=(e,{radius:t,color:r,gradient:n,variant:o,autoContrast:s,size:a})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:n,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":Ne(a,"section-height"),"--section-padding-x":Ne(a,"section-padding-x"),"--section-fz":a!=null&&a.includes("compact")?Ie(a.replace("compact-","")):Ie(a),"--section-radius":t===void 0?void 0:Je(t),"--section-bg":r||o?i.background:void 0,"--section-color":i.color,"--section-bd":r||o?i.border:void 0}}},xs=se((e,t)=>{const r=K("ButtonGroupSection",Ca,e),{className:n,style:o,classNames:s,styles:a,unstyled:i,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,...m}=K("ButtonGroupSection",Ca,e),v=ye({name:"ButtonGroupSection",props:r,classes:fr,className:n,style:o,classNames:s,styles:a,unstyled:i,vars:c,varsResolver:qp,rootSelector:"groupSection"});return g.jsx(ue,{...v("groupSection"),ref:t,variant:l,...m})});xs.classes=fr;xs.displayName="@mantine/core/ButtonGroupSection";const Xp={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${_e(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},Kp={},Zp=(e,{radius:t,color:r,gradient:n,variant:o,size:s,justify:a,autoContrast:i})=>{const c=e.variantColorResolver({color:r||e.primaryColor,theme:e,gradient:n,variant:o||"filled",autoContrast:i});return{root:{"--button-justify":a,"--button-height":Ne(s,"button-height"),"--button-padding-x":Ne(s,"button-padding-x"),"--button-fz":s!=null&&s.includes("compact")?Ie(s.replace("compact-","")):Ie(s),"--button-radius":t===void 0?void 0:Je(t),"--button-bg":r||o?c.background:void 0,"--button-hover":r||o?c.hover:void 0,"--button-color":c.color,"--button-bd":r||o?c.border:void 0,"--button-hover-color":r||o?c.hoverColor:void 0}}},tr=Ct((e,t)=>{const r=K("Button",Kp,e),{style:n,vars:o,className:s,color:a,disabled:i,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:m,loading:v,loaderProps:p,gradient:h,classNames:y,styles:w,unstyled:b,"data-disabled":C,autoContrast:D,mod:S,...O}=r,k=ye({name:"Button",props:r,classes:fr,className:s,style:n,classNames:y,styles:w,unstyled:b,vars:o,varsResolver:Zp}),j=!!l,P=!!u;return g.jsxs(tt,{ref:t,...k("root",{active:!i&&!v&&!C}),unstyled:b,variant:f,disabled:i||v,mod:[{disabled:i||C,loading:v,block:d,"with-left-section":j,"with-right-section":P},S],...O,children:[g.jsx(zt,{mounted:!!v,transition:Xp,duration:150,children:L=>g.jsx(ue,{component:"span",...k("loader",{style:L}),"aria-hidden":!0,children:g.jsx(Ar,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...p})})}),g.jsxs("span",{...k("inner"),children:[l&&g.jsx(ue,{component:"span",...k("section"),mod:{position:"left"},children:l}),g.jsx(ue,{component:"span",mod:{loading:v},...k("label"),children:c}),u&&g.jsx(ue,{component:"span",...k("section"),mod:{position:"right"},children:u})]})]})});tr.classes=fr;tr.displayName="@mantine/core/Button";tr.Group=bs;tr.GroupSection=xs;var kc={root:"m_e9408a47","root--default":"m_84c9523a","root--filled":"m_ef274e49","root--unstyled":"m_eda993d3",legend:"m_90794832","legend--unstyled":"m_74ca27fe"};const Jp={variant:"default"},Qp=(e,{radius:t})=>({root:{"--fieldset-radius":t===void 0?void 0:Je(t)}}),ws=se((e,t)=>{const r=K("Fieldset",Jp,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,legend:l,variant:u,children:d,...f}=r,m=ye({name:"Fieldset",classes:kc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:Qp});return g.jsxs(ue,{component:"fieldset",ref:t,variant:u,...m("root",{variant:u}),...f,children:[l&&g.jsx("legend",{...m("legend",{variant:u}),children:l}),d]})});ws.classes=kc;ws.displayName="@mantine/core/Fieldset";function Eo(){return Eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eo.apply(null,arguments)}function eh(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var th=x.useLayoutEffect,rh=function(t){var r=x.useRef(t);return th(function(){r.current=t}),r},Da=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},nh=function(t,r){var n=x.useRef();return x.useCallback(function(o){t.current=o,n.current&&Da(n.current,null),n.current=r,r&&Da(r,o)},[r])},_a={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},oh=function(t){Object.keys(_a).forEach(function(r){t.style.setProperty(r,_a[r],"important")})},Ra=oh,Ge=null,Ea=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function sh(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Ge||(Ge=document.createElement("textarea"),Ge.setAttribute("tabindex","-1"),Ge.setAttribute("aria-hidden","true"),Ra(Ge)),Ge.parentNode===null&&document.body.appendChild(Ge);var o=e.paddingSize,s=e.borderSize,a=e.sizingStyle,i=a.boxSizing;Object.keys(a).forEach(function(f){var m=f;Ge.style[m]=a[m]}),Ra(Ge),Ge.value=t;var c=Ea(Ge,e);Ge.value=t,c=Ea(Ge,e),Ge.value="x";var l=Ge.scrollHeight-o,u=l*r;i==="border-box"&&(u=u+o+s),c=Math.max(u,c);var d=l*n;return i==="border-box"&&(d=d+o+s),c=Math.min(d,c),[c,l]}var Na=function(){},ah=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},ih=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],ch=!!document.documentElement.currentStyle,lh=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=ah(ih,r),o=n.boxSizing;if(o==="")return null;ch&&o==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var s=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:s,borderSize:a}},uh=lh;function Ss(e,t,r){var n=rh(r);G.useLayoutEffect(function(){var o=function(a){return n.current(a)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var dh=function(t,r){Ss(document.body,"reset",function(n){t.current.form===n.target&&r(n)})},fh=function(t){Ss(window,"resize",t)},mh=function(t){Ss(document.fonts,"loadingdone",t)},ph=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],hh=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,s=t.minRows,a=t.onChange,i=a===void 0?Na:a,c=t.onHeightChange,l=c===void 0?Na:c,u=eh(t,ph),d=u.value!==void 0,f=G.useRef(null),m=nh(f,r),v=G.useRef(0),p=G.useRef(),h=function(){var b=f.current,C=n&&p.current?p.current:uh(b);if(C){p.current=C;var D=sh(C,b.value||b.placeholder||"x",s,o),S=D[0],O=D[1];v.current!==S&&(v.current=S,b.style.setProperty("height",S+"px","important"),l(S,{rowHeight:O}))}},y=function(b){d||h(),i(b)};return G.useLayoutEffect(h),dh(f,function(){if(!d){var w=f.current.value;requestAnimationFrame(function(){var b=f.current;b&&w!==b.value&&h()})}}),fh(h),mh(h),G.createElement("textarea",Eo({},u,{onChange:y,ref:m}))},vh=G.forwardRef(hh);const gh={},Cs=se((e,t)=>{const{autosize:r,maxRows:n,minRows:o,__staticSelector:s,resize:a,...i}=K("Textarea",gh,e),c=r&&Vu()!=="test",l=c?{maxRows:n,minRows:o}:{};return g.jsx(st,{component:c?vh:"textarea",ref:t,...i,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":r&&n===void 0||void 0,__vars:{"--input-resize":a},...l})});Cs.classes=st.classes;Cs.displayName="@mantine/core/Textarea";const[yh,mr]=or("Modal component was not found in tree");var _t={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const bh={},_n=se((e,t)=>{const r=K("ModalBody",bh,e),{classNames:n,className:o,style:s,styles:a,vars:i,...c}=r,l=mr();return g.jsx(oc,{ref:t,...l.getStyles("body",{classNames:n,style:s,styles:a,className:o}),...c})});_n.classes=_t;_n.displayName="@mantine/core/ModalBody";const xh={},Rn=se((e,t)=>{const r=K("ModalCloseButton",xh,e),{classNames:n,className:o,style:s,styles:a,vars:i,...c}=r,l=mr();return g.jsx(sc,{ref:t,...l.getStyles("close",{classNames:n,style:s,styles:a,className:o}),...c})});Rn.classes=_t;Rn.displayName="@mantine/core/ModalCloseButton";const wh={},En=se((e,t)=>{const r=K("ModalContent",wh,e),{classNames:n,className:o,style:s,styles:a,vars:i,children:c,__hidden:l,...u}=r,d=mr(),f=d.scrollAreaComponent||Gm;return g.jsx(ac,{...d.getStyles("content",{className:o,style:s,styles:a,classNames:n}),innerProps:d.getStyles("inner",{className:o,style:s,styles:a,classNames:n}),"data-full-screen":d.fullScreen||void 0,"data-modal-content":!0,"data-hidden":l||void 0,ref:t,...u,children:g.jsx(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${_e(d.yOffset)} * 2))`},children:c})})});En.classes=_t;En.displayName="@mantine/core/ModalContent";const Sh={},Nn=se((e,t)=>{const r=K("ModalHeader",Sh,e),{classNames:n,className:o,style:s,styles:a,vars:i,...c}=r,l=mr();return g.jsx(ic,{ref:t,...l.getStyles("header",{classNames:n,style:s,styles:a,className:o}),...c})});Nn.classes=_t;Nn.displayName="@mantine/core/ModalHeader";const Ch={},Tn=se((e,t)=>{const r=K("ModalOverlay",Ch,e),{classNames:n,className:o,style:s,styles:a,vars:i,...c}=r,l=mr();return g.jsx(cc,{ref:t,...l.getStyles("overlay",{classNames:n,style:s,styles:a,className:o}),...c})});Tn.classes=_t;Tn.displayName="@mantine/core/ModalOverlay";const Dh={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Ft("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},_h=(e,{radius:t,size:r,yOffset:n,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Je(t),"--modal-size":Ne(r,"modal-size"),"--modal-y-offset":_e(n),"--modal-x-offset":_e(o)}}),On=se((e,t)=>{const r=K("ModalRoot",Dh,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,yOffset:l,scrollAreaComponent:u,radius:d,fullScreen:f,centered:m,xOffset:v,__staticSelector:p,...h}=r,y=ye({name:p,classes:_t,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:_h});return g.jsx(yh,{value:{yOffset:l,scrollAreaComponent:u,getStyles:y,fullScreen:f},children:g.jsx(nc,{ref:t,...y("root"),"data-full-screen":f||void 0,"data-centered":m||void 0,unstyled:i,...h})})});On.classes=_t;On.displayName="@mantine/core/ModalRoot";const[Rh,Eh]=un();function $c({children:e}){const[t,r]=x.useState([]),[n,o]=x.useState(Ft("modal"));return g.jsx(Rh,{value:{stack:t,addModal:(s,a)=>{r(i=>[...new Set([...i,s])]),o(i=>typeof a=="number"&&typeof i=="number"?Math.max(i,a):i)},removeModal:s=>r(a=>a.filter(i=>i!==s)),getZIndex:s=>`calc(${n} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:n},children:e})}$c.displayName="@mantine/core/ModalStack";const Nh={},kn=se((e,t)=>{const r=K("ModalTitle",Nh,e),{classNames:n,className:o,style:s,styles:a,vars:i,...c}=r,l=mr();return g.jsx(lc,{ref:t,...l.getStyles("title",{classNames:n,style:s,styles:a,className:o}),...c})});kn.classes=_t;kn.displayName="@mantine/core/ModalTitle";const Th={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Ft("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},dt=se((e,t)=>{const{title:r,withOverlay:n,overlayProps:o,withCloseButton:s,closeButtonProps:a,children:i,radius:c,opened:l,stackId:u,zIndex:d,...f}=K("Modal",Th,e),m=Eh(),v=!!r||s,p=m&&u?{closeOnEscape:m.currentId===u,trapFocus:m.currentId===u,zIndex:m.getZIndex(u)}:{},h=n===!1?!1:u&&m?m.currentId===u:l;return x.useEffect(()=>{m&&u&&(l?m.addModal(u,d||Ft("modal")):m.removeModal(u))},[l,u,d]),g.jsxs(On,{ref:t,radius:c,opened:l,zIndex:m&&u?m.getZIndex(u):d,...f,...p,children:[n&&g.jsx(Tn,{visible:h,transitionProps:m&&u?{duration:0}:void 0,...o}),g.jsxs(En,{radius:c,__hidden:m&&u&&l?u!==m.currentId:!1,children:[v&&g.jsxs(Nn,{children:[r&&g.jsx(kn,{children:r}),s&&g.jsx(Rn,{...a})]}),g.jsx(_n,{children:i})]})]})});dt.classes=_t;dt.displayName="@mantine/core/Modal";dt.Root=On;dt.Overlay=Tn;dt.Content=En;dt.Body=_n;dt.Header=Nn;dt.Title=kn;dt.CloseButton=Rn;dt.Stack=$c;function jc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}var Rr;(function(e){e.event="event",e.props="prop"})(Rr||(Rr={}));function Tt(){}function Oh(e){var t,r=void 0;return function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return t&&n.length===t.length&&n.every(function(s,a){return s===t[a]})||(t=n,r=e.apply(void 0,n)),r}}function Er(e){return!!(e||"").match(/\d/)}function Kt(e){return e==null}function kh(e){return typeof e=="number"&&isNaN(e)}function Ac(e){return Kt(e)||kh(e)||typeof e=="number"&&!isFinite(e)}function Pc(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function $h(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function jh(e,t,r){var n=$h(r),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(n,"$1"+t)}function Ah(e){var t=x.useRef(e);t.current=e;var r=x.useRef(function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return t.current.apply(t,n)});return r.current}function Ds(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var o=e.split("."),s=o[0],a=o[1]||"";return{beforeDecimal:s,afterDecimal:a,hasNegation:r,addNegation:n}}function Ph(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",o=r[1]||"";return(t?"-":"")+n+(o?"."+o:"")}function Mc(e,t,r){for(var n="",o=r?"0":"",s=0;s<=t-1;s++)n+=e[s]||o;return n}function Ta(e,t){return Array(t+1).join(e)}function Lc(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),o=n[0],s=n[1];if(s=Number(s),!s)return r+o;o=o.replace(".","");var a=1+s,i=o.length;return a<0?o="0."+Ta("0",Math.abs(a))+o:a>=i?o=o+Ta("0",a-i):o=(o.substring(0,a)||"0")+"."+o.substring(a),r+o}function Oa(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,o=Ds(e),s=o.beforeDecimal,a=o.afterDecimal,i=o.hasNegation,c=parseFloat("0."+(a||"0")),l=a.length<=t?"0."+a:c.toFixed(t),u=l.split("."),d=s;s&&Number(u[0])&&(d=s.split("").reverse().reduce(function(p,h,y){return p.length>y?(Number(p[0])+Number(h)).toString()+p.substring(1,p.length):h+p},u[0]));var f=Mc(u[1]||"",t,r),m=i?"-":"",v=n?".":"";return""+m+d+v+f}function Mt(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Ic=Oh(function(e,t){for(var r=0,n=0,o=e.length,s=t.length;e[r]===t[r]&&r<o;)r++;for(;e[o-1-n]===t[s-1-n]&&s-n>r&&o-n>r;)n++;return{from:{start:r,end:o-n},to:{start:r,end:s-n}}}),Mh=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function Lh(e,t,r){return Math.min(Math.max(e,t),r)}function ao(e){return Math.max(e.selectionStart,e.selectionEnd)}function Ih(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Fh(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function Vh(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,o=e.formattedValueIndex;return t[n]===r[o]}function zh(e,t,r,n,o,s,a){a===void 0&&(a=Vh);var i=o.findIndex(function(C){return C}),c=e.slice(0,i);!t&&!r.startsWith(c)&&(t=c,r=c+r,n=n+c.length);for(var l=r.length,u=e.length,d={},f=new Array(l),m=0;m<l;m++){f[m]=-1;for(var v=0,p=u;v<p;v++){var h=a({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:m,formattedValueIndex:v});if(h&&d[v]!==!0){f[m]=v,d[v]=!0;break}}}for(var y=n;y<l&&(f[y]===-1||!s(r[y]));)y++;var w=y===l||f[y]===-1?u:f[y];for(y=n-1;y>0&&f[y]===-1;)y--;var b=y===-1||f[y]===-1?0:f[y]+1;return b>w?w:n-b<w-n?b:w}function ka(e,t,r,n){var o=e.length;if(t=Lh(t,0,o),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=o&&!r[t];)t++;t>o&&(t=r.lastIndexOf(!0))}return t===-1&&(t=o),t}function Bh(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(Er(e[r])||Er(e[r-1]));return t}function Fc(e,t,r,n,o,s){s===void 0&&(s=Tt);var a=Ah(function(v,p){var h,y;return Ac(v)?(y="",h=""):typeof v=="number"||p?(y=typeof v=="number"?Lc(v):v,h=n(y)):(y=o(v,void 0),h=n(y)),{formattedValue:h,numAsString:y}}),i=x.useState(function(){return a(Kt(e)?t:e,r)}),c=i[0],l=i[1],u=function(v,p){v.formattedValue!==c.formattedValue&&l({formattedValue:v.formattedValue,numAsString:v.value}),s(v,p)},d=e,f=r;Kt(e)&&(d=c.numAsString,f=!0);var m=a(d,f);return x.useMemo(function(){l(m)},[m.formattedValue]),[c,u]}function Wh(e){return e.replace(/[^0-9]/g,"")}function Yh(e){return e}function Hh(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,o=e.renderText,s=e.getInputRef,a=e.format;a===void 0&&(a=Yh);var i=e.removeFormatting;i===void 0&&(i=Wh);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,d=e.isAllowed,f=e.onChange;f===void 0&&(f=Tt);var m=e.onKeyDown;m===void 0&&(m=Tt);var v=e.onMouseUp;v===void 0&&(v=Tt);var p=e.onFocus;p===void 0&&(p=Tt);var h=e.onBlur;h===void 0&&(h=Tt);var y=e.value,w=e.getCaretBoundary;w===void 0&&(w=Bh);var b=e.isValidInputCharacter;b===void 0&&(b=Er);var C=e.isCharacterSame,D=jc(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),S=Fc(y,c,!!l,a,i,u),O=S[0],k=O.formattedValue,j=O.numAsString,P=S[1],L=x.useRef(),V=x.useRef({formattedValue:k,numAsString:j}),z=function(U,J){V.current={formattedValue:U.formattedValue,numAsString:U.value},P(U,J)},M=x.useState(!1),$=M[0],_=M[1],E=x.useRef(null),T=x.useRef({setCaretTimeout:null,focusTimeout:null});x.useEffect(function(){return _(!0),function(){clearTimeout(T.current.setCaretTimeout),clearTimeout(T.current.focusTimeout)}},[]);var N=a,I=function(U,J){var ee=parseFloat(J);return{formattedValue:U,value:J,floatValue:isNaN(ee)?void 0:ee}},A=function(U,J,ee){U.selectionStart===0&&U.selectionEnd===U.value.length||(Mt(U,J),T.current.setCaretTimeout=setTimeout(function(){U.value===ee&&U.selectionStart!==J&&Mt(U,J)},0))},B=function(U,J,ee){return ka(U,J,w(U),ee)},Y=function(U,J,ee){var de=w(J),be=zh(J,k,U,ee,de,b,C);return be=ka(J,be,de),be},te=function(U){var J=U.formattedValue;J===void 0&&(J="");var ee=U.input,de=U.source,be=U.event,oe=U.numAsString,he;if(ee){var H=U.inputValue||ee.value,ce=ao(ee);ee.value=J,he=Y(H,J,ce),he!==void 0&&A(ee,he,J)}J!==k&&z(I(J,oe),{event:be,source:de})};x.useEffect(function(){var U=V.current,J=U.formattedValue,ee=U.numAsString;(k!==J||j!==ee)&&z(I(k,j),{event:void 0,source:Rr.props})},[k,j]);var F=E.current?ao(E.current):void 0,Q=typeof window<"u"?x.useLayoutEffect:x.useEffect;Q(function(){var U=E.current;if(k!==V.current.formattedValue&&U){var J=Y(V.current.formattedValue,k,F);U.value=k,A(U,J,k)}},[k]);var re=function(U,J,ee){var de=J.target,be=L.current?Mh(L.current,de.selectionEnd):Ic(k,U),oe=Object.assign(Object.assign({},be),{lastValue:k}),he=i(U,oe),H=N(he);if(he=i(H,void 0),d&&!d(I(H,he))){var ce=J.target,we=ao(ce),Oe=Y(U,k,we);return ce.value=k,A(ce,Oe,k),!1}return te({formattedValue:H,numAsString:he,inputValue:U,event:J,source:ee,input:J.target}),!0},ae=function(U,J){J===void 0&&(J=0);var ee=U.selectionStart,de=U.selectionEnd;L.current={selectionStart:ee,selectionEnd:de+J}},Z=function(U){var J=U.target,ee=J.value,de=re(ee,U,Rr.event);de&&f(U),L.current=void 0},le=function(U){var J=U.target,ee=U.key,de=J.selectionStart,be=J.selectionEnd,oe=J.value;oe===void 0&&(oe="");var he;ee==="ArrowLeft"||ee==="Backspace"?he=Math.max(de-1,0):ee==="ArrowRight"?he=Math.min(de+1,oe.length):ee==="Delete"&&(he=de);var H=0;ee==="Delete"&&de===be&&(H=1);var ce=ee==="ArrowLeft"||ee==="ArrowRight";if(he===void 0||de!==be&&!ce){m(U),ae(J,H);return}var we=he;if(ce){var Oe=ee==="ArrowLeft"?"left":"right";we=B(oe,he,Oe),we!==he&&U.preventDefault()}else ee==="Delete"&&!b(oe[he])?we=B(oe,he,"right"):ee==="Backspace"&&!b(oe[he])&&(we=B(oe,he,"left"));we!==he&&A(J,we,oe),m(U),ae(J,H)},ie=function(U){var J=U.target,ee=function(){var de=J.selectionStart,be=J.selectionEnd,oe=J.value;if(oe===void 0&&(oe=""),de===be){var he=B(oe,de);he!==de&&A(J,he,oe)}};ee(),requestAnimationFrame(function(){ee()}),v(U),ae(J)},pe=function(U){U.persist&&U.persist();var J=U.target,ee=U.currentTarget;E.current=J,T.current.focusTimeout=setTimeout(function(){var de=J.selectionStart,be=J.selectionEnd,oe=J.value;oe===void 0&&(oe="");var he=B(oe,de);he!==de&&!(de===0&&be===oe.length)&&A(J,he,oe),p(Object.assign(Object.assign({},U),{currentTarget:ee}))},0)},X=function(U){E.current=null,clearTimeout(T.current.focusTimeout),clearTimeout(T.current.setCaretTimeout),h(U)},me=$&&Ih()?"numeric":void 0,fe=Object.assign({inputMode:me},D,{type:t,value:k,onChange:Z,onKeyDown:le,onMouseUp:ie,onFocus:pe,onBlur:X});if(r==="text")return o?x.createElement(x.Fragment,null,o(k,D)||null):x.createElement("span",Object.assign({},D,{ref:s}),k);if(n){var ge=n;return x.createElement(ge,Object.assign({},fe,{ref:s}))}return x.createElement("input",Object.assign({},fe,{ref:s}))}function $a(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var s=t.suffix;s===void 0&&(s="");var a=t.allowNegative,i=t.thousandsGroupStyle;if(i===void 0&&(i="thousand"),e===""||e==="-")return e;var c=$n(t),l=c.thousandSeparator,u=c.decimalSeparator,d=r!==0&&e.indexOf(".")!==-1||r&&n,f=Ds(e,a),m=f.beforeDecimal,v=f.afterDecimal,p=f.addNegation;return r!==void 0&&(v=Mc(v,r,!!n)),l&&(m=jh(m,l,i)),o&&(m=o+m),s&&(v=v+s),p&&(m="-"+m),e=m+(d&&u||"")+v,e}function $n(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function Uh(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),o=r.test(e),s=n.test(e);return e=e.replace(/-/g,""),o&&!s&&t&&(e="-"+e),e}function Gh(e,t){return new RegExp("(^-)|[0-9]|"+Pc(e),"g")}function qh(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function Xh(e,t,r){var n;t===void 0&&(t=Fh(e));var o=r.allowNegative,s=r.prefix;s===void 0&&(s="");var a=r.suffix;a===void 0&&(a="");var i=r.decimalScale,c=t.from,l=t.to,u=l.start,d=l.end,f=$n(r),m=f.allowedDecimalSeparators,v=f.decimalSeparator,p=e[d]===v;if(Er(e)&&(e===s||e===a)&&t.lastValue==="")return e;if(d-u===1&&m.indexOf(e[u])!==-1){var h=i===0?"":v;e=e.substring(0,u)+h+e.substring(u+1,e.length)}var y=function(E,T,N){var I=!1,A=!1;s.startsWith("-")?I=!1:E.startsWith("--")?(I=!1,A=!0):a.startsWith("-")&&E.length===a.length?I=!1:E[0]==="-"&&(I=!0);var B=I?1:0;return A&&(B=2),B&&(E=E.substring(B),T-=B,N-=B),{value:E,start:T,end:N,hasNegation:I}},w=y(e,u,d),b=w.hasNegation;n=w,e=n.value,u=n.start,d=n.end;var C=y(t.lastValue,c.start,c.end),D=C.start,S=C.end,O=C.value,k=e.substring(u,d);e.length&&O.length&&(D>O.length-a.length||S<s.length)&&!(k&&a.startsWith(k))&&(e=O);var j=0;e.startsWith(s)?j+=s.length:u<s.length&&(j=u),e=e.substring(j),d-=j;var P=e.length,L=e.length-a.length;e.endsWith(a)?P=L:(d>L||d>e.length-a.length)&&(P=d),e=e.substring(0,P),e=Uh(b?"-"+e:e,o),e=(e.match(Gh(v))||[]).join("");var V=e.indexOf(v);e=e.replace(new RegExp(Pc(v),"g"),function(E,T){return T===V?".":""});var z=Ds(e,o),M=z.beforeDecimal,$=z.afterDecimal,_=z.addNegation;return l.end-l.start<c.end-c.start&&M===""&&p&&!parseFloat($)&&(e=_?"-":""),e}function Kh(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var o=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";o.fill(!1,0,r.length+(s?1:0));var a=e.length;return o.fill(!1,a-n.length+1,a+1),o}function Zh(e){var t=$n(e),r=t.thousandSeparator,n=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var s=e.allowNegative;if(s===void 0&&(s=!0),r===n)throw new Error(`
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function Jh(e){e=Zh(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=Tt);var s=e.onBlur;s===void 0&&(s=Tt);var a=e.thousandSeparator,i=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,m=e.onValueChange,v=jc(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),p=$n(e),h=p.decimalSeparator,y=p.allowedDecimalSeparators,w=function(_){return $a(_,e)},b=function(_,E){return Xh(_,E,e)},C=Kt(d)?u:d,D=f??qh(C,l,t);Kt(d)?Kt(u)||(D=D||typeof u=="number"):D=D||typeof d=="number";var S=function(_){return Ac(_)?_:(typeof _=="number"&&(_=Lc(_)),D&&typeof i=="number"?Oa(_,i,!!c):_)},O=Fc(S(d),S(u),!!D,w,b,m),k=O[0],j=k.numAsString,P=k.formattedValue,L=O[1],V=function(_){var E=_.target,T=_.key,N=E.selectionStart,I=E.selectionEnd,A=E.value;if(A===void 0&&(A=""),(T==="Backspace"||T==="Delete")&&I<l.length){_.preventDefault();return}if(N!==I){o(_);return}T==="Backspace"&&A[0]==="-"&&N===l.length+1&&r&&Mt(E,1),i&&c&&(T==="Backspace"&&A[N-1]===h?(Mt(E,N-1),_.preventDefault()):T==="Delete"&&A[N]===h&&_.preventDefault()),y!=null&&y.includes(T)&&A[N]===h&&Mt(E,N+1);var B=a===!0?",":a;T==="Backspace"&&A[N-1]===B&&Mt(E,N-1),T==="Delete"&&A[N]===B&&Mt(E,N+1),o(_)},z=function(_){var E=j;if(E.match(/\d/g)||(E=""),n||(E=Ph(E)),c&&i&&(E=Oa(E,i,c)),E!==j){var T=$a(E,e);L({formattedValue:T,value:E,floatValue:parseFloat(E)},{event:_,source:Rr.event})}s(_)},M=function(_){return _===h?!0:Er(_)},$=function(_){var E=_.currentValue,T=_.lastValue,N=_.formattedValue,I=_.currentValueIndex,A=_.formattedValueIndex,B=E[I],Y=N[A],te=Ic(T,E),F=te.to,Q=function(re){return b(re).indexOf(".")+l.length};return d===0&&c&&i&&E[F.start]===h&&Q(E)<I&&Q(N)>A?!1:I>=F.start&&I<F.end&&y&&y.includes(B)&&Y===h?!0:B===Y};return Object.assign(Object.assign({},v),{value:P,valueIsNumericString:!1,isValidInputCharacter:M,isCharacterSame:$,onValueChange:L,format:w,removeFormatting:b,getCaretBoundary:function(_){return Kh(_,e)},onKeyDown:V,onBlur:z})}function Qh(e){var t=Jh(e);return x.createElement(Hh,Object.assign({},t))}function ja({direction:e,style:t,...r}){return g.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:g.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var No={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const ev=/^(0\.0*|-0(\.0*)?)$/,tv=/^-?0\d+(\.\d+)?\.?$/;function To(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function io(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||To(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function rv(e){return e.toString().replace(".","").length}function nv(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&rv(t)<14&&t!==""}function Aa(e,t,r){if(e===void 0)return!0;const n=t===void 0||e>=t,o=r===void 0||e<=r;return n&&o}const ov={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},sv=(e,{size:t})=>({controls:{"--ni-chevron-size":Ne(t,"ni-chevron-size")}}),_s=se((e,t)=>{const r=K("NumberInput",ov,e),{className:n,classNames:o,styles:s,unstyled:a,vars:i,onChange:c,onValueChange:l,value:u,defaultValue:d,max:f,min:m,step:v,hideControls:p,rightSection:h,isAllowed:y,clampBehavior:w,onBlur:b,allowDecimal:C,decimalScale:D,onKeyDown:S,onKeyDownCapture:O,handlersRef:k,startValue:j,disabled:P,rightSectionPointerEvents:L,allowNegative:V,readOnly:z,size:M,rightSectionWidth:$,stepHoldInterval:_,stepHoldDelay:E,allowLeadingZeros:T,withKeyboardEvents:N,trimLeadingZeroesOnBlur:I,...A}=r,B=ye({name:"NumberInput",classes:No,props:r,classNames:o,styles:s,unstyled:a,vars:i,varsResolver:sv}),{resolvedClassNames:Y,resolvedStyles:te}=St({classNames:o,styles:s,props:r}),[F,Q]=bt({value:u,defaultValue:d,finalValue:"",onChange:c}),re=E!==void 0&&_!==void 0,ae=x.useRef(null),Z=x.useRef(null),le=x.useRef(0),ie=(H,ce)=>{ce.source==="event"&&Q(nv(H.floatValue,H.value)&&!ev.test(H.value)&&!(T&&tv.test(H.value))?H.floatValue:H.value),l==null||l(H,ce)},pe=H=>{const ce=String(H).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ce?Math.max(0,(ce[1]?ce[1].length:0)-(ce[2]?+ce[2]:0)):0},X=H=>{ae.current&&typeof H<"u"&&ae.current.setSelectionRange(H,H)},me=x.useRef(vo);me.current=()=>{if(!io(F))return;let H;const ce=pe(F),we=pe(v),Oe=Math.max(ce,we),De=10**Oe;if(!To(F)&&(typeof F!="number"||Number.isNaN(F)))H=Cr(j,m,f);else if(f!==void 0){const Pe=(Math.round(Number(F)*De)+Math.round(v*De))/De;H=Pe<=f?Pe:f}else H=(Math.round(Number(F)*De)+Math.round(v*De))/De;const je=H.toFixed(Oe);Q(parseFloat(je)),l==null||l({floatValue:parseFloat(je),formattedValue:je,value:je},{source:"increment"}),setTimeout(()=>{var Pe;return X((Pe=ae.current)==null?void 0:Pe.value.length)},0)};const fe=x.useRef(vo);fe.current=()=>{if(!io(F))return;let H;const ce=m!==void 0?m:V?Number.MIN_SAFE_INTEGER:0,we=pe(F),Oe=pe(v),De=Math.max(we,Oe),je=10**De;if(!To(F)&&typeof F!="number"||Number.isNaN(F))H=Cr(j,ce,f);else{const Re=(Math.round(Number(F)*je)-Math.round(v*je))/je;H=ce!==void 0&&Re<ce?ce:Re}const Pe=H.toFixed(De);Q(parseFloat(Pe)),l==null||l({floatValue:parseFloat(Pe),formattedValue:Pe,value:Pe},{source:"decrement"}),setTimeout(()=>{var Re;return X((Re=ae.current)==null?void 0:Re.value.length)},0)};const ge=H=>{S==null||S(H),!(z||!N)&&(H.key==="ArrowUp"&&(H.preventDefault(),me.current()),H.key==="ArrowDown"&&(H.preventDefault(),fe.current()))},U=H=>{if(O==null||O(H),H.key==="Backspace"){const ce=ae.current;ce.selectionStart===0&&ce.selectionStart===ce.selectionEnd&&(H.preventDefault(),window.setTimeout(()=>X(0),0))}},J=H=>{let ce=F;if(w==="blur"&&typeof ce=="number"&&(ce=Cr(ce,m,f)),I&&typeof ce=="string"&&pe(ce)<15){const we=ce.toString().replace(/^0+/,""),Oe=parseFloat(we);ce=Number.isNaN(Oe)||Oe>Number.MAX_SAFE_INTEGER?we:Cr(Oe,m,f)}F!==ce&&Q(ce),b==null||b(H)};rn(k,{increment:me.current,decrement:fe.current});const ee=H=>{H?me.current():fe.current(),le.current+=1},de=H=>{if(ee(H),re){const ce=typeof _=="number"?_:_(le.current);Z.current=window.setTimeout(()=>de(H),ce)}},be=(H,ce)=>{var we;H.preventDefault(),(we=ae.current)==null||we.focus(),ee(ce),re&&(Z.current=window.setTimeout(()=>de(ce),E))},oe=()=>{Z.current&&window.clearTimeout(Z.current),Z.current=null,le.current=0},he=g.jsxs("div",{...B("controls"),children:[g.jsx(tt,{...B("control"),tabIndex:-1,"aria-hidden":!0,disabled:P||typeof F=="number"&&f!==void 0&&F>=f,mod:{direction:"up"},onMouseDown:H=>H.preventDefault(),onPointerDown:H=>{be(H,!0)},onPointerUp:oe,onPointerLeave:oe,children:g.jsx(ja,{direction:"up"})}),g.jsx(tt,{...B("control"),tabIndex:-1,"aria-hidden":!0,disabled:P||typeof F=="number"&&m!==void 0&&F<=m,mod:{direction:"down"},onMouseDown:H=>H.preventDefault(),onPointerDown:H=>{be(H,!1)},onPointerUp:oe,onPointerLeave:oe,children:g.jsx(ja,{direction:"down"})})]});return g.jsx(st,{component:Qh,allowNegative:V,className:Fe(No.root,n),size:M,...A,readOnly:z,disabled:P,value:F,getInputRef:Ze(t,ae),onValueChange:ie,rightSection:p||z||!io(F)?h:h||he,classNames:Y,styles:te,unstyled:a,__staticSelector:"NumberInput",decimalScale:C?D:0,onKeyDown:ge,onKeyDownCapture:U,rightSectionPointerEvents:L??(P?"none":void 0),rightSectionWidth:$??`var(--ni-right-section-width-${M||"sm"})`,allowLeadingZeros:T,onBlur:J,isAllowed:H=>w==="strict"?y?y(H)&&Aa(H.floatValue,m,f):Aa(H.floatValue,m,f):y?y(H):!0})});_s.classes={...st.classes,...No};_s.displayName="@mantine/core/NumberInput";const av={searchable:!1,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},Rs=se((e,t)=>{const r=K("Select",av,e),{classNames:n,styles:o,unstyled:s,vars:a,dropdownOpened:i,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:m,onChange:v,data:p,value:h,defaultValue:y,selectFirstOptionOnChange:w,onOptionSubmit:b,comboboxProps:C,readOnly:D,disabled:S,filter:O,limit:k,withScrollArea:j,maxDropdownHeight:P,size:L,searchable:V,rightSection:z,checkIconPosition:M,withCheckIcon:$,nothingFoundMessage:_,name:E,form:T,searchValue:N,defaultSearchValue:I,onSearchChange:A,allowDeselect:B,error:Y,rightSectionPointerEvents:te,id:F,clearable:Q,clearButtonProps:re,hiddenInputProps:ae,renderOption:Z,onClear:le,autoComplete:ie,scrollAreaProps:pe,__defaultRightSection:X,__clearSection:me,__clearable:fe,chevronColor:ge,...U}=r,J=x.useMemo(()=>dp(p),[p]),ee=x.useMemo(()=>mc(J),[J]),de=nr(F),[be,oe,he]=bt({value:h,defaultValue:y,finalValue:null,onChange:v}),H=typeof be=="string"?ee[be]:void 0,ce=Ql(H),[we,Oe]=bt({value:N,defaultValue:I,finalValue:H?H.label:"",onChange:A}),De=bc({opened:i,defaultOpened:c,onDropdownOpen:()=>{u==null||u(),De.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{l==null||l(),De.resetSelectedOption()}}),je=ke=>{Oe(ke),De.resetSelectedOption()},{resolvedClassNames:Pe,resolvedStyles:Re}=St({props:r,styles:o,classNames:n});x.useEffect(()=>{w&&De.selectFirstOption()},[w,we]),x.useEffect(()=>{h===null&&je(""),typeof h=="string"&&H&&((ce==null?void 0:ce.value)!==H.value||(ce==null?void 0:ce.label)!==H.label)&&je(H.label)},[h,H]);const Rt=g.jsx(Ee.ClearButton,{...re,onClear:()=>{oe(null,null),je(""),le==null||le()}}),Bt=Q&&!!be&&!S&&!D;return g.jsxs(g.Fragment,{children:[g.jsxs(Ee,{store:De,__staticSelector:"Select",classNames:Pe,styles:Re,unstyled:s,readOnly:D,onOptionSubmit:ke=>{b==null||b(ke);const He=B&&ee[ke].value===be?null:ee[ke],jt=He?He.value:null;jt!==be&&oe(jt,He),!he&&je(typeof jt=="string"&&(He==null?void 0:He.label)||""),De.closeDropdown()},size:L,...C,children:[g.jsx(Ee.Target,{targetType:V?"input":"button",autoComplete:ie,children:g.jsx(st,{id:de,ref:t,__defaultRightSection:g.jsx(Ee.Chevron,{size:L,error:Y,unstyled:s,color:ge}),__clearSection:Rt,__clearable:Bt,rightSection:z,rightSectionPointerEvents:te||(Bt?"all":"none"),...U,size:L,__staticSelector:"Select",disabled:S,readOnly:D||!V,value:we,onChange:ke=>{je(ke.currentTarget.value),De.openDropdown(),w&&De.selectFirstOption()},onFocus:ke=>{V&&De.openDropdown(),d==null||d(ke)},onBlur:ke=>{var He;V&&De.closeDropdown(),je(be!=null&&((He=ee[be])==null?void 0:He.label)||""),f==null||f(ke)},onClick:ke=>{V?De.openDropdown():De.toggleDropdown(),m==null||m(ke)},classNames:Pe,styles:Re,unstyled:s,pointer:!V,error:Y})}),g.jsx(Up,{data:J,hidden:D||S,filter:O,search:we,limit:k,hiddenWhenEmpty:!_,withScrollArea:j,maxDropdownHeight:P,filterOptions:V&&(H==null?void 0:H.label)!==we,value:be,checkIconPosition:M,withCheckIcon:$,nothingFoundMessage:_,unstyled:s,labelId:U.label?`${de}-label`:void 0,"aria-label":U.label?void 0:U["aria-label"],renderOption:Z,scrollAreaProps:pe})]}),g.jsx(Ee.HiddenInput,{value:be,name:E,form:T,disabled:S,...ae})]})});Rs.classes={...st.classes,...Ee.classes};Rs.displayName="@mantine/core/Select";const iv={},Es=se((e,t)=>{const r=K("TextInput",iv,e);return g.jsx(st,{component:"input",ref:t,...r,__staticSelector:"TextInput"})});Es.classes=st.classes;Es.displayName="@mantine/core/TextInput";const cv=e=>{const{fields:t,options:r,value:n,error:o={},name:s,readOnly:a}=e,i=n.map((c,l)=>{const u=(d,f)=>{c[d]=f,r.replaceElement(l,c)};return t.map((d,f)=>g.jsxs(x.Fragment,{children:[g.jsx(As,{field:d,formValues:c,onChange:u,value:c[d.name],error:d.name in(o[l]??{})?o[l][d.name]:void 0,readOnly:a}),!a&&g.jsx(tr,{onClick:()=>r.removeElement(l),children:"Remove"})]},f))});return g.jsxs(g.Fragment,{children:[typeof o=="string"&&g.jsx(Dn,{c:"red",fz:"sm",fw:500,children:o}),i,!a&&g.jsx(tr,{display:"block",onClick:()=>r.addElement({}),children:"Add"})]})},lv=e=>{const{name:t,onChange:r,value:n,readOnly:o,label:s}=e;return g.jsx(dr,{name:t,checked:n,readOnly:o,onChange:a=>r(t,a.target.checked),label:s})};var Zr={exports:{}},uv=Zr.exports,Pa;function dv(){return Pa||(Pa=1,function(e,t){(function(r,n){e.exports=n()})(uv,function(){var r=1e3,n=6e4,o=36e5,s="millisecond",a="second",i="minute",c="hour",l="day",u="week",d="month",f="quarter",m="year",v="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var $=["th","st","nd","rd"],_=M%100;return"["+M+($[(_-20)%10]||$[_]||$[0])+"]"}},b=function(M,$,_){var E=String(M);return!E||E.length>=$?M:""+Array($+1-E.length).join(_)+M},C={s:b,z:function(M){var $=-M.utcOffset(),_=Math.abs($),E=Math.floor(_/60),T=_%60;return($<=0?"+":"-")+b(E,2,"0")+":"+b(T,2,"0")},m:function M($,_){if($.date()<_.date())return-M(_,$);var E=12*(_.year()-$.year())+(_.month()-$.month()),T=$.clone().add(E,d),N=_-T<0,I=$.clone().add(E+(N?-1:1),d);return+(-(E+(_-T)/(N?T-I:I-T))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:d,y:m,w:u,d:l,D:v,h:c,m:i,s:a,ms:s,Q:f}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},D="en",S={};S[D]=w;var O="$isDayjsObject",k=function(M){return M instanceof V||!(!M||!M[O])},j=function M($,_,E){var T;if(!$)return D;if(typeof $=="string"){var N=$.toLowerCase();S[N]&&(T=N),_&&(S[N]=_,T=N);var I=$.split("-");if(!T&&I.length>1)return M(I[0])}else{var A=$.name;S[A]=$,T=A}return!E&&T&&(D=T),T||!E&&D},P=function(M,$){if(k(M))return M.clone();var _=typeof $=="object"?$:{};return _.date=M,_.args=arguments,new V(_)},L=C;L.l=j,L.i=k,L.w=function(M,$){return P(M,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var V=function(){function M(_){this.$L=j(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[O]=!0}var $=M.prototype;return $.parse=function(_){this.$d=function(E){var T=E.date,N=E.utc;if(T===null)return new Date(NaN);if(L.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var I=T.match(h);if(I){var A=I[2]-1||0,B=(I[7]||"0").substring(0,3);return N?new Date(Date.UTC(I[1],A,I[3]||1,I[4]||0,I[5]||0,I[6]||0,B)):new Date(I[1],A,I[3]||1,I[4]||0,I[5]||0,I[6]||0,B)}}return new Date(T)}(_),this.init()},$.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},$.$utils=function(){return L},$.isValid=function(){return this.$d.toString()!==p},$.isSame=function(_,E){var T=P(_);return this.startOf(E)<=T&&T<=this.endOf(E)},$.isAfter=function(_,E){return P(_)<this.startOf(E)},$.isBefore=function(_,E){return this.endOf(E)<P(_)},$.$g=function(_,E,T){return L.u(_)?this[E]:this.set(T,_)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(_,E){var T=this,N=!!L.u(E)||E,I=L.p(_),A=function(Z,le){var ie=L.w(T.$u?Date.UTC(T.$y,le,Z):new Date(T.$y,le,Z),T);return N?ie:ie.endOf(l)},B=function(Z,le){return L.w(T.toDate()[Z].apply(T.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(le)),T)},Y=this.$W,te=this.$M,F=this.$D,Q="set"+(this.$u?"UTC":"");switch(I){case m:return N?A(1,0):A(31,11);case d:return N?A(1,te):A(0,te+1);case u:var re=this.$locale().weekStart||0,ae=(Y<re?Y+7:Y)-re;return A(N?F-ae:F+(6-ae),te);case l:case v:return B(Q+"Hours",0);case c:return B(Q+"Minutes",1);case i:return B(Q+"Seconds",2);case a:return B(Q+"Milliseconds",3);default:return this.clone()}},$.endOf=function(_){return this.startOf(_,!1)},$.$set=function(_,E){var T,N=L.p(_),I="set"+(this.$u?"UTC":""),A=(T={},T[l]=I+"Date",T[v]=I+"Date",T[d]=I+"Month",T[m]=I+"FullYear",T[c]=I+"Hours",T[i]=I+"Minutes",T[a]=I+"Seconds",T[s]=I+"Milliseconds",T)[N],B=N===l?this.$D+(E-this.$W):E;if(N===d||N===m){var Y=this.clone().set(v,1);Y.$d[A](B),Y.init(),this.$d=Y.set(v,Math.min(this.$D,Y.daysInMonth())).$d}else A&&this.$d[A](B);return this.init(),this},$.set=function(_,E){return this.clone().$set(_,E)},$.get=function(_){return this[L.p(_)]()},$.add=function(_,E){var T,N=this;_=Number(_);var I=L.p(E),A=function(te){var F=P(N);return L.w(F.date(F.date()+Math.round(te*_)),N)};if(I===d)return this.set(d,this.$M+_);if(I===m)return this.set(m,this.$y+_);if(I===l)return A(1);if(I===u)return A(7);var B=(T={},T[i]=n,T[c]=o,T[a]=r,T)[I]||1,Y=this.$d.getTime()+_*B;return L.w(Y,this)},$.subtract=function(_,E){return this.add(-1*_,E)},$.format=function(_){var E=this,T=this.$locale();if(!this.isValid())return T.invalidDate||p;var N=_||"YYYY-MM-DDTHH:mm:ssZ",I=L.z(this),A=this.$H,B=this.$m,Y=this.$M,te=T.weekdays,F=T.months,Q=T.meridiem,re=function(le,ie,pe,X){return le&&(le[ie]||le(E,N))||pe[ie].slice(0,X)},ae=function(le){return L.s(A%12||12,le,"0")},Z=Q||function(le,ie,pe){var X=le<12?"AM":"PM";return pe?X.toLowerCase():X};return N.replace(y,function(le,ie){return ie||function(pe){switch(pe){case"YY":return String(E.$y).slice(-2);case"YYYY":return L.s(E.$y,4,"0");case"M":return Y+1;case"MM":return L.s(Y+1,2,"0");case"MMM":return re(T.monthsShort,Y,F,3);case"MMMM":return re(F,Y);case"D":return E.$D;case"DD":return L.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return re(T.weekdaysMin,E.$W,te,2);case"ddd":return re(T.weekdaysShort,E.$W,te,3);case"dddd":return te[E.$W];case"H":return String(A);case"HH":return L.s(A,2,"0");case"h":return ae(1);case"hh":return ae(2);case"a":return Z(A,B,!0);case"A":return Z(A,B,!1);case"m":return String(B);case"mm":return L.s(B,2,"0");case"s":return String(E.$s);case"ss":return L.s(E.$s,2,"0");case"SSS":return L.s(E.$ms,3,"0");case"Z":return I}return null}(le)||I.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(_,E,T){var N,I=this,A=L.p(E),B=P(_),Y=(B.utcOffset()-this.utcOffset())*n,te=this-B,F=function(){return L.m(I,B)};switch(A){case m:N=F()/12;break;case d:N=F();break;case f:N=F()/3;break;case u:N=(te-Y)/6048e5;break;case l:N=(te-Y)/864e5;break;case c:N=te/o;break;case i:N=te/n;break;case a:N=te/r;break;default:N=te}return T?N:L.a(N)},$.daysInMonth=function(){return this.endOf(d).$D},$.$locale=function(){return S[this.$L]},$.locale=function(_,E){if(!_)return this.$L;var T=this.clone(),N=j(_,E,!0);return N&&(T.$L=N),T},$.clone=function(){return L.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},M}(),z=V.prototype;return P.prototype=z,[["$ms",s],["$s",a],["$m",i],["$H",c],["$W",l],["$M",d],["$y",m],["$D",v]].forEach(function(M){z[M[1]]=function($){return this.$g($,M[0],M[1])}}),P.extend=function(M,$){return M.$i||(M($,V,P),M.$i=!0),P},P.locale=j,P.isDayjs=k,P.unix=function(M){return P(1e3*M)},P.en=S[D],P.Ls=S,P.p={},P})}(Zr)),Zr.exports}var fv=dv();const q=rr(fv);var Jr={exports:{}},mv=Jr.exports,Ma;function pv(){return Ma||(Ma=1,function(e,t){(function(r,n){e.exports=n()})(mv,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,s=/\d\d/,a=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,c={},l=function(h){return(h=+h)+(h>68?1900:2e3)},u=function(h){return function(y){this[h]=+y}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(h){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var w=y.match(/([+-]|\d\d)/g),b=60*w[1]+(+w[2]||0);return b===0?0:w[0]==="+"?-b:b}(h)}],f=function(h){var y=c[h];return y&&(y.indexOf?y:y.s.concat(y.f))},m=function(h,y){var w,b=c.meridiem;if(b){for(var C=1;C<=24;C+=1)if(h.indexOf(b(C,0,y))>-1){w=C>12;break}}else w=h===(y?"pm":"PM");return w},v={A:[i,function(h){this.afternoon=m(h,!1)}],a:[i,function(h){this.afternoon=m(h,!0)}],Q:[o,function(h){this.month=3*(h-1)+1}],S:[o,function(h){this.milliseconds=100*+h}],SS:[s,function(h){this.milliseconds=10*+h}],SSS:[/\d{3}/,function(h){this.milliseconds=+h}],s:[a,u("seconds")],ss:[a,u("seconds")],m:[a,u("minutes")],mm:[a,u("minutes")],H:[a,u("hours")],h:[a,u("hours")],HH:[a,u("hours")],hh:[a,u("hours")],D:[a,u("day")],DD:[s,u("day")],Do:[i,function(h){var y=c.ordinal,w=h.match(/\d+/);if(this.day=w[0],y)for(var b=1;b<=31;b+=1)y(b).replace(/\[|\]/g,"")===h&&(this.day=b)}],w:[a,u("week")],ww:[s,u("week")],M:[a,u("month")],MM:[s,u("month")],MMM:[i,function(h){var y=f("months"),w=(f("monthsShort")||y.map(function(b){return b.slice(0,3)})).indexOf(h)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[i,function(h){var y=f("months").indexOf(h)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,u("year")],YY:[s,function(h){this.year=l(h)}],YYYY:[/\d{4}/,u("year")],Z:d,ZZ:d};function p(h){var y,w;y=h,w=c&&c.formats;for(var b=(h=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(P,L,V){var z=V&&V.toUpperCase();return L||w[V]||r[V]||w[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,$,_){return $||_.slice(1)})})).match(n),C=b.length,D=0;D<C;D+=1){var S=b[D],O=v[S],k=O&&O[0],j=O&&O[1];b[D]=j?{regex:k,parser:j}:S.replace(/^\[|\]$/g,"")}return function(P){for(var L={},V=0,z=0;V<C;V+=1){var M=b[V];if(typeof M=="string")z+=M.length;else{var $=M.regex,_=M.parser,E=P.slice(z),T=$.exec(E)[0];_.call(L,T),P=P.replace(T,"")}}return function(N){var I=N.afternoon;if(I!==void 0){var A=N.hours;I?A<12&&(N.hours+=12):A===12&&(N.hours=0),delete N.afternoon}}(L),L}}return function(h,y,w){w.p.customParseFormat=!0,h&&h.parseTwoDigitYear&&(l=h.parseTwoDigitYear);var b=y.prototype,C=b.parse;b.parse=function(D){var S=D.date,O=D.utc,k=D.args;this.$u=O;var j=k[1];if(typeof j=="string"){var P=k[2]===!0,L=k[3]===!0,V=P||L,z=k[2];L&&(z=k[2]),c=this.$locale(),!P&&z&&(c=w.Ls[z]),this.$d=function(E,T,N,I){try{if(["x","X"].indexOf(T)>-1)return new Date((T==="X"?1e3:1)*E);var A=p(T)(E),B=A.year,Y=A.month,te=A.day,F=A.hours,Q=A.minutes,re=A.seconds,ae=A.milliseconds,Z=A.zone,le=A.week,ie=new Date,pe=te||(B||Y?1:ie.getDate()),X=B||ie.getFullYear(),me=0;B&&!Y||(me=Y>0?Y-1:ie.getMonth());var fe,ge=F||0,U=Q||0,J=re||0,ee=ae||0;return Z?new Date(Date.UTC(X,me,pe,ge,U,J,ee+60*Z.offset*1e3)):N?new Date(Date.UTC(X,me,pe,ge,U,J,ee)):(fe=new Date(X,me,pe,ge,U,J,ee),le&&(fe=I(fe).week(le).toDate()),fe)}catch{return new Date("")}}(S,j,O,w),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),V&&S!=this.format(j)&&(this.$d=new Date("")),c={}}else if(j instanceof Array)for(var M=j.length,$=1;$<=M;$+=1){k[1]=j[$-1];var _=w.apply(this,k);if(_.isValid()){this.$d=_.$d,this.$L=_.$L,this.init();break}$===M&&(this.$d=new Date(""))}else C.call(this,D)}}})}(Jr)),Jr.exports}var hv=pv();const Vc=rr(hv);function vv({direction:e,levelIndex:t,rowIndex:r,cellIndex:n,size:o}){switch(e){case"up":return t===0&&r===0?null:r===0?{levelIndex:t-1,rowIndex:n<=o[t-1][o[t-1].length-1]-1?o[t-1].length-1:o[t-1].length-2,cellIndex:n}:{levelIndex:t,rowIndex:r-1,cellIndex:n};case"down":return r===o[t].length-1?{levelIndex:t+1,rowIndex:0,cellIndex:n}:r===o[t].length-2&&n>=o[t][o[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:n}:{levelIndex:t,rowIndex:r+1,cellIndex:n};case"left":return t===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:t-1,rowIndex:o[t-1].length-1,cellIndex:o[t-1][o[t-1].length-1]-1}:n===0?{levelIndex:t,rowIndex:r-1,cellIndex:o[t][r-1]-1}:{levelIndex:t,rowIndex:r,cellIndex:n-1};case"right":return r===o[t].length-1&&n===o[t][r]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:n===o[t][r]-1?{levelIndex:t,rowIndex:r+1,cellIndex:0}:{levelIndex:t,rowIndex:r,cellIndex:n+1};default:return{levelIndex:t,rowIndex:r,cellIndex:n}}}function zc({controlsRef:e,direction:t,levelIndex:r,rowIndex:n,cellIndex:o,size:s}){var c,l,u;const a=vv({direction:t,size:s,rowIndex:n,cellIndex:o,levelIndex:r});if(!a)return;const i=(u=(l=(c=e.current)==null?void 0:c[a.levelIndex])==null?void 0:l[a.rowIndex])==null?void 0:u[a.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?zc({controlsRef:e,direction:t,levelIndex:a.levelIndex,cellIndex:a.cellIndex,rowIndex:a.rowIndex,size:s}):i.focus())}function gv(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function yv(e){var t;return(t=e.current)==null?void 0:t.map(r=>r.map(n=>n.length))}function Ns({controlsRef:e,levelIndex:t,rowIndex:r,cellIndex:n,event:o}){const s=gv(o.key);if(s){o.preventDefault();const a=yv(e);zc({controlsRef:e,direction:s,levelIndex:t,rowIndex:r,cellIndex:n,size:a})}}function Oo(e,t){if(!e||!t)return t;const r=e.getHours(),n=e.getMinutes(),o=e.getSeconds(),s=e.getMilliseconds(),a=new Date(t);return a.setHours(r),a.setMinutes(n),a.setSeconds(o),a.setMilliseconds(s),a}var Qr={exports:{}},bv=Qr.exports,La;function xv(){return La||(La=1,function(e,t){(function(r,n){e.exports=n()})(bv,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(o,s,a){var i,c=function(f,m,v){v===void 0&&(v={});var p=new Date(f),h=function(y,w){w===void 0&&(w={});var b=w.timeZoneName||"short",C=y+"|"+b,D=n[C];return D||(D=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:y,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:b}),n[C]=D),D}(m,v);return h.formatToParts(p)},l=function(f,m){for(var v=c(f,m),p=[],h=0;h<v.length;h+=1){var y=v[h],w=y.type,b=y.value,C=r[w];C>=0&&(p[C]=parseInt(b,10))}var D=p[3],S=D===24?0:D,O=p[0]+"-"+p[1]+"-"+p[2]+" "+S+":"+p[4]+":"+p[5]+":000",k=+f;return(a.utc(O).valueOf()-(k-=k%1e3))/6e4},u=s.prototype;u.tz=function(f,m){f===void 0&&(f=i);var v,p=this.utcOffset(),h=this.toDate(),y=h.toLocaleString("en-US",{timeZone:f}),w=Math.round((h-new Date(y))/1e3/60),b=15*-Math.round(h.getTimezoneOffset()/15)-w;if(!Number(b))v=this.utcOffset(0,m);else if(v=a(y,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(b,!0),m){var C=v.utcOffset();v=v.add(p-C,"minute")}return v.$x.$timezone=f,v},u.offsetName=function(f){var m=this.$x.$timezone||a.tz.guess(),v=c(this.valueOf(),m,{timeZoneName:f}).find(function(p){return p.type.toLowerCase()==="timezonename"});return v&&v.value};var d=u.startOf;u.startOf=function(f,m){if(!this.$x||!this.$x.$timezone)return d.call(this,f,m);var v=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(v,f,m).tz(this.$x.$timezone,!0)},a.tz=function(f,m,v){var p=v&&m,h=v||m||i,y=l(+a(),h);if(typeof f!="string")return a(f).tz(h);var w=function(S,O,k){var j=S-60*O*1e3,P=l(j,k);if(O===P)return[j,O];var L=l(j-=60*(P-O)*1e3,k);return P===L?[j,P]:[S-60*Math.min(P,L)*1e3,Math.max(P,L)]}(a.utc(f,p).valueOf(),y,h),b=w[0],C=w[1],D=a(b).utcOffset(C);return D.$x.$timezone=h,D},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(f){i=f}}})}(Qr)),Qr.exports}var wv=xv();const Sv=rr(wv);var en={exports:{}},Cv=en.exports,Ia;function Dv(){return Ia||(Ia=1,function(e,t){(function(r,n){e.exports=n()})(Cv,function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(s,a,i){var c=a.prototype;i.utc=function(p){var h={date:p,utc:!0,args:arguments};return new a(h)},c.utc=function(p){var h=i(this.toDate(),{locale:this.$L,utc:!0});return p?h.add(this.utcOffset(),r):h},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var l=c.parse;c.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),l.call(this,p)};var u=c.init;c.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else u.call(this)};var d=c.utcOffset;c.utcOffset=function(p,h){var y=this.$utils().u;if(y(p))return this.$u?0:y(this.$offset)?d.call(this):this.$offset;if(typeof p=="string"&&(p=function(D){D===void 0&&(D="");var S=D.match(n);if(!S)return null;var O=(""+S[0]).match(o)||["-",0,0],k=O[0],j=60*+O[1]+ +O[2];return j===0?0:k==="+"?j:-j}(p),p===null))return this;var w=Math.abs(p)<=16?60*p:p,b=this;if(h)return b.$offset=w,b.$u=p===0,b;if(p!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(w+C,r)).$offset=w,b.$x.$localOffset=C}else b=this.utc();return b};var f=c.format;c.format=function(p){var h=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,h)},c.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var m=c.toDate;c.toDate=function(p){return p==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var v=c.diff;c.diff=function(p,h,y){if(p&&this.$u===p.$u)return v.call(this,p,h,y);var w=this.local(),b=i(p).local();return v.call(w,b,h,y)}}})}(en)),en.exports}var _v=Dv();const Rv=rr(_v);q.extend(Rv);q.extend(Sv);function Ev(e,t){return t?q(e).tz(t).utcOffset()+e.getTimezoneOffset():0}const Fa=(e,t,r)=>{if(!e)return null;if(!t)return e;let n=Ev(e,t);return r==="remove"&&(n*=-1),q(e).add(n,"minutes").toDate()};function ht(e,t,r,n){return n||!t?t:Array.isArray(t)?t.map(o=>Fa(o,r,e)):Fa(t,r,e)}const Nv={locale:"en",timezone:null,firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Tv=x.createContext(Nv);function Qe(){const e=x.useContext(Tv),t=x.useCallback(a=>a||e.locale,[e.locale]),r=x.useCallback(a=>a||e.timezone||void 0,[e.timezone]),n=x.useCallback(a=>typeof a=="number"?a:e.firstDayOfWeek,[e.firstDayOfWeek]),o=x.useCallback(a=>Array.isArray(a)?a:e.weekendDays,[e.weekendDays]),s=x.useCallback(a=>typeof a=="string"?a:e.labelSeparator,[e.labelSeparator]);return{...e,getLocale:t,getTimezone:r,getFirstDayOfWeek:n,getWeekendDays:o,getLabelSeparator:s}}function Ov(e,t){const r=Qe(),n=o=>ht("remove",o,r.getTimezone()).toISOString();if(t==="range"&&Array.isArray(e)){const[o,s]=e;return o?s?`${n(o)} – ${n(s)}`:`${n(o)} –`:""}return t==="multiple"&&Array.isArray(e)?e.map(o=>o&&n(o)).filter(Boolean).join(", "):!Array.isArray(e)&&e?n(e):""}function Ts({value:e,type:t,name:r,form:n}){return g.jsx("input",{type:"hidden",value:Ov(e,t),name:r,form:n})}Ts.displayName="@mantine/dates/HiddenDatesInput";var kv={input:"m_468e7eda"};const $v={},jn=se((e,t)=>{const r=K("TimeInput",$v,e),{classNames:n,styles:o,unstyled:s,vars:a,withSeconds:i,minTime:c,maxTime:l,value:u,onChange:d,...f}=r,{resolvedClassNames:m,resolvedStyles:v}=St({classNames:n,styles:o,props:r}),p=y=>{if(c!==void 0||l!==void 0){const[w,b,C]=y.split(":").map(Number);if(c){const[D,S,O]=c.split(":").map(Number);if(w<D||w===D&&b<S||i&&w===D&&b===S&&C<O)return-1}if(l){const[D,S,O]=l.split(":").map(Number);if(w>D||w===D&&b>S||i&&w===D&&b===S&&C>O)return 1}}return 0},h=y=>{var w,b,C;if((w=r.onBlur)==null||w.call(r,y),c!==void 0||l!==void 0){const D=y.currentTarget.value;if(D){const S=p(D);S===1?(y.currentTarget.value=l,(b=r.onChange)==null||b.call(r,y)):S===-1&&(y.currentTarget.value=c,(C=r.onChange)==null||C.call(r,y))}}};return g.jsx(st,{classNames:{...m,input:Fe(kv.input,m==null?void 0:m.input)},styles:v,unstyled:s,ref:t,value:u,...f,step:i?1:60,onChange:d,onBlur:h,type:"time",__staticSelector:"TimeInput"})});jn.classes=st.classes;jn.displayName="@mantine/dates/TimeInput";var Bc={day:"m_396ce5cb"};const jv={},Av=(e,{size:t})=>({day:{"--day-size":Ne(t,"day-size")}}),Os=se((e,t)=>{const r=K("Day",jv,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,date:l,disabled:u,__staticSelector:d,weekend:f,outside:m,selected:v,renderDay:p,inRange:h,firstInRange:y,lastInRange:w,hidden:b,static:C,highlightToday:D,...S}=r,O=ye({name:d||"Day",classes:Bc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:Av,rootSelector:"day"}),k=Qe();return g.jsx(tt,{...O("day",{style:b?{display:"none"}:void 0}),component:C?"div":"button",ref:t,disabled:u,"data-today":q(l).isSame(ht("add",new Date,k.getTimezone()),"day")||void 0,"data-hidden":b||void 0,"data-highlight-today":D||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!m&&f||void 0,"data-outside":!u&&m||void 0,"data-selected":!u&&v||void 0,"data-in-range":h&&!u||void 0,"data-first-in-range":y&&!u||void 0,"data-last-in-range":w&&!u||void 0,"data-static":C||void 0,unstyled:i,...S,children:(p==null?void 0:p(l))||q(l).date()})});Os.classes=Bc;Os.displayName="@mantine/dates/Day";function Pv({locale:e,format:t="dd",firstDayOfWeek:r=1}){const n=q().day(r),o=[];for(let s=0;s<7;s+=1)typeof t=="string"?o.push(q(n).add(s,"days").locale(e).format(t)):o.push(t(q(n).add(s,"days").toDate()));return o}var Wc={weekday:"m_18a3eca"};const Mv={},Lv=(e,{size:t})=>({weekdaysRow:{"--wr-fz":Ie(t),"--wr-spacing":ii(t)}}),ks=se((e,t)=>{const r=K("WeekdaysRow",Mv,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,locale:l,firstDayOfWeek:u,weekdayFormat:d,cellComponent:f="th",__staticSelector:m,withWeekNumbers:v,...p}=r,h=ye({name:m||"WeekdaysRow",classes:Wc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:Lv,rootSelector:"weekdaysRow"}),y=Qe(),w=Pv({locale:y.getLocale(l),format:d,firstDayOfWeek:y.getFirstDayOfWeek(u)}).map((b,C)=>g.jsx(f,{...h("weekday"),children:b},C));return g.jsxs(ue,{component:"tr",ref:t,...h("weekdaysRow"),...p,children:[v&&g.jsx(f,{...h("weekday"),children:"#"}),w]})});ks.classes=Wc;ks.displayName="@mantine/dates/WeekdaysRow";function Iv(e,t=1){let r=q(e);const n=t===0?6:t-1;for(;r.day()!==n;)r=r.add(1,"day");return r.toDate()}function Fv(e,t=1){let r=q(e);for(;r.day()!==t;)r=r.subtract(1,"day");return r.toDate()}function Vv({month:e,firstDayOfWeek:t=1,consistentWeeks:r}){const n=q(e).subtract(q(e).date()-1,"day"),o=q(n).startOf("day"),s=o.toDate(),a=o.add(+o.daysInMonth()-1,"day").toDate(),i=Iv(a,t),c=Fv(s,t),l=[];for(;c<=i;){const u=[];for(let d=0;d<7;d+=1)u.push(new Date(c)),c.setDate(c.getDate()+1);l.push(u)}if(r&&l.length<6){const u=l[l.length-1],d=u[u.length-1],f=new Date(d);for(f.setDate(f.getDate()+1);l.length<6;){const m=[];for(let v=0;v<7;v+=1)m.push(new Date(f)),f.setDate(f.getDate()+1);l.push(m)}}return l}function Yc(e,t){return q(e).format("YYYY-MM")===q(t).format("YYYY-MM")}function Hc(e,t){return t instanceof Date?q(e).isAfter(q(t).subtract(1,"day"),"day"):!0}function Uc(e,t){return t instanceof Date?q(e).isBefore(q(t).add(1,"day"),"day"):!0}function zv(e,t,r,n,o,s,a){const i=e.flat().filter(u=>{var d;return Uc(u,r)&&Hc(u,t)&&!(o!=null&&o(u))&&!((d=n==null?void 0:n(u))!=null&&d.disabled)&&(!s||Yc(u,a))}),c=i.find(u=>{var d;return(d=n==null?void 0:n(u))==null?void 0:d.selected});if(c)return c;const l=i.find(u=>q().isSame(u,"date"));return l||i[0]}var tn={exports:{}},Bv=tn.exports,Va;function Wv(){return Va||(Va=1,function(e,t){(function(r,n){e.exports=n()})(Bv,function(){var r="day";return function(n,o,s){var a=function(l){return l.add(4-l.isoWeekday(),r)},i=o.prototype;i.isoWeekYear=function(){return a(this).year()},i.isoWeek=function(l){if(!this.$utils().u(l))return this.add(7*(l-this.isoWeek()),r);var u,d,f,m,v=a(this),p=(u=this.isoWeekYear(),d=this.$u,f=(d?s.utc:s)().year(u).startOf("year"),m=4-f.isoWeekday(),f.isoWeekday()>4&&(m+=7),f.add(m,r));return v.diff(p,"week")+1},i.isoWeekday=function(l){return this.$utils().u(l)?this.day()||7:this.day(this.day()%7?l:l-7)};var c=i.startOf;i.startOf=function(l,u){var d=this.$utils(),f=!!d.u(u)||u;return d.p(l)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(l,u)}}})}(tn)),tn.exports}var Yv=Wv();const Hv=rr(Yv);q.extend(Hv);function Uv(e){const t=e.find(r=>q(r).day()===1);return q(t).isoWeek()}var Gc={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Gv={withCellSpacing:!0},qv=(e,{size:t})=>({weekNumber:{"--wn-fz":Ie(t),"--wn-size":Ne(t,"wn-size")}}),An=se((e,t)=>{const r=K("Month",Gv,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,__staticSelector:l,locale:u,firstDayOfWeek:d,weekdayFormat:f,month:m,weekendDays:v,getDayProps:p,excludeDate:h,minDate:y,maxDate:w,renderDay:b,hideOutsideDates:C,hideWeekdays:D,getDayAriaLabel:S,static:O,__getDayRef:k,__onDayKeyDown:j,__onDayClick:P,__onDayMouseEnter:L,__preventFocus:V,__stopPropagation:z,withCellSpacing:M,size:$,highlightToday:_,withWeekNumbers:E,...T}=r,N=ye({name:l||"Month",classes:Gc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:qv,rootSelector:"month"}),I=Qe(),A=Vv({month:m,firstDayOfWeek:I.getFirstDayOfWeek(d),consistentWeeks:I.consistentWeeks}),B=zv(A,y,w,p,h,C,m),{resolvedClassNames:Y,resolvedStyles:te}=St({classNames:n,styles:a,props:r}),F=A.map((Q,re)=>{const ae=Q.map((Z,le)=>{const ie=!Yc(Z,m),pe=(S==null?void 0:S(Z))||q(Z).locale(u||I.locale).format("D MMMM YYYY"),X=p==null?void 0:p(Z),me=q(Z).isSame(B,"date");return g.jsx("td",{...N("monthCell"),"data-with-spacing":M||void 0,children:g.jsx(Os,{__staticSelector:l||"Month",classNames:Y,styles:te,unstyled:i,"data-mantine-stop-propagation":z||void 0,highlightToday:_,renderDay:b,date:Z,size:$,weekend:I.getWeekendDays(v).includes(Z.getDay()),outside:ie,hidden:C?ie:!1,"aria-label":pe,static:O,disabled:(h==null?void 0:h(Z))||!Uc(Z,w)||!Hc(Z,y),ref:fe=>k==null?void 0:k(re,le,fe),...X,onKeyDown:fe=>{var ge;(ge=X==null?void 0:X.onKeyDown)==null||ge.call(X,fe),j==null||j(fe,{rowIndex:re,cellIndex:le,date:Z})},onMouseEnter:fe=>{var ge;(ge=X==null?void 0:X.onMouseEnter)==null||ge.call(X,fe),L==null||L(fe,Z)},onClick:fe=>{var ge;(ge=X==null?void 0:X.onClick)==null||ge.call(X,fe),P==null||P(fe,Z)},onMouseDown:fe=>{var ge;(ge=X==null?void 0:X.onMouseDown)==null||ge.call(X,fe),V&&fe.preventDefault()},tabIndex:V||!me?-1:0})},Z.toString())});return g.jsxs("tr",{...N("monthRow"),children:[E&&g.jsx("td",{...N("weekNumber"),children:Uv(Q)}),ae]},re)});return g.jsxs(ue,{component:"table",...N("month"),size:$,ref:t,...T,children:[!D&&g.jsx("thead",{...N("monthThead"),children:g.jsx(ks,{__staticSelector:l||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:f,size:$,classNames:Y,styles:te,unstyled:i,withWeekNumbers:E})}),g.jsx("tbody",{...N("monthTbody"),children:F})]})});An.classes=Gc;An.displayName="@mantine/dates/Month";var qc={pickerControl:"m_dc6a3c71"};const Xv={},Kv=(e,{size:t})=>({pickerControl:{"--dpc-fz":Ie(t),"--dpc-size":Ne(t,"dpc-size")}}),Pn=se((e,t)=>{const r=K("PickerControl",Xv,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,firstInRange:l,lastInRange:u,inRange:d,__staticSelector:f,selected:m,disabled:v,...p}=r,h=ye({name:f||"PickerControl",classes:qc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:Kv,rootSelector:"pickerControl"});return g.jsx(tt,{...h("pickerControl"),ref:t,unstyled:i,"data-picker-control":!0,"data-selected":m&&!v||void 0,"data-disabled":v||void 0,"data-in-range":d&&!v&&!m||void 0,"data-first-in-range":l&&!v||void 0,"data-last-in-range":u&&!v||void 0,disabled:v,...p})});Pn.classes=qc;Pn.displayName="@mantine/dates/PickerControl";function Xc(e,t,r){return!t&&!r?!1:!!(t&&q(e).isBefore(t,"year")||r&&q(e).isAfter(r,"year"))}function Zv(e,t,r,n){const o=e.flat().filter(i=>{var c;return!Xc(i,t,r)&&!((c=n==null?void 0:n(i))!=null&&c.disabled)}),s=o.find(i=>{var c;return(c=n==null?void 0:n(i))==null?void 0:c.selected});if(s)return s;const a=o.find(i=>q().isSame(i,"year"));return a||o[0]}function Kc(e){const t=e.getFullYear(),r=t-t%10;let n=0;const o=[[],[],[],[]];for(let s=0;s<4;s+=1){const a=s===3?1:3;for(let i=0;i<a;i+=1)o[s].push(new Date(r+n,0)),n+=1}return o}var Zc={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Jv={yearsListFormat:"YYYY",withCellSpacing:!0},Mn=se((e,t)=>{const r=K("YearsList",Jv,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,decade:l,yearsListFormat:u,locale:d,minDate:f,maxDate:m,getYearControlProps:v,__staticSelector:p,__getControlRef:h,__onControlKeyDown:y,__onControlClick:w,__onControlMouseEnter:b,__preventFocus:C,__stopPropagation:D,withCellSpacing:S,size:O,...k}=r,j=ye({name:p||"YearsList",classes:Zc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,rootSelector:"yearsList"}),P=Qe(),L=Kc(l),V=Zv(L,f,m,v),z=L.map((M,$)=>{const _=M.map((E,T)=>{const N=v==null?void 0:v(E),I=q(E).isSame(V,"year");return g.jsx("td",{...j("yearsListCell"),"data-with-spacing":S||void 0,children:g.jsx(Pn,{...j("yearsListControl"),size:O,unstyled:i,"data-mantine-stop-propagation":D||void 0,disabled:Xc(E,f,m),ref:A=>h==null?void 0:h($,T,A),...N,onKeyDown:A=>{var B;(B=N==null?void 0:N.onKeyDown)==null||B.call(N,A),y==null||y(A,{rowIndex:$,cellIndex:T,date:E})},onClick:A=>{var B;(B=N==null?void 0:N.onClick)==null||B.call(N,A),w==null||w(A,E)},onMouseEnter:A=>{var B;(B=N==null?void 0:N.onMouseEnter)==null||B.call(N,A),b==null||b(A,E)},onMouseDown:A=>{var B;(B=N==null?void 0:N.onMouseDown)==null||B.call(N,A),C&&A.preventDefault()},tabIndex:C||!I?-1:0,children:q(E).locale(P.getLocale(d)).format(u)})},T)});return g.jsx("tr",{...j("yearsListRow"),children:_},$)});return g.jsx(ue,{component:"table",ref:t,size:O,...j("yearsList"),...k,children:g.jsx("tbody",{children:z})})});Mn.classes=Zc;Mn.displayName="@mantine/dates/YearsList";function Jc(e,t,r){return!t&&!r?!1:!!(t&&q(e).isBefore(t,"month")||r&&q(e).isAfter(r,"month"))}function Qv(e,t,r,n){const o=e.flat().filter(i=>{var c;return!Jc(i,t,r)&&!((c=n==null?void 0:n(i))!=null&&c.disabled)}),s=o.find(i=>{var c;return(c=n==null?void 0:n(i))==null?void 0:c.selected});if(s)return s;const a=o.find(i=>q().isSame(i,"month"));return a||o[0]}function eg(e){const t=q(e).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let o=0;o<4;o+=1)for(let s=0;s<3;s+=1)r[o].push(q(t).add(n,"months").toDate()),n+=1;return r}var Qc={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const tg={monthsListFormat:"MMM",withCellSpacing:!0},Ln=se((e,t)=>{const r=K("MonthsList",tg,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,__staticSelector:l,year:u,monthsListFormat:d,locale:f,minDate:m,maxDate:v,getMonthControlProps:p,__getControlRef:h,__onControlKeyDown:y,__onControlClick:w,__onControlMouseEnter:b,__preventFocus:C,__stopPropagation:D,withCellSpacing:S,size:O,...k}=r,j=ye({name:l||"MonthsList",classes:Qc,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,rootSelector:"monthsList"}),P=Qe(),L=eg(u),V=Qv(L,m,v,p),z=L.map((M,$)=>{const _=M.map((E,T)=>{const N=p==null?void 0:p(E),I=q(E).isSame(V,"month");return g.jsx("td",{...j("monthsListCell"),"data-with-spacing":S||void 0,children:g.jsx(Pn,{...j("monthsListControl"),size:O,unstyled:i,__staticSelector:l||"MonthsList","data-mantine-stop-propagation":D||void 0,disabled:Jc(E,m,v),ref:A=>h==null?void 0:h($,T,A),...N,onKeyDown:A=>{var B;(B=N==null?void 0:N.onKeyDown)==null||B.call(N,A),y==null||y(A,{rowIndex:$,cellIndex:T,date:E})},onClick:A=>{var B;(B=N==null?void 0:N.onClick)==null||B.call(N,A),w==null||w(A,E)},onMouseEnter:A=>{var B;(B=N==null?void 0:N.onMouseEnter)==null||B.call(N,A),b==null||b(A,E)},onMouseDown:A=>{var B;(B=N==null?void 0:N.onMouseDown)==null||B.call(N,A),C&&A.preventDefault()},tabIndex:C||!I?-1:0,children:q(E).locale(P.getLocale(f)).format(d)})},T)});return g.jsx("tr",{...j("monthsListRow"),children:_},$)});return g.jsx(ue,{component:"table",ref:t,size:O,...j("monthsList"),...k,children:g.jsx("tbody",{children:z})})});Ln.classes=Qc;Ln.displayName="@mantine/dates/MonthsList";var el={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const rg={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0},ng=(e,{size:t})=>({calendarHeader:{"--dch-control-size":Ne(t,"dch-control-size"),"--dch-fz":Ie(t)}}),kt=se((e,t)=>{const r=K("CalendarHeader",rg,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,nextIcon:l,previousIcon:u,nextLabel:d,previousLabel:f,onNext:m,onPrevious:v,onLevelClick:p,label:h,nextDisabled:y,previousDisabled:w,hasNextLevel:b,levelControlAriaLabel:C,withNext:D,withPrevious:S,__staticSelector:O,__preventFocus:k,__stopPropagation:j,...P}=r,L=ye({name:O||"CalendarHeader",classes:el,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,varsResolver:ng,rootSelector:"calendarHeader"}),V=k?z=>z.preventDefault():void 0;return g.jsxs(ue,{...L("calendarHeader"),ref:t,...P,children:[S&&g.jsx(tt,{...L("calendarHeaderControl"),"data-direction":"previous","aria-label":f,onClick:v,unstyled:i,onMouseDown:V,disabled:w,"data-disabled":w||void 0,tabIndex:k||w?-1:0,"data-mantine-stop-propagation":j||void 0,children:u||g.jsx(Ro,{...L("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})}),g.jsx(tt,{component:b?"button":"div",...L("calendarHeaderLevel"),onClick:b?p:void 0,unstyled:i,onMouseDown:b?V:void 0,disabled:!b,"data-static":!b||void 0,"aria-label":C,tabIndex:k||!b?-1:0,"data-mantine-stop-propagation":j||void 0,children:h}),D&&g.jsx(tt,{...L("calendarHeaderControl"),"data-direction":"next","aria-label":d,onClick:m,unstyled:i,onMouseDown:V,disabled:y,"data-disabled":y||void 0,tabIndex:k||y?-1:0,"data-mantine-stop-propagation":j||void 0,children:l||g.jsx(Ro,{...L("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})})]})});kt.classes=el;kt.displayName="@mantine/dates/CalendarHeader";function og(e){const t=Kc(e);return[t[0][0],t[3][0]]}const sg={decadeLabelFormat:"YYYY"},In=se((e,t)=>{const r=K("DecadeLevel",sg,e),{decade:n,locale:o,minDate:s,maxDate:a,yearsListFormat:i,getYearControlProps:c,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:m,__preventFocus:v,nextIcon:p,previousIcon:h,nextLabel:y,previousLabel:w,onNext:b,onPrevious:C,nextDisabled:D,previousDisabled:S,levelControlAriaLabel:O,withNext:k,withPrevious:j,decadeLabelFormat:P,classNames:L,styles:V,unstyled:z,__staticSelector:M,__stopPropagation:$,size:_,...E}=r,T=Qe(),[N,I]=og(n),A={__staticSelector:M||"DecadeLevel",classNames:L,styles:V,unstyled:z,size:_},B=typeof D=="boolean"?D:a?!q(I).endOf("year").isBefore(a):!1,Y=typeof S=="boolean"?S:s?!q(N).startOf("year").isAfter(s):!1,te=(F,Q)=>q(F).locale(o||T.locale).format(Q);return g.jsxs(ue,{"data-decade-level":!0,size:_,ref:t,...E,children:[g.jsx(kt,{label:typeof P=="function"?P(N,I):`${te(N,P)} – ${te(I,P)}`,__preventFocus:v,__stopPropagation:$,nextIcon:p,previousIcon:h,nextLabel:y,previousLabel:w,onNext:b,onPrevious:C,nextDisabled:B,previousDisabled:Y,hasNextLevel:!1,levelControlAriaLabel:O,withNext:k,withPrevious:j,...A}),g.jsx(Mn,{decade:n,locale:o,minDate:s,maxDate:a,yearsListFormat:i,getYearControlProps:c,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:v,__stopPropagation:$,withCellSpacing:m,...A})]})});In.classes={...Mn.classes,...kt.classes};In.displayName="@mantine/dates/DecadeLevel";const ag={yearLabelFormat:"YYYY"},Fn=se((e,t)=>{const r=K("YearLevel",ag,e),{year:n,locale:o,minDate:s,maxDate:a,monthsListFormat:i,getMonthControlProps:c,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:m,__preventFocus:v,nextIcon:p,previousIcon:h,nextLabel:y,previousLabel:w,onNext:b,onPrevious:C,onLevelClick:D,nextDisabled:S,previousDisabled:O,hasNextLevel:k,levelControlAriaLabel:j,withNext:P,withPrevious:L,yearLabelFormat:V,__staticSelector:z,__stopPropagation:M,size:$,classNames:_,styles:E,unstyled:T,...N}=r,I=Qe(),A={__staticSelector:z||"YearLevel",classNames:_,styles:E,unstyled:T,size:$},B=typeof S=="boolean"?S:a?!q(n).endOf("year").isBefore(a):!1,Y=typeof O=="boolean"?O:s?!q(n).startOf("year").isAfter(s):!1;return g.jsxs(ue,{"data-year-level":!0,size:$,ref:t,...N,children:[g.jsx(kt,{label:typeof V=="function"?V(n):q(n).locale(o||I.locale).format(V),__preventFocus:v,__stopPropagation:M,nextIcon:p,previousIcon:h,nextLabel:y,previousLabel:w,onNext:b,onPrevious:C,onLevelClick:D,nextDisabled:B,previousDisabled:Y,hasNextLevel:k,levelControlAriaLabel:j,withNext:P,withPrevious:L,...A}),g.jsx(Ln,{year:n,locale:o,minDate:s,maxDate:a,monthsListFormat:i,getMonthControlProps:c,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:v,__stopPropagation:M,withCellSpacing:m,...A})]})});Fn.classes={...kt.classes,...Ln.classes};Fn.displayName="@mantine/dates/YearLevel";const ig={monthLabelFormat:"MMMM YYYY"},Vn=se((e,t)=>{const r=K("MonthLevel",ig,e),{month:n,locale:o,firstDayOfWeek:s,weekdayFormat:a,weekendDays:i,getDayProps:c,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:m,hideWeekdays:v,getDayAriaLabel:p,__getDayRef:h,__onDayKeyDown:y,__onDayClick:w,__onDayMouseEnter:b,withCellSpacing:C,highlightToday:D,withWeekNumbers:S,__preventFocus:O,__stopPropagation:k,nextIcon:j,previousIcon:P,nextLabel:L,previousLabel:V,onNext:z,onPrevious:M,onLevelClick:$,nextDisabled:_,previousDisabled:E,hasNextLevel:T,levelControlAriaLabel:N,withNext:I,withPrevious:A,monthLabelFormat:B,classNames:Y,styles:te,unstyled:F,__staticSelector:Q,size:re,static:ae,...Z}=r,le=Qe(),ie={__staticSelector:Q||"MonthLevel",classNames:Y,styles:te,unstyled:F,size:re},pe=typeof _=="boolean"?_:d?!q(n).endOf("month").isBefore(d):!1,X=typeof E=="boolean"?E:u?!q(n).startOf("month").isAfter(u):!1;return g.jsxs(ue,{"data-month-level":!0,size:re,ref:t,...Z,children:[g.jsx(kt,{label:typeof B=="function"?B(n):q(n).locale(o||le.locale).format(B),__preventFocus:O,__stopPropagation:k,nextIcon:j,previousIcon:P,nextLabel:L,previousLabel:V,onNext:z,onPrevious:M,onLevelClick:$,nextDisabled:pe,previousDisabled:X,hasNextLevel:T,levelControlAriaLabel:N,withNext:I,withPrevious:A,...ie}),g.jsx(An,{month:n,locale:o,firstDayOfWeek:s,weekdayFormat:a,weekendDays:i,getDayProps:c,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:m,hideWeekdays:v,getDayAriaLabel:p,__getDayRef:h,__onDayKeyDown:y,__onDayClick:w,__onDayMouseEnter:b,__preventFocus:O,__stopPropagation:k,static:ae,withCellSpacing:C,highlightToday:D,withWeekNumbers:S,...ie})]})});Vn.classes={...An.classes,...kt.classes};Vn.displayName="@mantine/dates/MonthLevel";var tl={levelsGroup:"m_30b26e33"};const cg={},$t=se((e,t)=>{const r=K("LevelsGroup",cg,e),{classNames:n,className:o,style:s,styles:a,unstyled:i,vars:c,__staticSelector:l,...u}=r,d=ye({name:l||"LevelsGroup",classes:tl,props:r,className:o,style:s,classNames:n,styles:a,unstyled:i,vars:c,rootSelector:"levelsGroup"});return g.jsx(ue,{ref:t,...d("levelsGroup"),...u})});$t.classes=tl;$t.displayName="@mantine/dates/LevelsGroup";const lg={numberOfColumns:1},zn=se((e,t)=>{const r=K("DecadeLevelGroup",lg,e),{decade:n,locale:o,minDate:s,maxDate:a,yearsListFormat:i,getYearControlProps:c,__onControlClick:l,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:m,previousIcon:v,nextLabel:p,previousLabel:h,onNext:y,onPrevious:w,nextDisabled:b,previousDisabled:C,classNames:D,styles:S,unstyled:O,__staticSelector:k,__stopPropagation:j,numberOfColumns:P,levelControlAriaLabel:L,decadeLabelFormat:V,size:z,vars:M,...$}=r,_=x.useRef([]),E=Array(P).fill(0).map((T,N)=>{const I=q(n).add(N*10,"years").toDate();return g.jsx(In,{size:z,yearsListFormat:i,decade:I,withNext:N===P-1,withPrevious:N===0,decadeLabelFormat:V,__onControlClick:l,__onControlMouseEnter:u,__onControlKeyDown:(A,B)=>Ns({levelIndex:N,rowIndex:B.rowIndex,cellIndex:B.cellIndex,event:A,controlsRef:_}),__getControlRef:(A,B,Y)=>{Array.isArray(_.current[N])||(_.current[N]=[]),Array.isArray(_.current[N][A])||(_.current[N][A]=[]),_.current[N][A][B]=Y},levelControlAriaLabel:typeof L=="function"?L(I):L,locale:o,minDate:s,maxDate:a,__preventFocus:f,__stopPropagation:j,nextIcon:m,previousIcon:v,nextLabel:p,previousLabel:h,onNext:y,onPrevious:w,nextDisabled:b,previousDisabled:C,getYearControlProps:c,__staticSelector:k||"DecadeLevelGroup",classNames:D,styles:S,unstyled:O,withCellSpacing:d},N)});return g.jsx($t,{classNames:D,styles:S,__staticSelector:k||"DecadeLevelGroup",ref:t,size:z,unstyled:O,...$,children:E})});zn.classes={...$t.classes,...In.classes};zn.displayName="@mantine/dates/DecadeLevelGroup";const ug={numberOfColumns:1},Bn=se((e,t)=>{const r=K("YearLevelGroup",ug,e),{year:n,locale:o,minDate:s,maxDate:a,monthsListFormat:i,getMonthControlProps:c,__onControlClick:l,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:m,previousIcon:v,nextLabel:p,previousLabel:h,onNext:y,onPrevious:w,onLevelClick:b,nextDisabled:C,previousDisabled:D,hasNextLevel:S,classNames:O,styles:k,unstyled:j,__staticSelector:P,__stopPropagation:L,numberOfColumns:V,levelControlAriaLabel:z,yearLabelFormat:M,size:$,vars:_,...E}=r,T=x.useRef([]),N=Array(V).fill(0).map((I,A)=>{const B=q(n).add(A,"years").toDate();return g.jsx(Fn,{size:$,monthsListFormat:i,year:B,withNext:A===V-1,withPrevious:A===0,yearLabelFormat:M,__stopPropagation:L,__onControlClick:l,__onControlMouseEnter:u,__onControlKeyDown:(Y,te)=>Ns({levelIndex:A,rowIndex:te.rowIndex,cellIndex:te.cellIndex,event:Y,controlsRef:T}),__getControlRef:(Y,te,F)=>{Array.isArray(T.current[A])||(T.current[A]=[]),Array.isArray(T.current[A][Y])||(T.current[A][Y]=[]),T.current[A][Y][te]=F},levelControlAriaLabel:typeof z=="function"?z(B):z,locale:o,minDate:s,maxDate:a,__preventFocus:f,nextIcon:m,previousIcon:v,nextLabel:p,previousLabel:h,onNext:y,onPrevious:w,onLevelClick:b,nextDisabled:C,previousDisabled:D,hasNextLevel:S,getMonthControlProps:c,classNames:O,styles:k,unstyled:j,__staticSelector:P||"YearLevelGroup",withCellSpacing:d},A)});return g.jsx($t,{classNames:O,styles:k,__staticSelector:P||"YearLevelGroup",ref:t,size:$,unstyled:j,...E,children:N})});Bn.classes={...Fn.classes,...$t.classes};Bn.displayName="@mantine/dates/YearLevelGroup";const dg={numberOfColumns:1},Wn=se((e,t)=>{const r=K("MonthLevelGroup",dg,e),{month:n,locale:o,firstDayOfWeek:s,weekdayFormat:a,weekendDays:i,getDayProps:c,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:m,hideWeekdays:v,getDayAriaLabel:p,__onDayClick:h,__onDayMouseEnter:y,withCellSpacing:w,highlightToday:b,withWeekNumbers:C,__preventFocus:D,nextIcon:S,previousIcon:O,nextLabel:k,previousLabel:j,onNext:P,onPrevious:L,onLevelClick:V,nextDisabled:z,previousDisabled:M,hasNextLevel:$,classNames:_,styles:E,unstyled:T,numberOfColumns:N,levelControlAriaLabel:I,monthLabelFormat:A,__staticSelector:B,__stopPropagation:Y,size:te,static:F,vars:Q,...re}=r,ae=x.useRef([]),Z=Array(N).fill(0).map((le,ie)=>{const pe=q(n).add(ie,"months").toDate();return g.jsx(Vn,{month:pe,withNext:ie===N-1,withPrevious:ie===0,monthLabelFormat:A,__stopPropagation:Y,__onDayClick:h,__onDayMouseEnter:y,__onDayKeyDown:(X,me)=>Ns({levelIndex:ie,rowIndex:me.rowIndex,cellIndex:me.cellIndex,event:X,controlsRef:ae}),__getDayRef:(X,me,fe)=>{Array.isArray(ae.current[ie])||(ae.current[ie]=[]),Array.isArray(ae.current[ie][X])||(ae.current[ie][X]=[]),ae.current[ie][X][me]=fe},levelControlAriaLabel:typeof I=="function"?I(pe):I,locale:o,firstDayOfWeek:s,weekdayFormat:a,weekendDays:i,getDayProps:c,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:m,hideWeekdays:v,getDayAriaLabel:p,__preventFocus:D,nextIcon:S,previousIcon:O,nextLabel:k,previousLabel:j,onNext:P,onPrevious:L,onLevelClick:V,nextDisabled:z,previousDisabled:M,hasNextLevel:$,classNames:_,styles:E,unstyled:T,__staticSelector:B||"MonthLevelGroup",size:te,static:F,withCellSpacing:w,highlightToday:b,withWeekNumbers:C},ie)});return g.jsx($t,{classNames:_,styles:E,__staticSelector:B||"MonthLevelGroup",ref:t,size:te,...re,children:Z})});Wn.classes={...$t.classes,...Vn.classes};Wn.displayName="@mantine/dates/MonthLevelGroup";var rl={input:"m_6fa5e2aa"};const fg={},Yn=se((e,t)=>{const{inputProps:r,wrapperProps:n,placeholder:o,classNames:s,styles:a,unstyled:i,popoverProps:c,modalProps:l,dropdownType:u,children:d,formattedValue:f,dropdownHandlers:m,dropdownOpened:v,onClick:p,clearable:h,onClear:y,clearButtonProps:w,rightSection:b,shouldClear:C,readOnly:D,disabled:S,value:O,name:k,form:j,type:P,...L}=os("PickerInputBase",fg,e),V=g.jsx($e.ClearButton,{onClick:y,unstyled:i,...w}),z=()=>{P==="range"&&Array.isArray(O)&&O[0]&&!O[1]&&y(),m.close()};return g.jsxs(g.Fragment,{children:[u==="modal"&&!D&&g.jsx(dt,{opened:v,onClose:z,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:i,...l,children:d}),g.jsx($e.Wrapper,{...n,children:g.jsxs(Xe,{position:"bottom-start",opened:v,trapFocus:!0,returnFocus:!1,unstyled:i,...c,disabled:(c==null?void 0:c.disabled)||u==="modal"||D,onChange:M=>{var $;M||(($=c==null?void 0:c.onClose)==null||$.call(c),z())},children:[g.jsx(Xe.Target,{children:g.jsx($e,{"data-dates-input":!0,"data-read-only":D||void 0,disabled:S,component:"button",type:"button",multiline:!0,onClick:M=>{p==null||p(M),m.toggle()},__clearSection:V,__clearable:h&&C&&!D&&!S,rightSection:b,...r,ref:t,classNames:{...s,input:Fe(rl.input,s==null?void 0:s.input)},...L,children:f||g.jsx($e.Placeholder,{error:r.error,unstyled:i,className:s==null?void 0:s.placeholder,style:a==null?void 0:a.placeholder,children:o})})}),g.jsx(Xe.Dropdown,{"data-dates-dropdown":!0,children:d})]})}),g.jsx(Ts,{value:O,name:k,form:j,type:P})]})});Yn.classes=rl;Yn.displayName="@mantine/dates/PickerInputBase";const za=e=>e==="range"?[null,null]:e==="multiple"?[]:null;function Nr({type:e,value:t,defaultValue:r,onChange:n,applyTimezone:o=!0}){const s=x.useRef(e),a=Qe(),[i,c,l]=bt({value:ht("add",t,a.getTimezone(),!o),defaultValue:ht("add",r,a.getTimezone(),!o),finalValue:za(e),onChange:d=>{n==null||n(ht("remove",d,a.getTimezone(),!o))}});let u=i;if(s.current!==e){if(s.current=e,t===void 0)u=r!==void 0?r:za(e),c(u);else if(process.env.NODE_ENV==="development")switch(e){case"default":t!==null&&typeof t!="string"&&console.error("[@mantine/dates/use-uncontrolled-dates] Value must be type of `null` or `string`");break;case"multiple":t instanceof Array||console.error("[@mantine/dates/use-uncontrolled-dates] Value must be type of `string[]`");break;case"range":(!(t instanceof Array)||t.length!==2)&&console.error("[@mantine/dates/use-uncontrolled-dates] Value must be type of `[string, string]`");break}}return[u,c,l]}function co(e,t){return e?e==="month"?0:e==="year"?1:2:t||0}function mg(e){return e===0?"month":e===1?"year":"decade"}function Sr(e,t,r){return mg(Cr(co(e,0),co(t,0),co(r,2)))}const pg={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},pr=se((e,t)=>{const r=K("Calendar",pg,e),{vars:n,maxLevel:o,minLevel:s,defaultLevel:a,level:i,onLevelChange:c,date:l,defaultDate:u,onDateChange:d,numberOfColumns:f,columnsToScroll:m,ariaLabels:v,nextLabel:p,previousLabel:h,onYearSelect:y,onMonthSelect:w,onYearMouseEnter:b,onMonthMouseEnter:C,__updateDateOnYearSelect:D,__updateDateOnMonthSelect:S,firstDayOfWeek:O,weekdayFormat:k,weekendDays:j,getDayProps:P,excludeDate:L,renderDay:V,hideOutsideDates:z,hideWeekdays:M,getDayAriaLabel:$,monthLabelFormat:_,nextIcon:E,previousIcon:T,__onDayClick:N,__onDayMouseEnter:I,withCellSpacing:A,highlightToday:B,withWeekNumbers:Y,monthsListFormat:te,getMonthControlProps:F,yearLabelFormat:Q,yearsListFormat:re,getYearControlProps:ae,decadeLabelFormat:Z,classNames:le,styles:ie,unstyled:pe,minDate:X,maxDate:me,locale:fe,__staticSelector:ge,size:U,__preventFocus:J,__stopPropagation:ee,onNextDecade:de,onPreviousDecade:be,onNextYear:oe,onPreviousYear:he,onNextMonth:H,onPreviousMonth:ce,static:we,__timezoneApplied:Oe,...De}=r,{resolvedClassNames:je,resolvedStyles:Pe}=St({classNames:le,styles:ie,props:r}),[Re,Rt]=bt({value:i?Sr(i,s,o):void 0,defaultValue:a?Sr(a,s,o):void 0,finalValue:Sr(void 0,s,o),onChange:c}),[Bt,ke]=Nr({type:"default",value:l,defaultValue:u,onChange:d,applyTimezone:!Oe}),He={__staticSelector:ge||"Calendar",styles:Pe,classNames:je,unstyled:pe,size:U},jt=Qe(),Et=m||f||1,Wt=new Date,Lr=X&&X>Wt?X:Wt,Be=Bt||ht("add",Lr,jt.getTimezone()),hr=()=>{const Ae=q(Be).add(Et,"month").toDate();H==null||H(Ae),ke(Ae)},vr=()=>{const Ae=q(Be).subtract(Et,"month").toDate();ce==null||ce(Ae),ke(Ae)},Ir=()=>{const Ae=q(Be).add(Et,"year").toDate();oe==null||oe(Ae),ke(Ae)},Un=()=>{const Ae=q(Be).subtract(Et,"year").toDate();he==null||he(Ae),ke(Ae)},Fr=()=>{const Ae=q(Be).add(10*Et,"year").toDate();de==null||de(Ae),ke(Ae)},Gn=()=>{const Ae=q(Be).subtract(10*Et,"year").toDate();be==null||be(Ae),ke(Ae)};return g.jsxs(ue,{ref:t,size:U,"data-calendar":!0,...De,children:[Re==="month"&&g.jsx(Wn,{month:Be,minDate:X,maxDate:me,firstDayOfWeek:O,weekdayFormat:k,weekendDays:j,getDayProps:P,excludeDate:L,renderDay:V,hideOutsideDates:z,hideWeekdays:M,getDayAriaLabel:$,onNext:hr,onPrevious:vr,hasNextLevel:o!=="month",onLevelClick:()=>Rt("year"),numberOfColumns:f,locale:fe,levelControlAriaLabel:v==null?void 0:v.monthLevelControl,nextLabel:(v==null?void 0:v.nextMonth)??p,nextIcon:E,previousLabel:(v==null?void 0:v.previousMonth)??h,previousIcon:T,monthLabelFormat:_,__onDayClick:N,__onDayMouseEnter:I,__preventFocus:J,__stopPropagation:ee,static:we,withCellSpacing:A,highlightToday:B,withWeekNumbers:Y,...He}),Re==="year"&&g.jsx(Bn,{year:Be,numberOfColumns:f,minDate:X,maxDate:me,monthsListFormat:te,getMonthControlProps:F,locale:fe,onNext:Ir,onPrevious:Un,hasNextLevel:o!=="month"&&o!=="year",onLevelClick:()=>Rt("decade"),levelControlAriaLabel:v==null?void 0:v.yearLevelControl,nextLabel:(v==null?void 0:v.nextYear)??p,nextIcon:E,previousLabel:(v==null?void 0:v.previousYear)??h,previousIcon:T,yearLabelFormat:Q,__onControlMouseEnter:C,__onControlClick:(Ae,Nt)=>{S&&ke(Nt),Rt(Sr("month",s,o)),w==null||w(Nt)},__preventFocus:J,__stopPropagation:ee,withCellSpacing:A,...He}),Re==="decade"&&g.jsx(zn,{decade:Be,minDate:X,maxDate:me,yearsListFormat:re,getYearControlProps:ae,locale:fe,onNext:Fr,onPrevious:Gn,numberOfColumns:f,nextLabel:(v==null?void 0:v.nextDecade)??p,nextIcon:E,previousLabel:(v==null?void 0:v.previousDecade)??h,previousIcon:T,decadeLabelFormat:Z,__onControlMouseEnter:b,__onControlClick:(Ae,Nt)=>{D&&ke(Nt),Rt(Sr("year",s,o)),y==null||y(Nt)},__preventFocus:J,__stopPropagation:ee,withCellSpacing:A,...He})]})});pr.classes={...zn.classes,...Bn.classes,...Wn.classes};pr.displayName="@mantine/dates/Calendar";function nl(e){const{maxLevel:t,minLevel:r,defaultLevel:n,level:o,onLevelChange:s,nextIcon:a,previousIcon:i,date:c,defaultDate:l,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:m,nextLabel:v,previousLabel:p,onYearSelect:h,onMonthSelect:y,onYearMouseEnter:w,onMonthMouseEnter:b,onNextMonth:C,onPreviousMonth:D,onNextYear:S,onPreviousYear:O,onNextDecade:k,onPreviousDecade:j,withCellSpacing:P,highlightToday:L,__updateDateOnYearSelect:V,__updateDateOnMonthSelect:z,withWeekNumbers:M,firstDayOfWeek:$,weekdayFormat:_,weekendDays:E,getDayProps:T,excludeDate:N,renderDay:I,hideOutsideDates:A,hideWeekdays:B,getDayAriaLabel:Y,monthLabelFormat:te,monthsListFormat:F,getMonthControlProps:Q,yearLabelFormat:re,yearsListFormat:ae,getYearControlProps:Z,decadeLabelFormat:le,allowSingleDateInRange:ie,allowDeselect:pe,minDate:X,maxDate:me,locale:fe,...ge}=e;return{calendarProps:{maxLevel:t,minLevel:r,defaultLevel:n,level:o,onLevelChange:s,nextIcon:a,previousIcon:i,date:c,defaultDate:l,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:m,nextLabel:v,previousLabel:p,onYearSelect:h,onMonthSelect:y,onYearMouseEnter:w,onMonthMouseEnter:b,onNextMonth:C,onPreviousMonth:D,onNextYear:S,onPreviousYear:O,onNextDecade:k,onPreviousDecade:j,withCellSpacing:P,highlightToday:L,__updateDateOnYearSelect:V,__updateDateOnMonthSelect:z,withWeekNumbers:M,firstDayOfWeek:$,weekdayFormat:_,weekendDays:E,getDayProps:T,excludeDate:N,renderDay:I,hideOutsideDates:A,hideWeekdays:B,getDayAriaLabel:Y,monthLabelFormat:te,monthsListFormat:F,getMonthControlProps:Q,yearLabelFormat:re,yearsListFormat:ae,getYearControlProps:Z,decadeLabelFormat:le,allowSingleDateInRange:ie,allowDeselect:pe,minDate:X,maxDate:me,locale:fe},others:ge}}function Ba(e,t){const r=[...t].sort((n,o)=>n.getTime()-o.getTime());return q(r[0]).startOf("day").subtract(1,"ms").isBefore(e)&&q(r[1]).endOf("day").add(1,"ms").isAfter(e)}function hg({type:e,level:t,value:r,defaultValue:n,onChange:o,allowSingleDateInRange:s,allowDeselect:a,onMouseLeave:i,applyTimezone:c=!0}){const[l,u]=Nr({type:e,value:r,defaultValue:n,onChange:o,applyTimezone:c}),[d,f]=x.useState(e==="range"&&l[0]&&!l[1]?l[0]:null),[m,v]=x.useState(null),p=S=>{if(e==="range"){if(d instanceof Date&&!l[1]){if(q(S).isSame(d,t)&&!s){f(null),v(null),u([null,null]);return}const O=[S,d];O.sort((k,j)=>k.getTime()-j.getTime()),u(O),v(null),f(null);return}if(l[0]&&!l[1]&&q(S).isSame(l[0],t)&&!s){f(null),v(null),u([null,null]);return}u([S,null]),v(null),f(S);return}if(e==="multiple"){l.some(O=>q(O).isSame(S,t))?u(l.filter(O=>!q(O).isSame(S,t))):u([...l,S]);return}l&&a&&q(S).isSame(l,t)?u(null):u(S)},h=S=>d instanceof Date&&m instanceof Date?Ba(S,[m,d]):l[0]instanceof Date&&l[1]instanceof Date?Ba(S,l):!1,y=e==="range"?S=>{i==null||i(S),v(null)}:i,w=S=>l[0]instanceof Date&&q(S).isSame(l[0],t)?!(m&&q(m).isBefore(l[0])):!1,b=S=>l[1]instanceof Date?q(S).isSame(l[1],t):!(l[0]instanceof Date)||!m?!1:q(m).isBefore(l[0])&&q(S).isSame(l[0],t),C=S=>{if(e==="range")return{selected:l.some(k=>k&&q(k).isSame(S,t)),inRange:h(S),firstInRange:w(S),lastInRange:b(S),"data-autofocus":!!l[0]&&q(l[0]).isSame(S,t)||void 0};if(e==="multiple")return{selected:l.some(k=>k&&q(k).isSame(S,t)),"data-autofocus":!!l[0]&&q(l[0]).isSame(S,t)||void 0};const O=q(l).isSame(S,t);return{selected:O,"data-autofocus":O||void 0}},D=e==="range"&&d?v:()=>{};return x.useEffect(()=>{if(e==="range")if(l[0]&&!l[1]&&(d==null?void 0:d.getTime())!==l[0].getTime())f(l[0]);else{const S=l[0]==null&&l[1]==null,O=l[0]!=null&&l[1]!=null;(S||O)&&(f(null),v(null))}},[l]),{onDateChange:p,onRootMouseLeave:y,onHoveredDateChange:D,getControlProps:C,_value:l,setValue:u}}const vg={type:"default",defaultLevel:"month",numberOfColumns:1},Hn=se((e,t)=>{const r=K("DatePicker",vg,e),{classNames:n,styles:o,vars:s,type:a,defaultValue:i,value:c,onChange:l,__staticSelector:u,getDayProps:d,allowSingleDateInRange:f,allowDeselect:m,onMouseLeave:v,numberOfColumns:p,hideOutsideDates:h,__onDayMouseEnter:y,__onDayClick:w,__timezoneApplied:b,...C}=r,{onDateChange:D,onRootMouseLeave:S,onHoveredDateChange:O,getControlProps:k}=hg({type:a,level:"day",allowDeselect:m,allowSingleDateInRange:f,value:c,defaultValue:i,onChange:l,onMouseLeave:v,applyTimezone:!b}),{resolvedClassNames:j,resolvedStyles:P}=St({classNames:n,styles:o,props:r}),L=Qe();return g.jsx(pr,{ref:t,minLevel:"month",classNames:j,styles:P,__staticSelector:u||"DatePicker",onMouseLeave:S,numberOfColumns:p,hideOutsideDates:h??p!==1,__onDayMouseEnter:(V,z)=>{O(z),y==null||y(V,z)},__onDayClick:(V,z)=>{D(z),w==null||w(V,z)},getDayProps:V=>({...k(V),...d==null?void 0:d(V)}),...C,date:ht("add",C.date,L.getTimezone(),b),__timezoneApplied:!0})});Hn.classes=pr.classes;Hn.displayName="@mantine/dates/DatePicker";function gg(e,t){if(e===null)return null;const r=ht("add",new Date(e),t);return Number.isNaN(r.getTime())||!e?null:r}function yg({date:e,maxDate:t,minDate:r}){return!(e==null||Number.isNaN(e.getTime())||t&&q(e).isAfter(t,"date")||r&&q(e).isBefore(r,"date"))}const bg={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,preserveTime:!0},$s=se((e,t)=>{const r=os("DateInput",bg,e),{inputProps:n,wrapperProps:o,value:s,defaultValue:a,onChange:i,clearable:c,clearButtonProps:l,popoverProps:u,getDayProps:d,locale:f,valueFormat:m,dateParser:v,minDate:p,maxDate:h,fixOnBlur:y,onFocus:w,onBlur:b,onClick:C,readOnly:D,name:S,form:O,rightSection:k,unstyled:j,classNames:P,styles:L,allowDeselect:V,preserveTime:z,date:M,defaultDate:$,onDateChange:_,...E}=r,T=x.useRef(null),N=x.useRef(null),[I,A]=x.useState(!1),{calendarProps:B,others:Y}=nl(E),te=Qe(),Q=v||(oe=>{const he=q(oe,m,te.getLocale(f)).toDate();return Number.isNaN(he.getTime())?gg(oe,te.getTimezone()):he}),re=V!==void 0?V:c,ae=oe=>oe?q(oe).locale(te.getLocale(f)).format(m):"",[Z,le,ie]=Nr({type:"default",value:s,defaultValue:a,onChange:i}),[pe,X]=Nr({type:"default",value:M,defaultValue:a||$,onChange:_});x.useEffect(()=>{ie&&s!==null&&X(s)},[ie,s]);const[me,fe]=x.useState(ae(Z));x.useEffect(()=>{fe(ae(Z))},[te.getLocale(f)]);const ge=oe=>{const he=oe.currentTarget.value;if(fe(he),A(!0),he.trim()===""&&c)le(null);else{const H=Q(he);yg({date:H,minDate:p,maxDate:h})&&(le(H),X(H))}},U=oe=>{b==null||b(oe),A(!1),y&&fe(ae(Z))},J=oe=>{w==null||w(oe),A(!0)},ee=oe=>{C==null||C(oe),A(!0)},de=oe=>({...d==null?void 0:d(oe),selected:q(Z).isSame(oe,"day"),onClick:he=>{var we,Oe;(Oe=d==null?void 0:(we=d(oe)).onClick)==null||Oe.call(we,he);const H=z?Oo(Z,oe):oe,ce=c&&re&&q(Z).isSame(oe,"day")?null:H;le(ce),!ie&&fe(ae(ce)),A(!1)}}),be=k||(c&&Z&&!D?g.jsx(Pr,{variant:"transparent",onMouseDown:oe=>oe.preventDefault(),tabIndex:-1,onClick:()=>{le(null),!ie&&fe(""),A(!1)},unstyled:j,size:n.size||"sm",...l}):null);return yt(()=>{Z!==void 0&&!I&&fe(ae(Z))},[Z]),Ha(()=>A(!1),void 0,[T.current,N.current]),g.jsxs(g.Fragment,{children:[g.jsx($e.Wrapper,{...o,__staticSelector:"DateInput",ref:T,children:g.jsxs(Xe,{opened:I,trapFocus:!1,position:"bottom-start",disabled:D,withRoles:!1,unstyled:j,...u,children:[g.jsx(Xe.Target,{children:g.jsx($e,{"data-dates-input":!0,"data-read-only":D||void 0,autoComplete:"off",ref:t,value:me,onChange:ge,onBlur:U,onFocus:J,onClick:ee,readOnly:D,rightSection:be,...n,...Y,__staticSelector:"DateInput"})}),g.jsx(Xe.Dropdown,{onMouseDown:oe=>oe.preventDefault(),"data-dates-dropdown":!0,ref:N,children:g.jsx(pr,{__staticSelector:"DateInput",__timezoneApplied:!0,...B,classNames:P,styles:L,unstyled:j,__preventFocus:!0,minDate:p,maxDate:h,locale:f,getDayProps:de,size:n.size,date:pe,onDateChange:X})})]})}),g.jsx(Ts,{name:S,form:O,value:Z,type:"default"})]})});$s.classes={...$e.classes,...pr.classes};$s.displayName="@mantine/dates/DateInput";var ol={timeWrapper:"m_208d2562",timeInput:"m_62ee059"};const xg={dropdownType:"popover"},js=se((e,t)=>{const r=K("DateTimePicker",xg,e),{value:n,defaultValue:o,onChange:s,valueFormat:a,locale:i,classNames:c,styles:l,unstyled:u,timeInputProps:d,submitButtonProps:f,withSeconds:m,level:v,defaultLevel:p,size:h,variant:y,dropdownType:w,vars:b,minDate:C,maxDate:D,...S}=r,O=ye({name:"DateTimePicker",classes:ol,props:r,classNames:c,styles:l,unstyled:u,vars:b}),{resolvedClassNames:k,resolvedStyles:j}=St({classNames:c,styles:l,props:r}),P=a||(m?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),L=x.useRef(null),V=Ze(L,d==null?void 0:d.ref),{calendarProps:{allowSingleDateInRange:z,...M},others:$}=nl(S),_=Qe(),[E,T]=Nr({type:"default",value:n,defaultValue:o,onChange:s}),N=X=>X?q(X).format(m?"HH:mm:ss":"HH:mm"):"",[I,A]=x.useState(N(E)),[B,Y]=x.useState(v||p||"month"),[te,F]=Jl(!1),Q=E?q(E).locale(_.getLocale(i)).tz(_.getTimezone(),!0).format(P):"",re=X=>{var fe;(fe=d==null?void 0:d.onChange)==null||fe.call(d,X);const me=X.currentTarget.value;if(A(me),me){const[ge,U,J]=me.split(":").map(Number),ee=ht("add",new Date,_.getTimezone());ee.setHours(ge),ee.setMinutes(U),ee.setSeconds(J||0),ee.setMilliseconds(0),T(Oo(ee,E||ht("add",new Date,_.getTimezone())))}},ae=X=>{var me;X&&T(Oo(E,X)),(me=L.current)==null||me.focus()},Z=X=>{var me;(me=d==null?void 0:d.onKeyDown)==null||me.call(d,X),X.key==="Enter"&&(X.preventDefault(),F.close())};yt(()=>{te||A(N(E))},[E,te]),yt(()=>{te&&Y("month")},[te]);const le=C?q(C).format("HH:mm:ss"):null,ie=D?q(D).format("HH:mm:ss"):null,pe=w==="popover";return g.jsxs(Yn,{formattedValue:Q,dropdownOpened:S.disabled?!1:te,dropdownHandlers:F,classNames:k,styles:j,unstyled:u,ref:t,onClear:()=>T(null),shouldClear:!!E,value:E,size:h,variant:y,dropdownType:w,...$,type:"default",__staticSelector:"DateTimePicker",children:[g.jsx(Hn,{...M,maxDate:D,minDate:C,size:h,variant:y,type:"default",value:E,defaultDate:E,onChange:ae,locale:i,classNames:k,styles:j,unstyled:u,__staticSelector:"DateTimePicker",__stopPropagation:pe,level:v,defaultLevel:p,onLevelChange:X=>{var me;Y(X),(me=M.onLevelChange)==null||me.call(M,X)},__timezoneApplied:!0}),B==="month"&&g.jsxs("div",{...O("timeWrapper"),children:[g.jsx(jn,{value:I,withSeconds:m,ref:V,unstyled:u,minTime:E&&C&&E.toDateString()===C.toDateString()?le??void 0:void 0,maxTime:E&&D&&E.toDateString()===D.toDateString()?ie??void 0:void 0,...d,...O("timeInput",{className:d==null?void 0:d.className,style:d==null?void 0:d.style}),onChange:re,onKeyDown:Z,size:h,"data-mantine-stop-propagation":pe||void 0}),g.jsx(ur,{variant:"default",size:`input-${h||"sm"}`,...O("submitButton",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),unstyled:u,"data-mantine-stop-propagation":pe||void 0,children:g.jsx(gs,{size:"30%"}),...f,onClick:X=>{var me;(me=f==null?void 0:f.onClick)==null||me.call(f,X),F.close()}})]})]})});js.classes={...ol,...Yn.classes,...Hn.classes};js.displayName="@mantine/dates/DateTimePicker";q.extend(Vc);const wg=e=>{const{name:t,onChange:r,value:n,readOnly:o}=e;return g.jsx($s,{name:t,onChange:s=>r(t,s),value:n,readOnly:o,valueFormat:"YYYY-MM-DD",clearable:!0})};q.extend(Vc);const Sg=e=>{const{name:t,onChange:r,value:n,readOnly:o}=e;return g.jsx(js,{name:t,onChange:s=>r(t,s),value:n,readOnly:o,valueFormat:"YYYY-MM-DD HH:mm:ss",clearable:!0})},Cg=e=>{const{name:t,onChange:r,value:n,readOnly:o}=e;return g.jsx(_s,{name:t,onChange:s=>r(t,s),value:n,readOnly:o})},Dg=e=>{const{fields:t,name:r,onChange:n,value:o,formValues:s,error:a={},readOnly:i}=e,c=(u,d)=>{n(`${r}.${u}`,d)};return t.map((u,d)=>g.jsx(As,{field:u,formValues:s,onChange:c,value:o[u.name],error:a[u.name],readOnly:i},d))},_g=e=>{const{data:t,name:r,onChange:n,value:o,readOnly:s}=e;return g.jsx(Rs,{name:r,data:t,value:o,onChange:a=>n(r,a),readOnly:s,clearable:!0})},Rg=e=>{const{name:t,onChange:r,value:n,readOnly:o}=e;return g.jsx(Cs,{name:t,onChange:s=>r(t,s.target.value),value:n,readOnly:o,styles:{input:{height:200}}})},Eg=e=>{const{name:t,onChange:r,value:n,readOnly:o}=e;return g.jsx(Es,{name:t,onChange:s=>r(t,s.target.value),value:n,readOnly:o})},Ng=e=>{const{name:t,onChange:r,value:n,readOnly:o}=e,s=x.useRef(null),a=g.jsx(ur,{variant:"subtle",color:"gray",onClick:()=>{var i;return(i=s.current)==null?void 0:i.showPicker()},children:"🕛"});return g.jsx(jn,{name:t,onChange:i=>r(t,i.target.value),value:n,readOnly:o,ref:s,rightSection:a,withSeconds:!0})};function Tg(e,t,r){return{addElement:n=>{t(e,[...r,n])},replaceElement:(n,o)=>{const s=r.map((a,i)=>i===n?o:a);t(e,s)},removeElement:n=>{t(e,r.filter((o,s)=>s!==n))}}}const As=({field:e,value:t,error:r,onChange:n,formValues:o,fieldContainer:s=c=>g.jsx(g.Fragment,{children:c}),customRender:a,readOnly:i})=>{const c=x.useMemo(()=>typeof e.visible=="function"?e.visible(o):e.visible!==!1,[e.visible,o]),l=x.useMemo(()=>typeof e.disabled=="function"?e.disabled(o):e.disabled===!0,[e.disabled,o]),u=x.useMemo(()=>{if(e.type==="array")return Tg(e.name,n,t)},[e.type,e.name,n,t]),d=x.useMemo(()=>a==null?void 0:a(e,t,r,n,o,u,i||e.readOnly),[a,e,t,r,n,o,u,i,e.readOnly]);if(!c)return null;if(d)return d;const f=()=>{switch(e.type){case"text":return g.jsx(Eg,{name:e.name,value:t,onChange:n,readOnly:i});case"number":return g.jsx(Cg,{name:e.name,value:t,onChange:n,readOnly:i});case"object":return g.jsx(Dg,{name:e.name,onChange:n,value:t,fields:e.fields??[],formValues:o,error:r,readOnly:i});case"array":return g.jsx(cv,{name:e.name,onChange:n,value:t,fields:e.fields,options:u,error:r,readOnly:i});case"check":return g.jsx(lv,{name:e.name,value:t,onChange:n,readOnly:i,label:e.label});case"select":return g.jsx(_g,{name:e.name,value:t,onChange:n,readOnly:i,data:e.data});case"textarea":return g.jsx(Rg,{name:e.name,value:t,onChange:n,readOnly:i});case"date":return g.jsx(wg,{name:e.name,value:t,onChange:n,readOnly:i});case"datetime":return g.jsx(Sg,{name:e.name,value:t,onChange:n,readOnly:i});case"time":return g.jsx(Ng,{name:e.name,value:t,onChange:n,readOnly:i});default:return null}},m=g.jsxs(ws,{legend:e.type==="check"?void 0:e.label,variant:"unstyled",disabled:l||i,styles:{legend:{fontWeight:500}},children:[f(),!["object","array"].includes(e.type)&&typeof r=="string"&&g.jsx(Dn,{c:"red",fz:"sm",fw:500,children:r})]});return s(m,e)},[Og,Mg,kg]=Ml(),$g=e=>{switch(e){case"number":return 0;case"array":return[];case"check":return!1;case"object":return{};case"select":case"date":case"datetime":return null;default:return""}},sl=e=>{const t={};for(const r of e)r.type==="object"&&r.fields?t[r.name]=sl(r.fields):t[r.name]=r.initialValue??$g(r.type);return t},jg=e=>e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0,ko=(e,t,r="")=>{const n={};for(const o of e){const s=r?`${r}.${o.name}`:o.name,a=t==null?void 0:t[o.name];if(o.type==="object")Object.assign(n,ko(o.fields,a||{},s));else if(o.type==="array"){if(o.required&&(!Array.isArray(a)||a.length===0)){n[s]=o.name+" is required";continue}Array.isArray(a)&&a.forEach((i,c)=>{Object.assign(n,ko(o.fields,i,`${s}.${c}`))})}else o.required&&jg(a)&&(n[s]=o.name+" is required")}return n};function Ag(e){const t={};return Object.entries(e).forEach(([r,n])=>{const o=r.split(".");let s=t;o.forEach((a,i)=>{const c=i===o.length-1;o[i+1],c?s[a]=n:(a in s||(s[a]={}),s=s[a])})}),t}const Pg=({onSubmit:e,schema:t,container:r,fieldContainer:n,customRender:o,validate:s,readOnly:a,values:i,onFieldChange:c})=>{const l=kg({mode:"uncontrolled",initialValues:sl(t),validate:s}),u=x.useMemo(()=>l.getValues(),[l.getValues()]),d=Or((p,h)=>{if(l.setFieldValue(p,h),c){const y=c(p,h,u);l.setValues(y)}},0),f=x.useCallback((p,h)=>{const y=l.errors;return p==="object"||p==="array"?Ag(y)[h]:y[h]},[l.errors]),m=x.useCallback(()=>{const p=l.getValues(),h=ko(t,p);if(Object.keys(h).length>0){l.setErrors(h);return}l.onSubmit(e)()},[l,e,t]);x.useEffect(()=>{i&&l.initialize(i)},[i]);const v=g.jsx(Og,{form:l,children:t.map((p,h)=>g.jsx(As,{field:p,formValues:u,value:u[p.name],error:f(p.type,p.name),onChange:d,fieldContainer:n,customRender:o,readOnly:p.readOnly||a},h))});return r(v,m,a)};exports.AutoForm=Pg;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ProseMirror-hideselection *::selection {
|
|
107
|
+
background: transparent;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
111
|
+
background: transparent;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ProseMirror-hideselection * {
|
|
115
|
+
caret-color: transparent;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
119
|
+
display: block;
|
|
120
|
+
}`;function e1(n,e,t){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(s),s}var t1=class extends g0{constructor(n={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:s,moved:o})=>this.options.onDrop(r,s,o)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=xf(e,this.options.autofocus);this.editorState=zn.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n!=null&&n.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=e1(Zb,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=af(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;t=t.filter(i=>!i.key.startsWith(o))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;const r=[...this.options.enableCoreExtensions?[Df,Cf.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Ef,Nf,Rf,If,Of,Lf,Tf].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Ro(r,this)}createCommandManager(){this.commandManager=new To({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=Yi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=Yi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){var e;this.editorView=new Wd(n,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.prependClass(),this.injectCSS();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),s=t.includes(n),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const i=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=i==null?void 0:i.getMeta("focus"),a=i==null?void 0:i.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:i}),a&&this.emit("blur",{editor:this,event:a.event,transaction:i}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||o.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return pf(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return A0(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Pl(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=`
|
|
121
|
+
|
|
122
|
+
`,textSerializers:t={}}=n||{};return M0(this.state.doc,{blockSeparator:e,textSerializers:{...ff(this.schema),...t}})}get isEmpty(){return Ao(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n);return new Qb(e,this)}get $doc(){return this.$pos(0)}};function Cn(n){return new No({find:n.find,handler:({state:e,range:t,match:r})=>{const s=xe(n.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:o}=e,i=r[r.length-1],l=r[0];if(i){const a=l.search(/\S/),c=t.from+l.indexOf(i),u=c+i.length;if(zl(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(y=>y===n.type&&y!==h.mark.type)).filter(h=>h.to>c).length)return null;u<t.to&&o.delete(u,t.to),c>t.from&&o.delete(t.from+a,c);const f=t.from+a+i.length;o.addMark(t.from+a,f,n.type.create(s||{})),o.removeStoredMark(n.type)}},undoable:n.undoable})}function n1(n){return new No({find:n.find,handler:({state:e,range:t,match:r})=>{const s=xe(n.getAttributes,void 0,r)||{},{tr:o}=e,i=t.from;let l=t.to;const a=n.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=i+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,i+r[0].length-1),o.replaceWith(u,l,a)}else if(r[0]){const c=n.type.isInline?i:i-1;o.insert(c,n.type.create(s)).delete(o.mapping.map(i),o.mapping.map(l))}o.scrollIntoView()},undoable:n.undoable})}function qi(n){return new No({find:n.find,handler:({state:e,range:t,match:r})=>{const s=e.doc.resolve(t.from),o=xe(n.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)},undoable:n.undoable})}function qn(n){return new No({find:n.find,handler:({state:e,range:t,match:r,chain:s})=>{const o=xe(n.getAttributes,void 0,r)||{},i=e.tr.delete(t.from,t.to),a=i.doc.resolve(t.from).blockRange(),c=a&&xl(a,n.type,o);if(!c)return null;if(i.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=n.editor.extensionManager,m=f||d.$to.parentOffset&&d.$from.marks();if(m){const y=m.filter(g=>h.includes(g.type.name));i.ensureMarks(y)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,o).run()}const u=i.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&en(i.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&i.join(t.from-1)},undoable:n.undoable})}function r1(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof Q){const o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let s=r.depth;for(;s>=0;){const o=r.index(s);if(r.node(s).contentMatchAt(o).matchType(e))return!0;s-=1}return!1}function s1(n,e,t={}){const{state:r}=e,{doc:s,tr:o}=r,i=n;s.descendants((l,a)=>{const c=o.mapping.map(a),u=o.mapping.map(a)+l.nodeSize;let d=null;if(l.marks.forEach(h=>{if(h!==i)return!1;d=h}),!d)return;let f=!1;if(Object.keys(t).forEach(h=>{t[h]!==d.attrs[h]&&(f=!0)}),f){const h=n.type.create({...n.attrs,...t});o.removeMark(c,u,n.type),o.addMark(c,u,h)}}),o.docChanged&&e.view.dispatch(o)}var it=class jf extends Vl{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new jf(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Xt(n){return new B0({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:s})=>{const o=xe(n.getAttributes,void 0,r,s);if(o===!1||o===null)return null;const{tr:i}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(zl(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===n.type&&g!==m.mark.type)).filter(m=>m.to>d).length)return null;f<t.to&&i.delete(f,t.to),d>t.from&&i.delete(t.from+u,d),c=t.from+u+l.length,i.addMark(t.from+u,c,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}var fi,Pc;function o1(){return Pc||(Pc=1,fi=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s of e.entries())if(!t.has(s[0]))return!1;for(s of e.entries())if(!n(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(e[s]!==t[s])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!(i==="_owner"&&e.$$typeof)&&!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),fi}var i1=o1();const l1=ol(i1);var Kr={exports:{}},hi={};/**
|
|
123
|
+
* @license React
|
|
124
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
125
|
+
*
|
|
126
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the MIT license found in the
|
|
129
|
+
* LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/var _c;function a1(){if(_c)return hi;_c=1;var n=E,e=gl();function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,o=n.useRef,i=n.useEffect,l=n.useMemo,a=n.useDebugValue;return hi.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var m=o(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=l(function(){function b(v){if(!k){if(k=!0,C=v,v=f(v),h!==void 0&&y.hasValue){var w=y.value;if(h(w,v))return T=w}return T=v}if(w=T,r(C,v))return w;var O=f(v);return h!==void 0&&h(w,O)?(C=v,w):(C=v,T=O)}var k=!1,C,T,M=d===void 0?null:d;return[function(){return b(u())},M===null?void 0:function(){return b(M())}]},[u,d,f,h]);var g=s(c,m[0],m[1]);return i(function(){y.hasValue=!0,y.value=g},[g]),a(g),g},hi}var pi={};/**
|
|
131
|
+
* @license React
|
|
132
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
133
|
+
*
|
|
134
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the MIT license found in the
|
|
137
|
+
* LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/var Bc;function c1(){return Bc||(Bc=1,process.env.NODE_ENV!=="production"&&function(){function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=E,t=gl(),r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,l=e.useMemo,a=e.useDebugValue;pi.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var m=o(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=l(function(){function b(v){if(!k){if(k=!0,C=v,v=f(v),h!==void 0&&y.hasValue){var w=y.value;if(h(w,v))return T=w}return T=v}if(w=T,r(C,v))return w;var O=f(v);return h!==void 0&&h(w,O)?(C=v,w):(C=v,T=O)}var k=!1,C,T,M=d===void 0?null:d;return[function(){return b(u())},M===null?void 0:function(){return b(M())}]},[u,d,f,h]);var g=s(c,m[0],m[1]);return i(function(){y.hasValue=!0,y.value=g},[g]),a(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),pi}var Fc;function u1(){return Fc||(Fc=1,process.env.NODE_ENV==="production"?Kr.exports=a1():Kr.exports=c1()),Kr.exports}var d1=u1(),f1=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},h1=({contentComponent:n})=>{const e=Au.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return p.jsx(p.Fragment,{children:Object.values(e)})};function p1(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:bh.createPortal(r.reactElement,r.element,t)},n.forEach(s=>s())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(s=>s())}}}var m1=class extends E.Component{constructor(n){var e;super(n),this.editorContentRef=E.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=n.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const n=this.props.editor;if(n&&!n.isDestroyed&&n.options.element){if(n.contentComponent)return;const e=this.editorContentRef.current;e.append(n.view.dom),n.setOptions({element:e}),n.contentComponent=p1(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=n.contentComponent.subscribe(()=>{this.setState(t=>t.hasContentComponentInitialized?t:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),n.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var n;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((n=e.view.dom)!=null&&n.firstChild))return;const t=document.createElement("div");t.append(e.view.dom),e.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return p.jsxs(p.Fragment,{children:[p.jsx("div",{ref:f1(e,this.editorContentRef),...t}),(n==null?void 0:n.contentComponent)&&p.jsx(h1,{contentComponent:n.contentComponent})]})}},g1=E.forwardRef((n,e)=>{const t=E.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return E.createElement(m1,{key:t,innerRef:e,...n})}),zc=E.memo(g1),y1=typeof window<"u"?E.useLayoutEffect:E.useEffect,b1=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function x1(n){var e;const[t]=E.useState(()=>new b1(n.editor)),r=d1.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!=null?e:l1);return y1(()=>t.watch(n.editor),[n.editor,t]),E.useDebugValue(r),r}var Vc=process.env.NODE_ENV!=="production",Ki=typeof window>"u",k1=Ki||!!(typeof window<"u"&&window.next),S1=class Pf{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(Ki||k1){if(Vc)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&Ki&&Vc)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,o;return(o=(s=this.options.current).onBeforeCreate)==null?void 0:o.call(s,...r)},onBlur:(...r)=>{var s,o;return(o=(s=this.options.current).onBlur)==null?void 0:o.call(s,...r)},onCreate:(...r)=>{var s,o;return(o=(s=this.options.current).onCreate)==null?void 0:o.call(s,...r)},onDestroy:(...r)=>{var s,o;return(o=(s=this.options.current).onDestroy)==null?void 0:o.call(s,...r)},onFocus:(...r)=>{var s,o;return(o=(s=this.options.current).onFocus)==null?void 0:o.call(s,...r)},onSelectionUpdate:(...r)=>{var s,o;return(o=(s=this.options.current).onSelectionUpdate)==null?void 0:o.call(s,...r)},onTransaction:(...r)=>{var s,o;return(o=(s=this.options.current).onTransaction)==null?void 0:o.call(s,...r)},onUpdate:(...r)=>{var s,o;return(o=(s=this.options.current).onUpdate)==null?void 0:o.call(s,...r)},onContentError:(...r)=>{var s,o;return(o=(s=this.options.current).onContentError)==null?void 0:o.call(s,...r)},onDrop:(...r)=>{var s,o;return(o=(s=this.options.current).onDrop)==null?void 0:o.call(s,...r)},onPaste:(...r)=>{var s,o;return(o=(s=this.options.current).onPaste)==null?void 0:o.call(s,...r)},onDelete:(...r)=>{var s,o;return(o=(s=this.options.current).onDelete)==null?void 0:o.call(s,...r)}};return new t1(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((s,o)=>{var i;return s===((i=t.extensions)==null?void 0:i[o])}):e[r]===t[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Pf.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function v1(n={},e=[]){const t=E.useRef(n);t.current=n;const[r]=E.useState(()=>new S1(t)),s=Au.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return E.useDebugValue(s),E.useEffect(r.onRender(e)),x1({editor:s,selector:({transactionNumber:o})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&o===0?0:o+1}),s}var C1=E.createContext({editor:null});C1.Consumer;var M1=E.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),w1=()=>E.useContext(M1);E.forwardRef((n,e)=>{const{onDragStart:t}=w1(),r=n.as||"div";return p.jsx(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});E.createContext({markViewContentRef:()=>{}});var Ds=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]},E1=/^\s*>\s$/,T1=it.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return Ds("blockquote",{...Me(this.options.HTMLAttributes,n),children:Ds("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[qn({find:E1,type:this.type})]}}),O1=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,D1=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,A1=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,N1=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,R1=St.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return Ds("strong",{...Me(this.options.HTMLAttributes,n),children:Ds("slot",{})})},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Cn({find:O1,type:this.type}),Cn({find:A1,type:this.type})]},addPasteRules(){return[Xt({find:D1,type:this.type}),Xt({find:N1,type:this.type})]}}),L1=/(^|[^`])`([^`]+)`(?!`)$/,I1=/(^|[^`])`([^`]+)`(?!`)/g,j1=St.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Cn({find:L1,type:this.type})]},addPasteRules(){return[Xt({find:I1,type:this.type})]}}),mi=4,P1=/^```([a-z]+)?[\s\n]$/,_1=/^~~~([a-z]+)?[\s\n]$/,B1=it.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:mi,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const o=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(t)).map(i=>i.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Me(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:mi,{state:r}=n,{selection:s}=r,{$from:o,empty:i}=s;if(o.parent.type!==this.type)return!1;const l=" ".repeat(t);return i?n.commands.insertContent(l):n.commands.command(({tr:a})=>{const{from:c,to:u}=s,h=r.doc.textBetween(c,u,`
|
|
139
|
+
`,`
|
|
140
|
+
`).split(`
|
|
141
|
+
`).map(m=>l+m).join(`
|
|
142
|
+
`);return a.replaceWith(c,u,r.schema.text(h)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:mi,{state:r}=n,{selection:s}=r,{$from:o,empty:i}=s;return o.parent.type!==this.type?!1:i?n.commands.command(({tr:l})=>{var a;const{pos:c}=o,u=o.start(),d=o.end(),h=r.doc.textBetween(u,d,`
|
|
143
|
+
`,`
|
|
144
|
+
`).split(`
|
|
145
|
+
`);let m=0,y=0;const g=c-u;for(let v=0;v<h.length;v+=1){if(y+h[v].length>=g){m=v;break}y+=h[v].length+1}const k=((a=h[m].match(/^ */))==null?void 0:a[0])||"",C=Math.min(k.length,t);if(C===0)return!0;let T=u;for(let v=0;v<m;v+=1)T+=h[v].length+1;return l.delete(T,T+C),c-T<=C&&l.setSelection(ne.create(l.doc,T)),!0}):n.commands.command(({tr:l})=>{const{from:a,to:c}=s,f=r.doc.textBetween(a,c,`
|
|
146
|
+
`,`
|
|
147
|
+
`).split(`
|
|
148
|
+
`).map(h=>{var m;const y=((m=h.match(/^ */))==null?void 0:m[0])||"",g=Math.min(y.length,t);return h.slice(g)}).join(`
|
|
149
|
+
`);return l.replaceWith(a,c,r.schema.text(f)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:s}=t;if(!s||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
|
|
150
|
+
|
|
151
|
+
`);return!o||!i?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:s,empty:o}=t;if(!o||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:r.nodeAt(l)?n.commands.command(({tr:c})=>(c.setSelection(le.near(r.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[qi({find:P1,type:this.type,getAttributes:n=>({language:n[1]})}),qi({find:_1,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Te({key:new _e("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,o=s==null?void 0:s.mode;if(!t||!o)return!1;const{tr:i,schema:l}=n.state,a=l.text(t.replace(/\r\n?/g,`
|
|
152
|
+
`));return i.replaceSelectionWith(this.type.create({language:o},a)),i.selection.$from.parent.type!==this.type&&i.setSelection(ne.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),n.dispatch(i),!0}}})]}}),F1=it.create({name:"doc",topNode:!0,content:"block+"}),z1=it.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Me(this.options.HTMLAttributes,n)]},renderText(){return`
|
|
153
|
+
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:o}=t;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:l}=r.extensionManager,a=o||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&i){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),V1=it.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Me(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>qi({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),H1=it.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Me(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!r1(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,s=n();return yf(t)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:o,tr:i,dispatch:l})=>{if(l){const{$to:a}=i.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(ne.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(Q.create(i.doc,a.pos)):i.setSelection(ne.create(i.doc,a.pos));else{const u=o.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(i.insert(c,d),i.setSelection(ne.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[n1({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),$1=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,W1=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Y1=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,U1=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,q1=St.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Cn({find:$1,type:this.type}),Cn({find:Y1,type:this.type})]},addPasteRules(){return[Xt({find:W1,type:this.type}),Xt({find:U1,type:this.type})]}});const K1="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",J1="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ji="numeric",Gi="ascii",Xi="alpha",fr="asciinumeric",lr="alphanumeric",Qi="domain",_f="emoji",G1="scheme",X1="slashscheme",gi="whitespace";function Q1(n,e){return n in e||(e[n]=[]),e[n]}function hn(n,e,t){e[Ji]&&(e[fr]=!0,e[lr]=!0),e[Gi]&&(e[fr]=!0,e[Xi]=!0),e[fr]&&(e[lr]=!0),e[Xi]&&(e[lr]=!0),e[lr]&&(e[Qi]=!0),e[_f]&&(e[Qi]=!0);for(const r in e){const s=Q1(r,t);s.indexOf(n)<0&&s.push(n)}}function Z1(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function nt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}nt.groups={};nt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],o=e.jr[r][1];if(o&&s.test(n))return o}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let s=0;s<n.length;s++)this.tt(n[s],e,t,r)},tr(n,e,t,r){r=r||nt.groups;let s;return e&&e.j?s=e:(s=new nt(e),t&&r&&hn(e,t,r)),this.jr.push([n,s]),s},ts(n,e,t,r){let s=this;const o=n.length;if(!o)return s;for(let i=0;i<o-1;i++)s=s.tt(n[i]);return s.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||nt.groups;const s=this;if(e&&e.j)return s.j[n]=e,e;const o=e;let i,l=s.go(n);if(l?(i=new nt,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new nt,o){if(r)if(i.t&&typeof i.t=="string"){const a=Object.assign(Z1(i.t,r),t);hn(o,a,r)}else t&&hn(o,t,r);i.t=o}return s.j[n]=i,i}};const ie=(n,e,t,r,s)=>n.ta(e,t,r,s),we=(n,e,t,r,s)=>n.tr(e,t,r,s),Hc=(n,e,t,r,s)=>n.ts(e,t,r,s),_=(n,e,t,r,s)=>n.tt(e,t,r,s),Ot="WORD",Zi="UWORD",Bf="ASCIINUMERICAL",Ff="ALPHANUMERICAL",Or="LOCALHOST",el="TLD",tl="UTLD",cs="SCHEME",_n="SLASH_SCHEME",$l="NUM",nl="WS",Wl="NL",hr="OPENBRACE",pr="CLOSEBRACE",As="OPENBRACKET",Ns="CLOSEBRACKET",Rs="OPENPAREN",Ls="CLOSEPAREN",Is="OPENANGLEBRACKET",js="CLOSEANGLEBRACKET",Ps="FULLWIDTHLEFTPAREN",_s="FULLWIDTHRIGHTPAREN",Bs="LEFTCORNERBRACKET",Fs="RIGHTCORNERBRACKET",zs="LEFTWHITECORNERBRACKET",Vs="RIGHTWHITECORNERBRACKET",Hs="FULLWIDTHLESSTHAN",$s="FULLWIDTHGREATERTHAN",Ws="AMPERSAND",Ys="APOSTROPHE",Us="ASTERISK",Bt="AT",qs="BACKSLASH",Ks="BACKTICK",Js="CARET",Vt="COLON",Yl="COMMA",Gs="DOLLAR",gt="DOT",Xs="EQUALS",Ul="EXCLAMATION",at="HYPHEN",mr="PERCENT",Qs="PIPE",Zs="PLUS",eo="POUND",gr="QUERY",ql="QUOTE",zf="FULLWIDTHMIDDLEDOT",Kl="SEMI",yt="SLASH",yr="TILDE",to="UNDERSCORE",Vf="EMOJI",no="SYM";var Hf=Object.freeze({__proto__:null,ALPHANUMERICAL:Ff,AMPERSAND:Ws,APOSTROPHE:Ys,ASCIINUMERICAL:Bf,ASTERISK:Us,AT:Bt,BACKSLASH:qs,BACKTICK:Ks,CARET:Js,CLOSEANGLEBRACKET:js,CLOSEBRACE:pr,CLOSEBRACKET:Ns,CLOSEPAREN:Ls,COLON:Vt,COMMA:Yl,DOLLAR:Gs,DOT:gt,EMOJI:Vf,EQUALS:Xs,EXCLAMATION:Ul,FULLWIDTHGREATERTHAN:$s,FULLWIDTHLEFTPAREN:Ps,FULLWIDTHLESSTHAN:Hs,FULLWIDTHMIDDLEDOT:zf,FULLWIDTHRIGHTPAREN:_s,HYPHEN:at,LEFTCORNERBRACKET:Bs,LEFTWHITECORNERBRACKET:zs,LOCALHOST:Or,NL:Wl,NUM:$l,OPENANGLEBRACKET:Is,OPENBRACE:hr,OPENBRACKET:As,OPENPAREN:Rs,PERCENT:mr,PIPE:Qs,PLUS:Zs,POUND:eo,QUERY:gr,QUOTE:ql,RIGHTCORNERBRACKET:Fs,RIGHTWHITECORNERBRACKET:Vs,SCHEME:cs,SEMI:Kl,SLASH:yt,SLASH_SCHEME:_n,SYM:no,TILDE:yr,TLD:el,UNDERSCORE:to,UTLD:tl,UWORD:Zi,WORD:Ot,WS:nl});const Et=/[a-z]/,tr=new RegExp("\\p{L}","u"),yi=new RegExp("\\p{Emoji}","u"),Tt=/\d/,bi=/\s/,$c="\r",xi=`
|
|
154
|
+
`,ex="️",tx="",ki="";let Jr=null,Gr=null;function nx(n=[]){const e={};nt.groups=e;const t=new nt;Jr==null&&(Jr=Wc(K1)),Gr==null&&(Gr=Wc(J1)),_(t,"'",Ys),_(t,"{",hr),_(t,"}",pr),_(t,"[",As),_(t,"]",Ns),_(t,"(",Rs),_(t,")",Ls),_(t,"<",Is),_(t,">",js),_(t,"(",Ps),_(t,")",_s),_(t,"「",Bs),_(t,"」",Fs),_(t,"『",zs),_(t,"』",Vs),_(t,"<",Hs),_(t,">",$s),_(t,"&",Ws),_(t,"*",Us),_(t,"@",Bt),_(t,"`",Ks),_(t,"^",Js),_(t,":",Vt),_(t,",",Yl),_(t,"$",Gs),_(t,".",gt),_(t,"=",Xs),_(t,"!",Ul),_(t,"-",at),_(t,"%",mr),_(t,"|",Qs),_(t,"+",Zs),_(t,"#",eo),_(t,"?",gr),_(t,'"',ql),_(t,"/",yt),_(t,";",Kl),_(t,"~",yr),_(t,"_",to),_(t,"\\",qs),_(t,"・",zf);const r=we(t,Tt,$l,{[Ji]:!0});we(r,Tt,r);const s=we(r,Et,Bf,{[fr]:!0}),o=we(r,tr,Ff,{[lr]:!0}),i=we(t,Et,Ot,{[Gi]:!0});we(i,Tt,s),we(i,Et,i),we(s,Tt,s),we(s,Et,s);const l=we(t,tr,Zi,{[Xi]:!0});we(l,Et),we(l,Tt,o),we(l,tr,l),we(o,Tt,o),we(o,Et),we(o,tr,o);const a=_(t,xi,Wl,{[gi]:!0}),c=_(t,$c,nl,{[gi]:!0}),u=we(t,bi,nl,{[gi]:!0});_(t,ki,u),_(c,xi,a),_(c,ki,u),we(c,bi,u),_(u,$c),_(u,xi),we(u,bi,u),_(u,ki,u);const d=we(t,yi,Vf,{[_f]:!0});_(d,"#"),we(d,yi,d),_(d,ex,d);const f=_(d,tx);_(f,"#"),we(f,yi,d);const h=[[Et,i],[Tt,s]],m=[[Et,null],[tr,l],[Tt,o]];for(let y=0;y<Jr.length;y++)jt(t,Jr[y],el,Ot,h);for(let y=0;y<Gr.length;y++)jt(t,Gr[y],tl,Zi,m);hn(el,{tld:!0,ascii:!0},e),hn(tl,{utld:!0,alpha:!0},e),jt(t,"file",cs,Ot,h),jt(t,"mailto",cs,Ot,h),jt(t,"http",_n,Ot,h),jt(t,"https",_n,Ot,h),jt(t,"ftp",_n,Ot,h),jt(t,"ftps",_n,Ot,h),hn(cs,{scheme:!0,ascii:!0},e),hn(_n,{slashscheme:!0,ascii:!0},e),n=n.sort((y,g)=>y[0]>g[0]?1:-1);for(let y=0;y<n.length;y++){const g=n[y][0],k=n[y][1]?{[G1]:!0}:{[X1]:!0};g.indexOf("-")>=0?k[Qi]=!0:Et.test(g)?Tt.test(g)?k[fr]=!0:k[Gi]=!0:k[Ji]=!0,Hc(t,g,g,k)}return Hc(t,"localhost",Or,{ascii:!0}),t.jd=new nt(no),{start:t,tokens:Object.assign({groups:e},Hf)}}function $f(n,e){const t=rx(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,s=[];let o=0,i=0;for(;i<r;){let l=n,a=null,c=0,u=null,d=-1,f=-1;for(;i<r&&(a=l.go(t[i]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=t[i].length,f++),c+=t[i].length,o+=t[i].length,i++;o-=d,i-=f,c-=d,s.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return s}function rx(n){const e=[],t=n.length;let r=0;for(;r<t;){let s=n.charCodeAt(r),o,i=s<55296||s>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(i),r+=i.length}return e}function jt(n,e,t,r,s){let o;const i=e.length;for(let l=0;l<i-1;l++){const a=e[l];n.j[a]?o=n.j[a]:(o=new nt(r),o.jr=s.slice(),n.j[a]=o),n=o}return o=new nt(t),o.jr=s.slice(),n.j[e[i-1]]=o,o}function Wc(n){const e=[],t=[];let r=0,s="0123456789";for(;r<n.length;){let o=0;for(;s.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let i=parseInt(n.substring(r,r+o),10);i>0;i--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Dr={defaultProtocol:"http",events:null,format:Yc,formatHref:Yc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Jl(n,e=null){let t=Object.assign({},Dr);n&&(t=Object.assign(t,n instanceof Jl?n.o:n));const r=t.ignoreTags,s=[];for(let o=0;o<r.length;o++)s.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=s}Jl.prototype={o:Dr,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let s=this.o[n];return s&&(typeof s=="object"?(s=t.t in s?s[t.t]:Dr[n],typeof s=="function"&&r&&(s=s(e,t))):typeof s=="function"&&r&&(s=s(e,t.t,t)),s)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function Yc(n){return n}function Wf(n,e){this.t="token",this.v=n,this.tk=e}Wf.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Dr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),s=n.get("tagName",t,e),o=this.toFormattedString(n),i={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return i.href=r,l&&(i.class=l),a&&(i.target=a),c&&(i.rel=c),u&&Object.assign(i,u),{tagName:s,attributes:i,content:o,eventListeners:d}}};function Lo(n,e){class t extends Wf{constructor(s,o){super(s,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Uc=Lo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),qc=Lo("text"),sx=Lo("nl"),Xr=Lo("url",{isLink:!0,toHref(n=Dr.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Or&&n[1].t===Vt}}),lt=n=>new nt(n);function ox({groups:n}){const e=n.domain.concat([Ws,Us,Bt,qs,Ks,Js,Gs,Xs,at,$l,mr,Qs,Zs,eo,yt,no,yr,to]),t=[Ys,Vt,Yl,gt,Ul,mr,gr,ql,Kl,Is,js,hr,pr,Ns,As,Rs,Ls,Ps,_s,Bs,Fs,zs,Vs,Hs,$s],r=[Ws,Ys,Us,qs,Ks,Js,Gs,Xs,at,hr,pr,mr,Qs,Zs,eo,gr,yt,no,yr,to],s=lt(),o=_(s,yr);ie(o,r,o),ie(o,n.domain,o);const i=lt(),l=lt(),a=lt();ie(s,n.domain,i),ie(s,n.scheme,l),ie(s,n.slashscheme,a),ie(i,r,o),ie(i,n.domain,i);const c=_(i,Bt);_(o,Bt,c),_(l,Bt,c),_(a,Bt,c);const u=_(o,gt);ie(u,r,o),ie(u,n.domain,o);const d=lt();ie(c,n.domain,d),ie(d,n.domain,d);const f=_(d,gt);ie(f,n.domain,d);const h=lt(Uc);ie(f,n.tld,h),ie(f,n.utld,h),_(c,Or,h);const m=_(d,at);_(m,at,m),ie(m,n.domain,d),ie(h,n.domain,d),_(h,gt,f),_(h,at,m);const y=_(h,Vt);ie(y,n.numeric,Uc);const g=_(i,at),b=_(i,gt);_(g,at,g),ie(g,n.domain,i),ie(b,r,o),ie(b,n.domain,i);const k=lt(Xr);ie(b,n.tld,k),ie(b,n.utld,k),ie(k,n.domain,i),ie(k,r,o),_(k,gt,b),_(k,at,g),_(k,Bt,c);const C=_(k,Vt),T=lt(Xr);ie(C,n.numeric,T);const M=lt(Xr),v=lt();ie(M,e,M),ie(M,t,v),ie(v,e,M),ie(v,t,v),_(k,yt,M),_(T,yt,M);const w=_(l,Vt),O=_(a,Vt),N=_(O,yt),B=_(N,yt);ie(l,n.domain,i),_(l,gt,b),_(l,at,g),ie(a,n.domain,i),_(a,gt,b),_(a,at,g),ie(w,n.domain,M),_(w,yt,M),_(w,gr,M),ie(B,n.domain,M),ie(B,e,M),_(B,yt,M);const Y=[[hr,pr],[As,Ns],[Rs,Ls],[Is,js],[Ps,_s],[Bs,Fs],[zs,Vs],[Hs,$s]];for(let $=0;$<Y.length;$++){const[F,K]=Y[$],ee=_(M,F);_(v,F,ee),_(ee,K,M);const q=lt(Xr);ie(ee,e,q);const J=lt();ie(ee,t),ie(q,e,q),ie(q,t,J),ie(J,e,q),ie(J,t,J),_(q,K,M),_(J,K,M)}return _(s,Or,k),_(s,Wl,sx),{start:s,tokens:Hf}}function ix(n,e,t){let r=t.length,s=0,o=[],i=[];for(;s<r;){let l=n,a=null,c=null,u=0,d=null,f=-1;for(;s<r&&!(a=l.go(t[s].t));)i.push(t[s++]);for(;s<r&&(c=a||l.go(t[s].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,s++,u++;if(f<0)s-=u,s<r&&(i.push(t[s]),s++);else{i.length>0&&(o.push(Si(qc,e,i)),i=[]),s-=f,u-=f;const h=d.t,m=t.slice(s-u,s);o.push(Si(h,e,m))}}return i.length>0&&o.push(Si(qc,e,i)),o}function Si(n,e,t){const r=t[0].s,s=t[t.length-1].e,o=e.slice(r,s);return new n(o,t)}const lx=typeof console<"u"&&console&&console.warn||(()=>{}),ax="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ve={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function cx(){return nt.groups={},ve.scanner=null,ve.parser=null,ve.tokenQueue=[],ve.pluginQueue=[],ve.customSchemes=[],ve.initialized=!1,ve}function Kc(n,e=!1){if(ve.initialized&&lx(`linkifyjs: already initialized - will not register custom scheme "${n}" ${ax}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
155
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
156
|
+
2. Cannot start or end with "-"
|
|
157
|
+
3. "-" cannot repeat`);ve.customSchemes.push([n,e])}function ux(){ve.scanner=nx(ve.customSchemes);for(let n=0;n<ve.tokenQueue.length;n++)ve.tokenQueue[n][1]({scanner:ve.scanner});ve.parser=ox(ve.scanner.tokens);for(let n=0;n<ve.pluginQueue.length;n++)ve.pluginQueue[n][1]({scanner:ve.scanner,parser:ve.parser});return ve.initialized=!0,ve}function Gl(n){return ve.initialized||ux(),ix(ve.parser.start,n,$f(ve.scanner.start,n))}Gl.scan=$f;function Yf(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Jl(t),s=Gl(n),o=[];for(let i=0;i<s.length;i++){const l=s[i];l.isLink&&(!e||l.t===e)&&r.check(l)&&o.push(l.toFormattedObject(r))}return o}var Xl="[\0- -\u2029 ]",dx=new RegExp(Xl),fx=new RegExp(`${Xl}$`),hx=new RegExp(Xl,"g");function px(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function mx(n){return new Te({key:new _e("autolink"),appendTransaction:(e,t,r)=>{const s=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!s||o)return;const{tr:i}=r,l=of(t.doc,[...e]);if(mf(l).forEach(({newRange:c})=>{const u=b0(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1)d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!fx.test(h))return;d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const h=f.split(dx).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],y=d.pos+f.lastIndexOf(m);if(!m)return!1;const g=Gl(m).map(b=>b.toObject(n.defaultProtocol));if(!px(g))return!1;g.filter(b=>b.isLink).map(b=>({...b,from:y+b.start+1,to:y+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>n.validate(b.value)).filter(b=>n.shouldAutoLink(b.value)).forEach(b=>{zl(b.from,b.to,r.doc).some(k=>k.mark.type===n.type)||i.addMark(b.from,b.to,n.type.create({href:b.href}))})}}),!!i.steps.length)return i}})}function gx(n){return new Te({key:new _e("handleClickLink"),props:{handleClick:(e,t,r)=>{var s,o;if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let u=r.target;const d=[];for(;u.nodeName!=="DIV";)d.push(u),u=u.parentNode;i=d.find(f=>f.nodeName==="A")}if(!i)return!1;const l=pf(e.state,n.type.name),a=(s=i==null?void 0:i.href)!=null?s:l.href,c=(o=i==null?void 0:i.target)!=null?o:l.target;return n.enableClickSelection&&n.editor.commands.extendMarkRange(n.type.name),i&&a?(window.open(a,c),!0):!1}}})}function yx(n){return new Te({key:new _e("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:s}=e,{selection:o}=s,{empty:i}=o;if(i)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=Yf(l,{defaultProtocol:n.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:n.editor.commands.setMark(n.type,{href:a.href})}}})}function an(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&t.push(s)}),!n||n.replace(hx,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Uf=St.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){Kc(n);return}Kc(n.scheme,n.optionalSlashes)})},onDestroy(){cx()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!an(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!an(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!an(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Me(this.options.HTMLAttributes,n),0]:["a",Me(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!an(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!an(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Xt({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,s=Yf(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:i=>!!an(i,t),protocols:t,defaultProtocol:r}));s.length&&s.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(mx({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!an(s,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(gx({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(yx({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),bx=Uf,xx=Object.defineProperty,kx=(n,e)=>{for(var t in e)xx(n,t,{get:e[t],enumerable:!0})},Sx="listItem",Jc="textStyle",Gc=/^\s*([-+*])\s$/,qf=it.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Sx,this.editor.getAttributes(Jc)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=qn({find:Gc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=qn({find:Gc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Jc),editor:this.editor})),[n]}}),Kf=it.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Me(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),vx={};kx(vx,{findListItemPos:()=>Ir,getNextListDepth:()=>Ql,handleBackspace:()=>rl,handleDelete:()=>sl,hasListBefore:()=>Jf,hasListItemAfter:()=>Cx,hasListItemBefore:()=>Gf,listItemHasSubList:()=>Xf,nextListIsDeeper:()=>Qf,nextListIsHigher:()=>Zf});var Ir=(n,e)=>{const{$from:t}=e.selection,r=Le(n,e.schema);let s=null,o=t.depth,i=t.pos,l=null;for(;o>0&&l===null;)s=t.node(o),s.type===r?l=o:(o-=1,i-=1);return l===null?null:{$pos:e.doc.resolve(i),depth:l}},Ql=(n,e)=>{const t=Ir(n,e);if(!t)return!1;const[,r]=O0(e,n,t.$pos.pos+4);return r},Jf=(n,e,t)=>{const{$anchor:r}=n.selection,s=Math.max(0,r.pos-2),o=n.doc.resolve(s).node();return!(!o||!t.includes(o.type.name))},Gf=(n,e)=>{var t;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((t=s.nodeBefore)==null?void 0:t.type.name)!==n)},Xf=(n,e,t)=>{if(!t)return!1;const r=Le(n,e.schema);let s=!1;return t.descendants(o=>{o.type===r&&(s=!0)}),s},rl=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!Gt(n.state,e)&&Jf(n.state,e,t)){const{$anchor:l}=n.state.selection,a=n.state.doc.resolve(l.before()-1),c=[];a.node().descendants((f,h)=>{f.type.name===e&&c.push({node:f,pos:h})});const u=c.at(-1);if(!u)return!1;const d=n.state.doc.resolve(a.start()+u.pos+1);return n.chain().cut({from:l.start()-1,to:l.end()+1},d.end()).joinForward().run()}if(!Gt(n.state,e)||!R0(n.state))return!1;const r=Ir(e,n.state);if(!r)return!1;const o=n.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=Xf(e,n.state,o);return Gf(e,n.state)&&!i?n.commands.joinItemBackward():n.chain().liftListItem(e).run()},Qf=(n,e)=>{const t=Ql(n,e),r=Ir(n,e);return!r||!t?!1:t>r.depth},Zf=(n,e)=>{const t=Ql(n,e),r=Ir(n,e);return!r||!t?!1:t<r.depth},sl=(n,e)=>{if(!Gt(n.state,e)||!N0(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:s}=t;return!t.empty&&r.sameParent(s)?!1:Qf(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():Zf(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},Cx=(n,e)=>{var t;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((t=s.nodeAfter)==null?void 0:t.type.name)!==n)},eh=De.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&sl(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&sl(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&rl(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&rl(n,t,r)&&(e=!0)}),e}}}}),Mx="listItem",Xc="textStyle",Qc=/^(\d+)\.\s$/,th=it.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Me(this.options.HTMLAttributes,t),0]:["ol",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Mx,this.editor.getAttributes(Xc)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=qn({find:Qc,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=qn({find:Qc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Xc)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),wx=/^\s*(\[([( |x])?\])\s$/,Ex=it.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",Me(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const s=document.createElement("li"),o=document.createElement("label"),i=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=u=>{var d,f;l.ariaLabel=((f=(d=this.options.a11y)==null?void 0:d.checkboxLabel)==null?void 0:f.call(d,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return c(n),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:d}=u.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const h=t();if(typeof h!="number")return!1;const m=f.doc.nodeAt(h);return f.setNodeMarkup(h,void 0,{...m==null?void 0:m.attrs,checked:d}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,d)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,d])=>{s.setAttribute(u,d)}),s.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,o.append(l,i),s.append(o,a),Object.entries(e).forEach(([u,d])=>{s.setAttribute(u,d)}),{dom:s,contentDOM:a,update:u=>u.type!==this.type?!1:(s.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u),!0)}}},addInputRules(){return[qn({find:wx,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),Tx=it.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",Me(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});De.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(qf.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(Kf.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(eh.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(th.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(Ex.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(Tx.configure(this.options.taskList)),n}});var Ox=it.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Dx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ax=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Nx=St.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Cn({find:Dx,type:this.type})]},addPasteRules(){return[Xt({find:Ax,type:this.type})]}}),Rx=it.create({name:"text",group:"inline"}),nh=St.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Lx=nh;function Ix(n={}){return new Te({view(e){return new jx(e,n)}})}class jx{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let o=i=>{this[s](i)};return e.dom.addEventListener(s,o),{name:s,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,s=this.editorView.dom,o=s.getBoundingClientRect(),i=o.width/s.offsetWidth,l=o.height/s.offsetHeight;if(t){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let m=h.getBoundingClientRect(),y=d?m.bottom:m.top;d&&f&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:m.left,right:m.right,top:y-g,bottom:y+g}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;c=d.left-a.scrollLeft*f,u=d.top-a.scrollTop*h}this.element.style.left=(r.left-c)/i+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),s=r&&r.type.spec.disableDropCursor,o=typeof s=="function"?s(this.editorView,t,e):s;if(t&&!o){let i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=rd(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ee extends le{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return Ee.valid(r)?new Ee(r):le.near(r)}content(){return V.empty}eq(e){return e instanceof Ee&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ee(e.resolve(t.pos))}getBookmark(){return new Zl(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Px(e)||!_x(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let s=t.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&Ee.valid(e))return e;let s=e.pos,o=null;for(let i=e.depth;;i--){let l=e.node(i);if(t>0?e.indexAfter(i)<l.childCount:e.index(i)>0){o=l.child(t>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;s+=t;let a=e.doc.resolve(s);if(Ee.valid(a))return a}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Q.isSelectable(o)){e=e.doc.resolve(s+o.nodeSize*t),r=!1;continue e}break}o=i,s+=t;let l=e.doc.resolve(s);if(Ee.valid(l))return l}return null}}}Ee.prototype.visible=!1;Ee.findFrom=Ee.findGapCursorFrom;le.jsonID("gapcursor",Ee);class Zl{constructor(e){this.pos=e}map(e){return new Zl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Ee.valid(t)?new Ee(t):le.near(t)}}function Px(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function _x(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function Bx(){return new Te({props:{decorations:Hx,createSelectionBetween(n,e,t){return e.pos==t.pos&&Ee.valid(t)?new Ee(t):null},handleClick:zx,handleKeyDown:Fx,handleDOMEvents:{beforeinput:Vx}}})}const Fx=Yd({ArrowLeft:Qr("horiz",-1),ArrowRight:Qr("horiz",1),ArrowUp:Qr("vert",-1),ArrowDown:Qr("vert",1)});function Qr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,o){let i=r.selection,l=e>0?i.$to:i.$from,a=i.empty;if(i instanceof ne){if(!o.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Ee.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new Ee(c))),!0):!1}}function zx(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!Ee.valid(r))return!1;let s=n.posAtCoords({left:t.clientX,top:t.clientY});return s&&s.inside>-1&&Q.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Ee(r))),!0)}function Vx(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Ee))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let s=I.empty;for(let i=r.length-1;i>=0;i--)s=I.from(r[i].createAndFill(null,s));let o=n.state.tr.replace(t.pos,t.pos,new V(s,0,0));return o.setSelection(ne.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function Hx(n){if(!(n.selection instanceof Ee))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ce.create(n.doc,[Ge.widget(n.selection.head,e,{key:"gapcursor"})])}var ro=200,Pe=function(){};Pe.prototype.append=function(e){return e.length?(e=Pe.from(e),!this.length&&e||e.length<ro&&this.leafAppend(e)||this.length<ro&&e.leafPrepend(this)||this.appendInner(e)):this};Pe.prototype.prepend=function(e){return e.length?Pe.from(e).append(this):this};Pe.prototype.appendInner=function(e){return new $x(this,e)};Pe.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Pe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Pe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Pe.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};Pe.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(o,i){return s.push(e(o,i))},t,r),s};Pe.from=function(e){return e instanceof Pe?e:e&&e.length?new rh(e):Pe.empty};var rh=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,o){return s==0&&o==this.length?this:new e(this.values.slice(s,o))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,o,i,l){for(var a=o;a<i;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,o,i,l){for(var a=o-1;a>=i;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=ro)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=ro)return new e(s.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Pe);Pe.empty=new rh([]);var $x=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,o,i){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(o,l),i)===!1||o>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,o)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,o,i){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(o,l)-l,i+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(s,l),o,i)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var o=this.left.length;return s<=o?this.left.slice(r,s):r>=o?this.right.slice(r-o,s-o):this.left.slice(r,o).append(this.right.slice(0,s-o))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Pe);const Wx=500;class ht{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,o;t&&(s=this.remapping(r,this.items.length),o=s.maps.length);let i=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){s||(s=this.remapping(r,f+1),o=s.maps.length),o--,u.push(d);return}if(s){u.push(new bt(d.map));let h=d.step.map(s.slice(o)),m;h&&i.maybeStep(h).doc&&(m=i.mapping.maps[i.mapping.maps.length-1],c.push(new bt(m,void 0,void 0,c.length+u.length))),o--,m&&s.appendMap(m,o)}else i.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(o)):d.selection,a=new ht(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:i,selection:l}}addTransform(e,t,r,s){let o=[],i=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new bt(e.mapping.maps[u],d,t),h;(h=a&&a.merge(f))&&(f=h,u?o.pop():l=l.slice(0,l.length-1)),o.push(f),t&&(i++,t=void 0),s||(a=f)}let c=i-r.depth;return c>Ux&&(l=Yx(l,c),i-=c),new ht(l.append(o),i)}remapping(e,t){let r=new Sr;return this.items.forEach((s,o)=>{let i=s.mirrorOffset!=null&&o-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,i)},e,t),r}addMaps(e){return this.eventCount==0?this:new ht(this.items.append(e.map(t=>new bt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let a=t;this.items.forEach(f=>{let h=o.getMirror(--a);if(h==null)return;i=Math.min(i,h);let m=o.maps[h];if(f.step){let y=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(o.slice(a+1,h));g&&l++,r.push(new bt(m,y,g))}else r.push(new bt(m))},s);let c=[];for(let f=t;f<i;f++)c.push(new bt(o.maps[f]));let u=this.items.slice(0,s).append(c).append(r),d=new ht(u,l);return d.emptyItemCount()>Wx&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,s=[],o=0;return this.items.forEach((i,l)=>{if(l>=e)s.push(i),i.selection&&o++;else if(i.step){let a=i.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=i.selection&&i.selection.map(t.slice(r));u&&o++;let d=new bt(c.invert(),a,u),f,h=s.length-1;(f=s.length&&s[h].merge(d))?s[h]=f:s.push(d)}}else i.map&&r--},this.items.length,0),new ht(Pe.from(s.reverse()),o)}}ht.empty=new ht(Pe.empty,0);function Yx(n,e){let t;return n.forEach((r,s)=>{if(r.selection&&e--==0)return t=s,!1}),n.slice(t)}class bt{constructor(e,t,r,s){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new bt(t.getMap().invert(),t,this.selection)}}}class Ft{constructor(e,t,r,s,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=s,this.prevComposition=o}}const Ux=20;function qx(n,e,t,r){let s=t.getMeta(bn),o;if(s)return s.historyState;t.getMeta(Gx)&&(n=new Ft(n.done,n.undone,null,0,-1));let i=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(i&&i.getMeta(bn))return i.getMeta(bn).redo?new Ft(n.done.addTransform(t,void 0,r,us(e)),n.undone,Zc(t.mapping.maps),n.prevTime,n.prevComposition):new Ft(n.done,n.undone.addTransform(t,void 0,r,us(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!i&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!Kx(t,n.prevRanges)),c=i?vi(n.prevRanges,t.mapping):Zc(t.mapping.maps);return new Ft(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,us(e)),ht.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new Ft(n.done.rebased(t,o),n.undone.rebased(t,o),vi(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Ft(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),vi(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function Kx(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&s>=e[o]&&(t=!0)}),t}function Zc(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,s,o,i)=>e.push(o,i));return e}function vi(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let s=e.map(n[r],1),o=e.map(n[r+1],-1);s<=o&&t.push(s,o)}return t}function Jx(n,e,t){let r=us(e),s=bn.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let i=o.selection.resolve(o.transform.doc),l=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),s,r),a=new Ft(t?l:o.remaining,t?o.remaining:l,null,0,-1);return o.transform.setSelection(i).setMeta(bn,{redo:t,historyState:a})}let Ci=!1,eu=null;function us(n){let e=n.plugins;if(eu!=e){Ci=!1,eu=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ci=!0;break}}return Ci}const bn=new _e("history"),Gx=new _e("closeHistory");function Xx(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Te({key:bn,state:{init(){return new Ft(ht.empty,ht.empty,null,0,-1)},apply(e,t,r){return qx(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,s=r=="historyUndo"?oh:r=="historyRedo"?ih:null;return s?(t.preventDefault(),s(e.state,e.dispatch)):!1}}}})}function sh(n,e){return(t,r)=>{let s=bn.getState(t);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let o=Jx(s,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const oh=sh(!1,!0),ih=sh(!0,!0);De.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new Te({key:new _e("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const s=this.options.limit;if(s==null||s===0){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const i=o-s,l=0,a=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,a);return n=!0,c}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||s>r&&o>r&&o<=s)return!0;if(s>r&&o>r&&o>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=o-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var Qx=De.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Ix(this.options)]}});De.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Te({key:new _e("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:s}=e,o=[];if(!t||!r)return Ce.create(n,[]);let i=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;i+=1});let l=0;return n.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(Ge.node(c,c+a.nodeSize,{class:this.options.className}))}),Ce.create(n,o)}}})]}});var Zx=De.create({name:"gapCursor",addProseMirrorPlugins(){return[Bx()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=xe(X(n,"allowGapCursor",t)))!=null?e:null}}});De.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Te({key:new _e("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,s=[];if(!t)return null;const o=this.editor.isEmpty;return n.descendants((i,l)=>{const a=r>=l&&r<=l+i.nodeSize,c=!i.isLeaf&&Ao(i);if((a||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const d=Ge.node(l,l+i.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:l,hasAnchor:a}):this.options.placeholder});s.push(d)}return this.options.includeChildren}),Ce.create(n,s)}}})]}});De.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new Te({key:new _e("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||yf(t.selection)||n.view.dragging?null:Ce.create(t.doc,[Ge.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function tu({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var ek=De.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const n=new _e(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(this.options.node).includes(t.name));return[new Te({key:n,appendTransaction:(t,r,s)=>{const{doc:o,tr:i,schema:l}=s,a=n.getState(s),c=o.content.size,u=l.nodes[this.options.node];if(a)return i.insert(c,u.create())},state:{init:(t,r)=>{const s=r.tr.doc.lastChild;return!tu({node:s,types:e})},apply:(t,r)=>{if(!t.docChanged)return r;const s=t.doc.lastChild;return!tu({node:s,types:e})}}})]}}),tk=De.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>oh(n,e),redo:()=>({state:n,dispatch:e})=>ih(n,e)}},addProseMirrorPlugins(){return[Xx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),nk=De.create({name:"starterKit",addExtensions(){var n,e,t,r;const s=[];return this.options.bold!==!1&&s.push(R1.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(T1.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(qf.configure(this.options.bulletList)),this.options.code!==!1&&s.push(j1.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(B1.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(F1.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(Qx.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(Zx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(z1.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(V1.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(tk.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(H1.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(q1.configure(this.options.italic)),this.options.listItem!==!1&&s.push(Kf.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(eh.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&s.push(Uf.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(th.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(Ox.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(Nx.configure(this.options.strike)),this.options.text!==!1&&s.push(Rx.configure(this.options.text)),this.options.underline!==!1&&s.push(nh.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&s.push(ek.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),rk=nk,sk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,ok=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,ik=St.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Cn({find:sk,type:this.type})]},addPasteRules(){return[Xt({find:ok,type:this.type})]}}),lk=ik,ak=De.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).every(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:n=>({editor:e,commands:t})=>this.options.alignments.includes(n)?e.isActive({textAlign:n})?t.unsetTextAlign():t.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),ck=ak,uk=St.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),dk=uk,fk=St.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",Me(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),hk=fk,En={root:"m_dd3f7539",Typography:"m_f2016866",content:"m_c2204cc2",linkEditorDropdown:"m_8a991b4f",control:"m_c2207da6",controlIcon:"m_9cdfeb3f",controlsGroup:"m_2ab47ef2",linkEditor:"m_b67b711e",linkEditorInput:"m_296cf94c",linkEditorExternalControl:"m_cfef614",linkEditorSave:"m_3b28e7bb",toolbar:"m_4574a3c4",taskList:"m_8b44009a"};const pk={linkControlLabel:"Link",colorPickerControlLabel:"Text color",highlightControlLabel:"Highlight text",colorControlLabel:n=>`Set text color ${n}`,boldControlLabel:"Bold",italicControlLabel:"Italic",underlineControlLabel:"Underline",strikeControlLabel:"Strikethrough",clearFormattingControlLabel:"Clear formatting",unlinkControlLabel:"Remove link",bulletListControlLabel:"Bullet list",orderedListControlLabel:"Ordered list",sourceCodeControlLabel:"Switch between text/source code",h1ControlLabel:"Heading 1",h2ControlLabel:"Heading 2",h3ControlLabel:"Heading 3",h4ControlLabel:"Heading 4",h5ControlLabel:"Heading 5",h6ControlLabel:"Heading 6",blockquoteControlLabel:"Blockquote",alignLeftControlLabel:"Align text: left",alignCenterControlLabel:"Align text: center",alignRightControlLabel:"Align text: right",alignJustifyControlLabel:"Align text: justify",codeControlLabel:"Code",codeBlockControlLabel:"Code block",subscriptControlLabel:"Subscript",superscriptControlLabel:"Superscript",unsetColorControlLabel:"Unset color",hrControlLabel:"Horizontal line",undoControlLabel:"Undo",redoControlLabel:"Redo",tasksControlLabel:"Task list",tasksSinkLabel:"Decrease task level",tasksLiftLabel:"Increase task level",linkEditorInputLabel:"Enter URL",linkEditorInputPlaceholder:"https://example.com/",linkEditorExternalLink:"Open link in a new tab",linkEditorInternalLink:"Open link in the same tab",linkEditorSave:"Save",colorPickerCancel:"Cancel",colorPickerClear:"Clear color",colorPickerColorPicker:"Color picker",colorPickerPalette:"Color palette",colorPickerSave:"Save",colorPickerColorLabel:n=>`Set text color ${n}`},[mk,vt]=x.createSafeContext("RichTextEditor component was not found in tree"),ea=x.factory((n,e)=>{const t=x.useProps("RichTextEditorContent",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,...a}=t,c=vt();return c.withTypographyStyles?p.jsx(x.Typography,{...c.getStyles("Typography",{className:s,style:o,styles:i,classNames:r}),unstyled:c.unstyled,ref:e,children:p.jsx(x.Box,{component:zc,editor:c.editor,...c.getStyles("content",{classNames:r,styles:i}),...a})}):p.jsx(x.Box,{component:zc,editor:c.editor,...c.getStyles("content",{classNames:r,styles:i,className:s,style:o}),...a})});ea.classes=En;ea.displayName="@mantine/tiptap/RichTextEditorContent";function he(n){return p.jsx("svg",{...n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})}function gk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),p.jsx("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"})]})}function yk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M11 5l6 0"}),p.jsx("path",{d:"M7 19l6 0"}),p.jsx("path",{d:"M14 5l-4 14"})]})}function bk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M7 5v5a5 5 0 0 0 10 0v-5"}),p.jsx("path",{d:"M5 19h14"})]})}function xk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 12l14 0"}),p.jsx("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})]})}function kk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M17 15l4 4m0 -4l-4 4"}),p.jsx("path",{d:"M7 6v-1h11v1"}),p.jsx("path",{d:"M7 19l4 0"}),p.jsx("path",{d:"M13 5l-4 14"})]})}function Sk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M19 18v-8l-2 2"}),p.jsx("path",{d:"M4 6v12"}),p.jsx("path",{d:"M12 6v12"}),p.jsx("path",{d:"M11 18h2"}),p.jsx("path",{d:"M3 18h2"}),p.jsx("path",{d:"M4 12h8"}),p.jsx("path",{d:"M3 6h2"}),p.jsx("path",{d:"M11 6h2"})]})}function vk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0"}),p.jsx("path",{d:"M4 6v12"}),p.jsx("path",{d:"M12 6v12"}),p.jsx("path",{d:"M11 18h2"}),p.jsx("path",{d:"M3 18h2"}),p.jsx("path",{d:"M4 12h8"}),p.jsx("path",{d:"M3 6h2"}),p.jsx("path",{d:"M11 6h2"})]})}function Ck(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M19 14a2 2 0 1 0 -2 -2"}),p.jsx("path",{d:"M17 16a2 2 0 1 0 2 -2"}),p.jsx("path",{d:"M4 6v12"}),p.jsx("path",{d:"M12 6v12"}),p.jsx("path",{d:"M11 18h2"}),p.jsx("path",{d:"M3 18h2"}),p.jsx("path",{d:"M4 12h8"}),p.jsx("path",{d:"M3 6h2"}),p.jsx("path",{d:"M11 6h2"})]})}function Mk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M20 18v-8l-4 6h5"}),p.jsx("path",{d:"M4 6v12"}),p.jsx("path",{d:"M12 6v12"}),p.jsx("path",{d:"M11 18h2"}),p.jsx("path",{d:"M3 18h2"}),p.jsx("path",{d:"M4 12h8"}),p.jsx("path",{d:"M3 6h2"}),p.jsx("path",{d:"M11 6h2"})]})}function wk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M17 18h2a2 2 0 1 0 0 -4h-2v-4h4"}),p.jsx("path",{d:"M4 6v12"}),p.jsx("path",{d:"M12 6v12"}),p.jsx("path",{d:"M11 18h2"}),p.jsx("path",{d:"M3 18h2"}),p.jsx("path",{d:"M4 12h8"}),p.jsx("path",{d:"M3 6h2"}),p.jsx("path",{d:"M11 6h2"})]})}function Ek(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z"}),p.jsx("path",{d:"M21 12a2 2 0 1 0 -4 0v4"}),p.jsx("path",{d:"M4 6v12"}),p.jsx("path",{d:"M12 6v12"}),p.jsx("path",{d:"M11 18h2"}),p.jsx("path",{d:"M3 18h2"}),p.jsx("path",{d:"M4 12h8"}),p.jsx("path",{d:"M3 6h2"}),p.jsx("path",{d:"M11 6h2"})]})}function Tk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M9 6l11 0"}),p.jsx("path",{d:"M9 12l11 0"}),p.jsx("path",{d:"M9 18l11 0"}),p.jsx("path",{d:"M5 6l0 .01"}),p.jsx("path",{d:"M5 12l0 .01"}),p.jsx("path",{d:"M5 18l0 .01"})]})}function Ok(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M11 6h9"}),p.jsx("path",{d:"M11 12h9"}),p.jsx("path",{d:"M12 18h8"}),p.jsx("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"}),p.jsx("path",{d:"M6 10v-6l-2 2"})]})}function Dk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M17 22v-2"}),p.jsx("path",{d:"M9 15l6 -6"}),p.jsx("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),p.jsx("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"}),p.jsx("path",{d:"M20 17h2"}),p.jsx("path",{d:"M2 7h2"}),p.jsx("path",{d:"M7 2v2"})]})}function Ak(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M6 15h15"}),p.jsx("path",{d:"M21 19h-15"}),p.jsx("path",{d:"M15 11h6"}),p.jsx("path",{d:"M21 7h-6"}),p.jsx("path",{d:"M9 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"}),p.jsx("path",{d:"M3 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"})]})}function Nk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 6l16 0"}),p.jsx("path",{d:"M4 12l10 0"}),p.jsx("path",{d:"M4 18l14 0"})]})}function Rk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 6l16 0"}),p.jsx("path",{d:"M10 12l10 0"}),p.jsx("path",{d:"M6 18l14 0"})]})}function Lk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 6l16 0"}),p.jsx("path",{d:"M8 12l8 0"}),p.jsx("path",{d:"M6 18l12 0"})]})}function Ik(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 6l16 0"}),p.jsx("path",{d:"M4 12l16 0"}),p.jsx("path",{d:"M4 18l12 0"})]})}function jk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 7l8 10m-8 0l8 -10"}),p.jsx("path",{d:"M21 20h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2"})]})}function Pk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 7l8 10m-8 0l8 -10"}),p.jsx("path",{d:"M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2"})]})}function lh(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M7 8l-4 4l4 4"}),p.jsx("path",{d:"M17 8l4 4l-4 4"}),p.jsx("path",{d:"M14 4l-4 16"})]})}function _k(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),p.jsx("path",{d:"M12.5 5.5l4 4"}),p.jsx("path",{d:"M4.5 13.5l4 4"}),p.jsx("path",{d:"M21 15v4h-8l4 -4z"})]})}function Bk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 12h2"}),p.jsx("path",{d:"M17 12h2"}),p.jsx("path",{d:"M11 12h2"})]})}function ah(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M20.042 16.045a9 9 0 0 0 -12.087 -12.087m-2.318 1.677a9 9 0 1 0 12.725 12.73"}),p.jsx("path",{d:"M3 3l18 18"})]})}function Fk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M11 7l6 6"}),p.jsx("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]})}function zk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M18 6l-12 12"}),p.jsx("path",{d:"M6 6l12 12"})]})}function Vk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25"}),p.jsx("path",{d:"M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),p.jsx("path",{d:"M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),p.jsx("path",{d:"M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Hk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 12l5 5l10 -10"})]})}function $k(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M9 15l6 -6"}),p.jsx("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),p.jsx("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"})]})}function Wk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6"}),p.jsx("path",{d:"M11 13l9 -9"}),p.jsx("path",{d:"M15 4h5v5"})]})}function Yk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M9 14l-4 -4l4 -4"}),p.jsx("path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"})]})}function Uk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M15 14l4 -4l-4 -4"}),p.jsx("path",{d:"M19 10h-11a4 4 0 1 0 0 8h1"})]})}function qk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3.5 5.5l1.5 1.5l2.5 -2.5"}),p.jsx("path",{d:"M3.5 11.5l1.5 1.5l2.5 -2.5"}),p.jsx("path",{d:"M3.5 17.5l1.5 1.5l2.5 -2.5"}),p.jsx("path",{d:"M11 6l9 0"}),p.jsx("path",{d:"M11 12l9 0"}),p.jsx("path",{d:"M11 18l9 0"})]})}function Kk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M20 6l-11 0"}),p.jsx("path",{d:"M20 12l-7 0"}),p.jsx("path",{d:"M20 18l-11 0"}),p.jsx("path",{d:"M4 8l4 4l-4 4"})]})}function Jk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M20 6l-7 0"}),p.jsx("path",{d:"M20 12l-9 0"}),p.jsx("path",{d:"M20 18l-7 0"}),p.jsx("path",{d:"M8 8l-4 4l4 4"})]})}function Gk(n){return p.jsxs(he,{...n,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:`M19 3v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7.914
|
|
158
|
+
a1 1 0 0 1 .293-.707l3.914-3.914A1 1 0 0 1 9.914 3H18
|
|
159
|
+
a1 1 0 0 1 1 1Z`}),p.jsx("path",{d:"M10 11l-2 2 2 2"}),p.jsx("path",{d:"M14 11l2 2-2 2"})]})}const Xk={interactive:!0},Tn=x.factory((n,e)=>{const t=x.useProps("RichTextEditorControl",Xk,n),{classNames:r,className:s,style:o,styles:i,vars:l,interactive:a,active:c,onMouseDown:u,disabled:d,...f}=t,h=vt();return p.jsx(x.UnstyledButton,{...f,...h.getStyles("control",{className:s,style:o,classNames:r,styles:i}),disabled:d,"data-rich-text-editor-control":!0,tabIndex:a?0:-1,"data-interactive":a||void 0,"data-disabled":d||void 0,"data-active":c||void 0,"aria-pressed":c&&a||void 0,"aria-hidden":!a||void 0,ref:e,unstyled:h.unstyled,variant:h.variant||"default",onMouseDown:m=>{m.preventDefault(),u==null||u(m)}})});Tn.classes=En;Tn.displayName="@mantine/tiptap/RichTextEditorControl";const ta=E.forwardRef(({className:n,icon:e,...t},r)=>{const s=vt();return p.jsx(Tn,{ref:r,...t,children:p.jsx(e,{...s.getStyles("controlIcon")})})});ta.displayName="@mantine/tiptap/RichTextEditorControlBase";function ge({label:n,isActive:e,operation:t,icon:r,isDisabled:s}){const o=E.forwardRef((i,l)=>{const{editor:a,labels:c}=vt(),u=c[n];return p.jsx(ta,{"aria-label":u,title:u,active:e!=null&&e.name?a==null?void 0:a.isActive(e.name,e.attributes):!1,ref:l,onClick:()=>a==null?void 0:a.chain().focus()[t.name](t.attributes).run(),icon:i.icon||r,disabled:(s==null?void 0:s(a))||!1,...i})});return o.displayName=`@mantine/tiptap/${n}`,o}const Qk=ge({label:"boldControlLabel",icon:n=>p.jsx(gk,{...n}),isActive:{name:"bold"},operation:{name:"toggleBold"}}),Zk=ge({label:"italicControlLabel",icon:n=>p.jsx(yk,{...n}),isActive:{name:"italic"},operation:{name:"toggleItalic"}}),eS=ge({label:"underlineControlLabel",icon:n=>p.jsx(bk,{...n}),isActive:{name:"underline"},operation:{name:"toggleUnderline"}}),tS=ge({label:"strikeControlLabel",icon:n=>p.jsx(xk,{...n}),isActive:{name:"strike"},operation:{name:"toggleStrike"}}),nS=ge({label:"clearFormattingControlLabel",icon:n=>p.jsx(kk,{...n}),operation:{name:"unsetAllMarks"}}),rS=ge({label:"unlinkControlLabel",icon:n=>p.jsx(Dk,{...n}),operation:{name:"unsetLink"}}),sS=ge({label:"bulletListControlLabel",icon:n=>p.jsx(Tk,{...n}),isActive:{name:"bulletList"},operation:{name:"toggleBulletList"}}),oS=ge({label:"orderedListControlLabel",icon:n=>p.jsx(Ok,{...n}),isActive:{name:"orderedList"},operation:{name:"toggleOrderedList"}}),iS=ge({label:"h1ControlLabel",icon:n=>p.jsx(Sk,{...n}),isActive:{name:"heading",attributes:{level:1}},operation:{name:"toggleHeading",attributes:{level:1}}}),lS=ge({label:"h2ControlLabel",icon:n=>p.jsx(vk,{...n}),isActive:{name:"heading",attributes:{level:2}},operation:{name:"toggleHeading",attributes:{level:2}}}),aS=ge({label:"h3ControlLabel",icon:n=>p.jsx(Ck,{...n}),isActive:{name:"heading",attributes:{level:3}},operation:{name:"toggleHeading",attributes:{level:3}}}),cS=ge({label:"h4ControlLabel",icon:n=>p.jsx(Mk,{...n}),isActive:{name:"heading",attributes:{level:4}},operation:{name:"toggleHeading",attributes:{level:4}}}),uS=ge({label:"h5ControlLabel",icon:n=>p.jsx(wk,{...n}),isActive:{name:"heading",attributes:{level:5}},operation:{name:"toggleHeading",attributes:{level:5}}}),dS=ge({label:"h6ControlLabel",icon:n=>p.jsx(Ek,{...n}),isActive:{name:"heading",attributes:{level:6}},operation:{name:"toggleHeading",attributes:{level:6}}}),fS=ge({label:"blockquoteControlLabel",icon:n=>p.jsx(Ak,{...n}),isActive:{name:"blockquote"},operation:{name:"toggleBlockquote"}}),hS=ge({label:"alignLeftControlLabel",icon:n=>p.jsx(Nk,{...n}),operation:{name:"setTextAlign",attributes:"left"}}),pS=ge({label:"alignRightControlLabel",icon:n=>p.jsx(Rk,{...n}),operation:{name:"setTextAlign",attributes:"right"}}),mS=ge({label:"alignCenterControlLabel",icon:n=>p.jsx(Lk,{...n}),operation:{name:"setTextAlign",attributes:"center"}}),gS=ge({label:"alignJustifyControlLabel",icon:n=>p.jsx(Ik,{...n}),operation:{name:"setTextAlign",attributes:"justify"}}),yS=ge({label:"subscriptControlLabel",icon:n=>p.jsx(jk,{...n}),isActive:{name:"subscript"},operation:{name:"toggleSubscript"}}),bS=ge({label:"superscriptControlLabel",icon:n=>p.jsx(Pk,{...n}),isActive:{name:"superscript"},operation:{name:"toggleSuperscript"}}),xS=ge({label:"codeControlLabel",icon:n=>p.jsx(lh,{...n}),isActive:{name:"code"},operation:{name:"toggleCode"}}),kS=ge({label:"codeBlockControlLabel",icon:n=>p.jsx(lh,{...n}),isActive:{name:"codeBlock"},operation:{name:"toggleCodeBlock"}}),SS=ge({label:"highlightControlLabel",icon:n=>p.jsx(_k,{...n}),isActive:{name:"highlight"},operation:{name:"toggleHighlight"}}),vS=ge({label:"hrControlLabel",icon:n=>p.jsx(Bk,{...n}),operation:{name:"setHorizontalRule"}}),CS=ge({label:"unsetColorControlLabel",icon:n=>p.jsx(ah,{...n}),operation:{name:"unsetColor"}}),MS=ge({label:"undoControlLabel",icon:n=>p.jsx(Yk,{...n}),isDisabled:n=>!(n!=null&&n.can().undo()),operation:{name:"undo"}}),wS=ge({label:"redoControlLabel",icon:n=>p.jsx(Uk,{...n}),isDisabled:n=>!(n!=null&&n.can().redo()),operation:{name:"redo"}}),ES=ge({label:"tasksControlLabel",icon:n=>p.jsx(qk,{...n}),isActive:{name:"taskList"},operation:{name:"toggleTaskList"}}),TS=ge({label:"tasksSinkLabel",icon:n=>p.jsx(Kk,{...n}),operation:{name:"sinkListItem",attributes:"taskItem"},isDisabled:n=>!(n!=null&&n.can().sinkListItem("taskItem"))}),OS=ge({label:"tasksLiftLabel",icon:n=>p.jsx(Jk,{...n}),operation:{name:"liftListItem",attributes:"taskItem"},isDisabled:n=>!(n!=null&&n.can().liftListItem("taskItem"))}),DS=n=>p.jsx($k,{...n}),na=x.factory((n,e)=>{var $;const t=x.useProps("RichTextEditorLinkControl",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,icon:a,popoverProps:c,disableTooltips:u,initialExternal:d,...f}=t,h=vt(),m={classNames:r,styles:i},[y,g]=ip(""),[b,k]=E.useState(d),[C,{open:T,close:M}]=cl(!1),v=()=>{var K;T();const F=(K=h.editor)==null?void 0:K.getAttributes("link");g((F==null?void 0:F.href)||""),k(F!=null&&F.href?(F==null?void 0:F.target)==="_blank":d)},w=()=>{M(),g(""),k(d)},O=()=>{var F,K;w(),y===""?(F=h.editor)==null||F.chain().focus().extendMarkRange("link").unsetLink().run():(K=h.editor)==null||K.chain().focus().extendMarkRange("link").setLink({href:y,target:b?"_blank":null}).run()},N=F=>{F.key==="Enter"&&(F.preventDefault(),O())};rp("edit-link",v,!1);const{resolvedClassNames:B,resolvedStyles:Y}=x.useResolvedStylesApi({classNames:r,styles:i,props:t});return p.jsxs(x.Popover,{trapFocus:!0,shadow:"md",withinPortal:!0,opened:C,onChange:F=>!F&&w(),offset:-44,zIndex:1e4,...c,children:[p.jsx(x.Popover.Target,{children:p.jsx(ta,{icon:a||DS,...f,"aria-label":h.labels.linkControlLabel,title:h.labels.linkControlLabel,onClick:v,active:($=h.editor)==null?void 0:$.isActive("link"),ref:e,classNames:B,styles:Y,className:s,style:o,variant:h.variant})}),p.jsx(x.Popover.Dropdown,{...h.getStyles("linkEditorDropdown",m),children:p.jsxs("div",{...h.getStyles("linkEditor",m),children:[p.jsx(x.TextInput,{placeholder:h.labels.linkEditorInputPlaceholder,"aria-label":h.labels.linkEditorInputLabel,type:"url",value:y,onChange:g,classNames:{input:h.getStyles("linkEditorInput",m).className},onKeyDown:N,rightSection:p.jsx(x.Tooltip,{label:b?h.labels.linkEditorExternalLink:h.labels.linkEditorInternalLink,events:{hover:!0,focus:!0,touch:!0},withinPortal:!0,withArrow:!0,disabled:u,zIndex:1e4,children:p.jsx(x.UnstyledButton,{onClick:()=>k(F=>!F),"data-active":b||void 0,...h.getStyles("linkEditorExternalControl",m),children:p.jsx(Wk,{style:{width:x.rem(14),height:x.rem(14)}})})})}),p.jsx(x.Button,{variant:"default",onClick:O,...h.getStyles("linkEditorSave",m),children:h.labels.linkEditorSave})]})})]})});na.classes=En;na.displayName="@mantine/tiptap/RichTextEditorLinkControl";const ch=E.forwardRef((n,e)=>{const{popoverProps:t,colors:r,colorPickerProps:s,...o}=x.useProps("RichTextEditorColorPickerControl",null,n),{editor:i,labels:l,getStyles:a,variant:c}=vt(),[u,{toggle:d,close:f}]=cl(!1),[h,m]=E.useState("palette"),y=(i==null?void 0:i.getAttributes("textStyle").color)||"var(--mantine-color-text)",g=(C,T=!0)=>{(i==null?void 0:i.chain()).focus().setColor(C).run(),T&&f()},b=()=>{(i==null?void 0:i.chain()).focus().unsetColor().run(),f()},k=r.map((C,T)=>p.jsx(x.ColorSwatch,{component:"button",color:C,onClick:()=>g(C),size:26,radius:"xs",style:{cursor:"pointer"},title:l.colorPickerColorLabel(C),"aria-label":l.colorPickerColorLabel(C)},T));return p.jsxs(x.Popover,{opened:u,withinPortal:!0,trapFocus:!0,onChange:C=>!C&&f(),...t,children:[p.jsx(x.Popover.Target,{children:p.jsx(Tn,{...o,variant:c,"aria-label":l.colorPickerControlLabel,title:l.colorPickerControlLabel,ref:e,onClick:d,children:p.jsx(x.ColorSwatch,{color:y,size:14})})}),p.jsxs(x.Popover.Dropdown,{...a("linkEditorDropdown"),children:[h==="palette"&&p.jsx(x.SimpleGrid,{cols:7,spacing:2,children:k}),h==="colorPicker"&&p.jsx(x.ColorPicker,{defaultValue:y,onChange:C=>g(C,!1),...s}),p.jsx(x.Tooltip.Group,{closeDelay:200,children:p.jsxs(x.Group,{justify:"flex-end",gap:"xs",mt:"sm",children:[h==="palette"&&p.jsx(x.ActionIcon,{variant:"default",onClick:f,title:l.colorPickerCancel,"aria-label":l.colorPickerCancel,children:p.jsx(zk,{style:{width:x.rem(16),height:x.rem(16)}})}),p.jsx(x.ActionIcon,{variant:"default",onClick:b,title:l.colorPickerClear,"aria-label":l.colorPickerClear,children:p.jsx(ah,{style:{width:x.rem(16),height:x.rem(16)}})}),h==="palette"?p.jsx(x.ActionIcon,{variant:"default",onClick:()=>m("colorPicker"),title:l.colorPickerColorPicker,"aria-label":l.colorPickerColorPicker,children:p.jsx(Fk,{style:{width:x.rem(16),height:x.rem(16)}})}):p.jsx(x.ActionIcon,{variant:"default",onClick:()=>m("palette"),"aria-label":l.colorPickerPalette,title:l.colorPickerPalette,children:p.jsx(Vk,{style:{width:x.rem(16),height:x.rem(16)}})}),h==="colorPicker"&&p.jsx(x.ActionIcon,{variant:"default",onClick:f,title:l.colorPickerSave,"aria-label":l.colorPickerSave,children:p.jsx(Hk,{style:{width:x.rem(16),height:x.rem(16)}})})]})})]})]})});ch.displayName="@mantine/tiptap/ColorPickerControl";const uh=E.forwardRef((n,e)=>{const{color:t,...r}=x.useProps("RichTextEditorColorControl",null,n),{editor:s,labels:o,variant:i}=vt(),l=(s==null?void 0:s.getAttributes("textStyle").color)||null,a=o.colorControlLabel(t);return p.jsx(Tn,{...r,variant:i,active:l===t,"aria-label":a,title:a,onClick:()=>(s==null?void 0:s.chain()).focus().setColor(t).run(),ref:e,children:p.jsx(x.ColorSwatch,{color:t,size:14})})});uh.displayName="@mantine/tiptap/RichTextEditorColorControl";const AS={},dh=E.forwardRef((n,e)=>{const{...t}=x.useProps("RichTextEditorSourceCodeControl",AS,n),{editor:r,labels:s,variant:o,onSourceCodeTextSwitch:i}=vt(),[l,a]=E.useState(!1),c=()=>{l?r==null||r.commands.setContent(r.getText(),{emitUpdate:!0}):r==null||r.commands.setContent(`<textarea>${r.getHTML()}</textarea>`);const u=!l;a(u),i==null||i(u)};return p.jsx(Tn,{...t,variant:o,active:l,"aria-label":s.sourceCodeControlLabel,title:s.sourceCodeControlLabel,onClick:()=>c(),ref:e,children:p.jsx(Gk,{style:{width:x.rem(16),height:x.rem(16)}})})});dh.displayName="@mantine/tiptap/RichTextEditorSourceCodeControl";const ra=x.factory((n,e)=>{const t=x.useProps("RichTextEditorControlsGroup",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,variant:a,...c}=t,u=vt();return p.jsx(x.Box,{ref:e,variant:a||u.variant,...u.getStyles("controlsGroup",{className:s,style:o,styles:i,classNames:r}),...c})});ra.classes=En;ra.displayName="@mantine/tiptap/RichTextEditorControlsGroup";const sa=x.factory((n,e)=>{const t=x.useProps("RichTextEditorToolbar",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,sticky:a,stickyOffset:c,mod:u,variant:d,...f}=t,h=vt();return p.jsx(x.Box,{ref:e,mod:[{sticky:a},u],variant:d||h.variant,...h.getStyles("toolbar",{className:s,style:o,styles:i,classNames:r}),...f,__vars:{"--rte-sticky-offset":x.rem(c)}})});sa.classes=En;sa.displayName="@mantine/tiptap/RichTextEditorToolbar";const NS={withCodeHighlightStyles:!0,withTypographyStyles:!0,variant:"default"},z=x.factory((n,e)=>{const t=x.useProps("RichTextEditor",NS,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,editor:c,withCodeHighlightStyles:u,withTypographyStyles:d,onSourceCodeTextSwitch:f,labels:h,children:m,variant:y,attributes:g,...b}=t,k=x.useStyles({name:"RichTextEditor",classes:En,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:g,vars:a}),C=E.useMemo(()=>({...pk,...h}),[h]);return p.jsx(mk,{value:{editor:c,getStyles:k,labels:C,withCodeHighlightStyles:u,withTypographyStyles:d,onSourceCodeTextSwitch:f,unstyled:l,variant:y},children:p.jsx(x.Box,{...k("root"),...b,ref:e,children:m})})});z.classes=En;z.displayName="@mantine/tiptap/RichTextEditor";z.Content=ea;z.Control=Tn;z.Toolbar=sa;z.ControlsGroup=ra;z.Bold=Qk;z.Italic=Zk;z.Strikethrough=tS;z.Underline=eS;z.ClearFormatting=nS;z.H1=iS;z.H2=lS;z.H3=aS;z.H4=cS;z.H5=uS;z.H6=dS;z.BulletList=sS;z.OrderedList=oS;z.Link=na;z.Unlink=rS;z.Blockquote=fS;z.AlignLeft=hS;z.AlignRight=pS;z.AlignCenter=mS;z.AlignJustify=gS;z.Superscript=bS;z.Subscript=yS;z.Code=xS;z.CodeBlock=kS;z.ColorPicker=ch;z.Color=uh;z.Highlight=SS;z.Hr=vS;z.UnsetColor=CS;z.Undo=MS;z.Redo=wS;z.TaskList=ES;z.TaskListSink=TS;z.TaskListLift=OS;z.SourceCode=dh;function RS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=v1({editable:!r&&!s,extensions:[rk,Lx,bx,dk,hk,lk,ck.configure({types:["heading","paragraph"]})],content:t.value||"",onUpdate:({editor:i})=>{t.onChange(i.getHTML())}});return p.jsxs(z,{editor:o,h:400,children:[p.jsxs(z.Toolbar,{sticky:!0,stickyOffset:60,children:[p.jsxs(z.ControlsGroup,{children:[p.jsx(z.Bold,{}),p.jsx(z.Italic,{}),p.jsx(z.Underline,{}),p.jsx(z.Strikethrough,{}),p.jsx(z.ClearFormatting,{}),p.jsx(z.Highlight,{}),p.jsx(z.Code,{})]}),p.jsxs(z.ControlsGroup,{children:[p.jsx(z.H1,{}),p.jsx(z.H2,{}),p.jsx(z.H3,{}),p.jsx(z.H4,{})]}),p.jsxs(z.ControlsGroup,{children:[p.jsx(z.Blockquote,{}),p.jsx(z.Hr,{}),p.jsx(z.BulletList,{}),p.jsx(z.OrderedList,{}),p.jsx(z.Subscript,{}),p.jsx(z.Superscript,{})]}),p.jsxs(z.ControlsGroup,{children:[p.jsx(z.Link,{}),p.jsx(z.Unlink,{})]}),p.jsxs(z.ControlsGroup,{children:[p.jsx(z.AlignLeft,{}),p.jsx(z.AlignCenter,{}),p.jsx(z.AlignJustify,{}),p.jsx(z.AlignRight,{})]}),p.jsxs(z.ControlsGroup,{children:[p.jsx(z.Undo,{}),p.jsx(z.Redo,{})]})]}),p.jsx(z.Content,{})]})}function LS({field:n,form:e}){const t=n,r=e.getInputProps(t.name),s=t.readOnly===!0,o=t.disabled===!0;return s||o?p.jsx(x.Select,{data:t.data,value:r.value,disabled:o||s,readOnly:s,placeholder:t.placeholder,required:t.required,variant:s?"filled":"default",error:void 0}):p.jsx(x.Select,{...r,data:t.data,placeholder:t.placeholder,error:void 0,onChange:i=>r.onFieldChange(i)})}function IS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?p.jsx(x.Switch,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0,checked:t.value}):p.jsx(x.Switch,{...t,checked:t.value,onChange:o=>t.onFieldChange(o.target.checked),required:n.required,placeholder:n.placeholder,error:void 0})}function jS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?p.jsx(x.TagsInput,{value:t.value||[],readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):p.jsx(x.TagsInput,{value:t.value||[],onChange:o=>t.onChange(o),required:n.required,placeholder:n.placeholder,error:void 0})}function PS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?p.jsx(x.TextInput,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):p.jsx(x.TextInput,{...t,onChange:o=>t.onFieldChange(o.target.value),required:n.required,placeholder:n.placeholder,error:void 0})}function _S({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=typeof t.value=="string"?t.value:"",i=E.useRef(null),l=p.jsx(x.ActionIcon,{variant:"subtle",color:"gray",onClick:()=>{var a;return(a=i.current)==null?void 0:a.showPicker()},children:"⏰"});return r||s?p.jsx(ds,{value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):p.jsx(ds,{value:o,onChange:a=>t.onChange(a.currentTarget.value),required:n.required,placeholder:n.placeholder,error:void 0,ref:i,rightSection:l})}function BS({field:n,form:e,children:t}){const{error:r}=e.getInputProps(n.name);return p.jsxs(x.Stack,{gap:4,children:[n.label&&p.jsxs(x.Text,{fw:500,size:"sm",mb:2,component:"label",htmlFor:n.name,style:{display:"block"},children:[n.label," ",n.required&&p.jsx(x.Text,{component:"span",c:"red",fz:"sm",children:"*"})]}),p.jsx(x.Box,{children:t}),n.description&&p.jsx(x.Text,{size:"xs",c:"dimmed",mt:2,style:{lineHeight:1.4},children:n.description}),r&&p.jsx(x.Text,{size:"xs",c:"red",mt:2,style:{fontWeight:500},children:r})]})}function FS(n){const{layout:e,field:{required:t,...r},form:s}=n;let o=null;switch(r.type){case"text":o=p.jsx(PS,{field:r,form:n.form});break;case"select":o=p.jsx(LS,{field:r,form:n.form});break;case"object":o=p.jsx(cm,{field:r,form:s,layout:e});break;case"array":o=p.jsx(zh,{field:r,form:s,layout:e});break;case"checkbox":o=p.jsx(Vh,{field:r,form:s});break;case"number":o=p.jsx(am,{field:r,form:s});break;case"date":o=p.jsx(im,{field:r,form:s});break;case"datetime":o=p.jsx(lm,{field:r,form:s});break;case"switch":o=p.jsx(IS,{field:r,form:s});break;case"texteditor":o=p.jsx(RS,{field:r,form:s});break;case"time":o=p.jsx(_S,{field:r,form:s});break;case"tags":o=p.jsx(jS,{field:r,form:s});break;default:o=p.jsxs("div",{children:["Unsupported field type: ",r.type]});break}return p.jsx(BS,{field:r,form:s,children:o})}class Io{constructor(){ca(this,"next")}setNext(e){return this.next=e,e}handle(e,t){var r;return this.canHandle(e)?this.render(e,t):((r=this.next)==null?void 0:r.handle(e,t))??null}}class zS extends Io{constructor(e){super(),this.layout=e}canHandle(){return!0}render(e,t){return p.jsx(FS,{field:e,form:t,layout:this.layout})}}class VS extends Io{constructor(e){super(),this.customFieldTypes=e}canHandle(e){return!!this.customFieldTypes[e.type]}render(e,t){return this.customFieldTypes[e.type](e,t)}}class HS extends Io{constructor(e){super(),this.fieldRenderers=e}canHandle(e){return!!this.fieldRenderers[e.name]}render(e,t){return this.fieldRenderers[e.name](e,t)}}class $S extends Io{constructor(e){super(),this.typeRenderers=e}canHandle(e){return!!this.typeRenderers[e.type]}render(e,t){return this.typeRenderers[e.type](e,t)}}const jo=n=>{const{field:e,form:t,customFieldRenderers:r,customTypeRenderers:s,customFieldTypes:o,layout:i="grid"}=n,l=new HS(r??{}),a=new $S(s??{}),c=new zS(i),u=new VS(o??{});return l.setNext(a).setNext(u).setNext(c),l.handle(e,t)},WS=E.createContext(null),YS=({children:n,value:e})=>p.jsx(WS.Provider,{value:e,children:n}),US=E.forwardRef(function({schema:e,values:t,getInitialValues:r,layout:s="vertical",readOnly:o,validate:i,onSubmit:l,onFieldChange:a,updateFieldSchema:c,transformBeforeSubmit:u=k=>k,transformAfterSubmit:d=()=>{},submitButton:f=!0,customFieldRenderers:h,customFieldTypes:m,customTypeRenderers:y,loading:g},b){const[k,C]=E.useState(!0),T=Fh({validate:i,enhanceGetInputProps(O){return{onFieldChange:async N=>{var B;O.inputProps.onChange(N),await((B=a==null?void 0:a[O.field])==null?void 0:B.call(a,N,T))}}}}),M=il[s],v=E.useMemo(()=>{if(!c)return e;const O=T.getValues();return e.map(N=>{const B=c[N.name];return B?B(N,O):N})},[e,T.values,c]),w=T.onSubmit(async O=>{const N=Di(e,O);if(Object.keys(N).length){T.setErrors(N);return}const B=await u(O);await l(B),d(B)});return E.useImperativeHandle(b,()=>({submit:()=>w(),reset:O=>{const N=ar(e,O);T.setValues(N),T.setDirty(N)},validate:()=>{const O=T.validate();return Object.keys(O.errors).length===0},getValues:()=>T.getValues(),setValues:O=>T.setValues(O),getFieldValue:O=>T.getInputProps(O).value,setFieldValue:(O,N)=>T.setFieldValue(O,N),isValid:()=>Object.keys(T.validate().errors).length===0,isDirty:()=>T.isDirty()})),E.useEffect(()=>{if(t){const O=ar(e,t);T.setValues(O),T.resetDirty(O)}},[t,e]),E.useEffect(()=>{async function O(){const N=r?await r():{};T.initialize(ar(e,N)),C(!1)}O()},[e]),p.jsx(YS,{value:{customFieldRenderers:h,customTypeRenderers:y,customFieldTypes:m},children:p.jsxs("form",{onSubmit:w,style:{position:"relative"},children:[p.jsx(x.LoadingOverlay,{visible:k||g}),M(p.jsx(p.Fragment,{children:v.map(O=>{const N={...O,readOnly:O.readOnly||o};return p.jsx(so,{field:N,layout:s,children:p.jsx(jo,{field:N,form:T,customFieldRenderers:h,customTypeRenderers:y,customFieldTypes:m,layout:s})},N.name)})})),typeof f=="boolean"?f?p.jsx(x.Group,{justify:"flex-end",mt:"md",children:p.jsx(x.Button,{type:"submit",loading:g,children:"Submit"})}):null:f]})})});exports.AutoForm=US;exports.FieldLayoutWrapper=so;exports.FieldRendererResolver=jo;
|