PageSourceSearch

https://app.invoiless.com/_next/static/chunks/0wl7bd0prm5vv.js?dpl=2-6-0

js invoiless.com collected 2026-09-24 13:27:54 UTC 758,057 bytes, 106 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="03bcf1a8-c2b7-89ac-c501-ade6096593ca")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,653145,e=>{"use strict";var t=e.i(271645),r=e=>e instanceof Date,n=e=>null==e,i=e=>!n(e)&&!Array.isArray(e)&&"object"==typeof e&&!r(e),o=e=>i(e)&&e.target?"checkbox"===e.target.type?e.target.checked:e.target.value:e,s=(e,t)=>{let r=t.split("."),n=[],i=r[0];for(let t=1;t<r.length;i+="."+r[t++])!isNaN(+r[t])&&e.has(i)&&n.push(i);return n},a="u">typeof window&&void 0!==window.HTMLElement&&"u">typeof document;function l(e){let t;if(e instanceof Date)return new Date(e);let r="u">typeof FileList&&e instanceof FileList;if(a&&(e instanceof Blob||r))return e;let n=Array.isArray(e);if(!n&&!(i(e)&&i(t=e.constructor&&e.constructor.prototype)&&t.hasOwnProperty("isPrototypeOf")))return e;let o=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=l(e[t]));return o}var u=e=>void 0===e,d=e=>Array.isArray(e)?e.filter(Boolean):[],c=e=>d(e.replace(/["|']|\]/g,"").split(/\.|\[/)),p=(e,t,r)=>{if(!t||!i(e))return r;let o=(/^\w*$/.test(t)?[t]:c(t)).reduce((e,t)=>n(e)?void 0:e[t],e);return u(o)||o===e?u(e[t])?r:e[t]:o},h=e=>"function"==typeof e,f=(e,t,r)=>{let n=-1,o=/^\w*$/.test(t)?[t]:c(t),s=o.length,a=s-1;for(;++n<s;){let t=o[n],s=r;if(n!==a){let r=e[t];s=i(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};let m="blur",g="trigger",v="onChange",y="onSubmit",b="maxLength",x="minLength",k="pattern",w="required",_="validate",$="form",S="root",I=t.default.createContext(null);I.displayName="HookFormControlContext";var O=(e,t,r,n=!0)=>{let i={};for(let o in e)Object.defineProperty(i,o,{get:()=>("all"!==t._proxyFormState[o]&&(t._proxyFormState[o]=!n||"all"),r&&(r[o]=!0),e[o])});return i};let C="u">typeof window?t.default.useLayoutEffect:t.default.useEffect;function N(e){let r=t.default.useContext(I),{control:n=r,disabled:i,name:o,exact:s}=e||{},[a,l]=t.default.useState(()=>({...n._formState,defaultValues:n._defaultValues})),u=t.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return C(()=>n._subscribe({name:o,formState:u.current,exact:s,callback:e=>{i||l({...n._formState,...e,defaultValues:n._defaultValues})}}),[o,i,s]),t.default.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),t.default.useMemo(()=>O(a,n,u.current,!1),[a,n])}var T=e=>"string"==typeof e,E=(e,t,r,n,i)=>T(e)?(n&&t.watch.add(e),p(r,e,i)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),p(r,e))):(n&&(t.watchAll=!0),r),A=e=>n(e)||"object"!=typeof e;function D(e,t,n=new WeakSet){if(e===t)return!0;if(A(e)||A(t))return Object.is(e,t);if(r(e)&&r(t))return Object.is(e.getTime(),t.getTime());let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;for(let s of(n.add(e),n.add(t),o)){let o=e[s];if(!(s in t))return!1;if("ref"!==s){let e=t[s];if(r(o)&&r(e)||(i(o)||Array.isArray(o))&&(i(e)||Array.isArray(e))?!D(o,e,n):!Object.is(o,e))return!1}}return!0}function j(e){let r=t.default.useContext(I),{control:n=r,name:i,defaultValue:o,disabled:s,exact:a,compute:l}=e||{},u=t.default.useRef(o),d=t.default.useRef(l),c=t.default.useRef(void 0),p=t.default.useRef(n),h=t.default.useRef(i);d.current=l;let[f,m]=t.default.useState(()=>{let e=n._getWatch(i,u.current);return d.current?d.current(e):e}),g=t.default.useCallback(e=>{let t=E(i,n._names,e||n._formValues,!1,u.current);return d.current?d.current(t):t},[n._formValues,n._names,i]),v=t.default.useCallback(e=>{if(!s){let t=E(i,n._names,e||n._formValues,!1,u.current);if(d.current){let e=d.current(t);D(e,c.current)||(m(e),c.current=e)}else m(t)}},[n._formValues,n._names,s,i]);C(()=>(p.current===n&&D(h.current,i)||(p.current=n,h.current=i,v()),n._subscribe({name:i,formState:{values:!0},exact:a,callback:e=>{v(e.values)}})),[n,a,i,v]),t.default.useEffect(()=>n._removeUnmounted());let y=p.current!==n,b=h.current,x=t.default.useMemo(()=>
2{if(s)return null;let e=!y&&!D(b,i);return y||e?g():null},[s,y,i,b,g]);return null!==x?x:f}let P=t.default.createContext(null);P.displayName="HookFormContext";var z=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},M=e=>Array.isArray(e)?e:[e],Z=()=>{let e=[];return{get observers(){return e},next:t=>{for(let r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},R=e=>i(e)&&!Object.keys(e).length,L=e=>{if(!a)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},U=e=>L(e)&&e.isConnected;function V(e,t){if(T(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let r=Array.isArray(t)?t:/^\w*$/.test(t)?[t]:c(t),o=1===r.length?e:function(e,t){let r=t.slice(0,-1).length,i=0;for(;i<r;){if(n(e)){e=void 0;break}e=e[t[i]],i++}return e}(e,r),s=r.length-1,a=r[s];return o&&delete o[a],0!==s&&(i(o)&&R(o)||Array.isArray(o)&&function(e){for(let t in e)if(e.hasOwnProperty(t)&&!u(e[t]))return!1;return!0}(o))&&V(e,r.slice(0,-1)),e}function F(e){return Array.isArray(e)||i(e)&&!(e=>{for(let t in e)if(h(e[t]))return!0;return!1})(e)}function B(e,t={}){for(let r in e){let n=e[r];F(n)?(t[r]=Array.isArray(n)?[]:{},B(n,t[r])):u(n)||(t[r]=!0)}return t}function H(e,t,r){for(let i in r||(r=B(t)),e){let o=e[i];if(F(o))u(t)||A(r[i])?r[i]=B(o,Array.isArray(o)?[]:{}):H(o,n(t)?{}:t[i],r[i]);else{let e=t[i];r[i]=!D(o,e)}}return function e(t){if(!1!==t){if(!0===t)return!0;if(Array.isArray(t)){let r=t.map(t=>e(t));return r.some(e=>void 0!==e)?r:void 0}if(i(t)){let r={};for(let n in t){let i=e(t[n]);u(i)||(r[n]=i)}return Object.keys(r).length?r:void 0}}}(r)||{}}let W={value:!1,isValid:!1},K={value:!0,isValid:!0};var J=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!u(e[0].attributes.value)?u(e[0].value)||""===e[0].value?K:{value:e[0].value,isValid:!0}:K:W}return W},q=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>u(e)?e:t?""===e?NaN:e?+e:e:r&&T(e)?new Date(e):n?n(e):e;let G={isValid:!1,value:null};var X=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,G):G;function Y(e){let t=e.ref;return"file"===t.type?t.files:"radio"===t.type?X(e.refs).value:"select-multiple"===t.type?[...t.selectedOptions].map(({value:e})=>e):"checkbox"===t.type?J(e.refs).value:q(u(t.value)?e.ref.value:t.value,e)}var Q=e=>u(e)?e:e instanceof RegExp?e.source:i(e)?e.value instanceof RegExp?e.value.source:e.value:e,ee=e=>({isOnSubmit:!e||e===y,isOnBlur:"onBlur"===e,isOnChange:e===v,isOnAll:"all"===e,isOnTouch:"onTouched"===e});let et="AsyncFunction";var er=e=>!!e&&!!e.validate&&!!(h(e.validate)&&e.validate.constructor.name===et||i(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===et)),en=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));let ei=(e,t,r,n)=>{for(let o of r||Object.keys(e)){let r=p(e,o);if(r){let{_f:e,...s}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;else if(e.ref&&t(e.ref,e.name)&&!n)return!0;else if(ei(s,t))break}else if(i(s)&&ei(s,t))break}}};function eo(e,t,r){let n=p(e,r);if(n||/^\w*$/.test(r))return{error:n,name:r};let i=r.split(".");for(;i.length;){let n=i.join("."),o=p(t,n),s=p(e,n);if(o&&!Array.isArray(o)&&r!==n)break;if(s&&s.type)return{name:n,error:s};if(s&&s.root&&s.root.type)return{name:`${n}.root`,error:s.root};i.pop()}return{name:r}}var es=(e,t,r)=>{let n=M(p(e,r));return f(n,S,t[r]),f(e,r,n),e};function ea(e,t,r="validate"){if(T(e)||Array.isArray(e)&&e.every(T)||"boolean"==typeof e&&!e)return{type:r,message:T(e)?e:"",ref:t}}var el=e=>!i(e)||e instanceof RegExp?{value:e,message:""}:e,eu=async(e,t,r,o,s,a)=>{let{ref:l,refs:d,required:c,maxLength:f,minLength:m,min:g,max:v,pattern:y,validate:$,name:S,valueAsNumber:I,mount:O}=e._f,C=p(r,S);if(!O||t.has(S))return{};let N=d?d[0]:l,E=e=>{s&&N.reportValidity&&(N.setCustomValidity("boolean"==typeof e?"":e||""),N.reportValidity())},A={},D="radio"===l.type,j="checkbox"===l.type,P=(I||"file"===l.type)&&u(l.value)&&u(C)||L(l)&&""===l.value||""===C||Array.isArray(C)&&!C.length||I&&"number"==typeof C&&isNaN(C),M=z.bind(null,S,o,A),Z=(e,t,r,n=b,i=x)=>{let o=e?t:r;A[S]={type:e?n:i,message:o,ref:l,...M(e?n:i,o)}};if(a?!Array.isArray(C)||!C.length:c&&(!(D||j)&&(P||n(C))||"boolean"==typeof C&&!C||j&&!J(d).isValid||D&&!X(d).isValid)){let{value:e,message:t}=T(c)?{value:!!c,message:c}:el(c);if(e&&(A[S]={type:w,message:t,ref:N,...M(w,t)},!o))return E(t),A}if(!P&&(!n(g)||!n(v))){let e,t,r=el(v),i=el(g);if(n(C)||isNaN(C)){let n=l.valueAsDate||new Date(C),o=e=>new Date(new Date().toDateString()+" "+e),s="time"==l.type,a="week"==l.type;T(r.value)&&C&&(e=s?o(C)>o(r.value):a?C>r.value:n>new Date(r.value)),T(i.value)&&C&&(t=s?o(C)<o(i.value):a?C<i.value:n<new Date(i.value))}else{let o=l.valueAsNumber||(C?+C:C);n(r.value)||(e=o>r.value),n(i.value)||(t=o<i.value)}if((e||t)&&(Z(!!e,r.message,i.message,"max","min"),!o))return E(A[S].message),A}if((f||m)&&!P&&(T(C)||a&&Array.isArray(C))){let e=el(f),t=el(m),r=!n(e.value)&&C.length>+e.value,i=!n(t.value)&&C.length<+t.value;if((r||i)&&(Z(r,e.message,t.message),!o))return E(A[S].message),A}if(y&&!P&&T(C)){let{value:e,message:t}=el(y);if(e instanceof RegExp&&!C.match(e)&&(A[S]={type:k,message:t,ref:l,...M(k,t)},!o))return E(t),A}if($){if(h($)){let e=ea(await $(C,r),N);if(e&&(A[S]={...e,...M(_,e.message)},!o))return E(e.message),A}else if(i($)){let e={};for(let t in $){if(!R(e)&&!o)break;let n=ea(await $[t](C,r),N,t);n&&(e={...n,...M(t,n.message)},E(n.message),o&&(A[S]=e))}if(!R(e)&&(A[S]={ref:N,...e},!o))return A}}return E(!0),A};let ed={mode:y,reValidateMode:v,shouldFocusError:!0},ec={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};var ep=()=>
2{if("u">typeof crypto&&crypto.randomUUID)return crypto.randomUUID();let e="u"<typeof performance?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=(16*Math.random()+e)%16|0;return("x"==t?r:3&r|8).toString(16)})},eh=(e,t,r={})=>r.shouldFocus||u(r.shouldFocus)?r.focusName||`${e}.${u(r.focusIndex)?t:r.focusIndex}.`:"",ef=(e,t)=>[...e,...M(t)],em=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function eg(e,t,r){return[...e.slice(0,t),...M(r),...e.slice(t)]}var ev=(e,t,r)=>Array.isArray(e)?(u(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],ey=(e,t)=>[...M(t),...M(e)],eb=(e,t)=>u(t)?[]:function(e,t){let r=0,n=[...e];for(let e of t)n.splice(e-r,1),r++;return d(n).length?n:[]}(e,M(t).sort((e,t)=>e-t)),ex=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},ek=(e,t,r)=>(e[t]=r,e);e.s(["Controller",0,e=>e.render(function(e){let r=t.default.useContext(I),{name:n,disabled:i,control:a=r,shouldUnregister:d,defaultValue:c,exact:g=!0}=e,v=!!s(a._names.array,n).length,y=t.default.useMemo(()=>p(a._formValues,n,p(a._defaultValues,n,c)),[a,n,c]),b=j({control:a,name:n,defaultValue:y,exact:g}),x=N({control:a,name:n,exact:g}),k=t.default.useRef(e),w=t.default.useRef(a.register(n,{...e.rules,value:b,..."boolean"==typeof e.disabled?{disabled:e.disabled}:{}}));k.current=e;let _=t.default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!p(x.errors,n)},isDirty:{enumerable:!0,get:()=>!!p(x.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!p(x.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!p(x.validatingFields,n)},error:{enumerable:!0,get:()=>p(x.errors,n)}}),[x,n]),$=t.default.useCallback(e=>w.current.onChange({target:{value:o(e),name:n},type:"change"}),[n]),S=t.default.useCallback(()=>w.current.onBlur({target:{value:p(a._formValues,n),name:n},type:m}),[n,a._formValues]),O=t.default.useCallback(e=>{let t=p(a._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>h(e.focus)&&e.focus(),select:()=>h(e.select)&&e.select(),setCustomValidity:t=>h(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>h(e.reportValidity)&&e.reportValidity()})},[a._fields,n]),C=t.default.useMemo(()=>({name:n,value:b,..."boolean"==typeof i||x.disabled?{disabled:x.disabled||i}:{},onChange:$,onBlur:S,ref:O}),[n,i,x.disabled,$,S,O,b]);return t.default.useEffect(()=>{let e=a._options.shouldUnregister||d;a.register(n,{...k.current.rules,..."boolean"==typeof k.current.disabled?{disabled:k.current.disabled}:{}});let t=(e,t)=>{let r=p(a._fields,e);r&&r._f&&(r._f.mount=t)};if(t(n,!0),e){let e=l(p(a._defaultValues,n,p(a._options.defaultValues,n,k.current.defaultValue)));f(a._defaultValues,n,e),u(p(a._formValues,n))&&f(a._formValues,n,e)}return v||a.register(n),()=>{(v?e&&!a._state.action:e)?a.unregister(n):t(n,!1)}},[n,a,v,d]),t.default.useEffect(()=>{a._setDisabledField({disabled:i,name:n})},[i,n,a]),t.default.useMemo(()=>({field:C,formState:x,fieldState:_}),[C,x,_])}(e)),"FormProvider",0,e=>{let{children:r,watch:n,getValues:i,getFieldState:o,setError:s,clearErrors:a,setValue:l,setValues:u,trigger:d,formState:c,resetField:p,reset:h,handleSubmit:f,unregister:m,control:g,register:v,setFocus:y,subscribe:b}=e,x=t.default.useMemo(()=>({watch:n,getValues:i,getFieldState:o,setError:s,clearErrors:a,setValue:l,setValues:u,trigger:d,formState:c,resetField:p,reset:h,handleSubmit:f,unregister:m,control:g,register:v,setFocus:y,subscribe:b}),[a,g,c,o,i,f,v,h,p,s,y,l,u,b,d,m,n]);return t.default.createElement(P.Provider,{value:x},t.default.createElement(I.Provider,{value:x.control},r))},"appendErrors",0,z,"get",0,p,"set",0,f,"useFieldArray",0,function(e){let r=t.default.useContext(I),{control:n=r,name:i,keyName:o="id",shouldUnregister:s,rules:a}=e,[u,d]=t.default.useState(n._getFieldArray(i)),c=t.default.useRef(n._getFieldArray(i).map(ep)),h=t.default.useRef(!1);n._names.array.add(i),t.default.useMemo(()=>a&&u.length>=0&&n.register(i,a),[n,i,u.length,a]),C(()=>n._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===i||!t){let t=p(e,i);Array.isArray(t)&&(d(t),c.current=t.map(ep))}}}).unsubscribe,[n,i]);let m=t.default.useCallback(e=>{h.current=!0,n._setFieldArray(i,e)},[n,i]);return t.default.useEffect(()=>{n._state.action=!1,en(i,n._names)&&n._subjects.state.next({...n._formState});let e=ee(n._options.mode);if(h.current&&(!e.isOnSubmit||n._formState.isSubmitted)&&!ee(n._options.reValidateMode).isOnSubmit&&!e.isOnBlur)if(n._options.resolver)n._runSchema([i]).then(e=>{n._updateIsValidating([i]);let t=p(e.errors,i),r=p(n._formState.errors,i);(r?!t&&r.type||t&&(r.type!==t.type||r.message!==t.message):t&&t.type)&&(t?f(n._formState.errors,i,t):V(n._formState.errors,i),n._subjects.state.next({errors:n._formState.errors}))});else{let e=p(n._fields,i);e&&e._f&&!(ee(n._options.reValidateMode).isOnSubmit&&ee(n._options.mode).isOnSubmit)&&eu(e,n._names.disabled,n._formValues,"all"===n._options.criteriaMode,n._options.shouldUseNativeValidation,!0).then(e=>!R(e)&&n._subjects.state.next({errors:es(n._formState.errors,e,i)}
2))}n._subjects.state.next({name:i,values:l(n._formValues)}),n._names.focus&&ei(n._fields,(e,t)=>{if(n._names.focus&&t.startsWith(n._names.focus)&&e.focus)return e.focus(),1}),n._names.focus="",n._setValid(),h.current=!1},[u,i,n]),t.default.useEffect(()=>(p(n._formValues,i)||n._setFieldArray(i),()=>{let e,t=!(n._options.shouldUnregister||s);h.current&&t&&n._subjects.state.next({name:i,values:l(n._formValues)}),t?(e=p(n._fields,i))&&e._f&&(e._f.mount=!1):n.unregister(i)}),[i,n,o,s]),{swap:t.default.useCallback((e,t)=>{let r=n._getFieldArray(i);ex(r,e,t),ex(c.current,e,t),m(r),d(r),n._setFieldArray(i,r,ex,{argA:e,argB:t},!1)},[m,i,n]),move:t.default.useCallback((e,t)=>{let r=n._getFieldArray(i);ev(r,e,t),ev(c.current,e,t),m(r),d(r),n._setFieldArray(i,r,ev,{argA:e,argB:t},!1)},[m,i,n]),prepend:t.default.useCallback((e,t)=>{let r=M(l(e)),o=ey(n._getFieldArray(i),r);n._names.focus=eh(i,0,t),c.current=ey(c.current,r.map(ep)),m(o),d(o),n._setFieldArray(i,o,ey,{argA:em(e)})},[m,i,n]),append:t.default.useCallback((e,t)=>{let r=M(l(e)),o=ef(n._getFieldArray(i),r);n._names.focus=eh(i,o.length-1,t),c.current=ef(c.current,r.map(ep)),m(o),d(o),n._setFieldArray(i,o,ef,{argA:em(e)})},[m,i,n]),remove:t.default.useCallback(e=>{let t=eb(n._getFieldArray(i),e);c.current=eb(c.current,e),m(t),d(t),Array.isArray(p(n._fields,i))||f(n._fields,i,void 0),n._setFieldArray(i,t,eb,{argA:e})},[m,i,n]),insert:t.default.useCallback((e,t,r)=>{let o=M(l(t)),s=eg(n._getFieldArray(i),e,o);n._names.focus=eh(i,e,r),c.current=eg(c.current,e,o.map(ep)),m(s),d(s),n._setFieldArray(i,s,eg,{argA:e,argB:em(t)})},[m,i,n]),update:t.default.useCallback((e,t)=>{let r=l(t),o=ek(n._getFieldArray(i),e,r);c.current=[...o].map((t,r)=>t&&r!==e?c.current[r]:ep()),m(o),d([...o]),n._setFieldArray(i,o,ek,{argA:e,argB:r},!0,!1)},[m,i,n]),replace:t.default.useCallback(e=>{let t=M(l(e));c.current=t.map(ep),m([...t]),d([...t]),n._setFieldArray(i,[...t],e=>e,{},!0,!1)},[m,i,n]),fields:t.default.useMemo(()=>u.map((e,t)=>({...e,[o]:c.current[t]||ep()})),[u,o])}},"useForm",0,function(e={}){let v=t.default.useRef(void 0),y=t.default.useRef(void 0),[b,x]=t.default.useState(()=>({...l(ec),isLoading:h(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:h(e.defaultValues)?void 0:e.defaultValues}));if(!v.current)if(e.formControl)v.current={...e.formControl,formState:b},e.defaultValues&&!h(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:t,...y}=function(e={}){let t,v={...ed,...e},y={...l(ec),isLoading:h(v.defaultValues),errors:v.errors||{},disabled:v.disabled||!1},b={},x=(i(v.defaultValues)||i(v.values))&&l(v.defaultValues||v.values)||{},k=v.shouldUnregister?{}:l(x),w={action:!1,mount:!1,watch:!1,keepIsValid:!1},I={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},O=0,C={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},N={...C},A={...N},j={array:Z(),state:Z()},P="all"===v.criteriaMode,z=async e=>{if(!w.keepIsValid&&!v.disabled&&(N.isValid||A.isValid||e)){let e;v.resolver?(e=R((await J()).errors),F()):e=await et({fields:b,onlyCheckValid:!0,eventType:"valid"}),e!==y.isValid&&j.state.next({isValid:e})}},F=(e,t)=>{!v.disabled&&(N.isValidating||N.validatingFields||A.isValidating||A.validatingFields)&&((e||Array.from(I.mount)).forEach(e=>{e&&(t?f(y.validatingFields,e,t):V(y.validatingFields,e))}),j.state.next({validatingFields:y.validatingFields,isValidating:!R(y.validatingFields)}))},B=()=>{y.dirtyFields=H(x,k)},W=(e,t,r,i)=>{let o=p(b,e);if(o){if((e=>{let t=/^\w*$/.test(e)?[e]:c(e),r=k,i=x;for(let e=0;e<t.length-1;e++){let o=t[e];if(r=n(r)?r:r[o],i=n(i)?i:i[o],null===r&&null!==i)return!0}return!1})(e))return;let s=u(p(k,e)),a=p(k,e,u(r)?p(x,e):r);u(a)||i&&i.defaultChecked||t?f(k,e,t?a:Y(o._f)):ep(e,a),w.mount&&!w.action&&(z(),s&&y.isDirty&&(N.isDirty||A.isDirty)&&(ea()||(y.isDirty=!1,j.state.next({...y}))))}},K=(e,t,r,n,i)=>{let o=!1,s=!1,a={name:e};if(!v.disabled){if(!r||n){(N.isDirty||A.isDirty)&&(s=y.isDirty,y.isDirty=a.isDirty=ea(),o=s!==a.isDirty);let r=D(p(x,e),t);s=!!p(y.dirtyFields,e),r!==y.isDirty?y.dirtyFields=H(x,k):r?V(y.dirtyFields,e):f(y.dirtyFields,e,!0),a.dirtyFields=y.dirtyFields,o=o||(N.dirtyFields||A.dirtyFields)&&!r!==s}if(r){let t=p(y.touchedFields,e);t||(f(y.touchedFields,e,r),a.touchedFields=y.touchedFields,o=o||(N.touchedFields||A.touchedFields)&&t!==r)}o&&i&&j.state.next(a)}return o?a:{}},J=async e=>(F(e,!0),await v.resolver(k,v.context,((e,t,r,n)=>{let i={};for(let r of e){let e=p(t,r);e&&f(i,r,e._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}})(e||I.mount,b,v.criteriaMode,v.shouldUseNativeValidation))),G=async e=>{let{errors:t}=await J(e);if(F(e),e)for(let r of e){let e=p(t,r);e?I.array.has(r)&&i(e)?es(y.errors,{[r]:e},r):f(y.errors,r,e):V(y.errors,r)}else y.errors=t;return t},X=async({name:t,eventType:r})=>{if(e.validate){let n=await e.validate({formValues:k,formState:y,name:t,eventType:r});if(i(n))for(let e in n){let t=n[e];t&&ek(`${$}.${e}`,{message:T(t.message)?t.message:"",type:t.type||_})}else T(n)||!n?ek($,{message:n||"",type:_}):ex($);return n}return!0},et=async({fields:t,onlyCheckValid:r,name:n,eventType:i,context:o={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(o.runRootValidation=!0,!await X({name:n,eventType:i}))&&(o.valid=!1,r))return o.valid;for(let n in t){let s=t[n];if(s){let{_f:t,...a}=s;if(t){let n=I.array.has(t.name),i=s._f&&er(s._f),a=N.validatingFields||N.isValidating||A.validatingFields||A.isValidating;i&&a&&F([t.name],!0);let l=await eu(s,I.disabled,k,P,v.shouldUseNativeValidation&&!r,n);if(i&&a&&F([t.name]),l[t.name]&&(o.valid=!1,r)||(r||(p(l,t.name)?n?es(y.errors,l,t.name):f(y.errors,t.name,l[t.name]):V(y.errors,t.name)),e.shouldUseNativeValidation&&l[t.name]))break}R(a)||await et({context:o,onlyCheckValid:r,fields:a,name:n,eventType:i})}}return o.valid},ea=(e,t)=>!v.disabled&&(e&&t&&f(k,e,t),!D(ey(),x)),el=(e,t,r)=>E(e,I,{...w.mount?k:u(t)?x:T(e)?{[e]:t}:t},r,t),ep=(e,t,r={})=>{let i=p(b,e),o=t;if(i){let r=i._f;r&&(r.disabled||f(k,e,q(t,r)),o=L(r.ref)&&n(t)?"":t,"select-multiple"===r.ref.type?[...r.ref.options].forEac
2h(e=>e.selected=o.includes(e.value)):r.refs?"checkbox"===r.ref.type?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):r.refs.forEach(e=>e.checked=e.value===o):"file"===r.ref.type?r.ref.value="":(r.ref.value=o,r.ref.type||j.state.next({name:e,values:l(k)})))}(r.shouldDirty||r.shouldTouch)&&K(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&ev(e)},eh=(e,t,n)=>{for(let o in t){if(!t.hasOwnProperty(o))return;let s=t[o],a=e+"."+o,l=p(b,a);(I.array.has(e)||i(s)||l&&!l._f)&&!r(s)?eh(a,s,n):ep(a,s,n)}},ef=(e,t,r={})=>{let i=p(b,e),o=I.array.has(e),a=l(t),u=D(p(k,e),a);if(u||f(k,e,a),o)j.array.next({name:e,values:l(k)}),(N.isDirty||N.dirtyFields||A.isDirty||A.dirtyFields)&&r.shouldDirty&&(B(),j.state.next({name:e,dirtyFields:y.dirtyFields,isDirty:ea(e,a)}));else{let t=Array.isArray(a)&&!a.length||R(a);!i||i._f||n(a)||t?ep(e,a,r):eh(e,a,r)}if(!u){let t=en(e,I),r=l(k);if(!o)for(let t of s(I.array,e))j.array.next({name:t,values:r});j.state.next({...t&&y,name:w.mount||t?e:void 0,values:r})}},em=async n=>{w.mount=!0;let i=n.target,s=i.name,a=!0,u=p(b,s),d=e=>{a=Number.isNaN(e)||r(e)&&isNaN(e.getTime())||D(e,p(k,s,e))},c=ee(v.mode),h=ee(v.reValidateMode);if(u){var g,x,_,$,S;let r,w,M,Z=i.type?Y(u._f):o(n),L=n.type===m||"focusout"===n.type,U=!((M=u._f).mount&&(M.required||M.min||M.max||M.maxLength||M.minLength||M.pattern||M.validate))&&!e.validate&&!v.resolver&&!p(y.errors,s)&&!u._f.deps||(g=L,x=p(y.touchedFields,s),_=y.isSubmitted,$=h,!(S=c).isOnAll&&(!_&&S.isOnTouch?!(x||g):(_?$.isOnBlur:S.isOnBlur)?!g:(_?!$.isOnChange:!S.isOnChange)||g)),B=en(s,I,L);f(k,s,Z),L?i&&i.readOnly||(u._f.onBlur&&u._f.onBlur(n),t&&t(0)):u._f.onChange&&u._f.onChange(n);let H=K(s,Z,L),W=!R(H)||B;if(L||j.state.next({name:s,type:n.type,values:l(k)}),U)return(N.isValid||A.isValid)&&("onBlur"===v.mode?L&&z():L||z()),W&&j.state.next({name:s,...B?{}:H});if(!v.resolver&&e.validate&&await X({name:s,eventType:n.type}),!L&&B&&j.state.next({...y}),v.resolver){let{errors:e}=await J([s]);if(F([s]),d(Z),a){let t=eo(y.errors,b,s),n=eo(e,b,t.name||s);r=n.error,s=n.name,w=R(e)}}else F([s],!0),r=(await eu(u,I.disabled,k,P,v.shouldUseNativeValidation))[s],F([s]),d(Z),a&&(r?w=!1:(N.isValid||A.isValid)&&(w=await et({fields:b,onlyCheckValid:!0,name:s,eventType:n.type})));if(a){u._f.deps&&(!Array.isArray(u._f.deps)||u._f.deps.length>0)&&ev(u._f.deps);var C=s,T=w,E=r;let e=p(y.errors,C),n=(N.isValid||A.isValid)&&"boolean"==typeof T&&y.isValid!==T;if(v.delayError&&E){let e;e=()=>{f(y.errors,C,E),j.state.next({errors:y.errors})},(t=t=>{clearTimeout(O),O=setTimeout(e,t)})(v.delayError)}else clearTimeout(O),t=null,E?f(y.errors,C,E):V(y.errors,C);if((E?!D(e,E):e)||!R(H)||n){let e={...H,...n&&"boolean"==typeof T?{isValid:T}:{},errors:y.errors,name:C};y={...y,...e},j.state.next(e)}}}},eg=(e,t)=>{if(p(y.errors,t)&&e.focus)return e.focus(),1},ev=async(e,t={})=>{let r,n,i=M(e);if(v.resolver){let t=await G(u(e)?e:i);r=R(t),n=e?!i.some(e=>p(t,e)):r}else e?((n=(await Promise.all(i.map(async e=>{let t=p(b,e);return await et({fields:t&&t._f?{[e]:t}:t,eventType:g})}))).every(Boolean))||y.isValid)&&z():n=r=await et({fields:b,name:e,eventType:g});return j.state.next({...!T(e)||(N.isValid||A.isValid)&&r!==y.isValid?{}:{name:e},...v.resolver||!e?{isValid:r}:{},errors:y.errors}),t.shouldFocus&&!n&&ei(b,eg,e?i:I.mount),n},ey=(e,t)=>{let r={...w.mount?k:x};return t&&(r=function e(t,r){let n={};for(let o in t)if(t.hasOwnProperty(o)){let s=t[o],a=r[o];if(s&&i(s)&&a){let t=e(s,a);i(t)&&(n[o]=t)}else t[o]&&(n[o]=a)}return n}(t.dirtyFields?y.dirtyFields:y.touchedFields,r)),u(e)?r:T(e)?p(r,e):e.map(e=>p(r,e))},eb=(e,t)=>({invalid:!!p((t||y).errors,e),isDirty:!!p((t||y).dirtyFields,e),error:p((t||y).errors,e),isValidating:!!p(y.validatingFields,e),isTouched:!!p((t||y).touchedFields,e)}),ex=e=>{let t=e?M(e):void 0;null==t||t.forEach(e=>V(y.errors,e)),t?t.forEach(e=>{j.state.next({name:e,errors:y.errors})}):j.state.next({errors:{}})},ek=(e,t,r)=>{let n=(p(b,e,{_f:{}})._f||{}).ref,{ref:i,message:o,type:s,...a}=p(y.errors,e)||{};f(y.errors,e,{...a,...t,ref:n}),j.state.next({name:e,errors:y.errors,isValid:!1}),r&&r.shouldFocus&&n&&n.focus&&n.focus()},ew=e=>j.state.subscribe({next:t=>{let r,n,i;if(r=e.name,n=t.name,i=e.exact,(!r||!n||r===n||M(r).some(e=>e&&(i?e===n:e.startsWith(n)||n.startsWith(e))))&&((e,t,r,n)=>{r(e);let{name:i,...o}=e;return R(o)||n&&Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!n||"all"))})(t,e.formState||N,eT,e.reRenderRoot)){let r={...k};e.callback({values:r,...y,...t,defaultValues:x})}}}).unsubscribe,e_=(e,t={})=>
2{for(let r of e?M(e):I.mount)I.mount.delete(r),I.array.delete(r),t.keepValue||(V(b,r),V(k,r)),t.keepError||V(y.errors,r),t.keepDirty||V(y.dirtyFields,r),t.keepTouched||V(y.touchedFields,r),t.keepIsValidating||V(y.validatingFields,r),v.shouldUnregister||t.keepDefaultValue||V(x,r);j.state.next({values:l(k)}),j.state.next({...y,...!t.keepDirty?{}:{isDirty:ea()}}),t.keepIsValid||z()},e$=({disabled:e,name:t})=>{if("boolean"==typeof e&&w.mount||e||I.disabled.has(t)){let r=I.disabled.has(t);e?I.disabled.add(t):I.disabled.delete(t),!!e!==r&&w.mount&&!w.action&&z()}},eS=(e,t={})=>{let r=p(b,e),n="boolean"==typeof t.disabled||"boolean"==typeof v.disabled,i=!I.registerName.has(e)&&r&&r._f&&!r._f.mount;return(f(b,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),I.mount.add(e),r&&!i)?e$({disabled:"boolean"==typeof t.disabled?t.disabled:v.disabled,name:e}):W(e,!0,t.value),{...n?{disabled:t.disabled||v.disabled}:{},...v.progressive?{required:!!t.required,min:Q(t.min),max:Q(t.max),minLength:Q(t.minLength),maxLength:Q(t.maxLength),pattern:Q(t.pattern)}:{},name:e,onChange:em,onBlur:em,ref:n=>{if(n){let i;I.registerName.add(e),eS(e,t),I.registerName.delete(e),r=p(b,e);let o=u(n.value)&&n.querySelectorAll&&n.querySelectorAll("input,select,textarea")[0]||n,s="radio"===(i=o).type||"checkbox"===i.type,a=r._f.refs||[];(s?a.find(e=>e===o):o===r._f.ref)||(f(b,e,{_f:{...r._f,...s?{refs:[...a.filter(U),o,...Array.isArray(p(x,e))?[{}]:[]],ref:{type:o.type,name:e}}:{ref:o}}}),W(e,!1,void 0,o))}else(r=p(b,e,{}))._f&&(r._f.mount=!1),(v.shouldUnregister||t.shouldUnregister)&&!(s(I.array,e).length&&w.action)&&I.unMount.add(e)}}},eI=()=>v.shouldFocusError&&!v.shouldUseNativeValidation&&ei(b,eg,I.mount),eO=(e,t)=>async r=>{let n;r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let i=l(k);if(j.state.next({isSubmitting:!0}),v.resolver){let{errors:e,values:t}=await J();F(),y.errors=e,i=l(t)}else await et({fields:b,eventType:"submit"});if(I.disabled.size)for(let e of I.disabled)V(i,e);if(V(y.errors,S),R(y.errors)){j.state.next({errors:{}});try{await e(i,r)}catch(e){n=e}}else t&&await t({...y.errors},r),eI(),setTimeout(eI);if(j.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:R(y.errors)&&!n,submitCount:y.submitCount+1,errors:y.errors}),n)throw n},eC=(e,t={})=>{let r=e?l(e):x,n=l(r),i=R(e),o=i?x:n;if(t.keepDefaultValues||(x=r),!t.keepValues){if(t.keepDirtyValues)for(let e of Array.from(new Set([...I.mount,...Object.keys(H(x,k))]))){let t=p(y.dirtyFields,e),r=p(k,e),n=p(o,e);t&&!u(r)?f(o,e,r):t||u(n)||ef(e,n)}else{if(a&&u(e))for(let e of I.mount){let t=p(b,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(L(e)){let t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(let e of I.mount)ef(e,p(o,e));else b={}}k=v.shouldUnregister?t.keepDefaultValues?l(x):{}:l(o),j.array.next({values:{...o}}),j.state.next({values:{...o}})}I={mount:t.keepDirtyValues?I.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},w.mount=!N.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!v.shouldUnregister&&!R(o),w.watch=!!v.shouldUnregister,w.keepIsValid=!!t.keepIsValid,w.action=!1,t.keepErrors||(y.errors={}),j.state.next({submitCount:t.keepSubmitCount?y.submitCount:0,isDirty:!i&&(t.keepDirty?y.isDirty:!!(t.keepDefaultValues&&!D(e,x))),isSubmitted:!!t.keepIsSubmitted&&y.isSubmitted,dirtyFields:i?{}:t.keepDirtyValues?t.keepDefaultValues&&k?H(x,k):y.dirtyFields:t.keepDefaultValues&&e?H(x,e):t.keepDirty?y.dirtyFields:{},touchedFields:t.keepTouched?y.touchedFields:{},errors:t.keepErrors?y.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&y.isSubmitSuccessful,isSubmitting:!1,defaultValues:x})},eN=(e,t)=>eC(h(e)?e(k):e,{...v.resetOptions,...t}),eT=e=>{y={...y,...e}},eE={control:{register:eS,unregister:e_,getFieldState:eb,handleSubmit:eO,setError:ek,_subscribe:ew,_runSchema:J,_updateIsValidating:F,_focusError:eI,_getWatch:el,_getDirty:ea,_setValid:z,_setFieldArray:(e,t=[],r,n,i=!0,o=!0)=>{if(n&&r&&!v.disabled){if(w.action=!0,o&&Array.isArray(p(b,e))){let t=r(p(b,e),n.argA,n.argB);i&&f(b,e,t)}if(o&&Array.isArray(p(y.errors,e))){let t,o=r(p(y.errors,e),n.argA,n.argB);i&&f(y.errors,e,o),d(p(t=y.errors,e)).length||V(t,e)}if((N.touchedFields||A.touchedFields)&&o&&Array.isArray(p(y.touchedFields,e))){let t=r(p(y.touchedFields,e),n.argA,n.argB);i&&f(y.touchedFields,e,t)}(N.dirtyFields||A.dirtyFields)&&B(),j.state.next({name:e,isDirty:ea(e,t),dirtyFields:y.dirtyFields,errors:y.errors,isValid:y.isValid})}else f(k,e,t)},_setDisabledField:e$,_setErrors:e=>{y.errors=e,j.state.next({errors:y.errors,isValid:!1})},_getFieldArray:e=>d(p(w.mount?k:x,e,v.shouldUnregister?p(x,e,[]):[])),_reset:eC,_resetDefaultValues:()=>h(v.defaultValues)&&v.defaultValues().then(e=>{eN(e,v.resetOptions),j.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(let e of I.unMount){let t=p(b,e);t&&(t._f.refs?t._f.refs.every(e=>!U(e)):!U(t._f.ref))&&e_(e)}I.unMount=new Set},_disableForm:e=>{"boolean"==typeof e&&(j.state.next({disabled:e}),ei(b,(t,r)=>{let n=p(b,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEac
2h(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:j,_proxyFormState:N,get _fields(){return b},get _formValues(){return k},get _state(){return w},set _state(value){w=value},get _defaultValues(){return x},get _names(){return I},set _names(value){I=value},get _formState(){return y},get _options(){return v},set _options(value){v={...v,...value}}},subscribe:e=>(w.mount=!0,A={...A,...e.formState},ew({...e,formState:{...C,...e.formState}})),trigger:ev,register:eS,handleSubmit:eO,watch:(e,t)=>h(e)?j.state.subscribe({next:r=>"values"in r&&e(r.values||el(void 0,t),r)}):el(e,t,!0),setValue:ef,setValues:e=>{let t=h(e)?e(k):e;if(!D(k,t)){for(let e of(k={...k,...t},I.mount))ef(e,p(t,e));j.state.next({...y,values:k})}},getValues:ey,reset:eN,resetField:(e,t={})=>{p(b,e)&&(u(t.defaultValue)?ef(e,l(p(x,e))):(ef(e,t.defaultValue),f(x,e,l(t.defaultValue))),t.keepTouched||V(y.touchedFields,e),t.keepDirty||(V(y.dirtyFields,e),y.isDirty=t.defaultValue?ea(e,l(p(x,e))):ea()),!t.keepError&&(V(y.errors,e),N.isValid&&z()),j.state.next({...y}))},clearErrors:ex,unregister:e_,setError:ek,setFocus:(e,t={})=>{let r=p(b,e),n=r&&r._f;if(n){let e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&h(e.select)&&e.select()})}},getFieldState:eb};return{...eE,formControl:eE}}(e);v.current={...y,formState:b}}let k=v.current.control;return k._options=e,C(()=>{let e=k._subscribe({formState:k._proxyFormState,callback:()=>x({...k._formState,defaultValues:k._defaultValues}),reRenderRoot:!0});return x(e=>({...e,isReady:!0})),k._formState.isReady=!0,e},[k]),t.default.useEffect(()=>k._disableForm(e.disabled),[k,e.disabled]),t.default.useEffect(()=>{e.mode&&(k._options.mode=e.mode),e.reValidateMode&&(k._options.reValidateMode=e.reValidateMode)},[k,e.mode,e.reValidateMode]),t.default.useEffect(()=>{e.errors&&(k._setErrors(e.errors),k._focusError())},[k,e.errors]),t.default.useEffect(()=>{e.shouldUnregister&&k._subjects.state.next({values:k._getWatch()})},[k,e.shouldUnregister]),t.default.useEffect(()=>{if(k._proxyFormState.isDirty){let e=k._getDirty();e!==b.isDirty&&k._subjects.state.next({isDirty:e})}},[k,b.isDirty]),t.default.useEffect(()=>{var t;e.values&&!D(e.values,y.current)?(k._reset(e.values,{keepFieldsRef:!0,...k._options.resetOptions}),(null==(t=k._options.resetOptions)?void 0:t.keepIsValid)||k._setValid(),y.current=e.values,x(e=>({...e}))):k._resetDefaultValues()},[k,e.values]),t.default.useEffect(()=>{k._state.mount||(k._setValid(),k._state.mount=!0),k._state.watch&&(k._state.watch=!1,k._subjects.state.next({...k._formState})),k._removeUnmounted()}),v.current.formState=t.default.useMemo(()=>O(b,k),[k,b]),v.current},"useFormContext",0,()=>t.default.useContext(P),"useFormState",0,N,"useWatch",0,j])},456998,e=>{"use strict";var t=e.i(653145);let r=(e,r,n)=>{if(e&&"reportValidity"in e){let i=(0,t.get)(n,r);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},n=(e,t)=>{for(let n in t.fields){let i=t.fields[n];i&&i.ref&&"reportValidity"in i.ref?r(i.ref,n,e):i&&i.refs&&i.refs.forEach(t=>r(t,n,e))}},i=(e,t)=>{let r=o(t);return e.some(e=>o(e).match(`^${r}\\.\\d+`))};function o(e){return e.replace(/\]|\[/g,"")}e.s(["toNestErrors",0,(e,r)=>{r.shouldUseNativeValidation&&n(e,r);let o={};for(let n in e){let s=(0,t.get)(r.fields,n),a=Object.assign(e[n]||{},{ref:s&&s.ref});if(i(r.names||Object.keys(e),n)){let e=Object.assign({},(0,t.get)(o,n));(0,t.set)(e,"root",a),(0,t.set)(o,n,e)}else(0,t.set)(o,n,a)}return o},"validateFieldsNatively",0,n])},197753,922143,e=>{"use strict";let t=Object.freeze({status:"aborted"}),r=Symbol("zod_brand"),n={};function i(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function o(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}e.s(["$ZodAsyncError",0,class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},"$brand",0,r,"$constructor",0,function(e,t,r){function n(r,n){var i;for(let o in Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(i=r._zod).traits??(i.traits=new Set),r._zod.traits.add(e),t(r,n),s.prototype)o in r||Object.defineProperty(r,o,{value:s.prototype[o].bind(r)});r._zod.constr=s,r._zod.def=n}
2let i=r?.Parent??Object;class o extends i{}function s(e){var t;let i=r?.Parent?new o:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s},"NEVER",0,t,"config",0,function(e){return e&&Object.assign(n,e),n},"globalConfig",0,n],197753);let s=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function a(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let l=i(()=>{if("u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function u(e){if(!1===a(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==a(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}let d=new Set(["string","number","symbol"]),c=new Set(["string","number","bigint","boolean","symbol","undefined"]);function p(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function h(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let f={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},m={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function g(e){return"string"==typeof e?e:e?.message}e.s(["BIGINT_FORMAT_RANGES",0,m,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,f,"aborted",0,function(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1},"allowsEval",0,l,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error()},"assertNotEqual",0,function(e){return e},"assignProp",0,o,"cached",0,i,"captureStackTrace",0,s,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,function(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)},"clone",0,p,"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,o)=>(t??(t=e()),Reflect.set(t,n,i,o)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})},"defineLazy",0,function(e,t,r){Object.defineProperty(e,t,{get(){{let n=r();return e[t]=n,n}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})},"esc",0,function(e){return JSON.stringify(e)},"escapeRegex",0,function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},"extend",0,function(e,t){if(!u(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return o(this,"shape",r),r},checks:[]};return p(e,r)},"finalizeIssue",0,function(e,t,r){let n={...e,path:e.path??[]};return e.message||(n.message=g(e.inst?._zod.def?.error?.(e))??g(t?.error?.(e))??g(r.customError?.(e))??g(r.localeError?.(e))??"Invalid input"),delete n.inst,delete n.continue,t?.reportInput||delete n.input,n},"floatSafeRemainder",0,function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i},"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,function(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)},"getLengthableOrigin",0,function(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"},"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,function(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"},"isObject",0,a,"isPlainObject",0,u,"issue",0,function(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}},"joinValues",0,function(e,t="|"){return e.map(e=>h(e)).join(t)},"jsonStringifyReplacer",0,function(e,t){return"bigint"==typeof t?t.toString():t},"merge",0,function(e,t){return p(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return o(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})},"normalizeParams",0,function(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e},"nullish",0,function(e){return null==e},"numKeys",0,function(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t},"omit",0,function(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return p(e,{...e._zod.def,shape:r,checks:[]})},"optionalKeys",0,function(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)},"partial",0,function(e,t,r){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return p(t,{...t._zod.def,shape:i,checks:[]})},"pick",0,function(e,t){let r={},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(r[e]=n.shape[e])}return p(e,{...e._zod.def,shape:r,checks:[]})},"prefixIssues",0,function(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}
2,"primitiveTypes",0,c,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})},"propertyKeyTypes",0,d,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r},"required",0,function(e,t,r){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return p(t,{...t._zod.def,shape:i,checks:[]})},"stringifyPrimitive",0,h,"unwrapMessage",0,g],922143)},803108,374969,e=>{"use strict";var t=e.i(197753),r=e.i(922143);let n=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,r.jsonStringifyReplacer,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},i=(0,t.$constructor)("$ZodError",n),o=(0,t.$constructor)("$ZodError",n,{Parent:Error});function s(e){let t=[];for(let r of e)"number"==typeof r?t.push(`[${r}]`):"symbol"==typeof r?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}e.s(["$ZodError",0,i,"$ZodRealError",0,o,"flattenError",0,function(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}},"formatError",0,function(e,t){let r=t||function(e){return e.message},n={_errors:[]},i=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>i({issues:e}));else if("invalid_key"===t.code)i({issues:t.issues});else if("invalid_element"===t.code)i({issues:t.issues});else if(0===t.path.length)n._errors.push(r(t));else{let e=n,i=0;for(;i<t.path.length;){let n=t.path[i];i===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(r(t))):e[n]=e[n]||{_errors:[]},e=e[n],i++}}};return i(e),n},"prettifyError",0,function(e){let t=[];for(let r of[...e.issues].sort((e,t)=>e.path.length-t.path.length))t.push(`✖ ${r.message}`),r.path?.length&&t.push(`  → at ${s(r.path)}`);return t.join("\n")},"toDotPath",0,s,"treeifyError",0,function(e,t){let r=t||function(e){return e.message},n={errors:[]},i=(e,t=[])=>{var o,s;for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>i({issues:e},a.path));else if("invalid_key"===a.code)i({issues:a.issues},a.path);else if("invalid_element"===a.code)i({issues:a.issues},a.path);else{let e=[...t,...a.path];if(0===e.length){n.errors.push(r(a));continue}let i=n,l=0;for(;l<e.length;){let t=e[l],n=l===e.length-1;"string"==typeof t?(i.properties??(i.properties={}),(o=i.properties)[t]??(o[t]={errors:[]}),i=i.properties[t]):(i.items??(i.items=[]),(s=i.items)[t]??(s[t]={errors:[]}),i=i.items[t]),n&&i.errors.push(r(a)),l++}}};return i(e),n}],374969);let a=e=>(n,i,o,s)=>{let a=o?Object.assign(o,{async:!1}):{async:!1},l=n._zod.run({value:i,issues:[]},a);if(l instanceof Promise)throw new t.$ZodAsyncError;if(l.issues.length){let n=new(s?.Err??e)(l.issues.map(e=>r.finalizeIssue(e,a,t.config())));throw r.captureStackTrace(n,s?.callee),n}return l.value},l=a(o),u=e=>async(n,i,o,s)=>{let a=o?Object.assign(o,{async:!0}):{async:!0},l=n._zod.run({value:i,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){let n=new(s?.Err??e)(l.issues.map(e=>r.finalizeIssue(e,a,t.config())));throw r.captureStackTrace(n,s?.callee),n}return l.value},d=u(o),c=e=>(n,o,s)=>{let a=s?{...s,async:!1}:{async:!1},l=n._zod.run({value:o,issues:[]},a);if(l instanceof Promise)throw new t.$ZodAsyncError;return l.issues.length?{success:!1,error:new(e??i)(l.issues.map(e=>r.finalizeIssue(e,a,t.config())))}:{success:!0,data:l.value}},p=c(o),h=e=>async(n,i,o)=>{let s=o?Object.assign(o,{async:!0}):{async:!0},a=n._zod.run({value:i,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>r.finalizeIssue(e,s,t.config())))}:{success:!0,data:a.value}},f=h(o);e.s(["_parse",0,a,"_parseAsync",0,u,"_safeParse",0,c,"_safeParseAsync",0,h,"parse",0,l,"parseAsync",0,d,"safeParse",0,p,"safeParseAsync",0,f],803108)},994814,e=>{"use strict";var t=e.i(456998),r=e.i(653145),n=e.i(374969),i=e.i(803108);function o(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}e.s(["zodResolver",0,function(e,s,a){if(void 0===a&&(a={}),"_def"in e&&"object"==typeof e._def&&"typeName"in e._def)return function(n,i,l){try{return Promise.resolve(o(function(){return Promise.resolve(e["sync"===a.mode?"parse":"parseAsync"](n,s)).then(function(e){return l.shouldUseNativeValidation&&(0,t.validateFieldsNatively)({},l),{errors:{},values:a.raw?Object.assign({},n):e}})},function(e){if(Array.isArray(null==e?void 0:e.issues))return{values:{},errors:(0,t.toNestErrors)(function(e,t){for(var n={};e.length;){var i=e[0],o=i.code,s=i.message,a=i.path.join(".");
2if(!n[a])if("unionErrors"in i){var l=i.unionErrors[0].errors[0];n[a]={message:l.message,type:l.code}}else n[a]={message:s,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var u=n[a].types,d=u&&u[i.code];n[a]=(0,r.appendErrors)(a,t,n,o,d?[].concat(d,i.message):i.message)}e.shift()}return n}(e.errors,!l.shouldUseNativeValidation&&"all"===l.criteriaMode),l)};throw e}))}catch(e){return Promise.reject(e)}};if("_zod"in e&&"object"==typeof e._zod)return function(l,u,d){try{return Promise.resolve(o(function(){return Promise.resolve(("sync"===a.mode?i.parse:i.parseAsync)(e,l,s)).then(function(e){return d.shouldUseNativeValidation&&(0,t.validateFieldsNatively)({},d),{errors:{},values:a.raw?Object.assign({},l):e}})},function(e){if(e instanceof n.$ZodError)return{values:{},errors:(0,t.toNestErrors)(function(e,t){for(var n={};e.length;){var i=e[0],o=i.code,s=i.message,a=i.path.join(".");if(!n[a])if("invalid_union"===i.code&&i.errors.length>0){var l=i.errors[0][0];n[a]={message:l.message,type:l.code}}else n[a]={message:s,type:o};if("invalid_union"===i.code&&i.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var u=n[a].types,d=u&&u[i.code];n[a]=(0,r.appendErrors)(a,t,n,o,d?[].concat(d,i.message):i.message)}e.shift()}return n}(e.issues,!d.shouldUseNativeValidation&&"all"===d.criteriaMode),d)};throw e}))}catch(e){return Promise.reject(e)}};throw Error("Invalid input: not a Zod schema")}])},874946,10708,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(991918),i=e.i(653145),o=e.i(647163),s=e.i(248425),a=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));a.displayName="Label",e.s(["Label",0,a,"Root",0,a],444461);var l=e.i(444461),l=l;function u({className:e,...r}){return(0,t.jsx)(l.Root,{"data-slot":"label",className:(0,o.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}e.s(["Label",0,u],10708);let d=i.FormProvider,c=r.createContext({}),p=()=>{let e=r.useContext(c),t=r.useContext(h),{getFieldState:n}=(0,i.useFormContext)(),o=(0,i.useFormState)({name:e.name}),s=n(e.name,o);if(!e)throw Error("useFormField should be used within <FormField>");let{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...s}},h=r.createContext({});e.s(["Form",0,d,"FormControl",0,function({...e}){let{error:r,formItemId:i,formDescriptionId:o,formMessageId:s}=p();return(0,t.jsx)(n.Slot,{"data-slot":"form-control",id:i,"aria-describedby":r?`${o} ${s}`:`${o}`,"aria-invalid":!!r,...e})},"FormDescription",0,function({className:e,...r}){let{formDescriptionId:n}=p();return(0,t.jsx)("p",{"data-slot":"form-description",id:n,className:(0,o.cn)("text-muted-foreground text-sm",e),...r})},"FormField",0,({...e})=>(0,t.jsx)(c.Provider,{value:{name:e.name},children:(0,t.jsx)(i.Controller,{...e})}),"FormItem",0,function({className:e,...n}){let i=r.useId();return(0,t.jsx)(h.Provider,{value:{id:i},children:(0,t.jsx)("div",{"data-slot":"form-item",className:(0,o.cn)("grid gap-2",e),...n})})},"FormLabel",0,function({className:e,...r}){let{error:n,formItemId:i}=p();return(0,t.jsx)(u,{"data-slot":"form-label","data-error":!!n,className:(0,o.cn)("data-[error=true]:text-destructive",e),htmlFor:i,...r})},"FormMessage",0,function({className:e,...r}){let{error:n,formMessageId:i}=p(),s=n?String(n?.message??""):r.children;return s?(0,t.jsx)("p",{"data-slot":"form-message",id:i,className:(0,o.cn)("text-destructive text-sm",e),...r,children:s}):null}],874946)},286536,77705,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,r],286536);let n=(0,t.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["EyeOff",0,n],77705)},344523,e=>{"use strict";let t=(0,e.i(475254).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],344523)},204753,915085,274768,448876,758472,40325,921430,989359,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);e.s(["Bold",0,r],204753);let n=(0,t.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);e.s(["Italic",0,n],915085);let i=(0,t.default)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);e.s(["Strikethrough",0,i],274768);let o=(0,t.default)("list-ordered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);e.s(["ListOrdered",0,o],448876);let s=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,s],758472);let a=(0,t.default)("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);e.s(["Undo",0,a],40325);let l=(0,t.default)("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);e.s(["Redo",0,l],921430);let u=(0,t.default)("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]);e.s(["Eraser",0,u],989359)},298821,40824,292135,e=>{"use strict";var t=e.i(197753),r=e.i(922143);function n(){let e,t;return{localeError:(e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n=>
2{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(n.input)}`;case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${r.stringifyPrimitive(n.values[0])}`;return`Invalid option: expected one of ${r.joinValues(n.values,"|")}`;case"too_big":{let t=n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${r.joinValues(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`}})}}e.s(["default",0,n],40824),(0,t.config)(n()),e.s([],298821),e.s([],292135)},681307,974559,494499,604366,99659,690256,649717,256378,103819,224929,963612,e=>{"use strict";e.i(298821),e.i(292135);var t,r,n,i,o,s,a,l,u,d,c,p,h,f,m,g,v,y,b,x=e.i(197753),k=e.i(803108),w=e.i(374969);let _=/^[cC][^\s-]{8,}$/,$=/^[0-9a-z]+$/,S=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,I=/^[0-9a-vA-V]{20}$/,O=/^[A-Za-z0-9]{27}$/,C=/^[a-zA-Z0-9_-]{21}$/,N=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,T=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,E=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,A=E(4),D=E(6),j=E(7),P=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,z="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function M(){return RegExp(z,"u")}let Z=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,L=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,U=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,V=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,F=/^[A-Za-z0-9_-]*$/,B=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,H=/^\+(?:[0-9]){6,14}[0-9]$/,W="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",K=RegExp(`^${W}$`);function J(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function q(e){return RegExp(`^${J(e)}$`)}function G(e){let t=J({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${W}T(?:${n})$`)}let X=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},Y=/^\d+n?$/,Q=/^\d+$/,ee=/^-?\d+(?:\.\d+)?/i,et=/true|false/i,er=/null/i,en=/undefined/i,ei=/^[^A-Z]*$/,eo=/^[^a-z]*$/;e.s(["_emoji",0,z,"base64",0,V,"base64url",0,F,"bigint",0,Y,"boolean",0,et,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,L,"cidrv6",0,U,"cuid",0,_,"cuid2",0,$,"date",0,K,"datetime",0,G,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,N,"e164",0,H,"email",0,P,"emoji",0,M,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,T,"hostname",0,B,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"integer",0,Q,"ipv4",0,Z,"ipv6",0,R,"ksuid",0,O,"lowercase",0,ei,"nanoid",0,C,"null",0,er,"number",0,ee,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"string",0,X,"time",0,q,"ulid",0,S,"undefined",0,en,"unicodeEmail",0,/^[^\s@"]{1,64}
2@[^\s@]{1,255}$/u,"uppercase",0,eo,"uuid",0,E,"uuid4",0,A,"uuid6",0,D,"uuid7",0,j,"xid",0,I],682358);var es=e.i(922143);let ea=x.$constructor("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),el={number:"number",bigint:"bigint",object:"date"},eu=x.$constructor("$ZodCheckLessThan",(e,t)=>{ea.init(e,t);let r=el[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ed=x.$constructor("$ZodCheckGreaterThan",(e,t)=>{ea.init(e,t);let r=el[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ec=x.$constructor("$ZodCheckMultipleOf",(e,t)=>{ea.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===es.floatSafeRemainder(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ep=x.$constructor("$ZodCheckNumberFormat",(e,t)=>{ea.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=es.NUMBER_FORMAT_RANGES[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=o,r&&(n.pattern=Q)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a))return void s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}))}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:e})}}),eh=x.$constructor("$ZodCheckBigIntFormat",(e,t)=>{ea.init(e,t);let[r,n]=es.BIGINT_FORMAT_RANGES[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=i=>{let o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inst:e})}}),ef=x.$constructor("$ZodCheckMaxSize",(e,t)=>{var r;ea.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!es.nullish(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:es.getSizableOrigin(n),code:"too_big",maximum:t.maximum,input:n,inst:e,continue:!t.abort})}}),em=x.$constructor("$ZodCheckMinSize",(e,t)=>{var r;ea.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!es.nullish(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:es.getSizableOrigin(n),code:"too_small",minimum:t.minimum,input:n,inst:e,continue:!t.abort})}}),eg=x.$constructor("$ZodCheckSizeEquals",(e,t)=>{var r;ea.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!es.nullish(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let o=i>
2t.size;r.issues.push({origin:es.getSizableOrigin(n),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ev=x.$constructor("$ZodCheckMaxLength",(e,t)=>{var r;ea.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!es.nullish(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=es.getLengthableOrigin(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ey=x.$constructor("$ZodCheckMinLength",(e,t)=>{var r;ea.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!es.nullish(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=es.getLengthableOrigin(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),eb=x.$constructor("$ZodCheckLengthEquals",(e,t)=>{var r;ea.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!es.nullish(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let o=es.getLengthableOrigin(n),s=i>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ex=x.$constructor("$ZodCheckStringFormat",(e,t)=>{var r,n;ea.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ek=x.$constructor("$ZodCheckRegex",(e,t)=>{ex.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ew=x.$constructor("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ei),ex.init(e,t)}),e_=x.$constructor("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eo),ex.init(e,t)}),e$=x.$constructor("$ZodCheckIncludes",(e,t)=>{ea.init(e,t);let r=es.escapeRegex(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),eS=x.$constructor("$ZodCheckStartsWith",(e,t)=>{ea.init(e,t);let r=RegExp(`^${es.escapeRegex(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),eI=x.$constructor("$ZodCheckEndsWith",(e,t)=>{ea.init(e,t);let r=RegExp(`.*${es.escapeRegex(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function eO(e,t,r){e.issues.length&&t.issues.push(...es.prefixIssues(r,e.issues))}let eC=x.$constructor("$ZodCheckProperty",(e,t)=>{ea.init(e,t),e._zod.check=e=>{let r=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(r=>eO(r,e,t.property));eO(r,e,t.property)}}),eN=x.$constructor("$ZodCheckMimeType",(e,t)=>{ea.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e})}}),eT=x.$constructor("$ZodCheckOverwrite",(e,t)=>{ea.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});e.s(["$ZodCheck",0,ea,"$ZodCheckBigIntFormat",0,eh,"$ZodCheckEndsWith",0,eI,"$ZodCheckGreaterThan",0,ed,"$ZodCheckIncludes",0,e$,"$ZodCheckLengthEquals",0,eb,"$ZodCheckLessThan",0,eu,"$ZodCheckLowerCase",0,ew,"$ZodCheckMaxLength",0,ev,"$ZodCheckMaxSize",0,ef,"$ZodCheckMimeType",0,eN,"$ZodCheckMinLength",0,ey,"$ZodCheckMinSize",0,em,"$ZodCheckMultipleOf",0,ec,"$ZodCheckNumberFormat",0,ep,"$ZodCheckOverwrite",0,eT,"$ZodCheckProperty",0,eC,"$ZodCheckRegex",0,ek,"$ZodCheckSizeEquals",0,eg,"$ZodCheckStartsWith",0,eS,"$ZodCheckStringFormat",0,ex,"$ZodCheckUpperCase",0,e_],355605);class eE{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}e.s(["Doc",0,eE],698530);let eA={major:4,minor:0,patch:0};e.s(["version",0,eA],398477);let eD=x.$constructor("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eA;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,i=es.aborted(e);for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new x.$ZodAsyncError;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||(i=es.aborted(e,t)))});else{if(e.issues.length===t)continue;i||(i=es.aborted(e,t))}}return n?n.then(()=>e):e};e._zod.run=(r,i)=>{let o=e._zod.parse(r,i);if(o instanceof Promise){if(!1===i.async)throw new x.$ZodAsyncError;return o.then(e=>t(e,n,i))}return t(o,n,i)}}e["~standard"]={validate:t=>{try{let r=(0,k.safeParse)(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return(0,k.safeParseAsync)(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),ej=x.$constructor("$ZodString",(e,t)=>{eD.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??X(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),eP=x.$constructor("$ZodStringFormat",(e,t)=>{ex.init(e,t),ej.init(e,t)}),ez=x.$constructor("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=T),eP.init(e,t)}),eM=x.$constructor("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=E(e))}else t.pattern??(t.pattern=E());eP.init(e,t)}),eZ=x.$constructor("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=P),eP.init(e,t)}),eR=x.$constructor("$ZodURL",(e,t)=>{eP.init(e,t),e._zod.check=r=>{try{let n=r.value,i=new URL(n),o=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",n
2ote:"Invalid hostname",pattern:B.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&o.endsWith("/")?r.value=o.slice(0,-1):r.value=o;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),eL=x.$constructor("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=M()),eP.init(e,t)}),eU=x.$constructor("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=C),eP.init(e,t)}),eV=x.$constructor("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_),eP.init(e,t)}),eF=x.$constructor("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$),eP.init(e,t)}),eB=x.$constructor("$ZodULID",(e,t)=>{t.pattern??(t.pattern=S),eP.init(e,t)}),eH=x.$constructor("$ZodXID",(e,t)=>{t.pattern??(t.pattern=I),eP.init(e,t)}),eW=x.$constructor("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=O),eP.init(e,t)}),eK=x.$constructor("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=G(t)),eP.init(e,t)}),eJ=x.$constructor("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=K),eP.init(e,t)}),eq=x.$constructor("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=q(t)),eP.init(e,t)}),eG=x.$constructor("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=N),eP.init(e,t)}),eX=x.$constructor("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Z),eP.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),eY=x.$constructor("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=R),eP.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),eQ=x.$constructor("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=L),eP.init(e,t)}),e0=x.$constructor("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=U),eP.init(e,t),e._zod.check=r=>{let[n,i]=r.value.split("/");try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function e1(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let e4=x.$constructor("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=V),eP.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{e1(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function e2(e){if(!F.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return e1(t.padEnd(4*Math.ceil(t.length/4),"="))}let e6=x.$constructor("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=F),eP.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{e2(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),e3=x.$constructor("$ZodE164",(e,t)=>{t.pattern??(t.pattern=H),eP.init(e,t)});function e9(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}let e5=x.$constructor("$ZodJWT",(e,t)=>{eP.init(e,t),e._zod.check=r=>{e9(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),e7=x.$constructor("$ZodCustomStringFormat",(e,t)=>{eP.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),e8=x.$constructor("$ZodNumber",(e,t)=>{eD.init(e,t),e._zod.pattern=e._zod.bag.pattern??ee,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),te=x.$constructor("$ZodNumber",(e,t)=>{ep.init(e,t),e8.init(e,t)}),tt=x.$constructor("$ZodBoolean",(e,t)=>{eD.init(e,t),e._zod.pattern=et,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),tr=x.$constructor("$ZodBigInt",(e,t)=>{eD.init(e,t),e._zod.pattern=Y,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),tn=x.$constructor("$ZodBigInt",(e,t)=>{eh.init(e,t),tr.init(e,t)}),ti=x.$constructor("$ZodSymbol",(e,t)=>{eD.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return"symbol"==typeof n||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),t}}),to=x.$constructor("$ZodUndefined",(e,t)=>{eD.init(e,t),e._zod.pattern=en,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),t}}),ts=x.$constructor("$ZodNull",(e,t)=>{eD.init(e,t),e._zod.pattern=er,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),ta=x.$constructor("$ZodAny",(e,t)=>{eD.init(e,t),e._zod.parse=e=>e}),tl=x.$constructor("$ZodUnknown",(e,t)=>{eD.init(e,t),e._zod.parse=e=>e}),tu=x.$constructor("$ZodNever",(e,t)=>{eD.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),td=x.$constructor("$ZodVoid",(e,t)=>{eD.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}}
2),tc=x.$constructor("$ZodDate",(e,t)=>{eD.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),r}});function tp(e,t,r){e.issues.length&&t.issues.push(...es.prefixIssues(r,e.issues)),t.value[r]=e.value}let th=x.$constructor("$ZodArray",(e,t)=>{eD.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let o=[];for(let e=0;e<i.length;e++){let s=i[e],a=t.element._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(t=>tp(t,r,e))):tp(a,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function tf(e,t,r){e.issues.length&&t.issues.push(...es.prefixIssues(r,e.issues)),t.value[r]=e.value}function tm(e,t,r,n){e.issues.length?void 0===n[r]?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...es.prefixIssues(r,e.issues)):void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}let tg=x.$constructor("$ZodObject",(e,t)=>{let r,n;eD.init(e,t);let i=es.cached(()=>{let e=Object.keys(t.shape);for(let r of e)if(!(t.shape[r]instanceof eD))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=es.optionalKeys(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}});es.defineLazy(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let o=es.isObject,s=!x.globalConfig.jitless,a=es.allowsEval,l=s&&a.value,u=t.catchall;e._zod.parse=(a,d)=>{n??(n=i.value);let c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;let p=[];if(s&&l&&d?.async===!1&&!0!==d.jitless)r||(r=(e=>
2{let t=new eE(["shape","payload","ctx"]),r=i.value,n=e=>{let t=es.esc(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let o=Object.create(null),s=0;for(let e of r.keys)o[e]=`key_${s++}`;for(let e of(t.write("const newResult = {}"),r.keys))if(r.optionalKeys.has(e)){let r=o[e];t.write(`const ${r} = ${n(e)};`);let i=es.esc(e);t.write(`
3        if (${r}.issues.length) {
4          if (input[${i}] === undefined) {
5            if (${i} in input) {
6              newResult[${i}] = undefined;
7            }
8          } else {
9            payload.issues = payload.issues.concat(
10              ${r}.issues.map((iss) => ({
11                ...iss,
12                path: iss.path ? [${i}, ...iss.path] : [${i}],
13              }))
14            );
15          }
16        } else if (${r}.value === undefined) {
17          if (${i} in input) newResult[${i}] = undefined;
18        } else {
19          newResult[${i}] = ${r}.value;
20        }
21        `)}else{let r=o[e];t.write(`const ${r} = ${n(e)};`),t.write(`
22          if (${r}.issues.length) payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
23            ...iss,
24            path: iss.path ? [${es.esc(e)}, ...iss.path] : [${es.esc(e)}]
25          })));`),t.write(`newResult[${es.esc(e)}] = ${r}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");let a=t.compile();return(t,r)=>a(e,t,r)})(t.shape)),a=r(a,d);else{a.value={};let e=n.shape;for(let t of n.keys){let r=e[t],n=r._zod.run({value:c[t],issues:[]},d),i="optional"===r._zod.optin&&"optional"===r._zod.optout;n instanceof Promise?p.push(n.then(e=>i?tm(e,a,t,c):tf(e,a,t))):i?tm(n,a,t,c):tf(n,a,t)}}if(!u)return p.length?Promise.all(p).then(()=>a):a;let h=[],f=n.keySet,m=u._zod,g=m.def.type;for(let e of Object.keys(c)){if(f.has(e))continue;if("never"===g){h.push(e);continue}let t=m.run({value:c[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>tf(t,a,e))):tf(t,a,e)}return(h.length&&a.issues.push({code:"unrecognized_keys",keys:h,input:c,inst:e}),p.length)?Promise.all(p).then(()=>a):a}});function tv(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>es.finalizeIssue(e,n,x.config())))}),t}let ty=x.$constructor("$ZodUnion",(e,t)=>{eD.init(e,t),es.defineLazy(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),es.defineLazy(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),es.defineLazy(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),es.defineLazy(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>es.cleanRegex(e.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let i=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},n);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then(t=>tv(t,r,e,n)):tv(o,r,e,n)}}),tb=x.$constructor("$ZodDiscriminatedUnion",(e,t)=>{ty.init(e,t);let r=e._zod.parse;es.defineLazy(e._zod,"propValues",()=>{let e={};for(let r of t.options){let n=r._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),r))e[t].add(n)}return e});let n=es.cached(()=>{let e=t.options,r=new Map;for(let n of e){let e=n._zod.propValues[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,n)}}return r});e._zod.parse=(i,o)=>{let s=i.value;if(!es.isObject(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),i)}}),tx=x.$constructor("$ZodIntersection",(e,t)=>{eD.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),o=t.right._zod.run({value:n,issues:[]},r);
25return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,r])=>tk(e,t,r)):tk(e,i,o)}});function tk(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),es.aborted(e))return e;let n=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(es.isPlainObject(t)&&es.isPlainObject(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),o={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let o=e(t[i],r[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}let tw=x.$constructor("$ZodTuple",(e,t)=>{eD.init(e,t);let r=t.items,n=r.length-[...r].reverse().findIndex(e=>"optional"!==e._zod.optin);e._zod.parse=(i,o)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[];if(!t.rest){let t=s.length>r.length,o=s.length<n-1;if(t||o)return i.issues.push({input:s,inst:e,origin:"array",...t?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),i}let l=-1;for(let e of r){if(++l>=s.length&&l>=n)continue;let t=e._zod.run({value:s[l],issues:[]},o);t instanceof Promise?a.push(t.then(e=>t_(e,i,l))):t_(t,i,l)}if(t.rest)for(let e of s.slice(r.length)){l++;let r=t.rest._zod.run({value:e,issues:[]},o);r instanceof Promise?a.push(r.then(e=>t_(e,i,l))):t_(r,i,l)}return a.length?Promise.all(a).then(()=>i):i}});function t_(e,t,r){e.issues.length&&t.issues.push(...es.prefixIssues(r,e.issues)),t.value[r]=e.value}let t$=x.$constructor("$ZodRecord",(e,t)=>{eD.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!es.isPlainObject(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let o=[];if(t.keyType._zod.values){let s,a=t.keyType._zod.values;for(let e of(r.value={},a))if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){let s=t.valueType._zod.run({value:i[e],issues:[]},n);s instanceof Promise?o.push(s.then(t=>{t.issues.length&&r.issues.push(...es.prefixIssues(e,t.issues)),r.value[e]=t.value})):(s.issues.length&&r.issues.push(...es.prefixIssues(e,s.issues)),r.value[e]=s.value)}for(let e in i)a.has(e)||(s=s??[]).push(e);s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:s})}else for(let s of(r.value={},Reflect.ownKeys(i))){if("__proto__"===s)continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(e=>es.finalizeIssue(e,n,x.config())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let l=t.valueType._zod.run({value:i[s],issues:[]},n);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&r.issues.push(...es.prefixIssues(s,e.issues)),r.value[a.value]=e.value})):(l.issues.length&&r.issues.push(...es.prefixIssues(s,l.issues)),r.value[a.value]=l.value)}return o.length?Promise.all(o).then(()=>r):r}}),tS=x.$constructor("$ZodMap",(e,t)=>{eD.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let o=[];for(let[s,a]of(r.value=new Map,i)){let l=t.keyType._zod.run({value:s,issues:[]},n),u=t.valueType._zod.run({value:a,issues:[]},n);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([t,o])=>{tI(t,o,r,s,i,e,n)})):tI(l,u,r,s,i,e,n)}return o.length?Promise.all(o).then(()=>r):r}});function tI(e,t,r,n,i,o,s){e.issues.length&&(es.propertyKeyTypes.has(typeof n)?r.issues.push(...es.prefixIssues(n,e.issues)):r.issues.push({origin:"map",code:"invalid_key",input:i,inst:o,issues:e.issues.map(e=>es.finalizeIssue(e,s,x.config()))})),t.issues.length&&(es.propertyKeyTypes.has(typeof n)?r.issues.push(...es.prefixIssues(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:t.issues.map(e=>es.finalizeIssue(e,s,x.config()))})),r.value.set(e.value,t.value)}let tO=x.$constructor("$ZodSet",(e,t)=>{eD.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];for(let e of(r.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},n);i instanceof Promise?o.push(i.then(e=>tC(e,r))):tC(i,r)}return o.length?Promise.all(o).then(()=>r):r}});function tC(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let tN=x.$constructor("$ZodEnum",(e,t)=>{eD.init(e,t);let r=es.getEnumValues(t.entries);e._zod.values=new Set(r),e._zod.pattern=RegExp(`^(${r.filter(e=>es.propertyKeyTypes.has(typeof e)).map(e=>"string"==typeof e?es.escapeRegex(e):e.toString()).join("|")})$`),e._zod.parse=(t,n)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),tT=x.$constructor("$ZodLiteral",(e,t)=>{eD.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?es.escapeRegex(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(r,n)=>{let i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),tE=x.$constructor("$ZodFile",(e,t)=>{eD.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),t}}),tA=x.$constructor("$ZodTransform",(e,t)=>{eD.init(e,t),e._zod.parse=(e,r)=>{let n=t.transform(e.value,e);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(t=>(e.value=t,e));if(n instanceof Promise)throw new x.$ZodAsyncError;return e.value=n,e}}),tD=x.$constructor("$ZodOptional",(e,t)=>{eD.init(e,t),e._zod.optin="optional",e._zod.optout="optional",es.defineLazy(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),es.defineLazy(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${es.cleanRegex(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,r):void 0===e.value?e:t.innerType._zod.run(e,r)}),tj=x.$constructor("$ZodNullable",(e,t)=>{eD.init(e,t),es.defineLazy(e._zod,"optin",()=>t.innerType._zod.optin),es.defineLazy(e._zod,"optout",()=>t.innerType._zod.optout),es.defineLazy(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${es.cleanRegex(e.source)}|null)$`):void 0}),es.defineLazy(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),tP=x.$constructor("$ZodDefault",(e,t)=>{eD.init(e,t),e._zod.optin="optional",es.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>tz(e,t)):tz(n,t)}});function tz(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let tM=x.$constructor("$ZodPrefault",(e,t)=>{eD.init(e,t),e._zod.optin="optional",es.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),tZ=x.$constructor("$ZodNonOptional",(e,t)=>{eD.init(e,t),es.defineLazy(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>tR(t,e)):tR(i,e)}});function tR(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let tL=x.$constructor("$ZodSuccess",(e,t)=>{eD.init(e,t),e._zod.parse=(e,r)=>{let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}}),tU=x.$constructor("$ZodCatch",(e,t)=>{eD.init(e,t),e._zod.optin="optional",es.defineLazy(e._zod,"optout",()=>t.innerType._zod.optout),es.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>
25(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>es.finalizeIssue(e,r,x.config()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>es.finalizeIssue(e,r,x.config()))},input:e.value}),e.issues=[]),e)}}),tV=x.$constructor("$ZodNaN",(e,t)=>{eD.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),tF=x.$constructor("$ZodPipe",(e,t)=>{eD.init(e,t),es.defineLazy(e._zod,"values",()=>t.in._zod.values),es.defineLazy(e._zod,"optin",()=>t.in._zod.optin),es.defineLazy(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,r)=>{let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>tB(e,t,r)):tB(n,t,r)}});function tB(e,t,r){return es.aborted(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}let tH=x.$constructor("$ZodReadonly",(e,t)=>{eD.init(e,t),es.defineLazy(e._zod,"propValues",()=>t.innerType._zod.propValues),es.defineLazy(e._zod,"values",()=>t.innerType._zod.values),es.defineLazy(e._zod,"optin",()=>t.innerType._zod.optin),es.defineLazy(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,r)=>{let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(tW):tW(n)}});function tW(e){return e.value=Object.freeze(e.value),e}let tK=x.$constructor("$ZodTemplateLiteral",(e,t)=>{eD.init(e,t);let r=[];for(let e of t.parts)if(e instanceof eD){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let n=+!!t.startsWith("^"),i=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(n,i))}else if(null===e||es.primitiveTypes.has(typeof e))r.push(es.escapeRegex(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(t,r)=>("string"!=typeof t.value?t.issues.push({input:t.value,inst:e,expected:"template_literal",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(t.value)||t.issues.push({input:t.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source})),t)}),tJ=x.$constructor("$ZodPromise",(e,t)=>{eD.init(e,t),e._zod.parse=(e,r)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},r))}),tq=x.$constructor("$ZodLazy",(e,t)=>{eD.init(e,t),es.defineLazy(e._zod,"innerType",()=>t.getter()),es.defineLazy(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),es.defineLazy(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),es.defineLazy(e._zod,"optin",()=>e._zod.innerType._zod.optin),es.defineLazy(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),tG=x.$constructor("$ZodCustom",(e,t)=>{ea.init(e,t),eD.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>tX(t,r,n,e));tX(i,r,n,e)}});function tX(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(es.issue(e))}}e.s(["$ZodAny",0,ta,"$ZodArray",0,th,"$ZodBase64",0,e4,"$ZodBase64URL",0,e6,"$ZodBigInt",0,tr,"$ZodBigIntFormat",0,tn,"$ZodBoolean",0,tt,"$ZodCIDRv4",0,eQ,"$ZodCIDRv6",0,e0,"$ZodCUID",0,eV,"$ZodCUID2",0,eF,"$ZodCatch",0,tU,"$ZodCustom",0,tG,"$ZodCustomStringFormat",0,e7,"$ZodDate",0,tc,"$ZodDefault",0,tP,"$ZodDiscriminatedUnion",0,tb,"$ZodE164",0,e3,"$ZodEmail",0,eZ,"$ZodEmoji",0,eL,"$ZodEnum",0,tN,"$ZodFile",0,tE,"$ZodGUID",0,ez,"$ZodIPv4",0,eX,"$ZodIPv6",0,eY,"$ZodISODate",0,eJ,"$ZodISODateTime",0,eK,"$ZodISODuration",0,eG,"$ZodISOTime",0,eq,"$ZodIntersection",0,tx,"$ZodJWT",0,e5,"$ZodKSUID",0,eW,"$ZodLazy",0,tq,"$ZodLiteral",0,tT,"$ZodMap",0,tS,"$ZodNaN",0,tV,"$ZodNanoID",0,eU,"$ZodNever",0,tu,"$ZodNonOptional",0,tZ,"$ZodNull",0,ts,"$ZodNullable",0,tj,"$ZodNumber",0,e8,"$ZodNumberFormat",0,te,"$ZodObject",0,tg,"$ZodOptional",0,tD,"$ZodPipe",0,tF,"$ZodPrefault",0,tM,"$ZodPromise",0,tJ,"$ZodReadonly",0,tH,"$ZodRecord",0,t$,"$ZodSet",0,tO,"$ZodString",0,ej,"$ZodStringFormat",0,eP,"$ZodSuccess",0,tL,"$ZodSymbol",0,ti,"$ZodTemplateLiteral",0,tK,"$ZodTransform",0,tA,"$ZodTuple",0,tw,"$ZodType",0,eD,"$ZodULID",0,eB,"$ZodURL",0,eR,"$ZodUUID",0,eM,"$ZodUndefined",0,to,"$ZodUnion",0,ty,"$ZodUnknown",0,tl,"$ZodVoid",0,td,"$ZodXID",0,eH,"isValidBase64",0,e1,"isValidBase64URL",0,e2,"isValidJWT",0,e9],676094),e.i(676094),e.s(["$ZodAny",0,ta,"$ZodArray",0,th,"$ZodBase64",0,e4,"$ZodBase64URL",0,e6,"$ZodBigInt",0,tr,"$ZodBigIntFormat",0,tn,"$ZodBoolean",0,tt,"$ZodCIDRv4",0,eQ,"$ZodCIDRv6",0,e0,"$ZodCUID",0,eV,"$ZodCUID2",0,eF,"$ZodCatch",0,t
25U,"$ZodCustom",0,tG,"$ZodCustomStringFormat",0,e7,"$ZodDate",0,tc,"$ZodDefault",0,tP,"$ZodDiscriminatedUnion",0,tb,"$ZodE164",0,e3,"$ZodEmail",0,eZ,"$ZodEmoji",0,eL,"$ZodEnum",0,tN,"$ZodFile",0,tE,"$ZodGUID",0,ez,"$ZodIPv4",0,eX,"$ZodIPv6",0,eY,"$ZodISODate",0,eJ,"$ZodISODateTime",0,eK,"$ZodISODuration",0,eG,"$ZodISOTime",0,eq,"$ZodIntersection",0,tx,"$ZodJWT",0,e5,"$ZodKSUID",0,eW,"$ZodLazy",0,tq,"$ZodLiteral",0,tT,"$ZodMap",0,tS,"$ZodNaN",0,tV,"$ZodNanoID",0,eU,"$ZodNever",0,tu,"$ZodNonOptional",0,tZ,"$ZodNull",0,ts,"$ZodNullable",0,tj,"$ZodNumber",0,e8,"$ZodNumberFormat",0,te,"$ZodObject",0,tg,"$ZodOptional",0,tD,"$ZodPipe",0,tF,"$ZodPrefault",0,tM,"$ZodPromise",0,tJ,"$ZodReadonly",0,tH,"$ZodRecord",0,t$,"$ZodSet",0,tO,"$ZodString",0,ej,"$ZodStringFormat",0,eP,"$ZodSuccess",0,tL,"$ZodSymbol",0,ti,"$ZodTemplateLiteral",0,tK,"$ZodTransform",0,tA,"$ZodTuple",0,tw,"$ZodType",0,eD,"$ZodULID",0,eB,"$ZodURL",0,eR,"$ZodUUID",0,eM,"$ZodUndefined",0,to,"$ZodUnion",0,ty,"$ZodUnknown",0,tl,"$ZodVoid",0,td,"$ZodXID",0,eH,"clone",()=>es.clone,"isValidBase64",0,e1,"isValidBase64URL",0,e2,"isValidJWT",0,e9],532952),e.i(532952),e.i(355605),e.i(398477);var tY=e.i(922143),tQ=e.i(682358);function t0(e,t,r,n){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?n:1===o?t:o>=2&&o<=4?r:n}e.s([],543365),e.i(543365);var t1=e.i(40824);function t4(e,t,r,n){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?n:1===o?t:o>=2&&o<=4?r:n}e.s(["ar",0,function(){let e,t;return{localeError:(e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}},t={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},r=>{switch(r.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${r.expected}، ولكن تم إدخال ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`مدخلات غير مقبولة: يفترض إدخال ${es.stringifyPrimitive(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${t} ${r.maximum.toString()} ${n.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${t} ${r.minimum.toString()} ${n.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if("ends_with"===r.format)return`نَص غير مقبول: يجب أن ينتهي بـ "${r.suffix}"`;if("includes"===r.format)return`نَص غير مقبول: يجب أن يتضمَّن "${r.includes}"`;if("regex"===r.format)return`نَص غير مقبول: يجب أن يطابق النمط ${r.pattern}`;return`${t[r.format]??r.format} غير مقبول`;case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${es.joinValues(r.keys,"، ")}`;
25case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":default:return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`}})}},"az",0,function(){let e,t;return{localeError:(e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r=>{switch(r.code){case"invalid_type":return`Yanlış dəyər: g\xf6zlənilən ${r.expected}, daxil olan ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Yanlış dəyər: g\xf6zlənilən ${es.stringifyPrimitive(r.values[0])}`;return`Yanlış se\xe7im: aşağıdakılardan biri olmalıdır: ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`\xc7ox b\xf6y\xfck: g\xf6zlənilən ${r.origin??"dəyər"} ${t}${r.maximum.toString()} ${n.unit??"element"}`;return`\xc7ox b\xf6y\xfck: g\xf6zlənilən ${r.origin??"dəyər"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`\xc7ox ki\xe7ik: g\xf6zlənilən ${r.origin} ${t}${r.minimum.toString()} ${n.unit}`;return`\xc7ox ki\xe7ik: g\xf6zlənilən ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Yanlış mətn: "${r.prefix}" ilə başlamalıdır`;if("ends_with"===r.format)return`Yanlış mətn: "${r.suffix}" ilə bitməlidir`;if("includes"===r.format)return`Yanlış mətn: "${r.includes}" daxil olmalıdır`;if("regex"===r.format)return`Yanlış mətn: ${r.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${t[r.format]??r.format}`;case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə b\xf6l\xfcnə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan a\xe7ar${r.keys.length>1?"lar":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış a\xe7ar`;case"invalid_union":default:return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`}})}},"be",0,function(){let e,t;return{localeError:(e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}},t={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},r=>{switch(r.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${r.expected}, атрымана ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"лік";case"object":if(Array.isArray(e))return"масіў";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;
25case"invalid_value":if(1===r.values.length)return`Няправільны ўвод: чакалася ${es.stringifyPrimitive(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n){let e=t0(Number(r.maximum),n.unit.one,n.unit.few,n.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${n.verb} ${t}${r.maximum.toString()} ${e}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n){let e=t0(Number(r.minimum),n.unit.one,n.unit.few,n.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${n.verb} ${t}${r.minimum.toString()} ${e}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Няправільны радок: павінен пачынацца з "${r.prefix}"`;if("ends_with"===r.format)return`Няправільны радок: павінен заканчвацца на "${r.suffix}"`;if("includes"===r.format)return`Няправільны радок: павінен змяшчаць "${r.includes}"`;if("regex"===r.format)return`Няправільны радок: павінен адпавядаць шаблону ${r.pattern}`;return`Няправільны ${t[r.format]??r.format}`;case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":default:return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`}})}},"ca",0,function(){let e,t;return{localeError:(e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}},t={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r=>{switch(r.code){case"invalid_type":return`Tipus inv\xe0lid: s'esperava ${r.expected}, s'ha rebut ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Valor inv\xe0lid: s'esperava ${es.stringifyPrimitive(r.values[0])}`;return`Opci\xf3 inv\xe0lida: s'esperava una de ${es.joinValues(r.values," o ")}`;case"too_big":{let t=r.inclusive?"com a màxim":"menys de",n=e[r.origin]??null;if(n)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xe9s ${t} ${r.maximum.toString()} ${n.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?"com a mínim":"més de",n=e[r.origin]??null;if(n)return`Massa petit: s'esperava que ${r.origin} contingu\xe9s ${t} ${r.minimum.toString()} ${n.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Format inv\xe0lid: ha de comen\xe7ar amb "${r.prefix}"`;if("ends_with"===r.format)return`Format inv\xe0lid: ha d'acabar amb "${r.suffix}"`;if("includes"===r.format)return`Format inv\xe0lid: ha d'incloure "${r.includes}"`;if("regex"===r.format)return`Format inv\xe0lid: ha de coincidir amb el patr\xf3 ${r.pattern}`;return`Format inv\xe0lid per a ${t[r.format]??r.format}`;case"not_multiple_of":return`N\xfamero inv\xe0lid: ha de ser m\xfaltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>
251?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Clau inv\xe0lida a ${r.origin}`;case"invalid_union":default:return"Entrada invàlida";case"invalid_element":return`Element inv\xe0lid a ${r.origin}`}})}},"cs",0,function(){let e,t;return{localeError:(e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}},t={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},r=>{switch(r.code){case"invalid_type":return`Neplatn\xfd vstup: oček\xe1v\xe1no ${r.expected}, obdrženo ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":if(Array.isArray(e))return"pole";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Neplatn\xfd vstup: oček\xe1v\xe1no ${es.stringifyPrimitive(r.values[0])}`;return`Neplatn\xe1 možnost: oček\xe1v\xe1na jedna z hodnot ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Hodnota je př\xedliš velk\xe1: ${r.origin??"hodnota"} mus\xed m\xedt ${t}${r.maximum.toString()} ${n.unit??"prvků"}`;return`Hodnota je př\xedliš velk\xe1: ${r.origin??"hodnota"} mus\xed b\xfdt ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Hodnota je př\xedliš mal\xe1: ${r.origin??"hodnota"} mus\xed m\xedt ${t}${r.minimum.toString()} ${n.unit??"prvků"}`;return`Hodnota je př\xedliš mal\xe1: ${r.origin??"hodnota"} mus\xed b\xfdt ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Neplatn\xfd řetězec: mus\xed zač\xednat na "${r.prefix}"`;if("ends_with"===r.format)return`Neplatn\xfd řetězec: mus\xed končit na "${r.suffix}"`;if("includes"===r.format)return`Neplatn\xfd řetězec: mus\xed obsahovat "${r.includes}"`;if("regex"===r.format)return`Neplatn\xfd řetězec: mus\xed odpov\xeddat vzoru ${r.pattern}`;return`Neplatn\xfd form\xe1t ${t[r.format]??r.format}`;case"not_multiple_of":return`Neplatn\xe9 č\xedslo: mus\xed b\xfdt n\xe1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xe1m\xe9 kl\xedče: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Neplatn\xfd kl\xedč v ${r.origin}`;case"invalid_union":default:return"Neplatný vstup";case"invalid_element":return`Neplatn\xe1 hodnota v ${r.origin}`}})}},"de",0,function(){let e,t;return{localeError:(e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}},t={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r=>{switch(r.code){case"invalid_type":return`Ung\xfcltige Eingabe: erwartet ${r.expected}, erhalten ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"Zahl";case"object":if(Array.isArray(e))return"Array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;
25case"invalid_value":if(1===r.values.length)return`Ung\xfcltige Eingabe: erwartet ${es.stringifyPrimitive(r.values[0])}`;return`Ung\xfcltige Option: erwartet eine von ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Zu gro\xdf: erwartet, dass ${r.origin??"Wert"} ${t}${r.maximum.toString()} ${n.unit??"Elemente"} hat`;return`Zu gro\xdf: erwartet, dass ${r.origin??"Wert"} ${t}${r.maximum.toString()} ist`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Zu klein: erwartet, dass ${r.origin} ${t}${r.minimum.toString()} ${n.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${t}${r.minimum.toString()} ist`}case"invalid_format":if("starts_with"===r.format)return`Ung\xfcltiger String: muss mit "${r.prefix}" beginnen`;if("ends_with"===r.format)return`Ung\xfcltiger String: muss mit "${r.suffix}" enden`;if("includes"===r.format)return`Ung\xfcltiger String: muss "${r.includes}" enthalten`;if("regex"===r.format)return`Ung\xfcltiger String: muss dem Muster ${r.pattern} entsprechen`;return`Ung\xfcltig: ${t[r.format]??r.format}`;case"not_multiple_of":return`Ung\xfcltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Ung\xfcltiger Schl\xfcssel in ${r.origin}`;case"invalid_union":default:return"Ungültige Eingabe";case"invalid_element":return`Ung\xfcltiger Wert in ${r.origin}`}})}},"en",()=>t1.default,"eo",0,function(){let e,t;return{localeError:(e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}},t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r=>{switch(r.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${r.expected}, riceviĝis ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":if(Array.isArray(e))return"tabelo";if(null===e)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Nevalida enigo: atendiĝis ${es.stringifyPrimitive(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${t}${r.maximum.toString()} ${n.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${t}${r.minimum.toString()} ${n.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`;if("ends_with"===r.format)return`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`;if("includes"===r.format)return`Nevalida karaktraro: devas inkluzivi "${r.includes}"`;if("regex"===r.format)return`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`;return`Nevalida ${t[r.format]??r.format}`;case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":default:return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`}})}},"es",0,function(){let e,t;return{localeError:(e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r=>
25{switch(r.code){case"invalid_type":return`Entrada inv\xe1lida: se esperaba ${r.expected}, recibido ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"número";case"object":if(Array.isArray(e))return"arreglo";if(null===e)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Entrada inv\xe1lida: se esperaba ${es.stringifyPrimitive(r.values[0])}`;return`Opci\xf3n inv\xe1lida: se esperaba una de ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Demasiado grande: se esperaba que ${r.origin??"valor"} tuviera ${t}${r.maximum.toString()} ${n.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${r.origin??"valor"} fuera ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Demasiado peque\xf1o: se esperaba que ${r.origin} tuviera ${t}${r.minimum.toString()} ${n.unit}`;return`Demasiado peque\xf1o: se esperaba que ${r.origin} fuera ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Cadena inv\xe1lida: debe comenzar con "${r.prefix}"`;if("ends_with"===r.format)return`Cadena inv\xe1lida: debe terminar en "${r.suffix}"`;if("includes"===r.format)return`Cadena inv\xe1lida: debe incluir "${r.includes}"`;if("regex"===r.format)return`Cadena inv\xe1lida: debe coincidir con el patr\xf3n ${r.pattern}`;return`Inv\xe1lido ${t[r.format]??r.format}`;case"not_multiple_of":return`N\xfamero inv\xe1lido: debe ser m\xfaltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Llave inv\xe1lida en ${r.origin}`;case"invalid_union":default:return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido en ${r.origin}`}})}},"fa",0,function(){let e,t;return{localeError:(e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}},t={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},r=>{switch(r.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${r.expected} می‌بود، ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"عدد";case"object":if(Array.isArray(e))return"آرایه";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)} دریافت شد`;case"invalid_value":if(1===r.values.length)return`ورودی نامعتبر: می‌بایست ${es.stringifyPrimitive(r.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${es.joinValues(r.values,"|")} می‌بود`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${t}${r.maximum.toString()} ${n.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${t}${r.maximum.toString()} باشد`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`خیلی کوچک: ${r.origin} باید ${t}${r.minimum.toString()} ${n.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${t}${r.minimum.toString()} باشد`}case"invalid_format":if("starts_with"===r.format)return`رشته نامعتبر: باید با "${r.prefix}" شروع شود`;if("ends_with"===r.format)return`رشته نامعتبر: باید با "${r.suffix}" تمام شود`;if("includes"===r.format)return`رشته نامعتبر: باید شامل "${r.includes}" باشد`;if("regex"===r.format)return`رشته نامعتبر: باید با الگوی ${r.pattern} مطابقت داشته باشد`;return`${t[r.format]??r.format} نامعتبر`;case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${es.joinValues(r.keys,", ")}`;
25case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":default:return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`}})}},"fi",0,function(){let e,t;return{localeError:(e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}},t={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Virheellinen sy\xf6te: t\xe4ytyy olla ${es.stringifyPrimitive(r.values[0])}`;return`Virheellinen valinta: t\xe4ytyy olla yksi seuraavista: ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Liian suuri: ${n.subject} t\xe4ytyy olla ${t}${r.maximum.toString()} ${n.unit}`.trim();return`Liian suuri: arvon t\xe4ytyy olla ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Liian pieni: ${n.subject} t\xe4ytyy olla ${t}${r.minimum.toString()} ${n.unit}`.trim();return`Liian pieni: arvon t\xe4ytyy olla ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy alkaa "${r.prefix}"`;if("ends_with"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy loppua "${r.suffix}"`;if("includes"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy sis\xe4lt\xe4\xe4 "${r.includes}"`;if("regex"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy vastata s\xe4\xe4nn\xf6llist\xe4 lauseketta ${r.pattern}`;return`Virheellinen ${t[r.format]??r.format}`;case"not_multiple_of":return`Virheellinen luku: t\xe4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}})}},"fr",0,function(){let e,t;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r=>{switch(r.code){case"invalid_type":return`Entr\xe9e invalide : ${r.expected} attendu, ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombre";case"object":if(Array.isArray(e))return"tableau";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)} re\xe7u`;
25case"invalid_value":if(1===r.values.length)return`Entr\xe9e invalide : ${es.stringifyPrimitive(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${es.joinValues(r.values,"|")} attendue`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Trop grand : ${r.origin??"valeur"} doit ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"élément(s)"}`;return`Trop grand : ${r.origin??"valeur"} doit \xeatre ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Trop petit : ${r.origin} doit ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Trop petit : ${r.origin} doit \xeatre ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Cha\xeene invalide : doit commencer par "${r.prefix}"`;if("ends_with"===r.format)return`Cha\xeene invalide : doit se terminer par "${r.suffix}"`;if("includes"===r.format)return`Cha\xeene invalide : doit inclure "${r.includes}"`;if("regex"===r.format)return`Cha\xeene invalide : doit correspondre au mod\xe8le ${r.pattern}`;return`${t[r.format]??r.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xe9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${r.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`}})}},"frCA",0,function(){let e,t;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r=>{switch(r.code){case"invalid_type":return`Entr\xe9e invalide : attendu ${r.expected}, re\xe7u ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Entr\xe9e invalide : attendu ${es.stringifyPrimitive(r.values[0])}`;
25return`Option invalide : attendu l'une des valeurs suivantes ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"≤":"<",n=e[r.origin]??null;if(n)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${t}${r.maximum.toString()} ${n.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?"≥":">",n=e[r.origin]??null;if(n)return`Trop petit : attendu que ${r.origin} ait ${t}${r.minimum.toString()} ${n.unit}`;return`Trop petit : attendu que ${r.origin} soit ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Cha\xeene invalide : doit commencer par "${r.prefix}"`;if("ends_with"===r.format)return`Cha\xeene invalide : doit se terminer par "${r.suffix}"`;if("includes"===r.format)return`Cha\xeene invalide : doit inclure "${r.includes}"`;if("regex"===r.format)return`Cha\xeene invalide : doit correspondre au motif ${r.pattern}`;return`${t[r.format]??r.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xe9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${r.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`}})}},"he",0,function(){let e,t;return{localeError:(e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}},t={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"},r=>{switch(r.code){case"invalid_type":return`קלט לא תקין: צריך ${r.expected}, התקבל ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`קלט לא תקין: צריך ${es.stringifyPrimitive(r.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות  ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`גדול מדי: ${r.origin??"value"} צריך להיות ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`גדול מדי: ${r.origin??"value"} צריך להיות ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`קטן מדי: ${r.origin} צריך להיות ${t}${r.minimum.toString()} ${n.unit}`;return`קטן מדי: ${r.origin} צריך להיות ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`מחרוזת לא תקינה: חייבת להתחיל ב"${r.prefix}"`;if("ends_with"===r.format)return`מחרוזת לא תקינה: חייבת להסתיים ב "${r.suffix}"`;if("includes"===r.format)return`מחרוזת לא תקינה: חייבת לכלול "${r.includes}"`;if("regex"===r.format)return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${r.pattern}`;return`${t[r.format]??r.format} לא תקין`;case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${r.divisor}`;case"unrecognized_keys":return`מפתח${r.keys.length>1?"ות":""} לא מזוה${r.keys.length>1?"ים":"ה"}: ${es.joinValues(r.keys,", ")}`;
25case"invalid_key":return`מפתח לא תקין ב${r.origin}`;case"invalid_union":default:return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r.origin}`}})}},"hu",0,function(){let e,t;return{localeError:(e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}},t={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},r=>{switch(r.code){case"invalid_type":return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${r.expected}, a kapott \xe9rt\xe9k ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"szám";case"object":if(Array.isArray(e))return"tömb";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${es.stringifyPrimitive(r.values[0])}`;return`\xc9rv\xe9nytelen opci\xf3: valamelyik \xe9rt\xe9k v\xe1rt ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`T\xfal nagy: ${r.origin??"érték"} m\xe9rete t\xfal nagy ${t}${r.maximum.toString()} ${n.unit??"elem"}`;return`T\xfal nagy: a bemeneti \xe9rt\xe9k ${r.origin??"érték"} t\xfal nagy: ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${r.origin} m\xe9rete t\xfal kicsi ${t}${r.minimum.toString()} ${n.unit}`;return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${r.origin} t\xfal kicsi ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`\xc9rv\xe9nytelen string: "${r.prefix}" \xe9rt\xe9kkel kell kezdődnie`;if("ends_with"===r.format)return`\xc9rv\xe9nytelen string: "${r.suffix}" \xe9rt\xe9kkel kell v\xe9gződnie`;if("includes"===r.format)return`\xc9rv\xe9nytelen string: "${r.includes}" \xe9rt\xe9ket kell tartalmaznia`;if("regex"===r.format)return`\xc9rv\xe9nytelen string: ${r.pattern} mint\xe1nak kell megfelelnie`;return`\xc9rv\xe9nytelen ${t[r.format]??r.format}`;case"not_multiple_of":return`\xc9rv\xe9nytelen sz\xe1m: ${r.divisor} t\xf6bbsz\xf6r\xf6s\xe9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`\xc9rv\xe9nytelen kulcs ${r.origin}`;case"invalid_union":default:return"Érvénytelen bemenet";case"invalid_element":return`\xc9rv\xe9nytelen \xe9rt\xe9k: ${r.origin}`}})}},"id",0,function(){let e,t;return{localeError:(e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}},t={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;
25case"invalid_value":if(1===r.values.length)return`Input tidak valid: diharapkan ${es.stringifyPrimitive(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${t}${r.maximum.toString()} ${n.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${t}${r.minimum.toString()} ${n.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`String tidak valid: harus dimulai dengan "${r.prefix}"`;if("ends_with"===r.format)return`String tidak valid: harus berakhir dengan "${r.suffix}"`;if("includes"===r.format)return`String tidak valid: harus menyertakan "${r.includes}"`;if("regex"===r.format)return`String tidak valid: harus sesuai pola ${r.pattern}`;return`${t[r.format]??r.format} tidak valid`;case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":default:return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`}})}},"it",0,function(){let e,t;return{localeError:(e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}},t={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"numero";case"object":if(Array.isArray(e))return"vettore";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Input non valido: atteso ${es.stringifyPrimitive(r.values[0])}`;return`Opzione non valida: atteso uno tra ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Troppo grande: ${r.origin??"valore"} deve avere ${t}${r.maximum.toString()} ${n.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Troppo piccolo: ${r.origin} deve avere ${t}${r.minimum.toString()} ${n.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Stringa non valida: deve iniziare con "${r.prefix}"`;if("ends_with"===r.format)return`Stringa non valida: deve terminare con "${r.suffix}"`;if("includes"===r.format)return`Stringa non valida: deve includere "${r.includes}"`;if("regex"===r.format)return`Stringa non valida: deve corrispondere al pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":default:return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`}})}},"ja",0,function(){let e,t;return{localeError:(e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}},t={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},r=>
25{switch(r.code){case"invalid_type":return`無効な入力: ${r.expected}が期待されましたが、${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"数値";case"object":if(Array.isArray(e))return"配列";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}が入力されました`;case"invalid_value":if(1===r.values.length)return`無効な入力: ${es.stringifyPrimitive(r.values[0])}が期待されました`;return`無効な選択: ${es.joinValues(r.values,"、")}のいずれかである必要があります`;case"too_big":{let t=r.inclusive?"以下である":"より小さい",n=e[r.origin]??null;if(n)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${n.unit??"要素"}${t}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${t}必要があります`}case"too_small":{let t=r.inclusive?"以上である":"より大きい",n=e[r.origin]??null;if(n)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${n.unit}${t}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${t}必要があります`}case"invalid_format":if("starts_with"===r.format)return`無効な文字列: "${r.prefix}"で始まる必要があります`;if("ends_with"===r.format)return`無効な文字列: "${r.suffix}"で終わる必要があります`;if("includes"===r.format)return`無効な文字列: "${r.includes}"を含む必要があります`;if("regex"===r.format)return`無効な文字列: パターン${r.pattern}に一致する必要があります`;return`無効な${t[r.format]??r.format}`;case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${es.joinValues(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":default:return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`}})}},"kh",0,function(){let e,t;return{localeError:(e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}},t={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},r=>{switch(r.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r.expected} ប៉ុន្តែទទួលបាន ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":if(Array.isArray(e))return"អារេ (Array)";if(null===e)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${es.stringifyPrimitive(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${es.joinValues(r.values,"|")}`;
25case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${t} ${r.maximum.toString()} ${n.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`តូចពេក៖ ត្រូវការ ${r.origin} ${t} ${r.minimum.toString()} ${n.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${r.prefix}"`;if("ends_with"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${r.suffix}"`;if("includes"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${r.includes}"`;if("regex"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${r.pattern}`;return`មិនត្រឹមត្រូវ៖ ${t[r.format]??r.format}`;case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":default:return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`}})}},"ko",0,function(){let e,t;return{localeError:(e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}},t={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},r=>{switch(r.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${r.expected}, 받은 타입은 ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}입니다`;case"invalid_value":if(1===r.values.length)return`잘못된 입력: 값은 ${es.stringifyPrimitive(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${es.joinValues(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let t=r.inclusive?"이하":"미만",n="미만"===t?"이어야 합니다":"여야 합니다",i=e[r.origin]??null,o=i?.unit??"요소";if(i)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${o} ${t}${n}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${t}${n}`}case"too_small":{let t=r.inclusive?"이상":"초과",n="이상"===t?"이어야 합니다":"여야 합니다",i=e[r.origin]??null,o=i?.unit??"요소";if(i)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${o} ${t}${n}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${t}${n}`}case"invalid_format":if("starts_with"===r.format)return`잘못된 문자열: "${r.prefix}"(으)로 시작해야 합니다`;if("ends_with"===r.format)return`잘못된 문자열: "${r.suffix}"(으)로 끝나야 합니다`;if("includes"===r.format)return`잘못된 문자열: "${r.includes}"을(를) 포함해야 합니다`;if("regex"===r.format)return`잘못된 문자열: 정규식 ${r.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${t[r.format]??r.format}`;case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${es.joinValues(r.keys,", ")}`;
25case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":default:return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`}})}},"mk",0,function(){let e,t;return{localeError:(e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}},t={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},r=>{switch(r.code){case"invalid_type":return`Грешен внес: се очекува ${r.expected}, примено ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"број";case"object":if(Array.isArray(e))return"низа";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${es.stringifyPrimitive(r.values[0])}`;return`Грешана опција: се очекува една ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${t}${r.maximum.toString()} ${n.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Премногу мал: се очекува ${r.origin} да има ${t}${r.minimum.toString()} ${n.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Неважечка низа: мора да започнува со "${r.prefix}"`;if("ends_with"===r.format)return`Неважечка низа: мора да завршува со "${r.suffix}"`;if("includes"===r.format)return`Неважечка низа: мора да вклучува "${r.includes}"`;if("regex"===r.format)return`Неважечка низа: мора да одгоара на патернот ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":default:return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`}})}},"ms",0,function(){let e,t;return{localeError:(e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}},t={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombor";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;
25case"invalid_value":if(1===r.values.length)return`Input tidak sah: dijangka ${es.stringifyPrimitive(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Terlalu kecil: dijangka ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`String tidak sah: mesti bermula dengan "${r.prefix}"`;if("ends_with"===r.format)return`String tidak sah: mesti berakhir dengan "${r.suffix}"`;if("includes"===r.format)return`String tidak sah: mesti mengandungi "${r.includes}"`;if("regex"===r.format)return`String tidak sah: mesti sepadan dengan corak ${r.pattern}`;return`${t[r.format]??r.format} tidak sah`;case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":default:return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`}})}},"nl",0,function(){let e,t;return{localeError:(e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}},t={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"getal";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Ongeldige invoer: verwacht ${es.stringifyPrimitive(r.values[0])}`;return`Ongeldige optie: verwacht \xe9\xe9n van ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Te lang: verwacht dat ${r.origin??"waarde"} ${t}${r.maximum.toString()} ${n.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${r.origin??"waarde"} ${t}${r.maximum.toString()} is`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Te kort: verwacht dat ${r.origin} ${t}${r.minimum.toString()} ${n.unit} bevat`;return`Te kort: verwacht dat ${r.origin} ${t}${r.minimum.toString()} is`}case"invalid_format":if("starts_with"===r.format)return`Ongeldige tekst: moet met "${r.prefix}" beginnen`;if("ends_with"===r.format)return`Ongeldige tekst: moet op "${r.suffix}" eindigen`;if("includes"===r.format)return`Ongeldige tekst: moet "${r.includes}" bevatten`;if("regex"===r.format)return`Ongeldige tekst: moet overeenkomen met patroon ${r.pattern}`;return`Ongeldig: ${t[r.format]??r.format}`;case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":default:return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`}})}},"no",0,function(){let e,t;return{localeError:(e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}},t={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r=>
25{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"tall";case"object":if(Array.isArray(e))return"liste";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Ugyldig verdi: forventet ${es.stringifyPrimitive(r.values[0])}`;return`Ugyldig valg: forventet en av ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`For stor(t): forventet ${r.origin??"value"} til \xe5 ha ${t}${r.maximum.toString()} ${n.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til \xe5 ha ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`For lite(n): forventet ${r.origin} til \xe5 ha ${t}${r.minimum.toString()} ${n.unit}`;return`For lite(n): forventet ${r.origin} til \xe5 ha ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Ugyldig streng: m\xe5 starte med "${r.prefix}"`;if("ends_with"===r.format)return`Ugyldig streng: m\xe5 ende med "${r.suffix}"`;if("includes"===r.format)return`Ugyldig streng: m\xe5 inneholde "${r.includes}"`;if("regex"===r.format)return`Ugyldig streng: m\xe5 matche m\xf8nsteret ${r.pattern}`;return`Ugyldig ${t[r.format]??r.format}`;case"not_multiple_of":return`Ugyldig tall: m\xe5 v\xe6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xf8kkel i ${r.origin}`;case"invalid_union":default:return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`}})}},"ota",0,function(){let e,t;return{localeError:(e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}},t={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},r=>{switch(r.code){case"invalid_type":return`F\xe2sit giren: umulan ${r.expected}, alınan ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"numara";case"object":if(Array.isArray(e))return"saf";if(null===e)return"gayb";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`F\xe2sit giren: umulan ${es.stringifyPrimitive(r.values[0])}`;return`F\xe2sit tercih: m\xfbteberler ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Fazla b\xfcy\xfck: ${r.origin??"value"}, ${t}${r.maximum.toString()} ${n.unit??"elements"} sahip olmalıydı.`;return`Fazla b\xfcy\xfck: ${r.origin??"value"}, ${t}${r.maximum.toString()} olmalıydı.`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Fazla k\xfc\xe7\xfck: ${r.origin}, ${t}${r.minimum.toString()} ${n.unit} sahip olmalıydı.`;return`Fazla k\xfc\xe7\xfck: ${r.origin}, ${t}${r.minimum.toString()} olmalıydı.`}case"invalid_format":if("starts_with"===r.format)return`F\xe2sit metin: "${r.prefix}" ile başlamalı.`;if("ends_with"===r.format)return`F\xe2sit metin: "${r.suffix}" ile bitmeli.`;if("includes"===r.format)return`F\xe2sit metin: "${r.includes}" ihtiv\xe2 etmeli.`;if("regex"===r.format)return`F\xe2sit metin: ${r.pattern} nakşına uymalı.`;return`F\xe2sit ${t[r.format]??r.format}`;case"not_multiple_of":return`F\xe2sit sayı: ${r.divisor} katı olmalıydı.`;
25case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xe7in tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} i\xe7in tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}})}},"pl",0,function(){let e,t;return{localeError:(e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}},t={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},r=>{switch(r.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${r.expected}, otrzymano ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"liczba";case"object":if(Array.isArray(e))return"tablica";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Nieprawidłowe dane wejściowe: oczekiwano ${es.stringifyPrimitive(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${t}${r.maximum.toString()} ${n.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${t}${r.minimum.toString()} ${n.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi zaczynać się od "${r.prefix}"`;if("ends_with"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi kończyć się na "${r.suffix}"`;if("includes"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi zawierać "${r.includes}"`;if("regex"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi odpowiadać wzorcowi ${r.pattern}`;return`Nieprawidłow(y/a/e) ${t[r.format]??r.format}`;case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":default:return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`}})}},"ps",0,function(){let e,t;return{localeError:(e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}},t={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},r=>{switch(r.code){case"invalid_type":return`ناسم ورودي: باید ${r.expected} وای, مګر ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"عدد";case"object":if(Array.isArray(e))return"ارې";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)} ترلاسه شو`;
25case"invalid_value":if(1===r.values.length)return`ناسم ورودي: باید ${es.stringifyPrimitive(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${es.joinValues(r.values,"|")} څخه وای`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${t}${r.maximum.toString()} ${n.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${t}${r.maximum.toString()} وي`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`ډیر کوچنی: ${r.origin} باید ${t}${r.minimum.toString()} ${n.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${t}${r.minimum.toString()} وي`}case"invalid_format":if("starts_with"===r.format)return`ناسم متن: باید د "${r.prefix}" سره پیل شي`;if("ends_with"===r.format)return`ناسم متن: باید د "${r.suffix}" سره پای ته ورسيږي`;if("includes"===r.format)return`ناسم متن: باید "${r.includes}" ولري`;if("regex"===r.format)return`ناسم متن: باید د ${r.pattern} سره مطابقت ولري`;return`${t[r.format]??r.format} ناسم دی`;case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":default:return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`}})}},"pt",0,function(){let e,t;return{localeError:(e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}},t={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r=>{switch(r.code){case"invalid_type":return`Tipo inv\xe1lido: esperado ${r.expected}, recebido ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"número";case"object":if(Array.isArray(e))return"array";if(null===e)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Entrada inv\xe1lida: esperado ${es.stringifyPrimitive(r.values[0])}`;return`Op\xe7\xe3o inv\xe1lida: esperada uma das ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${t}${r.maximum.toString()} ${n.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Muito pequeno: esperado que ${r.origin} tivesse ${t}${r.minimum.toString()} ${n.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Texto inv\xe1lido: deve come\xe7ar com "${r.prefix}"`;if("ends_with"===r.format)return`Texto inv\xe1lido: deve terminar com "${r.suffix}"`;if("includes"===r.format)return`Texto inv\xe1lido: deve incluir "${r.includes}"`;if("regex"===r.format)return`Texto inv\xe1lido: deve corresponder ao padr\xe3o ${r.pattern}`;return`${t[r.format]??r.format} inv\xe1lido`;case"not_multiple_of":return`N\xfamero inv\xe1lido: deve ser m\xfaltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Chave inv\xe1lida em ${r.origin}`;
25case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido em ${r.origin}`;default:return"Campo inválido"}})}},"ru",0,function(){let e,t;return{localeError:(e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}},t={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},r=>{switch(r.code){case"invalid_type":return`Неверный ввод: ожидалось ${r.expected}, получено ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"число";case"object":if(Array.isArray(e))return"массив";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Неверный ввод: ожидалось ${es.stringifyPrimitive(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n){let e=t4(Number(r.maximum),n.unit.one,n.unit.few,n.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${t}${r.maximum.toString()} ${e}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n){let e=t4(Number(r.minimum),n.unit.one,n.unit.few,n.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${t}${r.minimum.toString()} ${e}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Неверная строка: должна начинаться с "${r.prefix}"`;if("ends_with"===r.format)return`Неверная строка: должна заканчиваться на "${r.suffix}"`;if("includes"===r.format)return`Неверная строка: должна содержать "${r.includes}"`;if("regex"===r.format)return`Неверная строка: должна соответствовать шаблону ${r.pattern}`;return`Неверный ${t[r.format]??r.format}`;case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":default:return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`}})}},"sl",0,function(){let e,t;return{localeError:(e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}},t={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},r=>
25{switch(r.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${r.expected}, prejeto ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"število";case"object":if(Array.isArray(e))return"tabela";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Neveljaven vnos: pričakovano ${es.stringifyPrimitive(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${t}${r.maximum.toString()} ${n.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${t}${r.minimum.toString()} ${n.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Neveljaven niz: mora se začeti z "${r.prefix}"`;if("ends_with"===r.format)return`Neveljaven niz: mora se končati z "${r.suffix}"`;if("includes"===r.format)return`Neveljaven niz: mora vsebovati "${r.includes}"`;if("regex"===r.format)return`Neveljaven niz: mora ustrezati vzorcu ${r.pattern}`;return`Neveljaven ${t[r.format]??r.format}`;case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":default:return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`}})}},"sv",0,function(){let e,t;return{localeError:(e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}},t={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: f\xf6rv\xe4ntat ${r.expected}, fick ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"antal";case"object":if(Array.isArray(e))return"lista";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Ogiltig inmatning: f\xf6rv\xe4ntat ${es.stringifyPrimitive(r.values[0])}`;return`Ogiltigt val: f\xf6rv\xe4ntade en av ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`F\xf6r stor(t): f\xf6rv\xe4ntade ${r.origin??"värdet"} att ha ${t}${r.maximum.toString()} ${n.unit??"element"}`;return`F\xf6r stor(t): f\xf6rv\xe4ntat ${r.origin??"värdet"} att ha ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`F\xf6r lite(t): f\xf6rv\xe4ntade ${r.origin??"värdet"} att ha ${t}${r.minimum.toString()} ${n.unit}`;return`F\xf6r lite(t): f\xf6rv\xe4ntade ${r.origin??"värdet"} att ha ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Ogiltig str\xe4ng: m\xe5ste b\xf6rja med "${r.prefix}"`;if("ends_with"===r.format)return`Ogiltig str\xe4ng: m\xe5ste sluta med "${r.suffix}"`;if("includes"===r.format)return`Ogiltig str\xe4ng: m\xe5ste inneh\xe5lla "${r.includes}"`;if("regex"===r.format)return`Ogiltig str\xe4ng: m\xe5ste matcha m\xf6nstret "${r.pattern}"`;return`Ogiltig(t) ${t[r.format]??r.format}`;case"not_multiple_of":return`Ogiltigt tal: m\xe5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${es.joinValues(r.keys,", ")}`;
25case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":default:return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xe4rde i ${r.origin??"värdet"}`}})}},"ta",0,function(){let e,t;return{localeError:(e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}},t={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},r=>{switch(r.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r.expected}, பெறப்பட்டது ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"எண் அல்லாதது":"எண்";case"object":if(Array.isArray(e))return"அணி";
25if(null===e)return"வெறுமை";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${es.stringifyPrimitive(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${es.joinValues(r.values,"|")} இல் ஒன்று`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${t}${r.maximum.toString()} ${n.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${t}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${t}${r.minimum.toString()} ${n.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${t}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":if("starts_with"===r.format)return`தவறான சரம்: "${r.prefix}" இல் தொடங்க வேண்டும்`;if("ends_with"===r.format)return`தவறான சரம்: "${r.suffix}" இல் முடிவடைய வேண்டும்`;if("includes"===r.format)return`தவறான சரம்: "${r.includes}" ஐ உள்ளடக்க வேண்டும்`;if("regex"===r.format)return`தவறான சரம்: ${r.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${t[r.format]??r.format}`;case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":default:return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`}})}},"th",0,function(){let e,t;return{localeError:(e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}},t={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},r=>{switch(r.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r.expected} แต่ได้รับ ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":if(Array.isArray(e))return"อาร์เรย์ (Array)";if(null===e)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;
25case"invalid_value":if(1===r.values.length)return`ค่าไม่ถูกต้อง: ควรเป็น ${es.stringifyPrimitive(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"ไม่เกิน":"น้อยกว่า",n=e[r.origin]??null;if(n)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${t} ${r.maximum.toString()} ${n.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?"อย่างน้อย":"มากกว่า",n=e[r.origin]??null;if(n)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${t} ${r.minimum.toString()} ${n.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${r.prefix}"`;if("ends_with"===r.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${r.suffix}"`;if("includes"===r.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${r.includes}" อยู่ในข้อความ`;if("regex"===r.format)return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${r.pattern}`;return`รูปแบบไม่ถูกต้อง: ${t[r.format]??r.format}`;case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}})}},"tr",0,function(){let e,t;return{localeError:(e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}},t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},r=>{switch(r.code){case"invalid_type":return`Ge\xe7ersiz değer: beklenen ${r.expected}, alınan ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Ge\xe7ersiz değer: beklenen ${es.stringifyPrimitive(r.values[0])}`;return`Ge\xe7ersiz se\xe7enek: aşağıdakilerden biri olmalı: ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`\xc7ok b\xfcy\xfck: beklenen ${r.origin??"değer"} ${t}${r.maximum.toString()} ${n.unit??"öğe"}`;return`\xc7ok b\xfcy\xfck: beklenen ${r.origin??"değer"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`\xc7ok k\xfc\xe7\xfck: beklenen ${r.origin} ${t}${r.minimum.toString()} ${n.unit}`;return`\xc7ok k\xfc\xe7\xfck: beklenen ${r.origin} ${t}${r.minimum.toString()}`}
25case"invalid_format":if("starts_with"===r.format)return`Ge\xe7ersiz metin: "${r.prefix}" ile başlamalı`;if("ends_with"===r.format)return`Ge\xe7ersiz metin: "${r.suffix}" ile bitmeli`;if("includes"===r.format)return`Ge\xe7ersiz metin: "${r.includes}" i\xe7ermeli`;if("regex"===r.format)return`Ge\xe7ersiz metin: ${r.pattern} desenine uymalı`;return`Ge\xe7ersiz ${t[r.format]??r.format}`;case"not_multiple_of":return`Ge\xe7ersiz sayı: ${r.divisor} ile tam b\xf6l\xfcnebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xe7inde ge\xe7ersiz anahtar`;case"invalid_union":default:return"Geçersiz değer";case"invalid_element":return`${r.origin} i\xe7inde ge\xe7ersiz değer`}})}},"ua",0,function(){let e,t;return{localeError:(e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}},t={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},r=>{switch(r.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${r.expected}, отримано ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"число";case"object":if(Array.isArray(e))return"масив";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Неправильні вхідні дані: очікується ${es.stringifyPrimitive(r.values[0])}`;return`Неправильна опція: очікується одне з ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Занадто велике: очікується, що ${r.origin??"значення"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Занадто мале: очікується, що ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Неправильний рядок: повинен починатися з "${r.prefix}"`;if("ends_with"===r.format)return`Неправильний рядок: повинен закінчуватися на "${r.suffix}"`;if("includes"===r.format)return`Неправильний рядок: повинен містити "${r.includes}"`;if("regex"===r.format)return`Неправильний рядок: повинен відповідати шаблону ${r.pattern}`;return`Неправильний ${t[r.format]??r.format}`;case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":default:return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`}})}},"ur",0,function(){let e,t;return{localeError:(e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}},t={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},r=>
25{switch(r.code){case"invalid_type":return`غلط ان پٹ: ${r.expected} متوقع تھا، ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"نمبر";case"object":if(Array.isArray(e))return"آرے";if(null===e)return"نل";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)} موصول ہوا`;case"invalid_value":if(1===r.values.length)return`غلط ان پٹ: ${es.stringifyPrimitive(r.values[0])} متوقع تھا`;return`غلط آپشن: ${es.joinValues(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${t}${r.maximum.toString()} ${n.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${t}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`بہت چھوٹا: ${r.origin} کے ${t}${r.minimum.toString()} ${n.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${t}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":if("starts_with"===r.format)return`غلط سٹرنگ: "${r.prefix}" سے شروع ہونا چاہیے`;if("ends_with"===r.format)return`غلط سٹرنگ: "${r.suffix}" پر ختم ہونا چاہیے`;if("includes"===r.format)return`غلط سٹرنگ: "${r.includes}" شامل ہونا چاہیے`;if("regex"===r.format)return`غلط سٹرنگ: پیٹرن ${r.pattern} سے میچ ہونا چاہیے`;return`غلط ${t[r.format]??r.format}`;case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${es.joinValues(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":default:return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`}})}},"vi",0,function(){let e,t;return{localeError:(e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}},t={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},r=>{switch(r.code){case"invalid_type":return`Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ${r.expected}, nhận được ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"số";case"object":if(Array.isArray(e))return"mảng";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ${es.stringifyPrimitive(r.values[0])}`;return`T\xf9y chọn kh\xf4ng hợp lệ: mong đợi một trong c\xe1c gi\xe1 trị ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Qu\xe1 lớn: mong đợi ${r.origin??"giá trị"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"phần tử"}`;return`Qu\xe1 lớn: mong đợi ${r.origin??"giá trị"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Qu\xe1 nhỏ: mong đợi ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Qu\xe1 nhỏ: mong đợi ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải bắt đầu bằng "${r.prefix}"`;if("ends_with"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải kết th\xfac bằng "${r.suffix}"`;if("includes"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải bao gồm "${r.includes}"`;if("regex"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải khớp với mẫu ${r.pattern}`;return`${t[r.format]??r.format} kh\xf4ng hợp lệ`;case"not_multiple_of":return`Số kh\xf4ng hợp lệ: phải l\xe0 bội số của ${r.divisor}`;case"unrecognized_keys":return`Kh\xf3a kh\xf4ng được nhận dạng: ${es.joinValues(r.keys,", ")}`;
25case"invalid_key":return`Kh\xf3a kh\xf4ng hợp lệ trong ${r.origin}`;case"invalid_union":default:return"Đầu vào không hợp lệ";case"invalid_element":return`Gi\xe1 trị kh\xf4ng hợp lệ trong ${r.origin}`}})}},"zhCN",0,function(){let e,t;return{localeError:(e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}},t={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},r=>{switch(r.code){case"invalid_type":return`无效输入:期望 ${r.expected},实际接收 ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"非数字(NaN)":"数字";case"object":if(Array.isArray(e))return"数组";if(null===e)return"空值(null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`无效输入:期望 ${es.stringifyPrimitive(r.values[0])}`;return`无效选项:期望以下之一 ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`数值过大:期望 ${r.origin??"值"} ${t}${r.maximum.toString()} ${n.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`数值过小:期望 ${r.origin} ${t}${r.minimum.toString()} ${n.unit}`;return`数值过小:期望 ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`无效字符串:必须以 "${r.prefix}" 开头`;if("ends_with"===r.format)return`无效字符串:必须以 "${r.suffix}" 结尾`;if("includes"===r.format)return`无效字符串:必须包含 "${r.includes}"`;if("regex"===r.format)return`无效字符串:必须满足正则表达式 ${r.pattern}`;return`无效${t[r.format]??r.format}`;case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${es.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":default:return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`}})}},"zhTW",0,function(){let e,t;return{localeError:(e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}},t={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},r=>{switch(r.code){case"invalid_type":return`無效的輸入值:預期為 ${r.expected},但收到 ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(r.input)}`;case"invalid_value":if(1===r.values.length)return`無效的輸入值:預期為 ${es.stringifyPrimitive(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${es.joinValues(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`數值過大:預期 ${r.origin??"值"} 應為 ${t}${r.maximum.toString()} ${n.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`數值過小:預期 ${r.origin} 應為 ${t}${r.minimum.toString()} ${n.unit}`;return`數值過小:預期 ${r.origin} 應為 ${t}${r.minimum.toString()}`}
25case"invalid_format":if("starts_with"===r.format)return`無效的字串:必須以 "${r.prefix}" 開頭`;if("ends_with"===r.format)return`無效的字串:必須以 "${r.suffix}" 結尾`;if("includes"===r.format)return`無效的字串:必須包含 "${r.includes}"`;if("regex"===r.format)return`無效的字串:必須符合格式 ${r.pattern}`;return`無效的 ${t[r.format]??r.format}`;case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${es.joinValues(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":default:return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`}})}}],554580);var t2=e.i(554580);let t6=Symbol("ZodOutput"),t3=Symbol("ZodInput");class t9{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function t5(){return new t9}let t7=t5();function t8(e,t){return new e({type:"string",...es.normalizeParams(t)})}function re(e,t){return new e({type:"string",coerce:!0,...es.normalizeParams(t)})}function rt(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...es.normalizeParams(t)})}function ri(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...es.normalizeParams(t)})}function ro(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...es.normalizeParams(t)})}function rs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...es.normalizeParams(t)})}function ra(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rl(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...es.normalizeParams(t)})}function ru(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rv(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...es.normalizeParams(t)})}function ry(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rb(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rx(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rk(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...es.normalizeParams(t)})}function rw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...es.normalizeParams(t)})}e.s(["$ZodRegistry",0,t9,"$input",0,t3,"$output",0,t6,"globalRegistry",0,t7,"registry",0,t5],525527),e.i(525527),e.i(698530);let r_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function r$(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...es.normalizeParams(t)})}function rS(e,t){return new e({type:"string",format:"date",check:"string_format",...es.normalizeParams(t)})}function rI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...es.normalizeParams(t)})}function rO(e,t){return new e({type:"string",format:"duration",check:"string_format",...es.normalizeParams(t)})}function rC(e,t){return new e({type:"number",checks:[],...es.normalizeParams(t)})}function rN(e,t){return new e({type:"number",coerce:!0,checks:[],...es.normalizeParams(t)})}function rT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...es.normalizeParams(t)})}function rE(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...es.normalizeParams(t)})}function rA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...es.normalizeParams(t)})}function rD(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...es.normalizeParams(t)})}function rj(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...es.normalizeParams(t)})}function rP(e,t){return new e({type:"boolean",...es.normalizeParams(t)})}function rz(e,t){return new e({type:"boolean",coerce:!0,...es.normalizeParams(t)})}function rM(e,t){return new e({type:"bigint",...es.normalizeParams(t)})}function rZ(e,t){return new e({type:"bigint",coerce:!0,...es.normalizeParams(t)})}function rR(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...es.normalizeParams(t)})}function rL(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...es.normalizeParams(t)})}function rU(e,t){return new e({type:"symbol",...es.normalizeParams(t)})}function rV(e,t){return new e({type:"undefined",...es.normalizeParams(t)})}function rF(e,t){return new e({type:"null",...es.normalizeParams(t)})}function rB(e){return new e({type:"any"})}function rH(e){return new e({type:"unknown"})}function rW(e,t){return new e({type:"never",...es.normalizeParams(t)})}function rK(e,t){return new e({type:"void",...es.normalizeParams(t)})}function rJ(e,t){return new e({type:"date",...es.normalizeParams(t)})}function rq(e,t){return new e({type:"date",coerce:!0,...es.normalizeParams(t)})}function rG(e,t){return new e({type:"nan",...es.normalizeParams(t)})}function rX(e,t){return new eu({check:"less_than",...es.normalizeParams(t),value:e,inclusive:!1})}function rY(e,t){return new eu({check:"less_than",...es.normalizeParams(t),value:e,inclusive:!0})}function rQ(e,t){return new ed({check:"greater_than",...es.normalizeParams(t),value:e,inclusive:!1})}function r0(e,t){return new ed({check:"greater_than",...es.normalizeParams(t),value:e,inclusive:!0})}function r1(e){return rQ(0,e)}function r4(e){return rX(0,e)}function r2(e){return rY(0,e)}function r6(e){return r0(0,e)}function r3(e,t){return new ec({check:"multiple_of",...es.normalizeParams(t),value:e})}function r9(e,t){return new ef({check:"max_size",...es.normalizeParams(t),maximum:e})}function r5(e,t){return new em({check:"min_size",...es.normalizeParams(t),minimum:e})}function r7(e,t){return new eg({check:"size_equals",...es.normalizeParams(t),size:e})}function r8(e,t){return new ev({check:"max_length",...es.normalizeParams(t),maximum:e})}function ne(e,t){return new ey({check:"min_length",...es.normalizeParams(t),minimum:e})}function nt(e,t){return new eb({check:"length_equals",...es.normalizeParams(t),length:e})}function nr(e,t){return new ek({check:"string_format",format:"regex",...es.normalizeParams(t),pattern:e})}function nn(e){return new ew({check:"string_format",format:"lowercase",...es.normalizeParams(e)})}
25function ni(e){return new e_({check:"string_format",format:"uppercase",...es.normalizeParams(e)})}function no(e,t){return new e$({check:"string_format",format:"includes",...es.normalizeParams(t),includes:e})}function ns(e,t){return new eS({check:"string_format",format:"starts_with",...es.normalizeParams(t),prefix:e})}function na(e,t){return new eI({check:"string_format",format:"ends_with",...es.normalizeParams(t),suffix:e})}function nl(e,t,r){return new eC({check:"property",property:e,schema:t,...es.normalizeParams(r)})}function nu(e,t){return new eN({check:"mime_type",mime:e,...es.normalizeParams(t)})}function nd(e){return new eT({check:"overwrite",tx:e})}function nc(e){return nd(t=>t.normalize(e))}function np(){return nd(e=>e.trim())}function nh(){return nd(e=>e.toLowerCase())}function nf(){return nd(e=>e.toUpperCase())}function nm(e,t,r){return new e({type:"array",element:t,...es.normalizeParams(r)})}function ng(e,t,r){return new e({type:"union",options:t,...es.normalizeParams(r)})}function nv(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...es.normalizeParams(n)})}function ny(e,t,r){return new e({type:"intersection",left:t,right:r})}function nb(e,t,r,n){let i=r instanceof eD,o=i?n:r;return new e({type:"tuple",items:t,rest:i?r:null,...es.normalizeParams(o)})}function nx(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...es.normalizeParams(n)})}function nk(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...es.normalizeParams(n)})}function nw(e,t,r){return new e({type:"set",valueType:t,...es.normalizeParams(r)})}function n_(e,t,r){return new e({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...es.normalizeParams(r)})}function n$(e,t,r){return new e({type:"enum",entries:t,...es.normalizeParams(r)})}function nS(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...es.normalizeParams(r)})}function nI(e,t){return new e({type:"file",...es.normalizeParams(t)})}function nO(e,t){return new e({type:"transform",transform:t})}function nC(e,t){return new e({type:"optional",innerType:t})}function nN(e,t){return new e({type:"nullable",innerType:t})}function nT(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():r}})}function nE(e,t,r){return new e({type:"nonoptional",innerType:t,...es.normalizeParams(r)})}function nA(e,t){return new e({type:"success",innerType:t})}function nD(e,t,r){return new e({type:"catch",innerType:t,catchValue:"function"==typeof r?r:()=>r})}function nj(e,t,r){return new e({type:"pipe",in:t,out:r})}function nP(e,t){return new e({type:"readonly",innerType:t})}function nz(e,t,r){return new e({type:"template_literal",parts:t,...es.normalizeParams(r)})}function nM(e,t){return new e({type:"lazy",getter:t})}function nZ(e,t){return new e({type:"promise",innerType:t})}function nR(e,t,r){let n=es.normalizeParams(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function nL(e,t,r){return new e({type:"custom",check:"custom",fn:t,...es.normalizeParams(r)})}function nU(e,t){let r=es.normalizeParams(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];"sensitive"!==r.case&&(n=n.map(e=>"string"==typeof e?e.toLowerCase():e),i=i.map(e=>"string"==typeof e?e.toLowerCase():e));let o=new Set(n),s=new Set(i),a=e.Pipe??tF,l=e.Boolean??tt,u=e.String??ej,d=new(e.Transform??tA)({type:"transform",transform:(e,t)=>{let n=e;return"sensitive"!==r.case&&(n=n.toLowerCase()),!!o.has(n)||!s.has(n)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:t.value,inst:d}),{})},error:r.error}),c=new a({type:"pipe",in:new u({type:"string",error:r.error}),out:d,error:r.error});return new a({type:"pipe",in:c,out:new l({type:"boolean",error:r.error}),error:r.error})}function nV(e,t,r,n={}){let i=es.normalizeParams(n),o={...es.normalizeParams(n),check:"string_format",type:"string",format:t,fn:"function"==typeof r?r:e=>r.test(e),...i};return r instanceof RegExp&&(o.pattern=r),new e(o)}e.s(["TimePrecision",0,r_,"_any",0,rB,"_array",0,nm,"_base64",0,rb,"_base64url",0,rx,"_bigint",0,rM,"_boolean",0,rP,"_cat
25ch",0,nD,"_cidrv4",0,rv,"_cidrv6",0,ry,"_coercedBigint",0,rZ,"_coercedBoolean",0,rz,"_coercedDate",0,rq,"_coercedNumber",0,rN,"_coercedString",0,re,"_cuid",0,rd,"_cuid2",0,rc,"_custom",0,nR,"_date",0,rJ,"_default",0,nT,"_discriminatedUnion",0,nv,"_e164",0,rk,"_email",0,rt,"_emoji",0,rl,"_endsWith",0,na,"_enum",0,n_,"_file",0,nI,"_float32",0,rE,"_float64",0,rA,"_gt",0,rQ,"_gte",0,r0,"_guid",0,rr,"_includes",0,no,"_int",0,rT,"_int32",0,rD,"_int64",0,rR,"_intersection",0,ny,"_ipv4",0,rm,"_ipv6",0,rg,"_isoDate",0,rS,"_isoDateTime",0,r$,"_isoDuration",0,rO,"_isoTime",0,rI,"_jwt",0,rw,"_ksuid",0,rf,"_lazy",0,nM,"_length",0,nt,"_literal",0,nS,"_lowercase",0,nn,"_lt",0,rX,"_lte",0,rY,"_map",0,nk,"_max",0,rY,"_maxLength",0,r8,"_maxSize",0,r9,"_mime",0,nu,"_min",0,r0,"_minLength",0,ne,"_minSize",0,r5,"_multipleOf",0,r3,"_nan",0,rG,"_nanoid",0,ru,"_nativeEnum",0,n$,"_negative",0,r4,"_never",0,rW,"_nonnegative",0,r6,"_nonoptional",0,nE,"_nonpositive",0,r2,"_normalize",0,nc,"_null",0,rF,"_nullable",0,nN,"_number",0,rC,"_optional",0,nC,"_overwrite",0,nd,"_pipe",0,nj,"_positive",0,r1,"_promise",0,nZ,"_property",0,nl,"_readonly",0,nP,"_record",0,nx,"_refine",0,nL,"_regex",0,nr,"_set",0,nw,"_size",0,r7,"_startsWith",0,ns,"_string",0,t8,"_stringFormat",0,nV,"_stringbool",0,nU,"_success",0,nA,"_symbol",0,rU,"_templateLiteral",0,nz,"_toLowerCase",0,nh,"_toUpperCase",0,nf,"_transform",0,nO,"_trim",0,np,"_tuple",0,nb,"_uint32",0,rj,"_uint64",0,rL,"_ulid",0,rp,"_undefined",0,rV,"_union",0,ng,"_unknown",0,rH,"_uppercase",0,ni,"_url",0,ra,"_uuid",0,rn,"_uuidv4",0,ri,"_uuidv6",0,ro,"_uuidv7",0,rs,"_void",0,rK,"_xid",0,rh],650215);
25class nF{constructor(e){this._def=e,this.def=e}implement(e){if("function"!=typeof e)throw Error("implement() must be called with a function");let t=(...r)=>{let n=this._def.input?(0,k.parse)(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(n))throw Error("Invalid arguments schema: not an array or tuple schema.");let i=e(...n);return this._def.output?(0,k.parse)(this._def.output,i,void 0,{callee:t}):i};return t}implementAsync(e){if("function"!=typeof e)throw Error("implement() must be called with a function");let t=async(...r)=>{let n=this._def.input?await (0,k.parseAsync)(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(n))throw Error("Invalid arguments schema: not an array or tuple schema.");let i=await e(...n);return this._def.output?(0,k.parseAsync)(this._def.output,i,void 0,{callee:t}):i};return t}input(...e){let t=this.constructor;return new t(Array.isArray(e[0])?{type:"function",input:new tw({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}:{type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}}function nB(e){return new nF({type:"function",input:Array.isArray(e?.input)?nb(tw,e?.input):e?.input??nm(th,rH(tl)),output:e?.output??rH(tl)})}e.s(["$ZodFunction",0,nF,"function",0,nB],523497),e.i(523497),e.i(650215);
25class nH{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??t7,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r;let n=e._zod.def,i=this.seen.get(e);if(i)return i.count++,t.schemaPath.includes(e)&&(i.cycle=t.path),i.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...t,schemaPath:[...t.schemaPath,e],path:t.path},i=e._zod.parent;if(i)o.ref=i,this.process(i,r),this.seen.get(i).isParent=!0;else{let t=o.schema;switch(n.type){case"string":{t.type="string";let{minimum:r,maximum:n,format:i,patterns:s,contentEncoding:a}=e._zod.bag;if("number"==typeof r&&(t.minLength=r),"number"==typeof n&&(t.maxLength=n),i&&(t.format=({guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""})[i]??i,""===t.format&&delete t.format),a&&(t.contentEncoding=a),s&&s.size>0){let e=[...s];1===e.length?t.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source}))])}break}case"number":{let{minimum:r,maximum:n,format:i,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:a}=e._zod.bag;"string"==typeof i&&i.includes("int")?t.type="integer":t.type="number","number"==typeof a&&(t.exclusiveMinimum=a),"number"==typeof r&&(t.minimum=r,"number"==typeof a&&(a>=r?delete t.minimum:delete t.exclusiveMinimum)),"number"==typeof s&&(t.exclusiveMaximum=s),"number"==typeof n&&(t.maximum=n,"number"==typeof s&&(s<=n?delete t.maximum:delete t.exclusiveMaximum)),"number"==typeof o&&(t.multipleOf=o);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw Error("Date cannot be represented in JSON Schema");break;case"array":{let{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(t.minItems=i),"number"==typeof o&&(t.maxItems=o),t.type="array",t.items=this.process(n.element,{...r,path:[...r.path,"items"]});break}case"object":{t.type="object",t.properties={};let e=n.shape;for(let n in e)t.properties[n]=this.process(e[n],{...r,path:[...r.path,"properties",n]});let i=new Set([...new Set(Object.keys(e))].filter(e=>{let t=n.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout}));i.size>0&&(t.required=Array.from(i)),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=this.process(n.catchall,{...r,path:[...r.path,"additionalProperties"]})):"output"===this.io&&(t.additionalProperties=!1);break}case"union":t.anyOf=n.options.map((e,t)=>this.process(e,{...r,path:[...r.path,"anyOf",t]}));break;case"intersection":{let e=this.process(n.left,{...r,path:[...r.path,"allOf",0]}),i=this.process(n.right,{...r,path:[...r.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length;t.allOf=[...o(e)?e.allOf:[e],...o(i)?i.allOf:[i]];break}case"tuple":{t.type="array";let i=n.items.map((e,t)=>this.process(e,{...r,path:[...r.path,"prefixItems",t]}));if("draft-2020-12"===this.target?t.prefixItems=i:t.items=i,n.rest){let e=this.process(n.rest,{...r,path:[...r.path,"items"]});
25"draft-2020-12"===this.target?t.items=e:t.additionalItems=e}n.rest&&(t.items=this.process(n.rest,{...r,path:[...r.path,"items"]}));let{minimum:o,maximum:s}=e._zod.bag;"number"==typeof o&&(t.minItems=o),"number"==typeof s&&(t.maxItems=s);break}case"record":t.type="object",t.propertyNames=this.process(n.keyType,{...r,path:[...r.path,"propertyNames"]}),t.additionalProperties=this.process(n.valueType,{...r,path:[...r.path,"additionalProperties"]});break;case"map":if("throw"===this.unrepresentable)throw Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw Error("Set cannot be represented in JSON Schema");break;case"enum":{let e=(0,es.getEnumValues)(n.entries);e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=e;break}case"literal":{let e=[];for(let t of n.values)if(void 0===t){if("throw"===this.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof t)if("throw"===this.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else e.push(Number(t));else e.push(t);if(0===e.length);else if(1===e.length){let r=e[0];t.type=null===r?"null":typeof r,t.const=r}else e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),e.every(e=>"boolean"==typeof e)&&(t.type="string"),e.every(e=>null===e)&&(t.type="null"),t.enum=e;break}case"file":{let r={type:"string",format:"binary",contentEncoding:"binary"},{minimum:n,maximum:i,mime:o}=e._zod.bag;void 0!==n&&(r.minLength=n),void 0!==i&&(r.maxLength=i),o?1===o.length?(r.contentMediaType=o[0],Object.assign(t,r)):t.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(t,r);break}case"transform":if("throw"===this.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema");break;case"nullable":t.anyOf=[this.process(n.innerType,r),{type:"null"}];break;case"nonoptional":case"promise":case"optional":this.process(n.innerType,r),o.ref=n.innerType;break;case"default":this.process(n.innerType,r),o.ref=n.innerType,t.default=JSON.parse(JSON.stringify(n.defaultValue));break;case"prefault":this.process(n.innerType,r),o.ref=n.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break;case"catch":{let e;this.process(n.innerType,r),o.ref=n.innerType;try{e=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{let r=e._zod.pattern;if(!r)throw Error("Pattern not found in template literal");t.type="string",t.pattern=r.source;break}case"pipe":{let e="input"===this.io?"transform"===n.in._zod.def.type?n.out:n.in:n.out;this.process(e,r),o.ref=e;break}case"readonly":this.process(n.innerType,r),o.ref=n.innerType,t.readOnly=!0;break;case"lazy":{let t=e._zod.innerType;this.process(t,r),o.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")}}}let a=this.metadataRegistry.get(e);return a&&Object.assign(o.schema,a),"input"===this.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return e(i.element,n);case"object":for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1;case"union":for(let t of i.options)if(e(t,n))return!0;return!1;case"intersection":return e(i.left,n)||e(i.right,n);case"tuple":for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0;return!1;case"record":case"map":return e(i.keyType,n)||e(i.valueType,n);case"set":return e(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return e(i.innerType,n);case"lazy":return e(i.getter(),n);case"transform":return!0;case"pipe":return e(i.in,n)||e(i.out,n)}throw Error(`Unknown schema type: ${i.type}`)}(e)&&(delete o.schema.examples,delete o.schema.default),"input"===this.io&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let r={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let i=e=>
25{let t="draft-2020-12"===this.target?"$defs":"definitions";if(r.external){let n=r.external.registry.get(e[0])?.id,i=r.external.uri??(e=>e);if(n)return{ref:i(n)};let o=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=o,{defId:o,ref:`${i("__shared")}#/${t}/${o}`}}if(e[1]===n)return{ref:"#"};let i=`#/${t}/`,o=e[1].schema.id??`__schema${this.counter++}`;return{defId:o,ref:i+o}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:r,defId:n}=i(e);t.def={...t.schema},n&&(t.defId=n);let o=t.schema;for(let e in o)delete o[e];o.$ref=r};if("throw"===r.cycles)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>
26
27Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let n=t[1];if(e===t[0]){o(t);continue}if(r.external){let n=r.external.registry.get(t[0])?.id;if(e!==t[0]&&n){o(t);continue}}if(this.metadataRegistry.get(t[0])?.id||n.cycle||n.count>1&&"ref"===r.reused){o(t);continue}}let s=(e,t)=>{let r=this.seen.get(e),n=r.def??r.schema,i={...n};if(null===r.ref)return;let o=r.ref;if(r.ref=null,o){s(o,t);let e=this.seen.get(o).schema;e.$ref&&"draft-7"===t.target?(n.allOf=n.allOf??[],n.allOf.push(e)):(Object.assign(n,e),Object.assign(n,i))}r.isParent||this.override({zodSchema:e,jsonSchema:n,path:r.path??[]})};for(let e of[...this.seen.entries()].reverse())s(e[0],{target:this.target});let a={};if("draft-2020-12"===this.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?a.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){let t=r.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");a.$id=r.external.uri(t)}Object.assign(a,n.def);let l=r.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}r.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?a.$defs=l:a.definitions=l);try{return JSON.parse(JSON.stringify(a))}catch(e){throw Error("Error converting schema to JSON.")}}}function nW(e,t){if(e instanceof t9){let r=new nH(t),n={};
27for(let t of e._idmap.entries()){let[e,n]=t;r.process(n)}let i={},o={registry:e,uri:t?.uri,defs:n};for(let n of e._idmap.entries()){let[e,s]=n;i[e]=r.emit(s,{...t,external:o})}return Object.keys(n).length>0&&(i.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:n}),{schemas:i}}let r=new nH(t);return r.process(e),r.emit(e,t)}e.s(["JSONSchemaGenerator",0,nH,"toJSONSchema",0,nW],34966),e.i(34966),e.s([],818249);var nK=e.i(818249);e.s(["$ZodAny",0,ta,"$ZodArray",0,th,"$ZodAsyncError",()=>x.$ZodAsyncError,"$ZodBase64",0,e4,"$ZodBase64URL",0,e6,"$ZodBigInt",0,tr,"$ZodBigIntFormat",0,tn,"$ZodBoolean",0,tt,"$ZodCIDRv4",0,eQ,"$ZodCIDRv6",0,e0,"$ZodCUID",0,eV,"$ZodCUID2",0,eF,"$ZodCatch",0,tU,"$ZodCheck",0,ea,"$ZodCheckBigIntFormat",0,eh,"$ZodCheckEndsWith",0,eI,"$ZodCheckGreaterThan",0,ed,"$ZodCheckIncludes",0,e$,"$ZodCheckLengthEquals",0,eb,"$ZodCheckLessThan",0,eu,"$ZodCheckLowerCase",0,ew,"$ZodCheckMaxLength",0,ev,"$ZodCheckMaxSize",0,ef,"$ZodCheckMimeType",0,eN,"$ZodCheckMinLength",0,ey,"$ZodCheckMinSize",0,em,"$ZodCheckMultipleOf",0,ec,"$ZodCheckNumberFormat",0,ep,"$ZodCheckOverwrite",0,eT,"$ZodCheckProperty",0,eC,"$ZodCheckRegex",0,ek,"$ZodCheckSizeEquals",0,eg,"$ZodCheckStartsWith",0,eS,"$ZodCheckStringFormat",0,ex,"$ZodCheckUpperCase",0,e_,"$ZodCustom",0,tG,"$ZodCustomStringFormat",0,e7,"$ZodDate",0,tc,"$ZodDefault",0,tP,"$ZodDiscriminatedUnion",0,tb,"$ZodE164",0,e3,"$ZodEmail",0,eZ,"$ZodEmoji",0,eL,"$ZodEnum",0,tN,"$ZodError",()=>w.$ZodError,"$ZodFile",0,tE,"$ZodFunction",0,nF,"$ZodGUID",0,ez,"$ZodIPv4",0,eX,"$ZodIPv6",0,eY,"$ZodISODate",0,eJ,"$ZodISODateTime",0,eK,"$ZodISODuration",0,eG,"$ZodISOTime",0,eq,"$ZodIntersection",0,tx,"$ZodJWT",0,e5,"$ZodKSUID",0,eW,"$ZodLazy",0,tq,"$ZodLiteral",0,tT,"$ZodMap",0,tS,"$ZodNaN",0,tV,"$ZodNanoID",0,eU,"$ZodNever",0,tu,"$ZodNonOptional",0,tZ,"$ZodNull",0,ts,"$ZodNullable",0,tj,"$ZodNumber",0,e8,"$ZodNumberFormat",0,te,"$ZodObject",0,tg,"$ZodOptional",0,tD,"$ZodPipe",0,tF,"$ZodPrefault",0,tM,"$ZodPromise",0,tJ,"$ZodReadonly",0,tH,"$ZodRealError",()=>w.$ZodRealError,"$ZodRecord",0,t$,"$ZodRegistry",0,t9,"$ZodSet",0,tO,"$ZodString",0,ej,"$ZodStringFormat",0,eP,"$ZodSuccess",0,tL,"$ZodSymbol",0,ti,"$ZodTemplateLiteral",0,tK,"$ZodTransform",0,tA,"$ZodTuple",0,tw,"$ZodType",0,eD,"$ZodULID",0,eB,"$ZodURL",0,eR,"$ZodUUID",0,eM,"$ZodUndefined",0,to,"$ZodUnion",0,ty,"$ZodUnknown",0,tl,"$ZodVoid",0,td,"$ZodXID",0,eH,"$brand",()=>x.$brand,"$constructor",()=>x.$constructor,"$input",0,t3,"$output",0,t6,"Doc",0,eE,"JSONSchema",0,nK,"JSONSchemaGenerator",0,nH,"NEVER",()=>x.NEVER,"TimePrecision",0,r_,"_any",0,rB,"_array",0,nm,"_base64",0,rb,"_base64url",0,rx,"_bigint",0,rM,"_boolean",0,rP,"_catch",0,nD,"_cidrv4",0,rv,"_cidrv6",0,ry,"_coercedBigint",0,rZ,"_coercedBoolean",0,rz,"_coercedDate",0,rq,"_coercedNumber",0,rN,"_coercedString",0,re,"_cuid",0,rd,"_cuid2",0,rc,"_custom",0,nR,"_date",0,rJ,"_default",0,nT,"_discriminatedUnion",0,nv,"_e164",0,rk,"_email",0,rt,"_emoji",0,rl,"_endsWith",0,na,"_enum",0,n_,"_file",0,nI,"_float32",0,rE,"_float64",0,rA,"_gt",0,rQ,"_gte",0,r0,"_guid",0,rr,"_includes",0,no,"_int",0,rT,"_int32",0,rD,"_int64",0,rR,"_intersection",0,ny,"_ipv4",0,rm,"_ipv6",0,rg,"_isoDate",0,rS,"_isoDateTime",0,r$,"_isoDuration",0,rO,"_isoTime",0,rI,"_jwt",0,rw,"_ksuid",0,rf,"_lazy",0,nM,"_length",0,nt,"_literal",0,nS,"_lowercase",0,nn,"_lt",0,rX,"_lte",0,rY,"_map",0,nk,"_max",0,rY,"_maxLength",0,r8,"_maxSize",0,r9,"_mime",0,nu,"_min",0,r0,"_minLength",0,ne,"_minSize",0,r5,"_multipleOf",0,r3,"_nan",0,rG,"_nanoid",0,ru,"_nativeEnum",0,n$,"_negative",0,r4,"_never",0,rW,"_nonnegative",0,r6,"_nonoptional",0,nE,"_nonpositive",0,r2,"_normalize",0,nc,"_null",0,rF,"_nullable",0,nN,"_number",0,rC,"_optional",0,nC,"_overwrite",0,nd,"_parse",()=>k._parse,"_parseAsync",()=>k._parseAsync,"_pipe",0,nj,"_positive",0,r1,"_promise",0,nZ,"_property",0,nl,"_readonly",0,nP,"_record",0,nx,"_refine",0,nL,"_regex",0,nr,"_safeParse",()=>k._safeParse,"_safeParseAsync",()=>k._safeParseAsync,"_set",0,nw,"_size",0,r7,"_startsWith",0,ns,"_string",0,t8,"_stringFormat",0,nV,"_stringbool",0,nU,"_success",0,nA,"_symbol",0,rU,"_templateLiteral",0,nz,"_toLowerCase",0,nh,"_toUpperCase",0,nf,"_transform",0,nO,"_trim",0,np,"_tuple",0,nb,"_uint32",0,rj,"_uint64",0,rL,"_ulid",0,rp,"_undefined",0,rV,"_union",0,ng,"_unknown",0,rH,"_uppercase",0,ni,"_url",0,ra,"_uuid",0,rn,"_uuidv4",0,ri,"_uuidv6",0,ro,"_uuidv7",0,rs,"_void",0,rK,"_xid",0,rh,"clone",()=>es.clone,"config",()=>x.config,"flattenError",()=>w.flattenError,"formatError",()=>w.formatError,"function",0,nB,"globalConfig",()=>x.globalConfig,"globalRegistry",0,t7,"isValidBase64",0,e1,"isValidBase64URL",0,e2,"isValidJWT",0,e9,"locales",0,t2,"parse",()=>k.parse,"parseAsync",()=>k.parseAsync,"prettifyError",()=>w.prettifyError,"regexes",0,tQ,"registry",0,t5,"safeParse",()=>k.safeParse,"safeParseAsync",()=>k.safeParseAsync,"toDotPath",()=>w.toDotPath,"toJSONSchema",0,nW,"treeifyError",()=>w.treeifyError,"util",0,tY,"version",0,eA],712717);var nJ=e.i(712717);e.s(["ZodAny",()=>ol,"ZodArray",()=>oy,"ZodBase64",()=>iL,"ZodBase64URL",()=>iV,"ZodBigInt",()=>i9,"ZodBigIntFormat",()=>i7,"ZodBoolean",()=>i6,"ZodCIDRv4",()=>iz,"ZodCIDRv6",()=>iZ,"ZodCUID",()=>iw,"ZodCUID2",()=>i$,"ZodCatch",()=>o7,"ZodCustom",()=>sp,"ZodCustomStringFormat",()=>iJ,"ZodDate",()=>og,"ZodDefault",()=>o0,"ZodDiscriminatedUnion",()=>oO,"ZodE164",()=>iB,"ZodEmail",()=>is,"ZodEmoji",()=>iy,"ZodEnum",()=>oL,"ZodFile",()=>oH,"ZodGUID",()=>il,"ZodIPv4",()=>iA,"ZodIPv6",()=>ij,"ZodIntersection",()=>oN,"ZodJWT",()=>iW,"ZodKSUID",()=>iT,"ZodLazy",()=>sl,"ZodLiteral",()=>oF,"ZodMap",()=>oz,"ZodNaN",()=>se,"ZodNanoID",()=>ix,"ZodNever",()=>op,"ZodNonOptional",()=>o6,"ZodNull",()=>oo,"ZodNullable",()=>oX,"ZodNumber",()=>iG,"ZodNumberFormat",()=>iY,"ZodObject",()=>ok,"ZodOptional",()=>oq,"ZodPipe",()=>sr,"ZodPrefault",()=>o4,"ZodPromise",()=>sd,"ZodReadonly",()=>si,"ZodRecord",()=>oD,"ZodSet",()=>oZ,"ZodString",()=>ir,"ZodStringFormat",()=>io,"ZodSuccess",()=>o9,"ZodSymbol",()=>ot,"ZodTemplateLiteral",()=>ss,"ZodTransform",()=>oK,"ZodTuple",()=>oE,"ZodType",()=>ie,"ZodULID",()=>iI,"ZodURL",()=>ig,"ZodUUID",()=>id,"ZodUndefined",()=>on,"ZodUnion",()=>oS,"ZodUnknown",()=>od,"ZodVoid",()=>of,"ZodXID",()=>iC,"_ZodString",()=>it,"_default",()=>o1,"any",()=>ou,"array",()=>ob,"base64",()=>iU,"base64url",()=>iF,"bigint",()=>i5,"boolean",()=>i3,"catch",()=>o8,"check",()=>sh,"cidrv4",()=>iM,"cidrv6",()=>iR,"cuid",()=>i_,"cuid2",()=>iS,"custom",()=>sf,"date",()=>ov,"discriminatedUnion",()=>oC,"e164",()=>iH,"email",()=>ia,"emoji",()=>ib,"enum",()=>oU,"file",()=>oW,"float32",()=>i0,"float64",()=>i1,"guid",()=>iu,"instanceof",()=>sv,"int",()=>iQ,"int32",()=>i4,"int64",()=>i8,"intersection",()=>oT,"ipv4",()=>iD,"ipv6",()=>iP,"json",()=>sb,"jwt",()=>iK,"keyof",()=>
27ox,"ksuid",()=>iE,"lazy",()=>su,"literal",()=>oB,"looseObject",()=>o$,"map",()=>oM,"nan",()=>st,"nanoid",()=>ik,"nativeEnum",()=>oV,"never",()=>oh,"nonoptional",()=>o3,"null",()=>oa,"nullable",()=>oY,"nullish",()=>oQ,"number",()=>iX,"object",()=>ow,"optional",()=>oG,"partialRecord",()=>oP,"pipe",()=>sn,"prefault",()=>o2,"preprocess",()=>sx,"promise",()=>sc,"readonly",()=>so,"record",()=>oj,"refine",()=>sm,"set",()=>oR,"strictObject",()=>o_,"string",()=>ii,"stringFormat",()=>iq,"stringbool",()=>sy,"success",()=>o5,"superRefine",()=>sg,"symbol",()=>or,"templateLiteral",()=>sa,"transform",()=>oJ,"tuple",()=>oA,"uint32",()=>i2,"uint64",()=>oe,"ulid",()=>iO,"undefined",()=>oi,"union",()=>oI,"unknown",()=>oc,"url",()=>iv,"uuid",()=>ic,"uuidv4",()=>ip,"uuidv6",()=>ih,"uuidv7",()=>im,"void",()=>om,"xid",()=>iN],362201);e.s(["ZodISODate",()=>nX,"ZodISODateTime",()=>nq,"ZodISODuration",()=>n1,"ZodISOTime",()=>nQ,"date",()=>nY,"datetime",()=>nG,"duration",()=>n4,"time",()=>n0],49732);let nq=x.$constructor("ZodISODateTime",(e,t)=>{eK.init(e,t),io.init(e,t)});function nG(e){return r$(nq,e)}let nX=x.$constructor("ZodISODate",(e,t)=>{eJ.init(e,t),io.init(e,t)});function nY(e){return rS(nX,e)}let nQ=x.$constructor("ZodISOTime",(e,t)=>{eq.init(e,t),io.init(e,t)});function n0(e){return rI(nQ,e)}let n1=x.$constructor("ZodISODuration",(e,t)=>{eG.init(e,t),io.init(e,t)});function n4(e){return rO(n1,e)}let n2=(e,t)=>{w.$ZodError.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>w.formatError(e,t)},flatten:{value:t=>w.flattenError(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},n6=x.$constructor("ZodError",n2),n3=x.$constructor("ZodError",n2,{Parent:Error});e.s(["ZodError",0,n6,"ZodRealError",0,n3],789282);let n9=k._parse(n3),n5=k._parseAsync(n3),n7=k._safeParse(n3),n8=k._safeParseAsync(n3);e.s(["parse",0,n9,"parseAsync",0,n5,"safeParse",0,n7,"safeParseAsync",0,n8],100364);let ie=x.$constructor("ZodType",(e,t)=>(eD.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>es.clone(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>n9(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>n7(e,t,r),e.parseAsync=async(t,r)=>n5(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>n8(e,t,r),e.spa=e.safeParseAsync,e.refine=(t,r)=>e.check(sm(t,r)),e.superRefine=t=>e.check(sg(t)),e.overwrite=t=>e.check(nd(t)),e.optional=()=>oG(e),e.nullable=()=>oY(e),e.nullish=()=>oG(oY(e)),e.nonoptional=t=>o3(e,t),e.array=()=>ob(e),e.or=t=>oI([e,t]),e.and=t=>oT(e,t),e.transform=t=>sn(e,oJ(t)),e.default=t=>o1(e,t),e.prefault=t=>o2(e,t),e.catch=t=>o8(e,t),e.pipe=t=>sn(e,t),e.readonly=()=>so(e),e.describe=t=>{let r=e.clone();return t7.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>t7.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return t7.get(e);let r=e.clone();return t7.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),it=x.$constructor("_ZodString",(e,t)=>{ej.init(e,t),ie.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(nr(...t)),e.includes=(...t)=>e.check(no(...t)),e.startsWith=(...t)=>e.check(ns(...t)),e.endsWith=(...t)=>e.check(na(...t)),e.min=(...t)=>e.check(ne(...t)),e.max=(...t)=>e.check(r8(...t)),e.length=(...t)=>e.check(nt(...t)),e.nonempty=(...t)=>e.check(ne(1,...t)),e.lowercase=t=>e.check(nn(t)),e.uppercase=t=>e.check(ni(t)),e.trim=()=>e.check(np()),e.normalize=(...t)=>e.check(nc(...t)),e.toLowerCase=()=>e.check(nh()),e.toUpperCase=()=>e.check(nf())}),ir=x.$constructor("ZodString",(e,t)=>{ej.init(e,t),it.init(e,t),e.email=t=>e.check(rt(is,t)),e.url=t=>e.check(ra(ig,t)),e.jwt=t=>e.check(rw(iW,t)),e.emoji=t=>e.check(rl(iy,t)),e.guid=t=>e.check(rr(il,t)),e.uuid=t=>e.check(rn(id,t)),e.uuidv4=t=>e.check(ri(id,t)),e.uuidv6=t=>e.check(ro(id,t)),e.uuidv7=t=>e.check(rs(id,t)),e.nanoid=t=>e.check(ru(ix,t)),e.guid=t=>e.check(rr(il,t)),e.cuid=t=>e.check(rd(iw,t)),e.cuid2=t=>e.check(rc(i$,t)),e.ulid=t=>e.check(rp(iI,t)),e.base64=t=>e.check(rb(iL,t)),e.base64url=t=>e.check(rx(iV,t)),e.xid=t=>e.check(rh(iC,t)),e.ksuid=t=>e.check(rf(iT,t)),e.ipv4=t=>e.check(rm(iA,t)),e.ipv6=t=>e.check(rg(ij,t)),e.cidrv4=t=>e.check(rv(iz,t)),e.cidrv6=t=>e.check(ry(iZ,t)),e.e164=t=>e.check(rk(iB,t)),e.datetime=t=>e.check(nG(t)),e.date=t=>e.check(nY(t)),e.time=t=>e.check(n0(t)),e.duration=t=>e.check(n4(t))});function ii(e){return t8(ir,e)}let io=x.$constructor("ZodStringFormat",(e,t)=>{eP.init(e,t),it.init(e,t)}),is=x.$constructor("ZodEmail",(e,t)=>{eZ.init(e,t),io.init(e,t)});function ia(e){return rt(is,e)}let il=x.$constructor("ZodGUID",(e,t)=>{ez.init(e,t),io.init(e,t)});function iu(e){return rr(il,e)}let id=x.$constructor("ZodUUID",(e,t)=>{eM.init(e,t),io.init(e,t)});function ic(e){return rn(id,e)}function ip(e){return ri(id,e)}function ih(e){return ro(id,e)}function im(e){return rs(id,e)}let ig=x.$constructor("ZodURL",(e,t)=>{eR.init(e,t),io.init(e,t)});function iv(e){return ra(ig,e)}let iy=x.$constructor("ZodEmoji",(e,t)=>{eL.init(e,t),io.init(e,t)});function ib(e){return rl(iy,e)}let ix=x.$constructor("ZodNanoID",(e,t)=>{eU.init(e,t),io.init(e,t)});function ik(e){return ru(ix,e)}let iw=x.$constructor("ZodCUID",(e,t)=>{eV.init(e,t),io.init(e,t)});function i_(e){return rd(iw,e)}let i$=x.$constructor("ZodCUID2",(e,t)=>{eF.init(e,t),io.init(e,t)});function iS(e){return rc(i$,e)}
27let iI=x.$constructor("ZodULID",(e,t)=>{eB.init(e,t),io.init(e,t)});function iO(e){return rp(iI,e)}let iC=x.$constructor("ZodXID",(e,t)=>{eH.init(e,t),io.init(e,t)});function iN(e){return rh(iC,e)}let iT=x.$constructor("ZodKSUID",(e,t)=>{eW.init(e,t),io.init(e,t)});function iE(e){return rf(iT,e)}let iA=x.$constructor("ZodIPv4",(e,t)=>{eX.init(e,t),io.init(e,t)});function iD(e){return rm(iA,e)}let ij=x.$constructor("ZodIPv6",(e,t)=>{eY.init(e,t),io.init(e,t)});function iP(e){return rg(ij,e)}let iz=x.$constructor("ZodCIDRv4",(e,t)=>{eQ.init(e,t),io.init(e,t)});function iM(e){return rv(iz,e)}let iZ=x.$constructor("ZodCIDRv6",(e,t)=>{e0.init(e,t),io.init(e,t)});function iR(e){return ry(iZ,e)}let iL=x.$constructor("ZodBase64",(e,t)=>{e4.init(e,t),io.init(e,t)});function iU(e){return rb(iL,e)}let iV=x.$constructor("ZodBase64URL",(e,t)=>{e6.init(e,t),io.init(e,t)});function iF(e){return rx(iV,e)}let iB=x.$constructor("ZodE164",(e,t)=>{e3.init(e,t),io.init(e,t)});function iH(e){return rk(iB,e)}let iW=x.$constructor("ZodJWT",(e,t)=>{e5.init(e,t),io.init(e,t)});function iK(e){return rw(iW,e)}let iJ=x.$constructor("ZodCustomStringFormat",(e,t)=>{e7.init(e,t),io.init(e,t)});function iq(e,t,r={}){return nV(iJ,e,t,r)}let iG=x.$constructor("ZodNumber",(e,t)=>{e8.init(e,t),ie.init(e,t),e.gt=(t,r)=>e.check(rQ(t,r)),e.gte=(t,r)=>e.check(r0(t,r)),e.min=(t,r)=>e.check(r0(t,r)),e.lt=(t,r)=>e.check(rX(t,r)),e.lte=(t,r)=>e.check(rY(t,r)),e.max=(t,r)=>e.check(rY(t,r)),e.int=t=>e.check(iQ(t)),e.safe=t=>e.check(iQ(t)),e.positive=t=>e.check(rQ(0,t)),e.nonnegative=t=>e.check(r0(0,t)),e.negative=t=>e.check(rX(0,t)),e.nonpositive=t=>e.check(rY(0,t)),e.multipleOf=(t,r)=>e.check(r3(t,r)),e.step=(t,r)=>e.check(r3(t,r)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function iX(e){return rC(iG,e)}let iY=x.$constructor("ZodNumberFormat",(e,t)=>{te.init(e,t),iG.init(e,t)});function iQ(e){return rT(iY,e)}function i0(e){return rE(iY,e)}
27function i1(e){return rA(iY,e)}function i4(e){return rD(iY,e)}function i2(e){return rj(iY,e)}let i6=x.$constructor("ZodBoolean",(e,t)=>{tt.init(e,t),ie.init(e,t)});function i3(e){return rP(i6,e)}let i9=x.$constructor("ZodBigInt",(e,t)=>{tr.init(e,t),ie.init(e,t),e.gte=(t,r)=>e.check(r0(t,r)),e.min=(t,r)=>e.check(r0(t,r)),e.gt=(t,r)=>e.check(rQ(t,r)),e.gte=(t,r)=>e.check(r0(t,r)),e.min=(t,r)=>e.check(r0(t,r)),e.lt=(t,r)=>e.check(rX(t,r)),e.lte=(t,r)=>e.check(rY(t,r)),e.max=(t,r)=>e.check(rY(t,r)),e.positive=t=>e.check(rQ(BigInt(0),t)),e.negative=t=>e.check(rX(BigInt(0),t)),e.nonpositive=t=>e.check(rY(BigInt(0),t)),e.nonnegative=t=>e.check(r0(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(r3(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function i5(e){return rM(i9,e)}let i7=x.$constructor("ZodBigIntFormat",(e,t)=>{tn.init(e,t),i9.init(e,t)});function i8(e){return rR(i7,e)}function oe(e){return rL(i7,e)}let ot=x.$constructor("ZodSymbol",(e,t)=>{ti.init(e,t),ie.init(e,t)});function or(e){return rU(ot,e)}let on=x.$constructor("ZodUndefined",(e,t)=>{to.init(e,t),ie.init(e,t)});function oi(e){return rV(on,e)}let oo=x.$constructor("ZodNull",(e,t)=>{ts.init(e,t),ie.init(e,t)});function oa(e){return rF(oo,e)}let ol=x.$constructor("ZodAny",(e,t)=>{ta.init(e,t),ie.init(e,t)});function ou(){return rB(ol)}let od=x.$constructor("ZodUnknown",(e,t)=>{tl.init(e,t),ie.init(e,t)});function oc(){return rH(od)}let op=x.$constructor("ZodNever",(e,t)=>{tu.init(e,t),ie.init(e,t)});function oh(e){return rW(op,e)}let of=x.$constructor("ZodVoid",(e,t)=>{td.init(e,t),ie.init(e,t)});function om(e){return rK(of,e)}let og=x.$constructor("ZodDate",(e,t)=>{tc.init(e,t),ie.init(e,t),e.min=(t,r)=>e.check(r0(t,r)),e.max=(t,r)=>e.check(rY(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function ov(e){return rJ(og,e)}let oy=x.$constructor("ZodArray",(e,t)=>{th.init(e,t),ie.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(ne(t,r)),e.nonempty=t=>e.check(ne(1,t)),e.max=(t,r)=>e.check(r8(t,r)),e.length=(t,r)=>e.check(nt(t,r)),e.unwrap=()=>e.element});function ob(e,t){return nm(oy,e,t)}function ox(e){return oB(Object.keys(e._zod.def.shape))}let ok=x.$constructor("ZodObject",(e,t)=>{tg.init(e,t),ie.init(e,t),es.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>oU(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:oc()}),e.loose=()=>e.clone({...e._zod.def,catchall:oc()}),e.strict=()=>e.clone({...e._zod.def,catchall:oh()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>es.extend(e,t),e.merge=t=>es.merge(e,t),e.pick=t=>es.pick(e,t),e.omit=t=>es.omit(e,t),e.partial=(...t)=>es.partial(oq,e,t[0]),e.required=(...t)=>es.required(o6,e,t[0])});function ow(e,t){return new ok({type:"object",get shape(){return es.assignProp(this,"shape",{...e}),this.shape},...es.normalizeParams(t)})}function o_(e,t){return new ok({type:"object",get shape(){return es.assignProp(this,"shape",{...e}),this.shape},catchall:oh(),...es.normalizeParams(t)})}function o$(e,t){return new ok({type:"object",get shape(){return es.assignProp(this,"shape",{...e}),this.shape},catchall:oc(),...es.normalizeParams(t)})}let oS=x.$constructor("ZodUnion",(e,t)=>{ty.init(e,t),ie.init(e,t),e.options=t.options});function oI(e,t){return new oS({type:"union",options:e,...es.normalizeParams(t)})}let oO=x.$constructor("ZodDiscriminatedUnion",(e,t)=>{oS.init(e,t),tb.init(e,t)});function oC(e,t,r){return new oO({type:"union",options:t,discriminator:e,...es.normalizeParams(r)})}let oN=x.$constructor("ZodIntersection",(e,t)=>{tx.init(e,t),ie.init(e,t)});function oT(e,t){return new oN({type:"intersection",left:e,right:t})}let oE=x.$constructor("ZodTuple",(e,t)=>{tw.init(e,t),ie.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function oA(e,t,r){let n=t instanceof eD,i=n?r:t;return new oE({type:"tuple",items:e,rest:n?t:null,...es.normalizeParams(i)})}let oD=x.$constructor("ZodRecord",(e,t)=>{t$.init(e,t),ie.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function oj(e,t,r){return new oD({type:"record",keyType:e,valueType:t,...es.normalizeParams(r)})}function oP(e,t,r){return new oD({type:"record",keyType:oI([e,oh()]),valueType:t,...es.normalizeParams(r)})}let oz=x.$constructor("ZodMap",(e,t)=>{tS.init(e,t),ie.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function oM(e,t,r){return new oz({type:"map",keyType:e,valueType:t,...es.normalizeParams(r)})}let oZ=x.$constructor("ZodSet",(e,t)=>{tO.init(e,t),ie.init(e,t),e.min=(...t)=>e.check(r5(...t)),e.nonempty=t=>e.check(r5(1,t)),e.max=(...t)=>e.check(r9(...t)),e.size=(...t)=>e.check(r7(...t))});function oR(e,t){return new oZ({type:"set",valueType:e,...es.normalizeParams(t)})}let oL=x.$constructor("ZodEnum",(e,t)=>{tN.init(e,t),ie.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new oL({...t,checks:[],...es.normalizeParams(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new oL({...t,checks:[],...es.normalizeParams(n),entries:i})}});function oU(e,t){return new oL({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...es.normalizeParams(t)})}function oV(e,t){return new oL({type:"enum",entries:e,...es.normalizeParams(t)})}let oF=x.$constructor("ZodLiteral",(e,t)=>{tT.init(e,t),ie.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if
27(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function oB(e,t){return new oF({type:"literal",values:Array.isArray(e)?e:[e],...es.normalizeParams(t)})}let oH=x.$constructor("ZodFile",(e,t)=>{tE.init(e,t),ie.init(e,t),e.min=(t,r)=>e.check(r5(t,r)),e.max=(t,r)=>e.check(r9(t,r)),e.mime=(t,r)=>e.check(nu(Array.isArray(t)?t:[t],r))});function oW(e){return nI(oH,e)}let oK=x.$constructor("ZodTransform",(e,t)=>{tA.init(e,t),ie.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=n=>{"string"==typeof n?r.issues.push(es.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),n.continue??(n.continue=!0),r.issues.push(es.issue(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r)):(r.value=i,r)}});function oJ(e){return new oK({type:"transform",transform:e})}let oq=x.$constructor("ZodOptional",(e,t)=>{tD.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function oG(e){return new oq({type:"optional",innerType:e})}let oX=x.$constructor("ZodNullable",(e,t)=>{tj.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function oY(e){return new oX({type:"nullable",innerType:e})}function oQ(e){return oG(oY(e))}let o0=x.$constructor("ZodDefault",(e,t)=>{tP.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function o1(e,t){return new o0({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})}let o4=x.$constructor("ZodPrefault",(e,t)=>{tM.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function o2(e,t){return new o4({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})}let o6=x.$constructor("ZodNonOptional",(e,t)=>{tZ.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function o3(e,t){return new o6({type:"nonoptional",innerType:e,...es.normalizeParams(t)})}let o9=x.$constructor("ZodSuccess",(e,t)=>{tL.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function o5(e){return new o9({type:"success",innerType:e})}let o7=x.$constructor("ZodCatch",(e,t)=>{tU.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function o8(e,t){return new o7({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}let se=x.$constructor("ZodNaN",(e,t)=>{tV.init(e,t),ie.init(e,t)});function st(e){return rG(se,e)}let sr=x.$constructor("ZodPipe",(e,t)=>{tF.init(e,t),ie.init(e,t),e.in=t.in,e.out=t.out});function sn(e,t){return new sr({type:"pipe",in:e,out:t})}let si=x.$constructor("ZodReadonly",(e,t)=>{tH.init(e,t),ie.init(e,t)});function so(e){return new si({type:"readonly",innerType:e})}let ss=x.$constructor("ZodTemplateLiteral",(e,t)=>{tK.init(e,t),ie.init(e,t)});function sa(e,t){return new ss({type:"template_literal",parts:e,...es.normalizeParams(t)})}let sl=x.$constructor("ZodLazy",(e,t)=>{tq.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.getter()});function su(e){return new sl({type:"lazy",getter:e})}let sd=x.$constructor("ZodPromise",(e,t)=>{tJ.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sc(e){return new sd({type:"promise",innerType:e})}let sp=x.$constructor("ZodCustom",(e,t)=>{tG.init(e,t),ie.init(e,t)});function sh(e){let t=new ea({check:"custom"});return t._zod.check=e,t}function sf(e,t){return nR(sp,e??(()=>!0),t)}function sm(e,t={}){return nL(sp,e,t)}function sg(e){let t=sh(r=>(r.addIssue=e=>{"string"==typeof e?r.issues.push(es.issue(e,r.value,t._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=r.value),e.inst??(e.inst=t),e.continue??(e.continue=!t._zod.def.abort),r.issues.push(es.issue(e)))},e(r.value,r)));return t}function sv(e,t={error:`Input not instance of ${e.name}`}){let r=new sp({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...es.normalizeParams(t)});return r._zod.bag.Class=e,r}let sy=(...e)=>nU({Pipe:sr,Boolean:i6,String:ir,Transform:oK},...e);function sb(e){let t=su(()=>oI([ii(e),iX(),i3(),oa(),ob(t),oj(ii(),t)]));return t}function sx(e,t){return sn(oJ(e),t)}e.i(362201),e.s([],342332),e.i(342332),e.s(["endsWith",0,na,"gt",0,rQ,"gte",0,r0,"includes",0,no,"length",0,nt,"lowercase",0,nn,"lt",0,rX,"lte",0,rY,"maxLength",0,r8,"maxSize",0,r9,"mime",0,nu,"minLength",0,ne,"minSize",0,r5,"multipleOf",0,r3,"negative",0,r4,"nonnegative",0,r6,"nonpositive",0,r2,"normalize",0,nc,"overwrite",0,nd,"positive",0,r1,"property",0,nl,"regex",0,nr,"size",0,r7,"startsWith",0,ns,"toLowerCase",0,nh,"toUpperCase",0,nf,"trim",0,np,"uppercase",0,ni],430421),e.i(430421),e.i(789282),e.i(100364);let sk={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invali
27d_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function sw(e){x.config({customError:e})}function s_(){return x.config().customError}e.s(["ZodIssueCode",0,sk,"getErrorMap",0,s_,"setErrorMap",0,sw],306034),e.i(306034),e.s(["$brand",()=>x.$brand,"ZodIssueCode",0,sk,"config",()=>x.config,"getErrorMap",0,s_,"setErrorMap",0,sw],458829),e.i(458829);var s$=e.i(49732);e.s(["bigint",0,function(e){return rZ(i9,e)},"boolean",0,function(e){return rz(i6,e)},"date",0,function(e){return rq(og,e)},"number",0,function(e){return rN(iG,e)},"string",0,function(e){return re(ir,e)}],313657);var sS=e.i(313657);e.s(["$brand",()=>x.$brand,"$input",0,t3,"$output",0,t6,"NEVER",()=>x.NEVER,"TimePrecision",0,r_,"ZodAny",0,ol,"ZodArray",0,oy,"ZodBase64",0,iL,"ZodBase64URL",0,iV,"ZodBigInt",0,i9,"ZodBigIntFormat",0,i7,"ZodBoolean",0,i6,"ZodCIDRv4",0,iz,"ZodCIDRv6",0,iZ,"ZodCUID",0,iw,"ZodCUID2",0,i$,"ZodCatch",0,o7,"ZodCustom",0,sp,"ZodCustomStringFormat",0,iJ,"ZodDate",0,og,"ZodDefault",0,o0,"ZodDiscriminatedUnion",0,oO,"ZodE164",0,iB,"ZodEmail",0,is,"ZodEmoji",0,iy,"ZodEnum",0,oL,"ZodError",0,n6,"ZodFile",0,oH,"ZodGUID",0,il,"ZodIPv4",0,iA,"ZodIPv6",0,ij,"ZodISODate",0,nX,"ZodISODateTime",0,nq,"ZodISODuration",0,n1,"ZodISOTime",0,nQ,"ZodIntersection",0,oN,"ZodIssueCode",0,sk,"ZodJWT",0,iW,"ZodKSUID",0,iT,"ZodLazy",0,sl,"ZodLiteral",0,oF,"ZodMap",0,oz,"ZodNaN",0,se,"ZodNanoID",0,ix,"ZodNever",0,op,"ZodNonOptional",0,o6,"ZodNull",0,oo,"ZodNullable",0,oX,"ZodNumber",0,iG,"ZodNumberFormat",0,iY,"ZodObject",0,ok,"ZodOptional",0,oq,"ZodPipe",0,sr,"ZodPrefault",0,o4,"ZodPromise",0,sd,"ZodReadonly",0,si,"ZodRealError",0,n3,"ZodRecord",0,oD,"ZodSet",0,oZ,"ZodString",0,ir,"ZodStringFormat",0,io,"ZodSuccess",0,o9,"ZodSymbol",0,ot,"ZodTemplateLiteral",0,ss,"ZodTransform",0,oK,"ZodTuple",0,oE,"ZodType",0,ie,"ZodULID",0,iI,"ZodURL",0,ig,"ZodUUID",0,id,"ZodUndefined",0,on,"ZodUnion",0,oS,"ZodUnknown",0,od,"ZodVoid",0,of,"ZodXID",0,iC,"_ZodString",0,it,"_default",0,o1,"any",0,ou,"array",0,ob,"base64",0,iU,"base64url",0,iF,"bigint",0,i5,"boolean",0,i3,"catch",0,o8,"check",0,sh,"cidrv4",0,i
27M,"cidrv6",0,iR,"clone",()=>es.clone,"coerce",0,sS,"config",()=>x.config,"core",0,nJ,"cuid",0,i_,"cuid2",0,iS,"custom",0,sf,"date",0,ov,"discriminatedUnion",0,oC,"e164",0,iH,"email",0,ia,"emoji",0,ib,"endsWith",0,na,"enum",0,oU,"file",0,oW,"flattenError",()=>w.flattenError,"float32",0,i0,"float64",0,i1,"formatError",()=>w.formatError,"function",0,nB,"getErrorMap",0,s_,"globalRegistry",0,t7,"gt",0,rQ,"gte",0,r0,"guid",0,iu,"includes",0,no,"instanceof",0,sv,"int",0,iQ,"int32",0,i4,"int64",0,i8,"intersection",0,oT,"ipv4",0,iD,"ipv6",0,iP,"iso",0,s$,"json",0,sb,"jwt",0,iK,"keyof",0,ox,"ksuid",0,iE,"lazy",0,su,"length",0,nt,"literal",0,oB,"locales",0,t2,"looseObject",0,o$,"lowercase",0,nn,"lt",0,rX,"lte",0,rY,"map",0,oM,"maxLength",0,r8,"maxSize",0,r9,"mime",0,nu,"minLength",0,ne,"minSize",0,r5,"multipleOf",0,r3,"nan",0,st,"nanoid",0,ik,"nativeEnum",0,oV,"negative",0,r4,"never",0,oh,"nonnegative",0,r6,"nonoptional",0,o3,"nonpositive",0,r2,"normalize",0,nc,"null",0,oa,"nullable",0,oY,"nullish",0,oQ,"number",0,iX,"object",0,ow,"optional",0,oG,"overwrite",0,nd,"parse",0,n9,"parseAsync",0,n5,"partialRecord",0,oP,"pipe",0,sn,"positive",0,r1,"prefault",0,o2,"preprocess",0,sx,"prettifyError",()=>w.prettifyError,"promise",0,sc,"property",0,nl,"readonly",0,so,"record",0,oj,"refine",0,sm,"regex",0,nr,"regexes",()=>tQ,"registry",0,t5,"safeParse",0,n7,"safeParseAsync",0,n8,"set",0,oR,"setErrorMap",0,sw,"size",0,r7,"startsWith",0,ns,"strictObject",0,o_,"string",0,ii,"stringFormat",0,iq,"stringbool",0,sy,"success",0,o5,"superRefine",0,sg,"symbol",0,or,"templateLiteral",0,sa,"toJSONSchema",0,nW,"toLowerCase",0,nh,"toUpperCase",0,nf,"transform",0,oJ,"treeifyError",()=>w.treeifyError,"trim",0,np,"tuple",0,oA,"uint32",0,i2,"uint64",0,oe,"ulid",0,iO,"undefined",0,oi,"union",0,oI,"unknown",0,oc,"uppercase",0,ni,"url",0,iv,"uuid",0,ic,"uuidv4",0,ip,"uuidv6",0,ih,"uuidv7",0,im,"void",0,om,"xid",0,iN],722219);var sI=e.i(722219);function sO(){return(sO=Object.assign.bind()).apply(null,arguments)}function sC(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sN(e,t){return(sN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}e.s(["z",0,sI],681307),e.i(247167);var sT=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function sE(e,t){if(e.length!==t.length)return!1;for(var r,n,i=0;i<e.length;i++)if(!((r=e[i])===(n=t[i])||sT(r)&&sT(n))&&1)return!1;return!0}let sA=function(e,t){void 0===t&&(t=sE);var r,n,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&r===this&&t(s,i)||(n=e.apply(this,s),o=!0,r=this,i=s),n}};var sD=e.i(271645),sj="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function sP(e){cancelAnimationFrame(e.id)}var sz=-1;function sM(e){if(void 0===e&&(e=!1),-1===sz||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),sz=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return sz}var sZ=null;function sR(e){if(void 0===e&&(e=!1),null===sZ||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?sZ="positive-descending":(t.scrollLeft=1,sZ=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t)}return sZ}var sL=function(e,t){return e},sU=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},sV=(n=(t={getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,r,n,i,o){var s=e.direction,a=e.height,l=e.itemCount,u=e.itemSize,d=e.layout,c=e.width,p="horizontal"===s||"horizontal"===d?c:a,h=Math.max(0,l*u-p),f=Math.min(h,t*u),m=Math.max(0,t*u-p+u+o);switch("smart"===r&&(r=n>=m-p&&n<=f+p?"auto":"center"),r){case"start":return f;case"end":return m;case"center":var g=Math.round(m+(f-m)/2);if(g<Math.ceil(p/2))return 0;if(g>h+Math.floor(p/2))return h;return g;default:if(n>=m&&n<=f)return n;if(n<m)return m;return f}},getStartIndexForOffset:function(e,t){return Math.max(0,Math.min(e.itemCount-1,Math.floor(t/e.itemSize)))},getStopIndexForStartIndex:function(e,t,r){var n=e.direction,i=e.he
27ight,o=e.itemCount,s=e.itemSize,a=e.layout,l=e.width,u=Math.ceil((("horizontal"===n||"horizontal"===a?l:i)+r-t*s)/s);return Math.max(0,Math.min(o-1,t+u-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}}).getItemOffset,i=t.getEstimatedTotalSize,o=t.getItemSize,s=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,l=t.getStopIndexForStartIndex,u=t.initInstanceProps,d=t.shouldResetStyleCacheOnItemSizeChange,c=t.validateProps,(r=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=u(r.props,sC(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:sC(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=sA(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=sA(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,s=i.direction,a=i.itemSize,l=i.layout,u=r._getItemStyleCache(d&&a,d&&l,d&&s);if(u.hasOwnProperty(e))t=u[e];else{var c=n(r.props,e,r._instanceProps),p=o(r.props,e,r._instanceProps),h="horizontal"===s||"horizontal"===l,f="rtl"===s,m=h?c:0;u[e]=t={position:"absolute",left:f?void 0:m,right:f?m:void 0,top:h?0:c,height:h?"100%":p,width:h?p:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=sA(function(e,t,r){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,s=i;if("rtl"===t)switch(sR()){case"negative":s=-i;break;case"positive-descending":s=o-n-i}return s=Math.max(0,Math.min(s,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n;null!==r._resetIsScrollingTimeoutId&&sP(r._resetIsScrollingTimeoutId),e=r._resetIsScrolling,t=sj(),r._resetIsScrollingTimeoutId=n={id:requestAnimationFrame(function r(){sj()-t>=150?e.call(null):n.id=requestAnimationFrame(r)})}},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}(r=t).prototype=Object.create((p=e).prototype),r.prototype.constructor=r,sN(r,p),t.getDerivedStateFromProps=function(e,t){return sU(e,t),c(e),null};var r,p,h=t.prototype;return h.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},h.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props,n=r.itemCount,i=r.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===i?l.scrollWidth>l.clientWidth?sM():0:l.scrollHeight>l.clientHeight?sM():0}this.scrollTo(s(this.props,e,t,o,this._instanceProps,a))},h.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,n=e.layout;if("number"==typeof r&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===n?i.scrollLeft=r:i.scrollTop=r}this._callPropsCallbacks()},h.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,n=this.state,i=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(sR()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var s=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-s-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},h.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&sP(this._resetIsScrollingTimeoutId)},h.render=function(){var e=this.props,t=e.children,r=e.className,n=e.direction,o=e.height,s=e.innerRef,a=e.innerElementType,l=e.innerTagName,u=e.itemCount,d=e.itemData,c=e.itemKey,p=void 0===c?sL:c,h=e.layout,f=e.outerElementType,m=e.outerTagName,g=e.style,v=e.useIsScrolling,y=e.width,b=this.state.isScrolling,x="horizontal"===n||"horizontal"===h,k=x?this._onScrollHorizontal:this._onScrollVertical,w=this._getRangeToRender(),_=w[0],$=w[1],S=[];if(u>0)for(var I=_;I<=$;
27I++)S.push((0,sD.createElement)(t,{data:d,key:p(I,d),index:I,isScrolling:v?b:void 0,style:this._getItemStyle(I)}));var O=i(this.props,this._instanceProps);return(0,sD.createElement)(f||m||"div",{className:r,onScroll:k,ref:this._outerRefSetter,style:sO({position:"relative",height:o,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:n},g)},(0,sD.createElement)(a||l||"div",{children:S,ref:s,style:{height:x?"100%":O,pointerEvents:b?"none":void 0,width:x?O:"100%"}}))},h._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],n=e[2],i=e[3];this._callOnItemsRendered(t,r,n,i)}if("function"==typeof this.props.onScroll){var o=this.state,s=o.scrollDirection,a=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(s,a,l)}},h._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,n=this.state,i=n.isScrolling,o=n.scrollDirection,s=n.scrollOffset;if(0===t)return[0,0,0,0];var u=a(this.props,s,this._instanceProps),d=l(this.props,u,s,this._instanceProps);return[Math.max(0,u-(i&&"backward"!==o?1:Math.max(1,r))),Math.max(0,Math.min(t-1,d+(i&&"forward"!==o?1:Math.max(1,r)))),u,d]},t}(sD.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},r);function sF(e){this.content=e}e.s(["FixedSizeList",0,sV],974559),sF.prototype={constructor:sF,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,r){var n=r&&r!=e?this.remove(r):this,i=n.find(e),o=n.content.slice();return -1==i?o.push(r||e,t):(o[i+1]=t,r&&(o[i]=r)),new sF(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var r=this.content.slice();return r.splice(t,2),new sF(r)},addToStart:function(e,t){return new sF([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var r=this.remove(e).content.slice();return r.push(e,t),new sF(r)},addBefore:function(e,t,r){var n=this.remove(t),i=n.content.slice(),o=n.find(e);return i.splice(-1==o?i.length:o,0,t,r),new sF(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=sF.from(e)).size?new sF(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=sF.from(e)).size?new sF(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=sF.from(e);for(var r=0;r<e.content.length;r+=2)t=t.remove(e.content[r]);return t},toObject:function(){var e={};return this.forEach(function(t,r){e[t]=r}),e},get size(){return this.content.length>>1}},sF.from=function(e){if(e instanceof sF)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new sF(t)};class sB{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,r,n=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==r(a,n+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),r,n+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,n){let i="",o=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?n?"function"==typeof n?n(s):n:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&r&&(o?o=!1:i+=r),i+=l},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,n=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(n[n.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)n.push(e.content[i]);return new sB(n,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let r=[],n=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),r.push(s),n+=s.nodeSize),o=a}return new sB(r,n)}cutByIndex(e,t){return e==t?sB.empty:0==e&&t==this.content.length?this:new sB(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;
27let n=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return n[e]=t,new sB(n,i)}addToStart(e){return new sB([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new sB(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 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 n=this.content[t];e(n,r,t),r+=n.nodeSize}}findDiffStart(e,t=0){return function e(t,r,n){for(let i=0;;i++){if(i==t.childCount||i==r.childCount)return t.childCount==r.childCount?null:n;let o=t.child(i),s=r.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)n++;return n}if(o.content.size||s.content.size){let t=e(o.content,s.content,n+1);if(null!=t)return t}n+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return function e(t,r,n,i){for(let o=t.childCount,s=r.childCount;;){if(0==o||0==s)return o==s?null:{a:n,b:i};let a=t.child(--o),l=r.child(--s),u=a.nodeSize;if(a==l){n-=u,i-=u;continue}if(!a.sameMarkup(l))return{a:n,b:i};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,i--;return{a:n,b:i}}if(a.content.size||l.content.size){let t=e(a.content,l.content,n-1,i-1);if(t)return t}n-=u,i-=u}}(this,e,t,r)}findIndex(e){if(0==e)return sW(0,e);if(e==this.size)return sW(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let n=r+this.child(t).nodeSize;if(n>=e){if(n==e)return sW(t+1,n);return sW(t,r)}r=n}}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 sB.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return sB.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return sB.empty;let t,r=0;for(let n=0;n<e.length;n++){let i=e[n];r+=i.nodeSize,n&&i.isText&&e[n-1].sameMarkup(i)?(t||(t=e.slice(0,n)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new sB(t||e,r)}static from(e){if(!e)return sB.empty;if(e instanceof sB)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new sB([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}sB.empty=new sB([],0);let sH={index:0,offset:0};function sW(e,t){return sH.index=e,sH.offset=t,sH}function sK(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let r=Array.isArray(e);if(Array.isArray(t)!=r)return!1;if(r){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!sK(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!sK(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class sJ{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let n=0;n<e.length;n++){let i=e[n];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,n));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,n)),t.push(this),r=!0),t&&t.push(i)}}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&&sK(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 RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw RangeError(`There is no mark type ${t.type} in this schema`);let n=r.create(t.attrs);return r.checkAttrs(n.attrs),n}static sameSet(e,t){if(e==t)return!0;
27if(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)&&0==e.length)return sJ.none;if(e instanceof sJ)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}sJ.none=[];class sq extends Error{}class sG{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=function e(t,r,n,i,o,s){let{index:a,offset:l}=t.findIndex(r),u=t.maybeChild(a);if(l==r||u.isText)return s&&i<=0&&o<=0&&!s.canReplace(a,a,n)?null:t.cut(0,r).append(n).append(t.cut(r));let d=e(u.content,r-l-1,n,0==a?i-1:0,a==t.childCount-1?o-1:0,u);return d&&t.replaceChild(a,u.copy(d))}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new sG(r,this.openStart,this.openEnd)}removeBetween(e,t){return new sG(function e(t,r,n){let{index:i,offset:o}=t.findIndex(r),s=t.maybeChild(i),{index:a,offset:l}=t.findIndex(n);if(o==r||s.isText){if(l!=n&&!t.child(a).isText)throw RangeError("Removing non-flat range");return t.cut(0,r).append(t.cut(n))}if(i!=a)throw RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,r-o-1,n-o-1)))}(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 sG.empty;let r=t.openStart||0,n=t.openEnd||0;if("number"!=typeof r||"number"!=typeof n)throw RangeError("Invalid input for Slice.fromJSON");return new sG(sB.fromJSON(e,t.content),r,n)}static maxOpen(e,t=!0){let r=0,n=0;for(let n=e.firstChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.firstChild)r++;for(let r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)n++;return new sG(e,r,n)}}function sX(e,t){if(!t.type.compatibleContent(e.type))throw new sq("Cannot join "+t.type.name+" onto "+e.type.name)}function sY(e,t,r){let n=e.node(r);return sX(n,t.node(r)),n}function sQ(e,t){let r=t.length-1;r>=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function s0(e,t,r,n){let i=(t||e).node(r),o=0,s=t?t.index(r):i.childCount;e&&(o=e.index(r),e.depth>r?o++:e.textOffset&&(sQ(e.nodeAfter,n),o++));for(let e=o;e<s;e++)sQ(i.child(e),n);t&&t.depth==r&&t.textOffset&&sQ(t.nodeBefore,n)}function s1(e,t){return e.type.checkContent(t),e.copy(t)}function s4(e,t,r){let n=[];return s0(null,e,r,n),e.depth>r&&sQ(s1(sY(e,t,r+1),s4(e,t,r+1)),n),s0(t,null,r,n),new sB(n)}sG.empty=new sG(sB.empty,0,0);class s2{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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],n=e.child(t);return r?e.child(t).cut(r):n}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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],n=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)n+=r.child(t).nodeSize;return n}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return sJ.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),n=e.maybeChild(t);if(!r){let e=r;r=n,n=e}let i=r.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||n&&i[o].isInSet(n.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,n=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)!1!==r[i].type.spec.inclusive||n&&r[i].isInSet(n.marks)||(r=r[i--].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 s5(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 RangeError("Position "+t+" out of range");let r=[],n=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(r.push(t,e,n+o),!s||(t=t.child(e)).isText)break;
27i=s-1,n+=o+1}return new s2(t,r,i)}static resolveCached(e,t){let r=s9.get(e);if(r)for(let e=0;e<r.elts.length;e++){let n=r.elts[e];if(n.pos==t)return n}else s9.set(e,r=new s6);let n=r.elts[r.i]=s2.resolve(e,t);return r.i=(r.i+1)%s3,n}}class s6{constructor(){this.elts=[],this.i=0}}let s3=12,s9=new WeakMap;class s5{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)}}let s7=Object.create(null);class s8{constructor(e,t,r,n=sJ.none){this.type=e,this.attrs=t,this.marks=n,this.content=r||sB.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,n=0){this.content.nodesBetween(e,t,r,n,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,n){return this.content.textBetween(e,t,r,n)}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&&sK(this.attrs,t||e.defaultAttrs||s7)&&sJ.sameSet(this.marks,r||sJ.none)}copy(e=null){return e==this.content?this:new s8(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new s8(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return sG.empty;let n=this.resolve(e),i=this.resolve(t),o=r?0:n.sharedDepth(t),s=n.start(o);return new sG(n.node(o).content.cut(n.pos-s,i.pos-s),n.depth-o,i.depth-o)}replace(e,t,r){var n=this.resolve(e),i=this.resolve(t);if(r.openStart>n.depth)throw new sq("Inserted content deeper than insertion position");if(n.depth-r.openStart!=i.depth-r.openEnd)throw new sq("Inconsistent open depths");return function e(t,r,n,i){let o=t.index(i),s=t.node(i);if(o==r.index(i)&&i<t.depth-n.openStart){let a=e(t,r,n,i+1);return s.copy(s.content.replaceChild(o,a))}if(!n.content.size)return s1(s,s4(t,r,i));if(n.openStart||n.openEnd||t.depth!=i||r.depth!=i){let{start:e,end:o}=function(e,t){let r=t.depth-e.openStart,n=t.node(r).copy(e.content);for(let e=r-1;e>=0;e--)n=t.node(e).copy(sB.from(n));return{start:n.resolveNoCache(e.openStart+r),end:n.resolveNoCache(n.content.size-e.openEnd-r)}}(n,t);return s1(s,function e(t,r,n,i,o){let s=t.depth>o&&sY(t,r,o+1),a=i.depth>o&&sY(n,i,o+1),l=[];return s0(null,t,o,l),s&&a&&r.index(o)==n.index(o)?(sX(s,a),sQ(s1(s,e(t,r,n,i,o+1)),l)):(s&&sQ(s1(s,s4(t,r,o+1)),l),s0(r,n,o,l),a&&sQ(s1(a,s4(n,i,o+1)),l)),s0(i,null,o,l),new sB(l)}(t,e,o,r,i))}{let e=t.parent,i=e.content;return s1(e,i.cut(0,t.parentOffset).append(n.content).append(i.cut(r.parentOffset)))}}(n,i,r,0)}nodeAt(e){for(let t=this;;){let{index:r,offset:n}=t.content.findIndex(e);if(!(t=t.maybeChild(r)))return null;if(n==e||t.isText)return t;e-=n+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(0==e)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 n=this.content.child(t-1);return{node:n,index:t-1,offset:r-n.nodeSize}}resolve(e){return s2.resolveCached(this,e)}resolveNoCache(e){return s2.resolve(this,e)}rangeHasMark(e,t,r){let n=!1;return t>e&&this.nodesBetween(e,t,e=>(r.isInSet(e.marks)&&(n=!0),!n)),n}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}
27toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),at(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=sB.empty,n=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,n,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=n;e<i;e++)if(!this.type.allowsMarks(r.child(e).marks))return!1;return!0}canReplaceWith(e,t,r,n){if(n&&!this.type.allowsMarks(n))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}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=sJ.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(!sJ.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.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(e=>e.toJSON())),e}static fromJSON(e,t){let r;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,r)}let n=sB.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,n,r);return i.type.checkAttrs(i.attrs),i}}s8.prototype.text=void 0;class ae extends s8{constructor(e,t,r,n){if(super(e,t,null,n),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):at(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 ae(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ae(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 at(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class ar{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var r;let n,i=new an(e,t);if(null==i.next)return ar.empty;let o=function e(t){let r=[];do r.push(function(t){let r=[];do r.push(function(t){let r=function(t){if(t.eat("(")){let r=e(t);return t.eat(")")||t.err("Missing closing paren"),r}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let i=[];for(let e in r){let n=r[e];n.isInGroup(t)&&i.push(n)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))r={type:"plus",expr:r};else if(t.eat("*"))r={type:"star",expr:r};else if(t.eat("?"))r={type:"opt",expr:r};else if(t.eat("{"))r=function(e,t){let r=ai(e),n=r;return e.eat(",")&&(n="}"!=e.next?ai(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}(t,r);else break;return r}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==r.length?r[0]:{type:"seq",exprs:r}}(t));while(t.eat("|"))return 1==r.length?r[0]:{type:"choice",exprs:r}}(i);i.next&&i.err("Unexpected trailing text");let s=(r=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(e(r,o)),[]);if("seq"==t.type)for(let n=0;;n++){let s=e(t.exprs[n],o);if(n==t.exprs.length-1)return s;i(s,o=r())}else if("star"==t.type){let s=r();return n(o,s),i(e(t.expr,s),s),[n(s)]}else if("plus"==t.type){let s=r();return i(e(t.expr,o),s),i(e(t.expr,s),s),[n(s)]}else if("opt"==t.type)return[n(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let n=0;n<t.min;n++){let n=r();i(e(t.expr,s),n),s=n}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;
27o++){let o=r();n(s,o),i(e(t.expr,s),o),s=o}return[n(s)]}else if("name"==t.type)return[n(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),r()),t;function r(){return t.push([])-1}function n(e,r,n){let i={term:n,to:r};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}}(o),n=Object.create(null),function e(t){let i=[];t.forEach(e=>{r[e].forEach(({term:e,to:t})=>{let n;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(n=i[t][1]);as(r,t).forEach(t=>{n||i.push([e,n=[]]),-1==n.indexOf(t)&&n.push(t)})}})});let o=n[t.join(",")]=new ar(t.indexOf(r.length-1)>-1);for(let t=0;t<i.length;t++){let r=i[t][1].sort(ao);o.next.push({type:i[t][0],next:n[r.join(",")]||e(r)})}return o}(as(r,0)));return function(e,t){for(let r=0,n=[e];r<n.length;r++){let e=n[r],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:r,next:s}=e.next[t];o.push(r.name),i&&!(r.isText||r.hasRequiredAttrs())&&(i=!1),-1==n.indexOf(s)&&n.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}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 n=this;for(let i=t;n&&i<r;i++)n=n.matchType(e.child(i).type);return n}get inlineContent(){return 0!=this.next.length&&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 n=[this];return function i(o,s){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return sB.from(s.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:r}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==n.indexOf(r)){n.push(r);let e=i(r,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+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 n=r.shift(),i=n.match;if(i.matchType(e)){let e=[];for(let t=n;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||n.type&&!s.validEnd||(r.push({match:o.contentMatch,type:o,via:n}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(r){e.push(r);for(let n=0;n<r.next.length;n++)-1==e.indexOf(r.next[n].next)&&t(r.next[n].next)}(this),e.map((t,r)=>{let n=r+(t.validEnd?"*":" ")+" ";for(let r=0;r<t.next.length;r++)n+=(r?", ":"")+t.next[r].type.name+"->"+e.indexOf(t.next[r].next);return n}).join("\n")}}ar.empty=new ar(!0);class an{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 SyntaxError(e+" (in content expression '"+this.string+"')")}}function ai(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function ao(e,t){return t-e}function as(e,t){let r=[];return function t(n){let i=e[n];if(1==i.length&&!i[0].term)return t(i[0].to);r.push(n);for(let e=0;e<i.length;e++){let{term:n,to:o}=i[e];n||-1!=r.indexOf(o)||t(o)}}(t),r.sort(ao)}function aa(e){let t=Object.create(null);for(let r in e){let n=e[r];if(!n.hasDefault)return null;t[r]=n.default}return t}function al(e,t){let r=Object.create(null);for(let n in e){let i=t&&t[n];if(void 0===i){let t=e[n];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function au(e,t,r,n){for(let n in t)if(!(n in e))throw RangeError(`Unsupported attribute ${n} for ${r} of type ${n}`);for(let r in e){let n=e[r];
27n.validate&&n.validate(t[r])}}function ad(e,t){let r=Object.create(null);if(t)for(let n in t)r[n]=new ap(e,n,t[n]);return r}class ac{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=ad(e,r.attrs),this.defaultAttrs=aa(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ar.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:al(this.attrs,e)}create(e=null,t,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new s8(this,this.computeAttrs(e),sB.from(t),sJ.setFrom(r))}createChecked(e=null,t,r){return t=sB.from(t),this.checkContent(t),new s8(this,this.computeAttrs(e),t,sJ.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=sB.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let n=this.contentMatch.matchFragment(t),i=n&&n.fillBefore(sB.empty,!0);return i?new s8(this,e,t.append(i),sJ.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){au(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;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:sJ.none:e}static compile(e,t){let r=Object.create(null);e.forEach((e,n)=>r[e]=new ac(e,t,n));let n=t.spec.topNode||"doc";if(!r[n])throw RangeError("Schema is missing its top node type ('"+n+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}}class ap{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?function(e,t,r){let n=r.split("|");return r=>{let i=null===r?"null":typeof r;if(0>n.indexOf(i))throw RangeError(`Expected value of type ${n} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ah{constructor(e,t,r,n){this.name=e,this.rank=t,this.schema=r,this.spec=n,this.attrs=ad(e,n.attrs),this.excluded=null;let i=aa(this.attrs);this.instance=i?new sJ(this,i):null}create(e=null){return!e&&this.instance?this.instance:new sJ(this,al(this.attrs,e))}static compile(e,t){let r=Object.create(null),n=0;return e.forEach((e,i)=>r[e]=new ah(e,n++,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){au(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class af{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=sF.from(e.nodes),t.marks=sF.from(e.marks||{}),this.nodes=ac.compile(this.spec.nodes,this),this.marks=ah.compile(this.spec.marks,this);let r=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],n=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=r[n]||(r[n]=ar.parse(n,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?am(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],r=t.spec.excludes;t.excluded=null==r?[t]:""==r?[]:am(this,r.split(" "))}this.nodeFromJSON=e=>s8.fromJSON(this,e),this.markFromJSON=e=>sJ.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,n){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof ac){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,r,n)}text(e,t){let r=this.nodes.text;return new ae(r,r.defaultAttrs,e,sJ.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function am(e,t){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=e.marks[i],s=o;if(o)r.push(o);else for(let t in e.marks){let n=e.marks[t];("_"==i||n.spec.group&&n.spec.group.split(" ").indexOf(i)>-1)&&r.push(s=n)}if(!s)throw SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}class ag{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];
27t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>r.indexOf(t)&&r.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let r=e.nodes[t.node];return r.contentMatch.matchType(r)})}parse(e,t={}){let r=new aw(this,t,!1);return r.addAll(e,sJ.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new aw(this,t,!0);return r.addAll(e,sJ.none,t.from,t.to),sG.maxOpen(r.finish())}matchTag(e,t,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){var n,i;let r=this.tags[o];if(n=e,i=r.tag,(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,i)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}matchStyle(e,t,r,n){for(let i=n?this.styles.indexOf(n)+1:0;i<this.styles.length;i++){let n=this.styles[i],o=n.style;if(0==o.indexOf(e)&&(!n.context||r.matchesContext(n.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}static schemaRules(e){let t=[];function r(e){let r=null==e.priority?50:e.priority,n=0;for(;n<t.length;n++){let e=t[n];if((null==e.priority?50:e.priority)<r)break}t.splice(n,0,e)}for(let t in e.marks){let n=e.marks[t].spec.parseDOM;n&&n.forEach(e=>{r(e=a_(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let n=e.nodes[t].spec.parseDOM;n&&n.forEach(e=>{r(e=a_(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ag(e,ag.schemaRules(e)))}}let av={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},ay={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ab={ol:!0,ul:!0};function ax(e,t,r){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&r}class ak{constructor(e,t,r,n,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=n,this.options=o,this.content=[],this.activeMarks=sJ.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(sB.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,r;return(r=t.findWrapping(e.type))?(this.match=t,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=sB.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(sB.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&&!av.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class aw{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let n=t.topNode,i,o=ax(null,t.preserveWhitespace,0)|4*!!r;i=n?new ak(n.type,n.attrs,sJ.none,!0,t.topMatch||n.type.contentMatch,o):r?new ak(null,null,sJ.none,!0,null,o):new ak(e.schema.topNodeType,null,sJ.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,n=this.top,i=2&n.options?"full":this.localPreserveWS||(1&n.options)>0,{schema:o}=this.parser;if("full"===i||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if("full"===i)r=r.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=r.split(/\r?\n|\r/);for(let r=0;r<e.length;r++)r&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[r]&&this.insertNode(o.text(e[r]),t,!/\S/.test(e[r]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let t=n.content[n.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let n=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;ab.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;
27e&&ab.hasOwnProperty(e)&&r?(r.appendChild(t),t=r):"li"==e?r=t:e&&(r=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,r));e:if(a?a.ignore:ay.hasOwnProperty(o))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 r,n=this.needsBlock;if(av.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),r=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=a&&a.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),r&&this.sync(i),this.needsBlock=n}else{let r=this.readStyles(e,t);r&&this.addElementByRule(e,a,r,!1===a.consuming?s:void 0)}this.localPreserveWS=n}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||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 e=0;e<this.parser.matchedStyles.length;e++){let n=this.parser.matchedStyles[e],i=r.getPropertyValue(n);if(i)for(let e;;){let r=this.parser.matchStyle(n,i,this,e);if(!r)break;if(r.ignore)return null;if(t=r.clearMark?t.filter(e=>!r.clearMark(e)):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1===r.consuming)e=r;else break}}return t}addElementByRule(e,t,r,n){let i,o;
27if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),r,"BR"==e.nodeName)||this.leafFallback(e,r);else{let e=this.enter(o,t.attrs||null,r,t.preserveWhitespace);e&&(i=!0,r=e)}else{let e=this.parser.schema.marks[t.mark];r=r.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,r,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,r,!1));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n,r),this.findAround(e,n,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,r,n){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,s=null==n?null:e.childNodes[n];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let n,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!n||n.length>a.length+o)&&(n=a,i=s,!a.length))break;if(s.solid){if(r)break;o+=2}}if(!n)return null;this.sync(i);for(let e=0;e<n.length;e++)t=this.enterInner(n[e],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let n=this.findPlace(e,t,r);if(n){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let r=sJ.none;for(let i of n.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):a$(i.type,e.type))&&(r=i.addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r,n){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,n)),i}enterInner(e,t,r,n=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=ax(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=sJ.none;return r=r.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!a$(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new ak(e,t,a,n,null,s)),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;else this.localPreserveWS&&(this.nodes[t].options|=1);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 t=r.length-1;t>=0;t--)e+=r[t].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++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==e.nodeType&&e.contains(this.find[n].node)&&t.compareDocumentPosition(this.find[n].node)&(r?2:4)&&(this.find[n].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,n=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+ +!n,o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&n?this.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return o(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 e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];
27if(t.isTextblock&&t.defaultAttrs)return t}}}function a_(e){let t={};for(let r in e)t[r]=e[r];return t}function a$(e,t){let r=t.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let r=0;r<e.edgeCount;r++){let{type:n,next:i}=e.edge(r);if(n==t||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class aS{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=aO(t).createDocumentFragment());let n=r,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let r=0,o=0;for(;r<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[r][0])||!1===t.type.spec.spanning)break;r++,o++}for(;r<i.length;)n=i.pop()[1];for(;o<e.marks.length;){let r=e.marks[o++],s=this.serializeMark(r,e.isInline,t);s&&(i.push([r,n]),n.appendChild(s.dom),n=s.contentDOM||s.dom)}}n.appendChild(this.serializeNodeInner(e,t))}),r}serializeNodeInner(e,t){if(e.isText)return aO(t).createTextNode(e.text);let{dom:r,contentDOM:n}=aN(aO(t),this.nodes[e.type.name](e),null,e.attrs);if(n){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,n)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let n=e.marks.length-1;n>=0;n--){let i=this.serializeMark(e.marks[n],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let n=this.marks[e.type.name];return n&&aN(aO(r),n(e,t),null,e.attrs)}static renderSpec(e,t,r=null,n){return"string"==typeof t?{dom:e.createTextNode(t)}:aN(e,t,r,n)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new aS(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=aI(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return aI(e.marks)}}function aI(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function aO(e){return e.document||window.document}let aC=new WeakMap;function aN(e,t,r,n){let i,o,s;if(3==t.nodeType)return{dom:t};if(t.dom&&3==t.dom.nodeType)return t;let a=t[0],l;if("string"!=typeof a)throw RangeError("Invalid array passed to renderSpec");if(n&&(void 0===(o=aC.get(n))&&aC.set(n,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let r=0;r<t.length;r++)e(t[r]);else for(let r in t)e(t[r])}(n),o=s)),l=o)&&l.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let u=a.indexOf(" ");u>0&&(r=a.slice(0,u),a=a.slice(u+1));let d=r?e.createElementNS(r,a):e.createElement(a),c=t[1],p=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){for(let e in p=2,c)if(null!=c[e]){let t=e.indexOf(" ");t>0?d.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&d.style?d.style.cssText=c[e]:d.setAttribute(e,c[e])}}for(let o=p;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}if("string"==typeof s)d.appendChild(e.createTextNode(s));else{let{dom:t,contentDOM:o}=aN(e,s,r,n);if(d.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:d,contentDOM:i}}class aT{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class aE{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&aE.empty)return aE.empty}recover(e){let t=0,r=65535&e;if(!this.inverted)for(let e=0;e<r;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*r]+t+(e-(65535&e))/65536}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 n=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?n:0);if(a>e)break;let l=this.ranges[s+i],u=this.ranges[s+o],d=a+l;if(e<=d){let i=l?e==a?-1:e==d?1:t:t,o=a+n+(i<0?0:u);if(r)return o;
27let c=e==(t<0?a:d)?null:s/3+(e-a)*65536,p=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(p|=8),new aT(o,p,c)}n+=u-l}return r?e+n:new aT(e+n,0,null)}touches(e,t){let r=0,n=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?r:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*n)return!0;r+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let n=0,i=0;n<this.ranges.length;n+=3){let o=this.ranges[n],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[n+t],u=this.ranges[n+r];e(s,s+l,a,a+u),i+=u-l}}invert(){return new aE(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?aE.empty:new aE(e<0?[0,-e,0]:[0,0,e])}}aE.empty=new aE([]);class aA{constructor(e,t,r=0,n=e?e.length:0){this.mirror=t,this.from=r,this.to=n,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new aA(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),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let n=e.getMirror(t);this.appendMap(e._maps[t],null!=n&&n<t?r+n: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 n=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=n&&n>t?r-n-1:void 0)}}invert(){let e=new aA;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 n=0;for(let r=this.from;r<this.to;r++){let i=this._maps[r].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(r);if(null!=t&&t>r&&t<this.to){r=t,e=this._maps[t].recover(i.recover);continue}}n|=i.delInfo,e=i.pos}return r?e:new aT(e,n,null)}}let aD=Object.create(null);class aj{getMap(){return aE.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=aD[t.stepType];if(!r)throw RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in aD)throw RangeError("Duplicate use of step JSON ID "+e);return aD[e]=t,t.prototype.jsonID=e,t}}class aP{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new aP(e,null)}static fail(e){return new aP(null,e)}static fromReplace(e,t,r,n){try{return aP.ok(e.replace(t,r,n))}catch(e){if(e instanceof sq)return aP.fail(e.message);throw e}}}function az(e,t,r){let n=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(az(o.content,t,o))),o.isInline&&(o=t(o,r,i)),n.push(o)}return sB.fromArray(n)}class aM extends aj{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),n=r.node(r.sharedDepth(this.to)),i=new sG(az(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,n),t.openStart,t.openEnd);return aP.fromReplace(e,this.from,this.to,i)}invert(){return new aZ(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 aM(t.pos,r.pos,this.mark)}merge(e){return e instanceof aM&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new aM(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("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new aM(t.from,t.to,e.markFromJSON(t.mark))}}aj.jsonID("addMark",aM);class aZ extends aj{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 sG(az(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return aP.fromReplace(e,this.from,this.to,r)}invert(){return new aM(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 aZ(t.pos,r.pos,this.mark)}merge(e){return e instanceof aZ&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new aZ(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("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new aZ(t.from,t.to,e.markFromJSON(t.mark))}}aj.jsonID("removeMark",aZ);class aR extends aj{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return aP.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return aP.fromReplace(e,this.pos,this.pos+1,new sG(sB.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let r=0;r<t.marks.length;r++)if(!t.marks[r].isInSet(e))return new aR(this.pos,t.marks[r]);return new aR(this.pos,this.mark)}}return new aL(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new aR(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new aR(t.pos,e.markFromJSON(t.mark))}}aj.jsonID("addNodeMark",aR);class aL extends aj{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return aP.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return aP.fromReplace(e,this.pos,this.pos+1,new sG(sB.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new aR(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new aL(t.pos,this.mark)}
27toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new aL(t.pos,e.markFromJSON(t.mark))}}aj.jsonID("removeNodeMark",aL);class aU extends aj{constructor(e,t,r,n=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=n}apply(e){return this.structure&&aF(e,this.from,this.to)?aP.fail("Structure replace would overwrite content"):aP.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new aE([this.from,this.to-this.from,this.slice.size])}invert(e){return new aU(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&aU.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new aU(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof aU)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?sG.empty:new sG(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new aU(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?sG.empty:new sG(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new aU(this.from,this.to+(e.to-e.from),t,this.structure)}}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("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new aU(t.from,t.to,sG.fromJSON(e,t.slice),!!t.structure)}}aU.MAP_BIAS=1,aj.jsonID("replace",aU);class aV extends aj{constructor(e,t,r,n,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=n,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(aF(e,this.from,this.gapFrom)||aF(e,this.gapTo,this.to)))return aP.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return aP.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?aP.fromReplace(e,this.from,this.to,r):aP.fail("Content does not fit in gap")}getMap(){return new aE([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 aV(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),n=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||n<t.pos||i>r.pos?null:new aV(t.pos,r.pos,n,i,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("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new aV(t.from,t.to,t.gapFrom,t.gapTo,sG.fromJSON(e,t.slice),t.insert,!!t.structure)}}function aF(e,t,r){let n=e.resolve(t),i=r-t,o=n.depth;for(;i>0&&o>0&&n.indexAfter(o)==n.node(o).childCount;)o--,i--;if(i>0){let e=n.node(o).maybeChild(n.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function aB(e,t,r,n=r.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<o.childCount;t++){let l=o.child(t),u=a+l.nodeSize,d=n.matchType(l.type);if(d){n=d;for(let t=0;t<l.marks.length;t++)r.allowsMarkType(l.marks[t].type)||e.step(new aZ(a,u,l.marks[t]));if(i&&l.isText&&"pre"!=r.whitespace){let e,t=/\r?\n|\r/g,n;for(;e=t.exec(l.text);)n||(n=new sG(sB.from(r.schema.text(" ",r.allowedMarks(l.marks))),0,0)),s.push(new aU(a+e.index,a+e.index+e[0].length,n))}}else s.push(new aU(a,u,sG.empty));a=u}if(!n.validEnd){let t=n.fillBefore(sB.empty,!0);e.replace(a,a,new sG(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function aH(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,n=0,i=0;;--r){let o=e.$from.node(r),s=e.$from.index(r)+n,a=e.$to.indexAfter(r)-i;if(r<e.depth&&o.canReplace(s,a,t))return r;if(0==r||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(a==o.childCount||o.canReplace(0,a))))break;s&&(n=1),a<o.childCount&&(i=1)}return null}function aW(e,t,r=null,n=e){let i=function(e,t){let{parent:r,startIndex:n,endIndex:i}=e,o=r.contentMatchAt(n).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return r.canReplaceWith(n,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:r,startIndex:n,endIndex:i}=e,o=r.child(n),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=n;a&&e<i;e++)a=a.matchType(r.child(e).type);return a&&a.validEnd?s:null}(n,t);return o?i.map(aK).concat({type:t,attrs:r}).concat(o.map(aK)):null}function aK(e){return{type:e,attrs:null}}function aJ(e,t,r,n){t.forEach((i,o)=>
27{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let i=e.mapping.slice(n).map(r+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function aq(e,t,r,n){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(n).map(r+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function aG(e,t,r=1,n){let i=e.resolve(t),o=i.depth-r,s=n&&n[n.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=r-2;e>o;e--,t--){let r=i.node(e),o=i.index(e);if(r.type.spec.isolating)return!1;let s=r.content.cutByIndex(o,r.childCount),a=n&&n[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=n&&n[t]||r;if(!r.canReplace(o+1,r.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(o),l=n&&n[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function aX(e,t){let r=e.resolve(t),n=r.index();return aY(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function aY(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let r=e.contentMatchAt(e.childCount),{linebreakReplacement:n}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==n?e.type.schema.nodes.text:o.type;if(!(r=r.matchType(s))||!e.type.allowsMarks(o.marks))return!1}return r.validEnd}(e,t))}function aQ(e,t,r=-1){let n=e.resolve(t);for(let e=n.depth;;e--){let i,o,s=n.index(e);if(e==n.depth?(i=n.nodeBefore,o=n.nodeAfter):r>0?(i=n.node(e+1),s++,o=n.node(e).maybeChild(s)):(i=n.node(e).maybeChild(s-1),o=n.node(e+1)),i&&!i.isTextblock&&aY(i,o)&&n.node(e).canReplace(s,s+1))return t;if(0==e)break;t=r<0?n.before(e):n.after(e)}}function a0(e,t,r){let n=e.resolve(t);if(!r.content.size)return t;let i=r.content;for(let e=0;e<r.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==r.openStart&&r.size?2:1);e++)for(let t=n.depth;t>=0;t--){let r=t==n.depth?0:n.pos<=(n.start(t+1)+n.end(t+1))/2?-1:1,o=n.index(t)+ +(r>0),s=n.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==r?n.pos:r<0?n.before(t+1):n.after(t+1)}return null}function a1(e,t,r=t,n=sG.empty){if(t==r&&!n.size)return null;let i=e.resolve(t),o=e.resolve(r);return a4(i,o,n)?new aU(t,r,n):new a2(i,o,n).fit()}function a4(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}aj.jsonID("replaceAround",aV);class a2{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=sB.empty;for(let t=0;t<=e.depth;t++){let r=e.node(t);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=sB.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,n=this.close(e<0?this.$to:r.doc.resolve(e));if(!n)return null;let i=this.placed,o=r.depth,s=n.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new sG(i,o,s);return e>-1?new aV(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new aU(r.pos,n.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,n=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(n=0),i.type.spec.isolating&&n<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=1==t?e:this.unplaced.openStart;r>=0;r--){let e=null,n=(r?(e=a9(this.unplaced.content,r-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:o,match:s}=this.frontier[i],a,l=null;if(1==t&&(n?s.matchType(n.type)||(l=s.fillBefore(sB.from(n),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:r,frontierDepth:i,parent:e,inject:l};if(2==t&&n&&(a=s.findWrapping(n.type)))return{sliceDepth:r,frontierDepth:i,parent:e,wrap:a};if(e&&s.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=a9(e,t);return!!n.childCount&&!n.firstChild.isLeaf&&(this.unplaced=new sG(e,t+1,Math.max(r,n.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=a9(e,t);if(n.childCount<=1&&t>0){let i=e.size-t<=t+n.size;this.unplaced=new sG(a6(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new sG(a6(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:n,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=r?r.content:o.content,a=o.openStart-e,l=0,u=[],{match:d,type:c}=this.frontier[t];if(n){for(let e=0;e<n.childCount;e++)u.push(n.child(e));d=d.matchFragment(n)}let p=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=d.matchType(e.type);if(!t)break;(++l>
vendor: 4,230 bytes, line 27
271||0==a||e.content.size)&&(d=t,u.push(function e(t,r,n){if(r<=0)return t;let i=t.content;return r>1&&(i=i.replaceChild(0,e(i.firstChild,r-1,1==i.childCount?n-1:0))),r>0&&(i=t.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(sB.empty,!0)))),t.copy(i)}(e.mark(c.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=a3(this.placed,t,sB.from(u)),this.frontier[t].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?sG.empty:new sG(a6(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new sG(a6(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!a5(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,n=this.$to.after(r);for(;r>1&&n==this.$to.end(--r);)++n;return n}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:n}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=a5(e,t,n,r,i);if(o){for(let r=t-1;r>=0;r--){let{match:t,type:n}=this.frontier[r],i=a5(e,r,n,t,!0);if(!i||i.childCount)continue t}return{depth:t,fit:o,move:i?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=a3(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let t=e.node(r),n=t.type.contentMatch.fillBefore(t.content,!0,e.index(r));this.openFrontierNode(t.type,t.attrs,n)}return e}openFrontierNode(e,t=null,r){let n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=a3(this.placed,this.depth,sB.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(sB.empty,!0);e.childCount&&(this.placed=a3(this.placed,this.frontier.length,e))}}function a6(e,t,r){return 0==t?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(a6(e.firstChild.content,t-1,r)))}function a3(e,t,r){return 0==t?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(a3(e.lastChild.content,t-1,r)))}function a9(e,t){for(let r=0;r<t;r++)e=e.firstChild.content;return e}function a5(e,t,r,n,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!r.compatibleContent(o.type))return null;let a=n.fillBefore(o.content,!0,s);return a&&!function(e,t,r){for(let n=r;n<t.childCount;n++)if(!e.allowsMarks(t.child(n).marks))return!0;return!1}(r,o.content,s)?a:null}function a7(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let i=n;i>=0;i--){let n=e.start(i);if(n<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(n==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==n-1)&&r.push(i)}return r}class a8 extends aj{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 aP.fail("No node at attribute step's position");let r=Object.create(null);for(let e in t.attrs)r[e]=t.attrs[e];r[this.attr]=this.value;let n=t.type.create(r,null,t.marks);return aP.fromReplace(e,this.pos,this.pos+1,new sG(sB.from(n),0,+!t.isLeaf))}getMap(){return aE.empty}invert(e){return new a8(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 a8(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new a8(t.pos,t.attr,t.value)}}aj.jsonID("attr",a8);class le extends aj{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return aP.ok(r)}
27getMap(){return aE.empty}invert(e){return new le(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("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new le(t.attr,t.value)}}aj.jsonID("docAttr",le);let lt=class extends Error{};(lt=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r}).prototype=Object.create(Error.prototype),lt.prototype.constructor=lt,lt.prototype.name="TransformError";class lr{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new aA}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new lt(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}changedRange(){let e=1e9,t=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let n=this.mapping.maps[r];r&&(e=n.map(e,1),t=n.map(t,-1)),n.forEach((r,n,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}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=sG.empty){let n=a1(this.doc,e,t,r);return n&&this.step(n),this}replaceWith(e,t,r){return this.replace(e,t,new sG(sB.from(r),0,0))}delete(e,t){return this.replace(e,t,sG.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return!function(e,t,r,n){if(!n.size)return e.deleteRange(t,r);let i=e.doc.resolve(t),o=e.doc.resolve(r);if(a4(i,o,n))return e.step(new aU(t,r,n));let s=a7(i,o);0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let r=i.node(e).type.spec;if(r.defining||r.definingAsContext||r.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),u=[],d=n.openStart;for(let e=n.content,t=0;;t++){let r=e.firstChild;if(u.push(r),t==n.openStart)break;e=r.content}for(let e=d-1;e>=0;e--){var c;let t=u[e],r=(c=t.type).spec.defining||c.spec.definingForContent;if(r&&!t.sameMarkup(i.node(Math.abs(a)-1)))d=e;else if(r||!t.type.isTextblock)break}for(let t=n.openStart;t>=0;t--){let a=(t+d+1)%(n.openStart+1),c=u[a];if(c)for(let t=0;t<s.length;t++){let u=s[(t+l)%s.length],d=!0;u<0&&(d=!1,u=-u);let p=i.node(u-1),h=i.index(u-1);if(p.canReplaceWith(h,h,c.type,c.marks))return e.replace(i.before(u),d?o.after(u):r,new sG(function e(t,r,n,i,o){if(r<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(e(o.content,r+1,n,i,o)))}if(r>i){let e=o.contentMatchAt(0),r=e.fillBefore(t).append(t);t=r.append(e.matchFragment(r).fillBefore(sB.empty,!0))}return t}(n.content,0,n.openStart,a),a,n.openEnd))}}let p=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,r,n),!(e.steps.length>p));a--){let e=s[a];e<0||(t=i.before(e),r=o.after(e))}}(this,e,t,r),this}replaceRangeWith(e,t,r){var n=e,i=t;if(!r.isInline&&n==i&&this.doc.resolve(n).parent.content.size){let e=function(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(0==n.parentOffset)for(let e=n.depth-1;e>=0;e--){let t=n.index(e);if(n.node(e).canReplaceWith(t,t,r))return n.before(e+1);if(t>0)return null}if(n.parentOffset==n.parent.content.size)for(let e=n.depth-1;e>=0;e--){let t=n.indexAfter(e);if(n.node(e).canReplaceWith(t,t,r))return n.after(e+1);if(t<n.node(e).childCount)break}return null}(this.doc,n,r.type);null!=e&&(n=i=e)}return this.replaceRange(n,i,new sG(sB.from(r),0,0)),this}deleteRange(e,t){return!function(e,t,r){let n=e.doc.resolve(t),i=e.doc.resolve(r);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&0==n.parentOffset&&0==i.parentOffset){let o=n.sharedDepth(r),s=!1;for(let e=n.depth;e>o;e--)n.node(e).type.spec.isolating&&(s=!0);for(let e=i.depth;e>o;e--)i.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=n.depth;e>0&&t==n.start(e);e--)t=n.before(e);for(let e=i.depth;e>0&&r==i.start(e);e--)r=i.before(e);n=e.doc.resolve(t),i=e.doc.resolve(r)}}let o=a7(n,i);for(let t=0;t<o.length;t++){let r=o[t],s=t==o.length-1;if(s&&0==r||n.node(r).type.contentMatch.validEnd)return e.delete(n.start(r),i.end(r));if(r>
270&&(s||n.node(r-1).canReplace(n.index(r-1),i.indexAfter(r-1))))return e.delete(n.before(r),i.after(r))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(t-n.start(o)==n.depth-o&&r>n.end(o)&&i.end(o)-r!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return e.delete(n.before(o),r);e.delete(t,r)}(this,e,t),this}lift(e,t){return!function(e,t,r){let{$from:n,$to:i,depth:o}=t,s=n.before(o+1),a=i.after(o+1),l=s,u=a,d=sB.empty,c=0;for(let e=o,t=!1;e>r;e--)t||n.index(e)>0?(t=!0,d=sB.from(n.node(e).copy(d)),c++):l--;let p=sB.empty,h=0;for(let e=o,t=!1;e>r;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=sB.from(i.node(e).copy(p)),h++):u++;e.step(new aV(l,u,s,a,new sG(d.append(p),c,h),d.size-c,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,r){let n=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-r),s=o.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(i);e&&!t?n=!1:!e&&t&&(n=!0)}let a=e.steps.length;if(!1===n){let n=e.doc.resolve(t+r);aq(e,n.node(),n.before(),a)}s.inlineContent&&aB(e,t+r-1,s,o.node().contentMatchAt(o.index()),null==n);let l=e.mapping.slice(a),u=l.map(t-r);if(e.step(new aU(u,l.map(t+r,-1),sG.empty,!0)),!0===n){let t=e.doc.resolve(u);aJ(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,r){let n=sB.empty;for(let e=r.length-1;e>=0;e--){if(n.size){let t=r[e].type.contentMatch.matchFragment(n);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=sB.from(r[e].type.create(r[e].attrs,n))}let i=t.start,o=t.end;e.step(new aV(i,o,i,o,new sG(n,0,0),r.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,n=null){var i=this;if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var s,a,l;let u,d,c="function"==typeof n?n(e):n;if(e.isTextblock&&!e.hasMarkup(r,c)&&(s=i.doc,a=i.mapping.slice(o).map(t),l=r,d=(u=s.resolve(a)).index(),u.parent.canReplaceWith(d,d+1,l))){let n=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?n=!1:!e&&t&&(n=!0)}!1===n&&aq(i,e,t,o),aB(i,i.mapping.slice(o).map(t,1),r,void 0,null===n);let s=i.mapping.slice(o),a=s.map(t,1),l=s.map(t+e.nodeSize,1);return i.step(new aV(a,l,a+1,l-1,new sG(sB.from(r.create(c,null,e.marks)),0,0),1,!0)),!0===n&&aJ(i,e,t,o),!1}}),this}setNodeMarkup(e,t,r=null,n){return!function(e,t,r,n,i){let o=e.doc.nodeAt(t);if(!o)throw RangeError("No node at given position");r||(r=o.type);let s=r.create(n,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!r.validContent(o.content))throw RangeError("Invalid content for node type "+r.name);e.step(new aV(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new sG(sB.from(s),0,0),1,!0))}(this,e,t,r,n),this}setNodeAttribute(e,t,r){return this.step(new a8(e,t,r)),this}setDocAttribute(e,t){return this.step(new le(e,t)),this}addNodeMark(e,t){return this.step(new aR(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw RangeError("No node at position "+e);if(t instanceof sJ)t.isInSet(r.marks)&&this.step(new aL(e,t));else{let n=r.marks,i,o=[];for(;i=t.isInSet(n);)o.push(new aL(e,i)),n=i.removeFromSet(n);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,r){return!function(e,t,r=1,n){let i=e.doc.resolve(t),o=sB.empty,s=sB.empty;for(let e=i.depth,t=i.depth-r,a=r-1;e>t;e--,a--){o=sB.from(i.node(e).copy(o));let t=n&&n[a];s=sB.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new aU(t,t,new sG(o.append(s),r,r),!0))}(this,e,t,r),this}addMark(e,t,r){var n;let i,o,s,a;return n=this,s=[],a=[],n.doc.nodesBetween(e,t,(n,l,u)=>{if(!n.isInline)return;let d=n.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let u=Math.max(l,e),c=Math.min(l+n.nodeSize,t),p=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(p)||(i&&i.to==u&&i.mark.eq(d[e])?i.to=c:s.push(i=new aZ(u,c,d[e])));o&&o.to==u?o.to=c:a.push(o=new aM(u,c,r))}}),s.forEach(e=>n.step(e)),a.forEach(e=>n.step(e)),this}removeMark(e,t,r){var n;let i,o;return n=this,i=[],o=0,n.doc.nodesBetween(e,t,(n,s)=>{if(!n.isInline)return;o++;let a=null;if(r instanceof ah){let e=n.marks,t;for(;t=r.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else r?r.isInSet(n.marks)&&(a=[r]):a=n.marks;if(a&&a.length){let r=Math.min(s+n.nodeSize,t);for(let t=0;t<a.length;t++){let n=a[t],l;for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&n.eq(i[e].style)&&(l=t)}l?(l.to=r,l.step=o):i.push({style:n,from:Math.max(s,e),to:r,step:o})}}}
27),i.forEach(e=>n.step(new aZ(e.from,e.to,e.style))),this}clearIncompatible(e,t,r){return aB(this,e,t,r),this}}let ln=Object.create(null);class li{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new lo(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=sG.empty){let r=t.content.lastChild,n=null;for(let e=0;e<t.openEnd;e++)n=r,r=r.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(l.pos),s?sG.empty:t),0==s&&lm(e,i,(r?r.isInline:n&&n.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,n=this.ranges;for(let i=0;i<n.length;i++){let{$from:o,$to:s}=n[i],a=e.mapping.slice(r),l=a.map(o.pos),u=a.map(s.pos);i?e.deleteRange(l,u):(e.replaceRangeWith(l,u,t),lm(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let n=e.parent.inlineContent?new ll(e):lf(e.node(0),e.parent,e.pos,e.index(),t,r);if(n)return n;for(let n=e.depth-1;n>=0;n--){let i=t<0?lf(e.node(0),e.node(n),e.before(n+1),e.index(n),t,r):lf(e.node(0),e.node(n),e.after(n+1),e.index(n)+1,t,r);if(i)return i}return null}
27static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new lp(e.node(0))}static atStart(e){return lf(e,e,0,0,1)||new lp(e)}static atEnd(e){return lf(e,e,e.content.size,e.childCount,-1)||new lp(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let r=ln[t.type];if(!r)throw RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ln)throw RangeError("Duplicate use of selection JSON ID "+e);return ln[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ll.between(this.$anchor,this.$head).getBookmark()}}li.prototype.visible=!0;class lo{constructor(e,t){this.$from=e,this.$to=t}}let ls=!1;function la(e){ls||e.parent.inlineContent||(ls=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ll extends li{constructor(e,t=e){la(e),la(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 li.near(r);let n=e.resolve(t.map(this.anchor));return new ll(n.parent.inlineContent?n:r,r)}replace(e,t=sG.empty){if(super.replace(e,t),t==sG.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof ll&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new lu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new ll(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let n=e.resolve(t);return new this(n,r==t?n:e.resolve(r))}static between(e,t,r){let n=e.pos-t.pos;if((!r||n)&&(r=n>=0?1:-1),!t.parent.inlineContent){let e=li.findFrom(t,r,!0)||li.findFrom(t,-r,!0);if(!e)return li.near(t,r);t=e.$head}return e.parent.inlineContent||(0==n?e=t:(e=(li.findFrom(e,-r,!0)||li.findFrom(e,r,!0)).$anchor).pos<t.pos!=n<0&&(e=t)),new ll(e,t)}}li.jsonID("text",ll);class lu{constructor(e,t){this.anchor=e,this.head=t}map(e){return new lu(e.map(this.anchor),e.map(this.head))}resolve(e){return ll.between(e.resolve(this.anchor),e.resolve(this.head))}}class ld extends li{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:n}=t.mapResult(this.anchor),i=e.resolve(n);return r?li.near(i):new ld(i)}content(){return new sG(sB.from(this.node),0,0)}eq(e){return e instanceof ld&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new lc(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new ld(e.resolve(t.anchor))}static create(e,t){return new ld(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}ld.prototype.visible=!1,li.jsonID("node",ld);class lc{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new lu(r,r):new lc(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&ld.isSelectable(r)?new ld(t):li.near(t)}}class lp extends li{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=sG.empty){if(t==sG.empty){e.delete(0,e.doc.content.size);let t=li.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new lp(e)}map(e){return new lp(e)}eq(e){return e instanceof lp}getBookmark(){return lh}}li.jsonID("all",lp);let lh={map(){return this},resolve:e=>new lp(e)};function lf(e,t,r,n,i,o=!1){if(t.inlineContent)return ll.create(e,r);for(let s=n-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let n=t.child(s);if(n.isAtom){if(!o&&ld.isSelectable(n))return ld.create(e,r-(i<0?n.nodeSize:0))}else{let t=lf(e,n,r+i,i<0?n.childCount:0,i,o);if(t)return t}r+=n.nodeSize*i}return null}function lm(e,t,r){let n,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof aU||o instanceof aV)&&(e.mapping.maps[i].forEach((e,t,r,i)=>{null==n&&(n=i)}),e.setSelection(li.near(e.doc.resolve(n),r)))}class lg extends lr{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 RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return sJ.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,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)||sJ.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let n=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(n.text(e),!0):this.deleteSelection();{if(null==r&&(r=t),!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=r==t?e.marks():e.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,n.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(li.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function lv(e,t){return t&&e?e.bind(t):e}class ly{constructor(e,t,r){this.name=e,this.init=lv(t.init,r),this.apply=lv(t.apply,r)}}let lb=[new ly("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new ly("selection",{init:(e,t)=>
27e.selection||li.atStart(t.doc),apply:e=>e.selection}),new ly("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,r,n)=>n.selection.$cursor?e.storedMarks:null}),new ly("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class lx{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=lb.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ly(e.key,e.spec.state,e))})}}class lk{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 t=this.config.plugins[r];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),n=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=n?n[o].n:0,l=n?n[o].state:this,u=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!n){n=[];for(let e=0;e<this.config.plugins.length;e++)n.push(e<o?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),i=!0}n&&(n[o]={state:r,n:t.length})}}if(!i)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new lk(this.config),r=this.config.fields;for(let n=0;n<r.length;n++){let i=r[n];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new lg(this)}static create(e){let t=new lx(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new lk(t);for(let n=0;n<t.fields.length;n++)r[t.fields[n].name]=t.fields[n].init(e,r);return r}reconfigure(e){let t=new lx(this.schema,e.plugins),r=t.fields,n=new lk(t);for(let t=0;t<r.length;t++){let i=r[t].name;n[i]=this.hasOwnProperty(i)?this[i]:r[t].init(e,n)}return n}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let r in e){if("doc"==r||"selection"==r)throw RangeError("The JSON fields `doc` and `selection` are reserved");let n=e[r],i=n.spec.state;i&&i.toJSON&&(t[r]=i.toJSON.call(n,this[n.key]))}return t}static fromJSON(e,t,r){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let n=new lx(e.schema,e.plugins),i=new lk(n);return n.fields.forEach(n=>{if("doc"==n.name)i.doc=s8.fromJSON(e.schema,t.doc);else if("selection"==n.name)i.selection=li.fromJSON(i.doc,t.selection);else if("storedMarks"==n.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let o in r){let s=r[o],a=s.spec.state;if(s.key==n.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){i[n.name]=a.fromJSON.call(s,e,t[o],i);return}}i[n.name]=n.init(e,i)}}),i}}class lw{constructor(e){this.spec=e,this.props={},e.props&&function e(t,r,n){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(r):"handleDOMEvents"==i&&(o=e(o,r,{})),n[i]=o}return n}(e.props,this,this.props),this.key=e.key?e.key.key:l$("plugin")}getState(e){return e[this.key]}}let l_=Object.create(null);function l$(e){return e in l_?e+"$"+ ++l_[e]:(l_[e]=0,e+"$")}class lS{constructor(e="key"){this.key=l$(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let lI=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},lO=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},lC=null,lN=function(e,t,r){let n=lC||(lC=document.createRange());return n.setEnd(e,null==r?e.nodeValue.length:r),n.setStart(e,t||0),n},lT=function(){lC=null},lE=function(e,t,r,n){return r&&(lD(e,t,r,n,-1)||lD(e,t,r,n,1))},lA=/^(img|br|input|textarea|hr)$/i;function lD(e,t,r,n,i){for(var o;;){if(e==r&&t==n)return!0;
27if(t==(i<0?0:lj(e))){let r=e.parentNode;if(!r||1!=r.nodeType||lP(e)||lA.test(e.nodeName)||"false"==e.contentEditable)return!1;t=lI(e)+(i<0?0:1),e=r}else{if(1!=e.nodeType)return!1;let r=e.childNodes[t+(i<0?-1:0)];if(1==r.nodeType&&"false"==r.contentEditable)if(null==(o=r.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=r,t=i<0?lj(e):0}}}function lj(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function lP(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let lz=function(e){return e.focusNode&&lE(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function lM(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}let lZ="u">typeof navigator?navigator:null,lR="u">typeof document?document:null,lL=lZ&&lZ.userAgent||"",lU=/Edge\/(\d+)/.exec(lL),lV=/MSIE \d/.exec(lL),lF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(lL),lB=!!(lV||lF||lU),lH=lV?document.documentMode:lF?+lF[1]:lU?+lU[1]:0,lW=!lB&&/gecko\/(\d+)/i.test(lL);lW&&(/Firefox\/(\d+)/.exec(lL)||[0,0])[1];let lK=!lB&&/Chrome\/(\d+)/.exec(lL),lJ=!!lK,lq=lK?+lK[1]:0,lG=!lB&&!!lZ&&/Apple Computer/.test(lZ.vendor),lX=lG&&(/Mobile\/\w+/.test(lL)||!!lZ&&lZ.maxTouchPoints>2),lY=lX||!!lZ&&/Mac/.test(lZ.platform),lQ=!!lZ&&/Win/.test(lZ.platform),l0=/Android \d/.test(lL),l1=!!lR&&"webkitFontSmoothing"in lR.documentElement.style,l4=l1?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function l2(e,t){return"number"==typeof e?e:e[t]}function l6(e,t,r){let n=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=r||e.dom;s;){if(1!=s.nodeType){s=lO(s);continue}let e=s,r=e==o.body,a=r?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(o):function(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}(e),l=0,u=0;if(t.top<a.top+l2(n,"top")?u=-(a.top-t.top+l2(i,"top")):t.bottom>a.bottom-l2(n,"bottom")&&(u=t.bottom-t.top>a.bottom-a.top?t.top+l2(i,"top")-a.top:t.bottom-a.bottom+l2(i,"bottom")),t.left<a.left+l2(n,"left")?l=-(a.left-t.left+l2(i,"left")):t.right>a.right-l2(n,"right")&&(l=t.right-a.right+l2(i,"right")),l||u)if(r)o.defaultView.scrollBy(l,u);else{let r=e.scrollLeft,n=e.scrollTop;u&&(e.scrollTop+=u),l&&(e.scrollLeft+=l);let i=e.scrollLeft-r,o=e.scrollTop-n;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let d=r?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:lO(s)}}function l3(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=lO(n));return t}function l9(e,t){for(let r=0;r<e.length;r++){let{dom:n,top:i,left:o}=e[r];n.scrollTop!=i+t&&(n.scrollTop=i+t),n.scrollLeft!=o&&(n.scrollLeft=o)}}let l5=null;function l7(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function l8(e){return e.top<e.bottom||e.left<e.right}function ue(e,t){let r=e.getClientRects();if(r.length){let e=r[t<0?0:r.length-1];if(l8(e))return e}return Array.prototype.find.call(r,l8)||e.getBoundingClientRect()}let ut=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ur(e,t,r){let{node:n,offset:i,atom:o}=e.docView.domFromPos(t,r<0?-1:1),s=l1||lW;if(3==n.nodeType)if(s&&(ut.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let e=ue(lN(n,i,i),r);if(lW&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let t=ue(lN(n,i-1,i-1),-1);if(t.top==e.top){let r=ue(lN(n,i,i+1),-1);if(r.top!=e.top)return un(r,r.left<t.left)}}return e}else{let e=i,t=i,o=r<0?1:-1;return r<0&&!i?(t++,o=-1):r>=0&&i==n.nodeValue.length?(e--,o=1):r<0?e--:t++,un(ue(lN(n,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(r<0||i==lj(n))){let e=n.childNodes[i-1];if(1==e.nodeType)return ui(e.getBoundingClientRect(),!1)}if(null==o&&i<lj(n)){let e=n.childNodes[i];if(1==e.nodeType)return ui(e.getBoundingClientRect(),!0)}return ui(n.getBoundingClientRect(),r>=0)}if(null==o&&i&&(r<0||i==lj(n))){let e=n.childNodes[i-1],t=3==e.nodeType?lN(e,lj(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return un(ue(t,1),!1)}if(null==o&&i<lj(n)){let e=n.childNodes[i];for(;
27e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?lN(e,0,+!s):1==e.nodeType?e:null:null;if(t)return un(ue(t,-1),!0)}return un(ue(3==n.nodeType?lN(n):n,-r),r>=0)}function un(e,t){if(0==e.width)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function ui(e,t){if(0==e.height)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function uo(e,t,r){let n=e.state,i=e.root.activeElement;n!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),i!=e.dom&&i&&i.focus()}}let us=/[\u0590-\u08ac]/,ua=null,ul=null,uu=!1;class ud{constructor(e,t,r,n){this.parent=e,this.children=t,this.dom=r,this.contentDOM=n,this.dirty=0,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 n=this.children[t];if(n==e)return r;r+=n.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){let n;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(r<0){let r,n;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&!((n=r.pmViewDesc)&&n.parent==this);)r=r.previousSibling;return r?this.posBeforeChild(n)+n.size:this.posAtStart}else{let r,n;if(e==this.contentDOM)r=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.nextSibling}for(;r&&!((n=r.pmViewDesc)&&n.parent==this);)r=r.nextSibling;return r?this.posBeforeChild(n):this.posAtEnd}if(e==this.dom&&this.contentDOM)n=t>lI(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))n=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){n=!1;break}if(t.previousSibling)break}if(null==n&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){n=!0;break}if(t.nextSibling)break}}return(null==n?r>0:n)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,n=e;n;n=n.parentNode){let i=this.getDesc(n),o;if(i&&(!t||i.node))if(!r||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;else r=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,r){for(let n=e;n;n=n.parentNode){let i=this.getDesc(n);if(i)return i.localPosFromDOM(e,t,r)}return -1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let n=this.children[t],i=r+n.size;if(r==e&&i!=r){for(;!n.border&&n.children.length;)for(let e=0;e<n.children.length;e++){let t=n.children[e];if(t.size){n=t;break}}return n}if(e<i)return n.descAt(e-r-n.border);r=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,n=0;for(let t=0;r<this.children.length;r++){let i=this.children[r],o=t+i.size;if(o>e||i instanceof uv){n=e-t;break}t=o}if(n)return this.children[r].domFromPos(n-this.children[r].border,t);for(let e;r&&!(e=this.children[r-1]).size&&e instanceof uc&&e.side>=0;r--);if(t<=0){let e,n=!0;for(;(e=r?this.children[r-1]:null)&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?lI(e.dom)+1:0}}{let e,n=!0;for(;(e=r<this.children.length?this.children[r]:null)&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?lI(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let n=-1,i=-1;for(let o=r,s=0;;s++){let r=this.children[s],a=o+r.size;if(-1==n&&e<=a){let i=o+r.border;if(e>=i&&t<=a-r.border&&r.node&&r.contentDOM&&this.contentDOM.contains(r.contentDOM))return r.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let r=this.children[t-1];if(r.size&&r.dom.parentNode==this.contentDOM&&!r.emptyChildAt(1)){n=lI(r.dom)+1;break}e-=r.size}-1==n&&(n=0)}if(n>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let r=this.children[e];if(r.size&&r.dom.parentNode==this.contentDOM&&!r.emptyChildAt(-1)){i=lI(r.dom);break}t+=r.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:n,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(1!=t.nodeType||r==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,n=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],u=a+l.size;if(i>a&&o<u)return l.setSelection(e-a-l.border,t-a-l.border,r,n);a=u}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((lW||lG)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((d=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,r;t;
27t=t.parentNode){if(r=t.nextSibling){"BR"==r.nodeName&&(s=a={node:r.parentNode,offset:lI(r)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let r=e.childNodes[t-1];d=r&&("BR"==r.nodeName||"false"==r.contentEditable)}}if(lW&&u.focusNode&&u.focusNode!=a.node&&1==u.focusNode.nodeType){let e=u.focusNode.childNodes[u.focusOffset];e&&"false"==e.contentEditable&&(n=!0)}if(!(n||d&&lG)&&lE(s.node,s.offset,u.anchorNode,u.anchorOffset)&&lE(a.node,a.offset,u.focusNode,u.focusOffset))return;let c=!1;if((l.extend||e==t)&&!(d&&lW)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),c=!0}catch(e){}}if(!c){if(e>t){let e=s;s=a,a=e}let r=document.createRange();r.setEnd(a.node,a.offset),r.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(r)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,n=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==o?e<=o&&t>=r:e<o&&t>r){let n=r+i.border,s=o-i.border;if(e>=n&&t<=s){this.dirty=e==r||t==o?2:1,e==n&&t==s&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-n,t-n);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}r=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=1==e?2:1;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class uc extends ud{constructor(e,t,r,n){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(r,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:n)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||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 up extends ud{constructor(e,t,r,n){super(e,[],t,null),this.textDOM=r,this.text=n}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"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class uh extends ud{constructor(e,t,r,n,i){super(e,[],r,n),this.mark=t,this.spec=i}static create(e,t,r,n){let i=n.nodeViews[t.type.name],o=i&&i(t,n,r);return o&&o.dom||(o=aS.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new uh(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,r){let n=uh.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;t<o&&(i=uC(i,t,o,r)),e>0&&(i=uC(i,0,e,r));for(let e=0;e<i.length;e++)i[e].parent=n;return n.children=i,n}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class uf extends ud{constructor(e,t,r,n,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=r,this.innerDeco=n,this.nodeDOM=s}static create(e,t,r,n,i,o){let s=i.nodeViews[t.type.name],a,l=s&&s(t,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:o,r,n),u=l&&l.dom,d=l&&l.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else if(!u){let e=aS.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:u,contentDOM:d}=e)}d||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let c=u;return(u=u_(u,r,t),l)?a=new uy(e,t,r,n,u,d||null,c,l,i,o+1):t.isText?new ug(e,t,r,n,u,c,i):new uf(e,t,r,n,u,d||null,c,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
27let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){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=()=>sB.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return 0==this.dirty&&e.eq(this.node)&&u$(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let r=this.node.inlineContent,n=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new uI(this,o&&o.node,e);(function(e,t,r,n){let i=t.locals(e),o=0;if(0==i.length){for(let r=0;r<e.childCount;r++){let s=e.child(r);n(s,i,t.forChild(o,s),r),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){let d,c,p,h;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(d?(c||(c=[d])).push(e):d=e)}if(d)if(c){c.sort(uO);for(let e=0;e<c.length;e++)r(c[e],u,!!l)}else r(d,u,!!l);if(l)h=-1,p=l,l=null;else if(u<e.childCount)h=u,p=e.child(u++);else break;for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+p.nodeSize;if(p.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=p.cut(e-o),p=p.cut(0,e-o),f=e,h=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=p.isInline&&!p.isLeaf?a.filter(e=>!e.inline):a.slice();n(p,m,t.forChild(o,p),h),o=f}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,r,e,i):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?sJ.none:this.node.child(i).marks,r,e,i),a.placeWidget(t,e,n)},(t,o,l,u)=>{let d;a.syncToMarks(t.marks,r,e,u),a.findNodeMatch(t,o,l,u)||s&&e.state.selection.from>n&&e.state.selection.to<n+t.nodeSize&&(d=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,d,e)||a.updateNextNode(t,o,l,e,u,n)||a.addNode(t,o,l,e,n),n+=t.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),function e(t,r,n){let i=t.firstChild,o=!1;for(let s=0;s<r.length;s++){let a=r[s],l=a.dom;if(l.parentNode==t){for(;l!=i;)i=uS(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(l,i);if(a instanceof uh){let r=i?i.previousSibling:t.lastChild;e(a.contentDOM,a.children,n),i=r?r.nextSibling:t.firstChild}}for(;i;)i=uS(i),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}(this.contentDOM,this.children,e),lX&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:n}=e.state.selection;if(!(e.state.selection instanceof ll)||r<t||n>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,o=function(e,t,r,n){for(let i=0,o=0;i<e.childCount&&o<=n;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=r){if(o>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let e=a<n?l.lastIndexOf(t,n-a-1):-1;if(e>=0&&e+t.length+a>=r)return a+e;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return -1}(this.node.content,e,r-t,n-t);return o<0?null:{node:i,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:r,text:n}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new up(this,i,t,n);e.input.compositionNodes.push(o),this.children=uC(this.children,r,r+n.length,e,o)}update(e,t,r,n){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,r,n),!0)}updateInner(e,t,r,n){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(n,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(u$(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=uw(this.dom,this.nodeDOM,uk(this.outerDeco,this.node,t),uk(e,this.node,t)),this.dom!=r&&(r.pmVie
27wDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function um(e,t,r,n,i){u_(n,t,e);let o=new uf(void 0,e,t,r,n,n,n,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ug extends uf{constructor(e,t,r,n,i,o,s){super(e,t,r,n,i,null,o,s,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,n){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,n.trackWrites==this.nodeDOM&&(n.trackWrites=null)),this.node=e,this.dirty=0,!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"characterData"!=e.type&&"selection"!=e.type}slice(e,t,r){let n=this.node.cut(e,t),i=document.createTextNode(n.text);return new ug(this.parent,n,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class uv extends ud{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class uy extends uf{constructor(e,t,r,n,i,o,s,a,l,u){super(e,t,r,n,i,o,s,l,u),this.spec=a}update(e,t,r,n){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,n),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,r,n)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,n){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,n)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let ub=function(e){e&&(this.nodeName=e)};ub.prototype=Object.create(null);let ux=[new ub];function uk(e,t,r){if(0==e.length)return ux;let n=r?ux[0]:new ub,i=[n];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(n=new ub(s.nodeName)),s){let o=s[e];null!=o&&(r&&1==i.length&&i.push(n=new ub(t.isInline?"span":"div")),"class"==e?n.class=(n.class?n.class+" ":"")+o:"style"==e?n.style=(n.style?n.style+";":"")+o:"nodeName"!=e&&(n[e]=o))}}return i}function uw(e,t,r,n){if(r==ux&&n==ux)return t;let i=t;for(let t=0;t<n.length;t++){let o=n[t],s=r[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=ux[0]),i=t}!function(e,t,r){for(let n in t)"class"==n||"style"==n||"nodeName"==n||n in r||e.removeAttribute(n);for(let n in r)"class"!=n&&"style"!=n&&"nodeName"!=n&&r[n]!=t[n]&&e.setAttribute(n,r[n]);if(t.class!=r.class){let n=t.class?t.class.split(" ").filter(Boolean):[],i=r.class?r.class.split(" ").filter(Boolean):[];for(let t=0;t<n.length;t++)-1==i.indexOf(n[t])&&e.classList.remove(n[t]);for(let t=0;t<i.length;t++)-1==n.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=r.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,n;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}r.style&&(e.style.cssText+=r.style)}}(i,s||ux[0],o)}return i}function u_(e,t,r){return uw(e,e,ux,uk(t,r,1!=e.nodeType))}function u$(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].type.eq(t[r].type))return!1;return!0}function uS(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class uI{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let r=t,n=r.children.length,i=e.childCount,o=new Map,s=[];r:for(;i>0;){let a;for(;;)if(n){let e=r.children[n-1];if(e instanceof uh)r=e,n=e.children.length;else{a=e,n--;break}}else if(r==t)break r;else n=r.parent.children.indexOf(r),r=r.parent;let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(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,n){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;n<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let r=this.top.children[t];if(r.matchesMark(e[o])&&!this.isLocked(r.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];
27else{let n=uh.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,n),this.top=n,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,n){let i=-1,o;if(n>=this.preMatch.index&&(o=this.preMatch.matches[n-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))i=this.top.children.indexOf(o,this.index);else for(let n=this.index,o=Math.min(this.top.children.length,n+5);n<o;n++){let o=this.top.children[n];if(o.matchesNode(e,t,r)&&!this.preMatch.matched.has(o)){i=n;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,r,n,i){let o=this.top.children[n];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,r,i)&&(this.destroyBetween(this.index,n),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,r,n,i,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof uf){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let u=a.dom,d,c=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&u$(t,a.outerDeco));if(!c&&a.update(e,t,r,n))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!c&&(d=this.recreateWrapper(a,e,t,r,n,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=2,d.updateChildren(n,o+1),d.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,n,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!u$(r,e.outerDeco)||!n.eq(e.innerDeco))return null;let s=uf.create(this.top,t,r,n,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,r,n,i){let o=uf.create(this.top,e,t,r,n,i);o.contentDOM&&o.updateChildren(n,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,r){let n=this.index<this.top.children.length?this.top.children[this.index]:null;if(n&&n.matchesWidget(e)&&(e==n.widget||!n.widget.type.toDOM.parentNode))this.index++;else{let n=new uc(this.top,e,t,r);this.top.children.splice(this.index++,0,n),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof uh;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof ug)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((lG||lJ)&&e&&"false"==e.dom.contentEditable&&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);"IMG"==e&&(r.className="ProseMirror-separator",r.alt=""),"BR"==e&&(r.className="ProseMirror-trailingBreak");let n=new uv(this.top,[],r,null);t!=this.top?t.children.push(n):t.children.splice(this.index++,0,n),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function uO(e,t){return e.type.side-t.type.side}function uC(e,t,r,n,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],u=a,d=a+=l.size;u>=r||d<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,n)),i&&(o.push(i),i=void 0),d>r&&o.push(l.slice(r-u,l.size,n)))}return o}function uN(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let i=e.docView.nearestDesc(r.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,u;if(lz(r)){for(l=s;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ld.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,r){for(let n=0==t,i=t==lj(e);n||i;){if(e==r)return!0;let t=lI(e);if(!(e=e.parentNode))return!1;n=n&&0==t,i=i&&t==lj(e)}}(r.focusNode,r.focusOffset,i.dom))){let e=i.posBefore;u=new ld(s==e?a:n.resolve(e))}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let t=s,i=s;for(let n=0;n<r.rangeCount;n++){let o=r.getRangeAt(n);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[l,s]=i==e.state.selection.anchor?[i,t]:[t,i],a=n.resolve(s)}else l=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let d=n.resolve(l);if(!u){let r="pointer"==t||e.state.selection.head<a.pos&&!o?1:-1;u=uZ(e,d,a,r)}return u}function uT(e){return e.editable?e.hasFocus():uL(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function uE(e,t=!1){let r=e.state.selection;if(uz(e,r),uT(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&lJ){let t=e.domSelectionRange(),r=e.domObserver.currentSelection;if(t.anchorNode&&r.anchorNode&&lE(t.anchorNode,t.anchorOffset,r.anchorNode,r.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let r=e.cursorWrapper.dom,n="IMG"==r.nodeName;n?t.collapse(r.parentNode,lI(r)+1):t.collapse(r,0),!n&&!e.state.selection.visible&&lB&&lH<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var n;
27let i,o,s,a,{anchor:l,head:u}=r,d,c;uA&&!(r instanceof ll)&&(r.$from.parent.inlineContent||(d=uD(e,r.from)),r.empty||r.$from.parent.inlineContent||(c=uD(e,r.to))),e.docView.setSelection(l,u,e,t),uA&&(d&&uP(d),c&&uP(c)),r.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(n=e).dom.ownerDocument).removeEventListener("selectionchange",n.input.hideSelectionGuard),s=(o=n.domSelectionRange()).anchorNode,a=o.anchorOffset,i.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(o.anchorNode!=s||o.anchorOffset!=a)&&(i.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!uT(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let uA=lG||lJ&&lq<63;function uD(e,t){let{node:r,offset:n}=e.docView.domFromPos(t,0),i=n<r.childNodes.length?r.childNodes[n]:null,o=n?r.childNodes[n-1]:null;if(lG&&i&&"false"==i.contentEditable)return uj(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return uj(i);else if(o)return uj(o)}}function uj(e){return e.contentEditable="true",lG&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function uP(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function uz(e,t){if(t instanceof ld){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(uM(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else uM(e)}function uM(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function uZ(e,t,r,n){return e.someProp("createSelectionBetween",n=>n(e,t,r))||ll.between(t,r,n)}function uR(e){return(!e.editable||!!e.hasFocus())&&uL(e)}function uL(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function uU(e,t){let{$anchor:r,$head:n}=e.selection,i=t>0?r.max(n):r.min(n),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&li.findFrom(o,t)}function uV(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function uF(e,t,r){let n=e.state.selection;if(n instanceof ll){if(r.indexOf("s")>-1){let{$head:r}=n,i=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(r.pos+i.nodeSize*(t<0?-1:1));return uV(e,new ll(n.$anchor,o))}else if(!n.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let r=uU(e.state,t);return!!r&&r instanceof ld&&uV(e,r)}else if(!(lY&&r.indexOf("m")>-1)){let r=n.$head,i=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,o;if(!i||i.isText)return!1;let s=t<0?r.pos-i.nodeSize:r.pos;return!!(i.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM)&&(ld.isSelectable(i)?uV(e,new ld(t<0?e.state.doc.resolve(r.pos-i.nodeSize):r)):!!l1&&uV(e,new ll(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}else{if(n instanceof ld&&n.node.isInline)return uV(e,new ll(t>0?n.$to:n.$from));let r=uU(e.state,t);return!!r&&uV(e,r)}}function uB(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function uH(e,t){let r=e.pmViewDesc;return r&&0==r.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function uW(e,t){return t<0?function(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let i,o,s=!1;for(lW&&1==r.nodeType&&n<uB(r)&&uH(r.childNodes[n],-1)&&(s=!0);;)if(n>0)if(1!=r.nodeType)break;else{let e=r.childNodes[n-1];if(uH(e,-1))i=r,o=--n;else if(3==e.nodeType)n=(r=e).nodeValue.length;else break}else if(uK(r))break;else{let t=r.previousSibling;for(;t&&uH(t,-1);)i=r.parentNode,o=lI(t),t=t.previousSibling;if(t)n=uB(r=t);else{if((r=r.parentNode)==e.dom)break;n=0}}s?uJ(e,r,n):i&&uJ(e,i,o)}(e):function(e){let t,r,n=e.domSelectionRange(),i=n.focusNode,o=n.focusOffset;if(!i)return;let s=uB(i);for(;;)if(o<s){if(1!=i.nodeType)break;if(uH(i.childNodes[o],1))t=i,r=++o;else break}else if(uK(i))break;else{let n=i.nextSibling;for(;n&&uH(n,1);)t=n.parentNode,r=lI(n)+1,n=n.nextSibling;if(n)o=0,s=uB(i=n);else{if((i=i.parentNode)==e.dom)break;o=s=0}}t&&uJ(e,t,r)}(e)}function uK(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function uJ(e,t,r){if(3!=t.nodeType){let e,n;(n=function(e,t){for(;e&&t==e.childNodes.length&&!lP(e);)t=lI(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let r=e.childNodes[t];
27if(3==r.nodeType)return r;if(1==r.nodeType&&"false"==r.contentEditable)break;e=r,t=0}}(t,r))?(t=n,r=0):(e=function(e,t){for(;e&&!t&&!lP(e);)t=lI(e),e=e.parentNode;for(;e&&t;){let r=e.childNodes[t-1];if(3==r.nodeType)return r;if(1==r.nodeType&&"false"==r.contentEditable)break;t=(e=r).childNodes.length}}(t,r))&&(t=e,r=e.nodeValue.length)}let n=e.domSelection();if(!n)return;if(lz(n)){let e=document.createRange();e.setEnd(t,r),e.setStart(t,r),n.removeAllRanges(),n.addRange(e)}else n.extend&&n.extend(t,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&uE(e)},50)}function uq(e,t){let r=e.state.doc.resolve(t);if(!(lJ||lQ)&&r.parent.inlineContent){let n=e.coordsAtPos(t);if(t>r.start()){let r=e.coordsAtPos(t-1),i=(r.top+r.bottom)/2;if(i>n.top&&i<n.bottom&&Math.abs(r.left-n.left)>1)return r.left<n.left?"ltr":"rtl"}if(t<r.end()){let r=e.coordsAtPos(t+1),i=(r.top+r.bottom)/2;if(i>n.top&&i<n.bottom&&Math.abs(r.left-n.left)>1)return r.left>n.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function uG(e,t,r){let n=e.state.selection;if(n instanceof ll&&!n.empty||r.indexOf("s")>-1||lY&&r.indexOf("m")>-1)return!1;let{$from:i,$to:o}=n;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let r=uU(e.state,t);if(r&&r instanceof ld)return uV(e,r)}if(!i.parent.inlineContent){let r=t<0?i:o,s=n instanceof lp?li.near(r,t):li.findFrom(r,t);return!!s&&uV(e,s)}return!1}function uX(e,t){if(!(e.state.selection instanceof ll))return!0;let{$head:r,$anchor:n,empty:i}=e.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(o&&!o.isText){let n=e.state.tr;return t<0?n.delete(r.pos-o.nodeSize,r.pos):n.delete(r.pos,r.pos+o.nodeSize),e.dispatch(n),!0}return!1}function uY(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function uQ(e,t){e.someProp("transformCopied",r=>{t=r(t,e)});let r=[],{content:n,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==n.childCount&&1==n.firstChild.childCount;){i--,o--;let e=n.firstChild;r.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),n=e.content}let s=e.someProp("clipboardSerializer")||aS.fromSchema(e.state.schema),a=u5(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let u=l.firstChild,d,c=0;for(;
27u&&1==u.nodeType&&(d=u3[u.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=a.createElement(d[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),c++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${c?` -${c}`:""} ${JSON.stringify(r)}`),{dom:l,text:e.someProp("clipboardTextSerializer",r=>r(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function u0(e,t,r,n,i){let o,s,a=i.parent.type.spec.code;if(!r&&!t)return null;let l=!!t&&(n||a||!r);if(l){if(e.someProp("transformPastedText",r=>{t=r(t,a||n,e)}),a)return s=new sG(sB.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let r=e.someProp("clipboardTextParser",r=>r(t,i,n,e));if(r)s=r;else{let r=i.marks(),{schema:n}=e.state,s=aS.fromSchema(n);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(n.text(e,r)))})}}else e.someProp("transformPastedHTML",t=>{r=t(r,e)}),o=function(e){var t;let r,n=/^(\s*<meta [^>]*>)*/.exec(e);n&&(e=e.slice(n[0].length));let i=u5().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&u3[o[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(r=window.trustedTypes)?(u7||(u7=r.defaultPolicy||r.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),u7.createHTML(t)):t),s)for(let e=0;e<s.length;e++)i=i.querySelector(s[e])||i;return i}(r),l1&&function(e){let t=e.querySelectorAll(lJ?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<t.length;r++){let n=t[r];1==n.childNodes.length&&" "==n.textContent&&n.parentNode&&n.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),n)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||ag.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||u1.test(e.parentNode.nodeName)?null:{ignore:!0}})),d)s=function(e,t){if(!e.size)return e;let r=e.content.firstChild.type.schema,n;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=sB.from(t.create(n[e+1],i)),o++,s++}return new sG(i,o,s)}(u6(s,+d[1],+d[2]),d[4]);else if((s=sG.maxOpen(function(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.index(r)),i,o=[];if(e.forEach(e=>{if(!o)return;let t=n.findWrapping(e.type),r;if(!t)return o=null;if(r=o.length&&i.length&&function e(t,r,n,i,o){if(o<t.length&&o<r.length&&t[o]==r[o]){let s=e(t,r,n,i.lastChild,o+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?n.type:t[o+1]))return i.copy(i.content.append(sB.from(u4(n,t,o+1))))}}(t,i,e,o[o.length-1],0))o[o.length-1]=r;else{o.length&&(o[o.length-1]=function e(t,r){if(0==r)return t;let n=t.content.replaceChild(t.childCount-1,e(t.lastChild,r-1)),i=t.contentMatchAt(t.childCount).fillBefore(sB.empty,!0);return t.copy(n.append(i))}(o[o.length-1],i.length));let r=u4(e,t);o.push(r),n=n.matchType(r.type),i=t}}),o)return sB.from(o)}return e}(s.content,i),!0)).openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=u6(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}let u1=/^(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 u4(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,sB.from(e));return e}function u2(e,t,r,n,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<n-1&&(a=u2(a,t,r,n,i+1,o)),i>
27=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(sB.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function u6(e,t,r){return t<e.openStart&&(e=new sG(u2(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),r<e.openEnd&&(e=new sG(u2(e.content,1,r,e.openEnd,0,0),e.openStart,r)),e}let u3={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},u9=null;function u5(){return u9||(u9=document.implementation.createHTMLDocument("title"))}let u7=null,u8={},de={},dt={touchstart:!0,touchmove:!0};class dr{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dn(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function di(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=t=>ds(e,t))})}function ds(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return!!n&&(n(e,t)||t.defaultPrevented)})}function da(e){return{left:e.clientX,top:e.clientY}}function dl(e,t,r,n,i){if(-1==n)return!1;let o=e.state.doc.resolve(n);for(let n=o.depth+1;n>0;n--)if(e.someProp(t,t=>n>o.depth?t(e,r,o.nodeAfter,o.before(n),i,!0):t(e,r,o.node(n),o.before(n),i,!1)))return!0;return!1}function du(e,t,r){if(e.focused||e.focus(),e.state.selection.eq(t))return;let n=e.state.tr.setSelection(t);"pointer"==r&&n.setMeta("pointer",!0),e.dispatch(n)}de.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!dp(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!l0||!lJ||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!lX||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",r=>r(e,t))||function(e,t){let r,n=t.keyCode,i=(r="",t.ctrlKey&&(r+="c"),t.metaKey&&(r+="m"),t.altKey&&(r+="a"),t.shiftKey&&(r+="s"),r);if(8==n||lY&&72==n&&"c"==i)return uX(e,-1)||uW(e,-1);if(46==n&&!t.shiftKey||lY&&68==n&&"c"==i)return uX(e,1)||uW(e,1);if(13==n||27==n)return!0;if(37==n||lY&&66==n&&"c"==i){let t=37==n?"ltr"==uq(e,e.state.selection.from)?-1:1:-1;return uF(e,t,i)||uW(e,t)}if(39==n||lY&&70==n&&"c"==i){let t=39==n?"ltr"==uq(e,e.state.selection.from)?1:-1:1;return uF(e,t,i)||uW(e,t)}else if(38==n||lY&&80==n&&"c"==i)return uG(e,-1,i)||uW(e,-1);else if(40==n||lY&&78==n&&"c"==i)return function(e){if(!lG||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&1==t.nodeType&&0==r&&t.firstChild&&"false"==t.firstChild.contentEditable){let r=t.firstChild;uY(e,r,"true"),setTimeout(()=>uY(e,r,"false"),20)}return!1}(e)||uG(e,1,i)||uW(e,1);else if(i==(lY?"m":"c")&&(66==n||73==n||89==n||90==n))return!0;return!1}(e,t)?t.preventDefault():dn(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,lM(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},de.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},de.keypress=(e,t)=>{if(dp(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||lY&&t.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,t)))return void t.preventDefault();let r=e.state.selection;if(!(r instanceof ll)||!r.$from.sameParent(r.$to)){let n=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(n).scrollIntoView();/[\r\n]/.test(n)||e.someProp("handleTextInput",t=>t(e,r.$from.pos,r.$to.pos,n,i))||e.dispatch(i()),t.preventDefault()}};let dd=lY?"metaKey":"ctrlKey";u8.mousedown=(e,t)=>{var r;let n,i;e.input.shiftKey=t.shiftKey;let o=dg(e),s=Date.now(),a="singleClick";
27s-e.input.lastClick.time<500&&(n=(r=e.input.lastClick).x-t.clientX)*n+(i=r.y-t.clientY)*i<100&&!t[dd]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:a,button:t.button};let l=e.posAtCoords(da(t));l&&("singleClick"==a?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new dc(e,l,t,!!o)):("doubleClick"==a?function(e,t,r,n){return dl(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",r=>r(e,t,n))}:function(e,t,r,n){return dl(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",r=>r(e,t,n))||function(e,t,r){if(0!=r.button)return!1;let n=e.state.doc;if(-1==t)return!!n.inlineContent&&(du(e,ll.create(n,0,n.content.size),"pointer"),!0);let i=n.resolve(t);for(let t=i.depth+1;t>0;t--){let r=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(r.inlineContent)du(e,ll.create(n,o+1,o+1+r.content.size),"pointer");else{if(!ld.isSelectable(r))continue;du(e,ld.create(n,o),"pointer")}return!0}}(e,r,n)})(e,l.pos,l.inside,t)?t.preventDefault():dn(e,"pointer"))};class dc{constructor(e,t,r,n){let i,o;if(this.view=e,this.pos=t,this.event=r,this.flushed=n,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[dd],this.allowDefault=r.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let r=e.state.doc.resolve(t.pos);i=r.parent,o=r.depth?r.before():0}const s=n?null:r.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;0==r.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ld&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&lW&&!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)),dn(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(()=>uE(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(da(e))),this.updateAllowDefault(e),this.allowDefault||!t)dn(this.view,"pointer");else{var r,n,i,o;(r=this.view,n=t.pos,i=t.inside,o=this.selectNode,dl(r,"handleClickOn",n,i,e)||r.someProp("handleClick",t=>t(r,n,e))||(o?function(e,t){if(-1==t)return!1;let r=e.state.selection,n,i;r instanceof ld&&(n=r.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ld.isSelectable(t)){i=n&&r.$from.depth>0&&e>=r.$from.depth&&o.before(r.$from.depth+1)==r.$from.pos?o.before(r.$from.depth):o.before(e);break}}return null!=i&&(du(e,ld.create(e.state.doc,i),"pointer"),!0)}(r,i):function(e,t){if(-1==t)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return!!(n&&n.isAtom&&ld.isSelectable(n))&&(du(e,new ld(r),"pointer"),!0)}(r,i)))?e.preventDefault():0==e.button&&(this.flushed||lG&&this.mightDrag&&!this.mightDrag.node.isAtom||lJ&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(du(this.view,li.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):dn(this.view,"pointer")}}move(e){this.updateAllowDefault(e),dn(this.view,"pointer"),0==e.buttons&&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)}}function dp(e,t){return!!e.composing||!!(lG&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}u8.touchstart=e=>{e.input.lastTouch=Date.now(),dg(e),dn(e,"pointer")},u8.touchmove=e=>{e.input.lastTouch=Date.now(),dn(e,"pointer")},u8.contextmenu=e=>dg(e);let dh=l0?5e3:-1;function df(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>dg(e),t))}function dm(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function dg(e,t=!1){if(!l0||!(e.domObserver.flushingSoon>
27=0)){if(e.domObserver.forceFlush(),dm(e),t||e.docView&&e.docView.dirty){let r=uN(e),n=e.state.selection;return r&&!r.eq(n)?e.dispatch(e.state.tr.setSelection(r)):(e.markCursor||t)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}de.compositionstart=de.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$to;if(t.selection instanceof ll&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||lJ&&lQ&&function(e){let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(!t||1!=t.nodeType||r>=t.childNodes.length)return!1;let n=t.childNodes[r];return 1==n.nodeType&&"false"==n.contentEditable}(e)))e.markCursor=e.state.storedMarks||r.marks(),dg(e,!0),e.markCursor=null;else if(dg(e,!t.selection.empty),lW&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let t=e.domSelectionRange();for(let r=t.focusNode,n=t.focusOffset;r&&1==r.nodeType&&0!=n;){let t=n<0?r.lastChild:r.childNodes[n-1];if(!t)break;if(3==t.nodeType){let r=e.domSelection();r&&r.collapse(t,t.nodeValue.length);break}r=t,n=-1}}e.input.composing=!0}df(e,dh)},de.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,df(e,20))};let dv=lB&&lH<15||lX&&l4<604;function dy(e,t,r,n,i){let o=u0(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||sG.empty)))return!0;if(!o)return!1;let s=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function db(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let r=e.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}u8.copy=de.cut=(e,t)=>{let r=e.state.selection,n="cut"==t.type;if(r.empty)return;let i=dv?null:t.clipboardData,{dom:o,text:s}=uQ(e,r.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}(e,o),n&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},de.paste=(e,t)=>{if(e.composing&&!l0)return;let r=dv?null:t.clipboardData,n=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&dy(e,db(r),r.getData("text/html"),n,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?dy(e,n.value,null,i,t):dy(e,n.textContent,n.innerHTML,i,t)},50)}(e,t)};class dx{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}let dk=lY?"altKey":"ctrlKey";function dw(e,t){let r;return e.someProp("dragCopies",e=>{r=r||e(t)}),null!=r?!r:!t[dk]}for(let e in u8.dragstart=(e,t)=>{let r,n=e.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(da(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ld?i.to-1:i.to));else if(n&&n.mightDrag)r=ld.create(e.state.doc,n.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let n=e.docView.nearestDesc(t.target,!0);n&&n.node.type.spec.draggable&&n!=e.docView&&(r=ld.create(e.state.doc,n.posBefore))}
vendor: 11,848 bytes, line 27
27let s=(r||e.state.selection).content(),{dom:a,text:l,slice:u}=uQ(e,s);t.dataTransfer.files.length&&lJ&&!(lq>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(dv?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",dv||t.dataTransfer.setData("text/plain",l),e.dragging=new dx(u,dw(e,t),r)},u8.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},de.dragover=de.dragenter=(e,t)=>t.preventDefault(),de.drop=(e,t)=>{try{!function(e,t,r){if(!t.dataTransfer)return;let n=e.posAtCoords(da(t));if(!n)return;let i=e.state.doc.resolve(n.pos),o=r&&r.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=u0(e,db(t.dataTransfer),dv?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(r&&dw(e,t));if(e.someProp("handleDrop",r=>r(e,t,o||sG.empty,s)))return t.preventDefault();if(!o)return;t.preventDefault();let a=o?a0(e.state.doc,i.pos,o):i.pos;null==a&&(a=i.pos);let l=e.state.tr;if(s){let{node:e}=r;e?e.replace(l):l.deleteSelection()}let u=l.mapping.map(a),d=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,c=l.doc;if(d?l.replaceRangeWith(u,u,o.content.firstChild):l.replaceRange(u,u,o),l.doc.eq(c))return;let p=l.doc.resolve(u);if(d&&ld.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new ld(p));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,r,n,i)=>t=i),l.setSelection(uZ(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},u8.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&uE(e)},20))},u8.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},u8.beforeinput=(e,t)=>{if(lJ&&l0&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,lM(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}},de)u8[e]=de[e];function d_(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class d${constructor(e,t){this.toDOM=e,this.spec=t||dN,this.side=this.spec.side||0}map(e,t,r,n){let{pos:i,deleted:o}=e.mapResult(t.from+n,this.side<0?-1:1);return o?null:new dO(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof d$&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&d_(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class dS{constructor(e,t){this.attrs=e,this.spec=t||dN}map(e,t,r,n){let i=e.map(t.from+n,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+n,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new dO(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof dS&&d_(this.attrs,e.attrs)&&d_(this.spec,e.spec)}static is(e){return e.type instanceof dS}destroy(){}}class dI{constructor(e,t){this.attrs=e,this.spec=t||dN}map(e,t,r,n){let i=e.mapResult(t.from+n,1);if(i.deleted)return null;let o=e.mapResult(t.to+n,-1);return o.deleted||o.pos<=i.pos?null:new dO(i.pos-r,o.pos-r,this)}valid(e,t){let{index:r,offset:n}=e.content.findIndex(t.from),i;return n==t.from&&!(i=e.child(r)).isText&&n+i.nodeSize==t.to}eq(e){return this==e||e instanceof dI&&d_(this.attrs,e.attrs)&&d_(this.spec,e.spec)}destroy(){}}class dO{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new dO(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 dO(e,e,new d$(t,r))}static inline(e,t,r,n){return new dO(e,t,new dS(r,n))}static node(e,t,r,n){return new dO(e,t,new dI(r,n))}get spec(){return this.type.spec}get inline(){return this.type instanceof dS}get widget(){return this.type instanceof d$}}let dC=[],dN={};class dT{constructor(e,t){this.local=e.length?e:dC,this.children=t.length?t:dC}static create(e,t){return t.length?dz(t,e,0,dN):dE}find(e,t,r){let n=[];return this.findInner(null==e?0:e,null==t?1e9:t,n,0,r),n}findInner(e,t,r,n,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&r.push(s.copy(s.from+n,s.to+n))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,r,n+s,i)}}map(e,t,r){return this==dE||0==e.maps.length?this:this.mapInner(e,t,0,0,r||dN)}mapInner(e,t,r,n,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,r,n);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,r,n,i,o,s){let a=e.slice();for(let e=0,t=o;e<r.maps.length;e++){let n=0;r.maps[e].forEach((e,r,i,o)=>{let s=o-i-(r-e);for(let i=0;i<a.length;i+=3){let o=a[i+1];if(o<0||e>o+t-n)continue;let l=a[i]+t-n;r>=l?a[i+1]=e<=l?-2:-1:e>=t&&s&&(a[i]+=s,a[i+1]+=s)}n+=s}),t=r.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let u=r.map(e[t]+o),d=u-i;if(d<0||d>=n.content.size){l=!0;continue}let c=r.map(e[t+1]+o,-1)-i,{index:p,offset:h}=n.content.findIndex(d),f=n.maybeChild(p);if(f&&h==d&&h+f.nodeSize==c){let n=a[t+2].mapInner(r,f,u+1,e[t]+o+1,s);n!=dE?(a[t]=d,a[t+1]=c,a[t+2]=n):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=dz(function(e,t,r,n,i,o,s){for(let a=0;a<e.length;a+=3)-1==e[a+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let a=t.local[e].map(n,i,o);a?r.push(a):s.onRemove&&s.onRemove(t.local[e].spec)}for(let r=0;r<t.children.length;r+=3)e(t.children[r+2],t.children[r]+o+1)}(e[a+2],t[a]+o+1);return r}(a,e,t,r,i,o,s),n,0,s);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let r=l.children[e];for(;t<a.length&&a[t]<r;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2])}}return new dT(t.sort(dM),a)}(this.children,o||[],e,t,r,n,i):o?new dT(o.sort(dM),dC):dE}add(e,t){return t.length?this==dE?dT.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let n,i=0;e.forEach((e,o)=>{let s=o+r,a;if(a=dj(t,e,s)){for(n||(n=this.children.slice());i<n.length&&n[i]<o;)i+=3;n[i]==o?n[i+2]=n[i+2].addInner(e,a,s+1):n.splice(i,0,o,o+e.nodeSize,dz(a,e,s+1,dN)),i+=3}});let o=dD(i?dP(t):t,-r);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new dT(o.length?this.local.concat(o).sort(dM):this.local,n||this.children)}remove(e){return 0==e.length||this==dE?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,n=this.local;for(let n=0;n<r.length;n+=3){let i,o=r[n]+t,s=r[n+1]+t;for(let t=0,r;t<e.length;t++)(r=e[t])&&r.from>o&&r.to<s&&(e[t]=null,(i||(i=[])).push(r));if(!i)continue;r==this.children&&(r=this.children.slice());let a=r[n+2].removeInner(i,o+1);a!=dE?r[n+2]=a:(r.splice(n,3),n-=3)}if(n.length){for(let r=0,i;r<e.length;r++)if(i=e[r])for(let e=0;e<n.length;e++)n[e].eq(i,t)&&(n==this.local&&(n=this.local.slice()),n.splice(e--,1))}return r==this.children&&n==this.local?this:n.length||r.length?new dT(n,r):dE}forChild(e,t){let r,n;if(this==dE)return this;if(t.isLeaf)return dT.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(r=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof dS){let e=Math.max(i,t.from)-i,r=Math.min(o,t.to)-i;e<r&&(n||(n=[])).push(t.copy(e,r))}}if(n){let e=new dT(n.sort(dM),dC);return r?new dA([e,r]):e}return r||dE}eq(e){if(this==e)return!0;if(!(e instanceof dT)||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 dZ(this.localsInner(e))}localsInner(e){if(this==dE)return dC;if(e.inlineContent||!this.local.some(dS.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof dS||t.push(this.local[e]);return t}forEachSet(e){e(this)}}dT.empty=new dT([],[]),dT.removeOverlap=dZ;let dE=dT.empty;class dA{constructor(e){this.members=e}map(e,t){let r=this.members.map(r=>r.map(e,t,dN));return dA.from(r)}forChild(e,t){if(t.isLeaf)return dT.empty;let r=[];for(let n=0;n<this.members.length;n++){let i=this.members[n].forChild(e,t);i!=dE&&(i instanceof dA?r=r.concat(i.members):r.push(i))}return dA.from(r)}eq(e){if(!(e instanceof dA)||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 n=0;n<this.members.length;n++){let i=this.members[n].localsInner(e);if(i.length)if(t){r&&(t=t.slice(),r=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?dZ(r?t:t.sort(dM)):dC}static from(e){switch(e.length){case 0:return dE;case 1:return e[0];default:return new dA(e.every(e=>e instanceof dT)?e:e.reduce((e,t)=>e.concat(t instanceof dT?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function dD(e,t){if(!t||!e.length)return e;let r=[];for(let n=0;n<e.length;n++){let i=e[n];r.push(new dO(i.from+t,i.to+t,i.type))}return r}function dj(e,t,r){if(t.isLeaf)return null;let n=r+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>r&&o.to<n&&((i||(i=[])).push(o),e[t]=null);return i}function dP(e){let t=[];for(let r=0;r<e.length;r++)null!=e[r]&&t.push(e[r]);return t}function dz(e,t,r,n){let i=[],o=!1;t.forEach((t,s)=>{let a=dj(e,t,s+r);if(a){o=!0;let e=dz(a,t,r+s+1,n);e!=dE&&i.push(s,s+t.nodeSize,e)}});let s=dD(o?dP(e):e,-r).sort(dM);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(n.onRemove&&n.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new dT(s,i):dE}function dM(e,t){return e.from-t.from||e.to-t.to}function dZ(e){let t=e;for(let r=0;r<t.length-1;r++){let n=t[r];if(n.from!=n.to)for(let i=r+1;i<t.length;i++){let o=t[i];if(o.from==n.from){o.to!=n.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,n.to),dR(t,i+1,o.copy(n.to,o.to)));continue}o.from<n.to&&(t==e&&(t=e.slice()),t[r]=n.copy(n.from,o.from),dR(t,i,n.copy(o.from,n.to)));break}}return t}function dR(e,t,r){for(;t<e.length&&dM(r,e[t])>0;)t++;e.splice(t,0,r)}function dL(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=dE&&t.push(n)}),e.cursorWrapper&&t.push(dT.create(e.state.doc,[e.cursorWrapper.deco])),dA.from(t)}let dU={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dV=lB&&lH<=11;class dF{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 dB{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new dF,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);lB&&lH<=11&&t.some(e=>
27"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():lG&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),dV&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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,dU)),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(uR(this.view)){if(this.suppressingSelectionUpdates)return uE(this.view);if(lB&&lH<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&lE(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 r=e.focusNode;r;r=lO(r))t.add(r);for(let n=e.anchorNode;n;n=lO(n))if(t.has(n)){r=n;break}let n=r&&this.view.docView.nearestDesc(r);if(n&&n.ignoreMutation({type:"selection",target:3==r.nodeType?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(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&uR(t)&&!this.ignoreSelectionChange(n),o=-1,s=-1,a=!1,l=[];
27if(t.editable)for(let e=0;e<r.length;e++){let t=this.registerMutation(r[e],l);t&&(o=o<0?t.from:Math.min(t.from,o),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(a=!0))}if(l.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of l)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(lW&&l.length){let e=l.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,r]=e;t.parentNode&&t.parentNode.parentNode==r.parentNode?r.remove():t.remove()}else{let{focusNode:r}=this.currentSelection;for(let n of e){let e=n.parentNode;e&&"LI"==e.nodeName&&(!r||function(e,t){for(let r=t.parentNode;r&&r!=e.dom;r=r.parentNode){let t=e.docView.nearestDesc(r,!0);if(t&&t.node.isBlock)return r}return null}(t,r)!=e)&&n.remove()}}}let u=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&lz(n)&&(u=uN(t))&&u.eq(li.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,uE(t),this.currentSelection.set(n),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),e=t,!dH.has(e)&&(dH.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=lW,dW||(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."),dW=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var r;let{focusNode:n,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(r=o.parentNode)?void 0:r.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let r=t;for(;;){let e=r.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;r=e}r.insertBefore(o,r.firstChild),n==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,l)),this.handleDOMChange(o,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||uE(t),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(r==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if("childList"==e.type){for(let r=0;r<e.addedNodes.length;r++){let n=e.addedNodes[r];t.push(n),3==n.nodeType&&(this.lastChangedTextNode=n)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let n=e.previousSibling,i=e.nextSibling;if(lB&&lH<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:r,nextSibling:o}=e.addedNodes[t];(!r||0>Array.prototype.indexOf.call(e.addedNodes,r))&&(n=r),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=n&&n.parentNode==e.target?lI(n)+1:0,s=r.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?lI(i):e.target.childNodes.length;return{from:s,to:r.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:r.posAtStart-r.border,to:r.posAt
27End+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let dH=new WeakMap,dW=!1;function dK(e,t){let r=t.startContainer,n=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return lE(s.node,s.offset,i,o)&&([r,n,i,o]=[i,o,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:o}}function dJ(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(lG&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||lG&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let dq=/^(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 dG(e,t,r){return Math.max(r.anchor,r.head)>t.content.size?null:uZ(e,t.resolve(r.anchor),t.resolve(r.head))}function dX(e,t,r){let n=e.depth,i=t?e.end():e.pos;for(;n>0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,i++,t=!1;if(r){let t=e.node(n).maybeChild(e.indexAfter(n));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function dY(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),r=e.charCodeAt(1);return t>=56320&&t<=57343&&r>=55296&&r<=56319}class dQ{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 dr,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(d6),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=d4(this),d1(this),this.nodeViews=d2(this),this.docView=um(this.state.doc,d0(this),dL(this),this.dom,this),this.domObserver=new dB(this,(e,t,r,n)=>(function(e,t,r,n,i){let o,s,a,l=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,r=uN(e,t);if(r&&!e.state.selection.eq(r)){if(lJ&&l0&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,lM(13,"Enter"))))return;let n=e.state.tr.setSelection(r);"pointer"==t?n.setMeta("pointer",!0):"key"==t&&n.scrollIntoView(),l&&n.setMeta("composition",l),e.dispatch(n)}return}let u=e.state.doc.resolve(t),d=u.sharedDepth(r);t=u.before(d+1),r=e.state.doc.resolve(r).after(d+1);let c=e.state.selection,p=function(e,t,r){let n,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,r),u=e.domSelectionRange(),d=u.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(n=[{node:d,offset:u.anchorOffset}
27],lz(u)||n.push({node:u.focusNode,offset:u.focusOffset})),lJ&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],r=t.pmViewDesc;if("BR"==t.nodeName&&!r){s=e;break}if(!r||r.size)break}let c=e.state.doc,p=e.someProp("domParser")||ag.fromSchema(e.state.schema),h=c.resolve(a),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:n,ruleFromNode:dJ,context:h});if(n&&null!=n[0].pos){let e=n[0].pos,t=n[1]&&n[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,r),h=e.state.doc,f=h.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(o=e.state.selection.to,s="end"):(o=e.state.selection.from,s="start"),e.input.lastKeyCode=null;let m=function(e,t,r,n,i){let o=e.findDiffStart(t,r);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if("end"==i){let e=Math.max(0,o-Math.min(s,a));n-=s+e-o}if(s<o&&e.size<t.size){let e=n<=o&&n>=s?o-n:0;(o-=e)&&o<t.size&&dY(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=n<=o&&n>=a?o-n:0;(o-=t)&&o<e.size&&dY(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(f.content,p.doc.content,p.from,o,s);if(m&&e.input.domChangeCount++,(lX&&e.input.lastIOSEnter>Date.now()-225||l0)&&i.some(e=>1==e.nodeType&&!dq.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",t=>t(e,lM(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(n&&c instanceof ll&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(p.sel&&p.sel.anchor!=p.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(p.sel){let t=dG(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let r=e.state.tr.setSelection(t);l&&r.setMeta("composition",l),e.dispatch(r)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof ll&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),lB&&lH<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>p.from&&"  "==p.doc.textBetween(m.start-p.from-1,m.start-p.from+1)&&(m.start--,m.endA--,m.endB--);let g=p.doc.resolveNoCache(m.start-p.from),v=p.doc.resolveNoCache(m.endB-p.from),y=h.resolve(m.start),b=g.sameParent(v)&&g.parent.inlineContent&&y.end()>=m.endA;if((lX&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!b&&g.pos<p.doc.content.size&&(!g.sameParent(v)||!g.parent.inlineContent)&&g.pos<v.pos&&!/\S/.test(p.doc.textBetween(g.pos,v.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,lM(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&function(e,t,r,n,i){if(r-t<=i.pos-n.pos||dX(n,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!n.parent.isTextblock){let e=o.nodeAfter;return null!=e&&r==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(dX(o,!0,!0));return!(!s.parent.isTextblock||s.pos>r||dX(s,!0,!1)<r)&&n.parent.content.cut(n.parentOffset).eq(s.parent.content)}(h,m.start,m.endA,g,v)&&e.someProp("handleKeyDown",t=>t(e,lM(8,"Backspace")))){l0&&lJ&&e.domObserver.suppressSelectionUpdates();return}lJ&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),l0&&!b&&g.start()!=v.start()&&0==v.parentOffset&&g.depth==v.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==m.endA&&(m.endB-=2,v=p.doc.resolveNoCache(m.endB-p.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,lM(13,"Enter"))})},20));let x=m.start,k=m.endA,w=t=>{let r=t||e.state.tr.replace(x,k,p.doc.slice(m.start-p.from,m.endB-p.from));if(p.sel){let t=dG(e,r.doc,p.sel);t&&!(lJ&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==x||t.head==r.mapping.map(k)-1)||lB&&t.empty&&t.head==x)&&r.setSelection(t)}return l&&r.setMeta("composition",l),r.scrollIntoView()};if(b)if(g.pos==v.pos){lB&&lH<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>uE(e),20));let t=w(e.state.tr.delete(x,k)),r=h.resolve(m.start).marksAcross(h.resolve(m.endA));r&&t.ensureMarks(r),e.dispatch(t)}else if(m.endA==m.endB&&(a=function(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,i=r,o=n,s,a,l;for(let e=0;e<n.length;e++)i=n[e].removeFromSet(i);for(let e=0;e<r.length;e++)o=r[e].removeFromSet(o);if(1==i.length&&0==o.length)a=i[0],s="add",l=e=>e.mark(a.addToSet(e.marks));else{if(0!=i.length||1!=o.length)return null;a=o[0],s="remove",l=e=>e.mark(a.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(l(t.child(e)));if(sB.from(u).eq(e))return{mark:a,type:s}}(g.parent.content.cut(g.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let t=w(e.state.tr);"add"==a.type?t.addMark(x,k,a.mark):t.removeMark(x,k,a.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==v.index()-!v.textOffset){let t=g.parent.textBetween(g.parentOffset,v.parentOffset),r=()=>w(e.state.tr.insertText(t,x,k));e.someProp("handleTextInput",n=>n(e,x,k,t,r))||e.dispatch(r())}else e.dispatch(w());else e.dispatch(w())})(this,e,t,r,n)),this.domObserver.start(),function(e){for(let t in u8){let r=u8[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(e,t){if(!t.bubbles)return!0;
27if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||ds(e,t)||!e.editable&&t.type in de||r(e,t)},dt[t]?{passive:!0}:void 0)}lG&&e.dom.addEventListener("input",()=>null),di(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&di(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(d6),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let r in t.state=this.state,e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r,n,i;let o=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(dm(this),a=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=d2(this);(function(e,t){let r=0,n=0;for(let n in e){if(e[n]!=t[n])return!0;r++}for(let e in t)n++;return r!=n})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&di(this),this.editable=d4(this),d1(this);let u=dL(this),d=d0(this),c=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",p=s||!this.docView.matchesNode(e.doc,d,u);(p||!e.selection.eq(o.selection))&&(a=!0);let h="preserve"==c&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,r,n=e.dom.getBoundingClientRect(),i=Math.max(0,n.top);for(let o=(n.left+n.right)/2,s=i+1;s<Math.min(innerHeight,n.bottom);s+=5){let n=e.root.elementFromPoint(o,s);if(!n||n==e.dom||!e.dom.contains(n))continue;let a=n.getBoundingClientRect();if(a.top>=i-20){t=n,r=a.top;break}}return{refDOM:t,refTop:r,stack:l3(e.dom)}}(this);if(a){let t,r,a;this.domObserver.stop();let l=p&&(lB||lJ)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(n=o.selection,i=e.selection,a=Math.min(n.$anchor.sharedDepth(n.head),i.$anchor.sharedDepth(i.head)),n.$anchor.start(a)!=i.$anchor.start(a));if(p){let t=lJ?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let r=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=lj(e=e.childNodes[t-1])}else{if(!e.parentNode||lP(e))return null;t=lI(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),n=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||lP(e))return null;t=lI(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(r&&n&&r!=n){let t=n.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(r==i||n==i)return i;if(!t||!t.isText(n.nodeValue))return n;if(e.input.compositionNode==n){let e=r.pmViewDesc;if(!(!e||!e.isText(r.nodeValue)))return n}}return r||n}(this)),(s||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=um(e.doc,d,u,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(l=!0)}l||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),r=this.domSelectionRange(),lE(t.node,t.offset,r.anchorNode,r.anchorOffset)))?uE(this,l):(uz(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(r=this.dragging)?void 0:r.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():h&&function({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;l9(r,0==n?0:n-t)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof ld){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&l6(this,t.getBoundingClientRect(),e)}else l6(this,this.coordsAtPos(this.state.selection.head,1),e)}
27destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let r=e.node,n=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)n=r.from;else{let e=r.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==r.node&&(n=e)}this.dragging=new dx(e.slice,e.move,n<0?void 0:ld.create(this.state.doc,n))}someProp(e,t){let r=this._props&&this._props[e],n;if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(lB){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(l5)return e.focus(l5);let t=l3(e);e.focus(null==l5?{get preventScroll(){return l5={preventScroll:!0},!0}}:void 0),l5||(l5=!1,l9(t,0))}(this.dom),uE(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var r;let n,i,o=e.dom.ownerDocument,s,a=0,l=function(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:Math.min(lj(n.offsetNode),n.offset)}}catch(e){}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:Math.min(lj(n.startContainer),n.startOffset)}}}(o,t.left,t.top);l&&({node:s,offset:a}=l);let u=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!u||!e.dom.contains(1!=u.nodeType?u.parentNode:u)){let r=e.dom.getBoundingClientRect();if(!l7(t,r)||!(u=function e(t,r,n){let i=t.childNodes.length;if(i&&n.top<n.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(r.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let n=t.childNodes[s];if(1==n.nodeType){let t=n.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(l7(r,o))return e(n,r,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,r)))return null}if(lG)for(let e=u;s&&e;e=lO(e))e.draggable&&(s=void 0);if(u=(n=(r=u).parentNode)&&/^li$/i.test(n.nodeName)&&t.left<r.getBoundingClientRect().left?n:r,s){let r;if(lW&&1==s.nodeType&&(a=Math.min(a,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[a],r;"IMG"==e.nodeName&&(r=e.getBoundingClientRect()).right<=t.left&&r.bottom>t.top&&a++}l1&&a&&1==s.nodeType&&1==(r=s.childNodes[a-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&a--,s==e.dom&&a==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==a||1!=s.nodeType||"BR"!=s.childNodes[a-1].nodeName)&&(i=function(e,t,r,n){let i=-1;for(let r=t,o=!1;r!=e.dom;){let t=e.docView.nearestDesc(r,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>n.left||s.top>n.top?i=t.posBefore:(!o&&s.right<n.left||s.bottom<n.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?n.top<(s.top+s.bottom)/2:n.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;r=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,r,-1)}(e,s,a,t))}null==i&&(i=function(e,t,r){let{node:n,offset:i}=function e(t,r){let n,i,o,s=2e8,a,l=0,u=r.top,d=r.top;for(let e=t.firstChild,c=0;e;e=e.nextSibling,c++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=lN(e).getClientRects()}for(let p=0;p<t.length;p++){let h=t[p];if(h.top<=u&&h.bottom>=d){u=Math.max(h.bottom,u),d=Math.min(h.top,d);let t=h.left>r.left?h.left-r.left:h.right<r.left?r.left-h.right:0;if(t<s){o=e,s=t,a=t&&3==o.nodeType?{left:h.right<r.left?h.right:h.left,top:r.top}
27:r,1==e.nodeType&&t&&(l=c+ +(r.left>=(h.left+h.right)/2));continue}}else h.top>r.top&&!n&&h.left<=r.left&&h.right>=r.left&&(n=e,i={left:Math.max(h.left,Math.min(h.right,r.left)),top:h.top});!o&&(r.left>=h.right&&r.top>=h.top||r.left>=h.left&&r.top>=h.bottom)&&(l=c+1)}}return(!o&&n&&(o=n,a=i,s=0),o&&3==o.nodeType)?function(e,t){let r=e.nodeValue.length,n=document.createRange(),i;for(let o=0;o<r;o++){n.setEnd(e,o+1),n.setStart(e,o);let r=ue(n,1);if(r.top!=r.bottom&&l7(t,r)){i={node:e,offset:o+ +(t.left>=(r.left+r.right)/2)};break}}return n.detach(),i||{node:e,offset:0}}(o,a):!o||s&&1==o.nodeType?{node:t,offset:l}:e(o,a)}(t,r),o=-1;if(1==n.nodeType&&!n.firstChild){let e=n.getBoundingClientRect();o=e.left!=e.right&&r.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(n,i,o)}(e,u,t));let d=e.docView.nearestDesc(u,!0);return{pos:i,inside:d?d.posAtStart-d.border:-1}}(this,e)}coordsAtPos(e,t=1){return ur(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 n=this.docView.posFromDOM(e,t,r);if(null==n)throw RangeError("DOM position not inside the editor");return n}endOfTextblock(e,t){return function(e,t,r){let n,i;return ua==t&&ul==r?uu:(ua=t,ul=r,uu="up"==r||"down"==r?(n=t.selection,i="up"==r?n.$from:n.$to,uo(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==r?-1:1);for(;;){let r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.contentDOM||r.dom;break}t=r.dom.parentNode}let n=ur(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=lN(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==r?n.top-i.top>(i.bottom-n.top)*2:i.bottom-n.bottom>(n.bottom-i.top)*2))return!1}}return!0})):function(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,o=i==n.parent.content.size,s=e.domSelection();return s?us.test(n.parent.textContent)&&s.modify?uo(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:a}=e.domSelectionRange(),l=s.caretBidiLevel;s.modify("move",r,"character");let u=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:d,focusOffset:c}=e.domSelectionRange(),p=d&&!u.contains(1==d.nodeType?d:d.parentNode)||t==d&&i==c;try{s.collapse(o,a),t&&(t!=o||i!=a)&&s.extend&&s.extend(t,i)}catch(e){}return null!=l&&(s.caretBidiLevel=l),p}):"left"==r||"backward"==r?!i:o:n.pos==n.start()||n.pos==n.end()}(e,t,r))}(this,t||this.state,e)}pasteHTML(e,t){return dy(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return dy(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return uQ(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],dL(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,lT()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!ds(this,e)&&u8[e.type]&&(this.editable||!(e.type in de))&&u8[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?lG&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let r;if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return dK(e,r)}function n(e){e.preventDefault(),e.stopImmediatePropagation(),r=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0),r?dK(e,r):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function d0(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if("function"==typeof r&&(r=r(e.state)),r)for(let e in r)"class"==e?t.class+=" "+r[e]:"style"==e?t.style=(t.style?t.style+";":"")+r[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(r[e]))}
27),t.translate||(t.translate="no"),[dO.node(0,e.state.doc.content.size,t)]}function d1(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:dO.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function d4(e){return!e.someProp("editable",t=>!1===t(e.state))}function d2(e){let t=Object.create(null);function r(e){for(let r in e)Object.prototype.hasOwnProperty.call(t,r)||(t[r]=e[r])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function d6(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}dQ.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var d3={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:"'"},d9={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},d5="u">typeof navigator&&/Mac/.test(navigator.platform),d7="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),d8=0;d8<10;d8++)d3[48+d8]=d3[96+d8]=String(d8);for(var d8=1;d8<=24;d8++)d3[d8+111]="F"+d8;for(var d8=65;d8<=90;d8++)d3[d8]=String.fromCharCode(d8+32),d9[d8]=String.fromCharCode(d8);for(var ce in d3)d9.hasOwnProperty(ce)||(d9[ce]=d3[ce]);let ct="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),cr="u">typeof navigator&&/Win/.test(navigator.platform);function cn(e,t,r=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),r&&t.shiftKey&&(e="Shift-"+e),e}function ci(e){let t=function(e){let t=Object.create(null);for(let r in e)t[function(e){let t,r,n,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))n=!0;else if(/^mod$/i.test(s))ct?i=!0:r=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),r&&(s="Ctrl-"+s),i&&(s="Meta-"+s),n&&(s="Shift-"+s),s}(r)]=e[r];return t}(e);return function(e,r){var n;let i=("Esc"==(n=!(d5&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||d7&&r.shiftKey&&r.key&&1==r.key.length||"Unidentified"==r.key)&&r.key||(r.shiftKey?d9:d3)[r.keyCode]||r.key||"Unidentified")&&(n="Escape"),"Del"==n&&(n="Delete"),"Left"==n&&(n="ArrowLeft"),"Up"==n&&(n="ArrowUp"),"Right"==n&&(n="ArrowRight"),"Down"==n&&(n="ArrowDown"),n),o,s=t[cn(i,r)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(r.shiftKey){let n=t[cn(i,r,!1)];if(n&&n(e.state,e.dispatch,e))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(cr&&r.ctrlKey&&r.altKey)&&(o=d3[r.keyCode])&&o!=i){let n=t[cn(o,r)];if(n&&n(e.state,e.dispatch,e))return!0}}return!1}}let co=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function cs(e,t){let{$cursor:r}=e.selection;return r&&(t?t.endOfTextblock("backward",e):!(r.parentOffset>0))?r:null}let ca=(e,t,r)=>{let n=cs(e,r);if(!n)return!1;let i=cc(n);if(!i){let r=n.blockRange(),i=r&&aH(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(ck(e,i,t,-1))return!0;if(0==n.parent.content.size&&(cu(o,"end")||ld.isSelectable(o)))for(let r=n.depth;;r--){let s=a1(e.doc,n.before(r),n.after(r),sG.empty);if(s&&s.slice.size<s.to-s.from){if(t){let r=e.tr.step(s);r.setSelection(cu(o,"end")?li.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):ld.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}if(1==r||n.node(r-1).childCount>1)break}return!!o.isAtom&&i.depth==n.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)};function cl(e,t,r){let n=t.nodeBefore,i=t.pos-1;for(;!n.isTextblock;
27i--){if(n.type.spec.isolating)return!1;let e=n.lastChild;if(!e)return!1;n=e}let o=t.nodeAfter,s=t.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let a=a1(e.doc,i,s,sG.empty);if(!a||a.from!=i||a instanceof aU&&a.slice.size>=s-i)return!1;if(r){let t=e.tr.step(a);t.setSelection(ll.create(t.doc,i)),r(t.scrollIntoView())}return!0}function cu(e,t,r=!1){for(let n=e;n;n="start"==t?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&1!=n.childCount)break}return!1}let cd=(e,t,r)=>{let{$head:n,empty:i}=e.selection,o=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;o=cc(n)}let s=o&&o.nodeBefore;return!!s&&!!ld.isSelectable(s)&&(t&&t(e.tr.setSelection(ld.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function cc(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function cp(e,t){let{$cursor:r}=e.selection;return r&&(t?t.endOfTextblock("forward",e):!(r.parentOffset<r.parent.content.size))?r:null}let ch=(e,t,r)=>{let n=cp(e,r);if(!n)return!1;let i=cm(n);if(!i)return!1;let o=i.nodeAfter;if(ck(e,i,t,1))return!0;if(0==n.parent.content.size&&(cu(o,"start")||ld.isSelectable(o))){let r=a1(e.doc,n.before(),n.after(),sG.empty);if(r&&r.slice.size<r.to-r.from){if(t){let n=e.tr.step(r);n.setSelection(cu(o,"start")?li.findFrom(n.doc.resolve(n.mapping.map(i.pos)),1):ld.create(n.doc,n.mapping.map(i.pos))),t(n.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==n.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},cf=(e,t,r)=>{let{$head:n,empty:i}=e.selection,o=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)return!1;o=cm(n)}let s=o&&o.nodeAfter;return!!s&&!!ld.isSelectable(s)&&(t&&t(e.tr.setSelection(ld.create(e.doc,o.pos)).scrollIntoView()),!0)};function cm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let r=e.node(t);if(e.index(t)+1<r.childCount)return e.doc.resolve(e.after(t+1));if(r.type.spec.isolating)break}return null}let cg=(e,t)=>{let{$head:r,$anchor:n}=e.selection;return!!r.parent.type.spec.code&&!!r.sameParent(n)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function cv(e){for(let t=0;t<e.edgeCount;t++){let{type:r}=e.edge(t);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let cy=(e,t)=>{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),o=r.indexAfter(-1),s=cv(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let n=r.after(),i=e.tr.replaceWith(n,n,s.createAndFill());i.setSelection(li.near(i.doc.resolve(n),1)),t(i.scrollIntoView())}return!0},cb=(e,t)=>{let r=e.selection,{$from:n,$to:i}=r;if(r instanceof lp||n.parent.inlineContent||i.parent.inlineContent)return!1;let o=cv(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let r=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,s=e.tr.insert(r,o.createAndFill());s.setSelection(ll.create(s.doc,r+1)),t(s.scrollIntoView())}return!0},cx=(e,t)=>{let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let n=r.before();if(aG(e.doc,n))return t&&t(e.tr.split(n).scrollIntoView()),!0}let n=r.blockRange(),i=n&&aH(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)};function ck(e,t,r,n){let i,o,s,a=t.nodeBefore,l=t.nodeAfter,u,d,c=a.type.spec.isolating||l.type.spec.isolating;if(!c&&(i=t.nodeBefore,o=t.nodeAfter,s=t.index(),i&&o&&i.type.compatibleContent(o.type)&&(!i.content.size&&t.parent.canReplace(s-1,s)?(r&&r(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(o.isTextblock||aX(e.doc,t.pos))&&(r&&r(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let p=!c&&t.parent.canReplace(t.index(),t.index()+1);if(p&&(u=(d=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&d.matchType(u[0]||l.type).validEnd){if(r){let n=t.pos+l.nodeSize,i=sB.empty;for(let e=u.length-1;e>=0;e--)i=sB.from(u[e].create(null,i));i=sB.from(a.copy(i));let o=e.tr.step(new aV(t.pos-1,n,t.pos,n,new sG(i,1,0),u.length,!0)),s=o.doc.resolve(n+2*u.length);s.nodeAfter&&s.nodeAfter.type==a.type&&aX(o.doc,s.pos)&&o.join(s.pos),r(o.scrollIntoView())}return!0}let h=l.type.spec.isolating||n>0&&c?null:li.findFrom(t,1),f=h&&h.$from.blockRange(h.$to),m=f&&aH(f);if(null!=m&&m>=t.depth)return r&&r(e.tr.lift(f,m).scrollIntoView()),!0;if(p&&cu(l,"start",!0)&&cu(a,"end")){let n=a,i=[];for(;i.push(n),!n.isTextblock;)n=n.lastChild;let o=l,s=1;for(;!o.isTextblock;o=o.firstChild)s++;if(n.canReplace(n.childCount,n.childCount,o.content)){if(r){let n=sB.empty;for(let e=i.length-1;e>=0;e--)n=sB.from(i[e].copy(n));r(e.tr.step(new aV(t.pos-i.length,t.pos+l.nodeSize,t.pos+s,t.pos+l.nodeSize-s,new sG(n,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function cw(e){return function(t,r){let n=t.selection,i=e<0?n.$from:n.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(r&&r(t.tr.setSelection(ll.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let c_=cw(-1),c$=cw(1);function cS(e,t=null){return function(r,n){let i=!1;for(let n=0;n<r.selection.ranges.length&&!i;n++){let{$from:{pos:o},$to:{pos:s}}=r.selection.ranges[n];r.doc.nodesBetween(o,s,(n,o)=>
27{if(i)return!1;if(!(!n.isTextblock||n.hasMarkup(e,t)))if(n.type==e)i=!0;else{let t=r.doc.resolve(o),n=t.index();i=t.parent.canReplaceWith(n,n+1,e)}})}if(!i)return!1;if(n){let i=r.tr;for(let n=0;n<r.selection.ranges.length;n++){let{$from:{pos:o},$to:{pos:s}}=r.selection.ranges[n];i.setBlockType(o,s,e,t)}n(i.scrollIntoView())}return!0}}function cI(...e){return function(t,r,n){for(let i=0;i<e.length;i++)if(e[i](t,r,n))return!0;return!1}}let cO=cI(co,ca,cd),cC=cI(co,ch,cf),cN={Enter:cI(cg,cb,cx,(e,t)=>{let{$from:r,$to:n}=e.selection;if(e.selection instanceof ld&&e.selection.node.isBlock)return!!r.parentOffset&&!!aG(e.doc,r.pos)&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],o,s,a=!1,l=!1;for(let e=r.depth;;e--){if(r.node(e).isBlock){let t;a=r.end(e)==r.pos+(r.depth-e),l=r.start(e)==r.pos-(r.depth-e),s=cv(r.node(e-1).contentMatchAt(r.indexAfter(e-1)));i.unshift(t||(a&&s?{type:s}:null)),o=e;break}if(1==e)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof ll||e.selection instanceof lp)&&u.deleteSelection();let d=u.mapping.map(r.pos),c=aG(u.doc,d,i.length,i);if(c||(i[0]=s?{type:s}:null,c=aG(u.doc,d,i.length,i)),!c)return!1;if(u.split(d,i.length,i),!a&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return t&&t(u.scrollIntoView()),!0}),"Mod-Enter":cy,Backspace:cO,"Mod-Backspace":cO,"Shift-Backspace":cO,Delete:cC,"Mod-Delete":cC,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new lp(e.doc))),!0)},cT={"Ctrl-h":cN.Backspace,"Alt-Backspace":cN["Mod-Backspace"],"Ctrl-d":cN.Delete,"Ctrl-Alt-Backspace":cN["Mod-Delete"],"Alt-Delete":cN["Mod-Delete"],"Alt-d":cN["Mod-Delete"],"Ctrl-a":c_,"Ctrl-e":c$};for(let e in cN)cT[e]=cN[e];function cE(e){let{state:t,transaction:r}=e,{selection:n}=r,{doc:i}=r,{storedMarks:o}=r;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return n},get doc(){return i},get tr(){return n=r.selection,i=r.doc,o=r.storedMarks,r}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class cA{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:r}=this,{view:n}=t,{tr:i}=r,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let r=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||n.dispatch(i),r}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:r,editor:n,state:i}=this,{view:o}=n,s=[],a=!!e,l=e||i.tr,u=()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every(e=>!0===e)),d={...Object.fromEntries(Object.entries(r).map(([e,r])=>[e,(...e)=>{let n=this.buildProps(l,t),i=r(...e)(n);return s.push(i),d}])),run:u};return d}createCan(e){let{rawCommands:t,state:r}=this,n=e||r.tr,i=this.buildProps(n,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(n,!1)}}buildProps(e,t=!0){let{rawCommands:r,editor:n,state:i}=this,{view:o}=n,s={tr:e,editor:n,view:o,state:cE({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}}class cD{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let r=this.callbacks[e];return r&&r.forEach(e=>e.apply(this,t)),this}off(e,t){let r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let r=(...n)=>{this.off(e,r),t.apply(this,n)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function cj(e,t,r){return void 0===e.config[t]&&e.parent?cj(e.parent,t,r):"function"==typeof e.config[t]?e.config[t].bind({...r,parent:e.parent?cj(e.parent,t,r):null}):e.config[t]}function cP(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function cz(e){let t=[],{nodeExtensions:r,markExtensions:n}=cP(e),i=[...r,...n],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};
27return e.forEach(e=>{let r={name:e.name,options:e.options,storage:e.storage,extensions:i},n=cj(e,"addGlobalAttributes",r);n&&n().forEach(e=>{e.types.forEach(r=>{Object.entries(e.attributes).forEach(([e,n])=>{t.push({type:r,name:e,attribute:{...o,...n}})})})})}),i.forEach(e=>{let r={name:e.name,options:e.options,storage:e.storage},n=cj(e,"addAttributes",r);n&&Object.entries(n()).forEach(([r,n])=>{let i={...o,...n};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:r,attribute:i})})}),t}function cM(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function cZ(...e){return e.filter(e=>!!e).reduce((e,t)=>{let r={...e};return Object.entries(t).forEach(([e,t])=>{if(!r[e]){r[e]=t;return}if("class"===e){let n=t?String(t).split(" "):[],i=r[e]?r[e].split(" "):[],o=n.filter(e=>!i.includes(e));r[e]=[...i,...o].join(" ")}else if("style"===e){let n=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],i=r[e]?r[e].split(";").map(e=>e.trim()).filter(Boolean):[],o=new Map;i.forEach(e=>{let[t,r]=e.split(":").map(e=>e.trim());o.set(t,r)}),n.forEach(e=>{let[t,r]=e.split(":").map(e=>e.trim());o.set(t,r)}),r[e]=Array.from(o.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else r[e]=t}),r},{})}function cR(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>cZ(e,t),{})}function cL(e){return"function"==typeof e}function cU(e,t,...r){return cL(e)?t?e.bind(t)(...r):e(...r):e}function cV(e,t){return"style"in e?e:{...e,getAttrs:r=>{let n=e.getAttrs?e.getAttrs(r):e.attrs;if(!1===n)return!1;let i=t.reduce((e,t)=>{var n;let i=t.attribute.parseHTML?t.attribute.parseHTML(r):"string"!=typeof(n=r.getAttribute(t.name))?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):"true"===n||"false"!==n&&n;return null==i?e:{...e,[t.name]:i}},{});return{...n,...i}}}}function cF(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function cB(e,t){return t.nodes[e]||t.marks[e]||null}function cH(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function cW(e,t){let r=aS.fromSchema(t).serializeFragment(e),n=document.implementation.createHTMLDocument().createElement("div");return n.appendChild(r),n.innerHTML}function cK(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class cJ{constructor(e){this.find=e.find,this.handler=e.handler}}function cq(e){var t;let{editor:r,from:n,to:i,text:o,rules:s,plugin:a}=e,{view:l}=r;if(l.composing)return!1;let u=l.state.doc.resolve(n);if(u.parent.type.spec.code||(null==(t=u.nodeBefore||u.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let d=!1,c=((e,t=500)=>{let r="",n=e.parentOffset;return e.parent.nodesBetween(Math.max(0,n-t),n,(e,t,i,o)=>{var s,a;let l=(null==(a=(s=e.type.spec).toText)?void 0:a.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";r+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,n-t))}),r})(u)+o;return s.forEach(e=>{if(d)return;let t=((e,t)=>{if(cK(t))return t.exec(e);let r=t(e);if(!r)return null;let n=[r.text];return n.index=r.index,n.input=e,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n})(c,e.find);if(!t)return;let s=l.state.tr,u=cE({state:l.state,transaction:s}),p={from:n-(t[0].length-o.length),to:i}
27,{commands:h,chain:f,can:m}=new cA({editor:r,state:u});null!==e.handler({state:u,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:n,to:i,text:o}),l.dispatch(s),d=!0)}),d}function cG(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function cX(e,t){let r={...e};return cG(e)&&cG(t)&&Object.keys(t).forEach(n=>{cG(t[n])&&cG(e[n])?r[n]=cX(e[n],t[n]):r[n]=t[n]}),r}class cY{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=cU(cj(this,"addOptions",{name:this.name}))),this.storage=cU(cj(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new cY(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>cX(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new cY(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=cU(cj(t,"addOptions",{name:t.name})),t.storage=cU(cj(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){let{tr:r}=e.state,n=e.state.selection.$from;if(n.pos===n.end()){let i=n.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&r.removeStoredMark(o),r.insertText(" ",n.pos),e.view.dispatch(r),!0}return!1}}class cQ{constructor(e){this.find=e.find,this.handler=e.handler}}let c0=null;class c1{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=c1.resolve(e),this.schema=function(e,t){var r;let n=cz(e),{nodeExtensions:i,markExtensions:o}=cP(e),s=null==(r=i.find(e=>cj(e,"topNode")))?void 0:r.name;return new af({topNode:s,nodes:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t},s=cF({...e.reduce((e,t)=>{let n=cj(t,"extendNodeSchema",o);return{...e,...n?n(r):{}}},{}),content:cU(cj(r,"content",o)),marks:cU(cj(r,"marks",o)),group:cU(cj(r,"group",o)),inline:cU(cj(r,"inline",o)),atom:cU(cj(r,"atom",o)),selectable:cU(cj(r,"selectable",o)),draggable:cU(cj(r,"draggable",o)),code:cU(cj(r,"code",o)),whitespace:cU(cj(r,"whitespace",o)),linebreakReplacement:cU(cj(r,"linebreakReplacement",o)),defining:cU(cj(r,"defining",o)),isolating:cU(cj(r,"isolating",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),a=cU(cj(r,"parseHTML",o));a&&(s.parseDOM=a.map(e=>cV(e,i)));let l=cj(r,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:cR(e,i)}));let u=cj(r,"renderText",o);return u&&(s.toText=u),[r.name,s]})),marks:Object.fromEntries(o.map(r=>{let i=n.filter(e=>e.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t},s=cF({...e.reduce((e,t)=>{let n=cj(t,"extendMarkSchema",o);return{...e,...n?n(r):{}}},{}),inclusive:cU(cj(r,"inclusive",o)),excludes:cU(cj(r,"excludes",o)),group:cU(cj(r,"group",o)),spanning:cU(cj(r,"spanning",o)),code:cU(cj(r,"code",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),a=cU(cj(r,"parseHTML",o));a&&(s.parseDOM=a.map(e=>cV(e,i)));let l=cj(r,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:cR(e,i)})),[r.name,s]}))})}(this.extensions,t),this.setupExtensions()}static resolve(e){var t;let r=c1.sort(c1.flatten(e)),n=Array.from(new Set((t=r.map(e=>e.name)).filter((e,r)=>t.indexOf(e)!==r)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),r}static flatten(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},r=cj(e,"addExtensions",t);return r?[e,...this.flatten(r())]:e}).flat(10)}static sort(e){return e.sort((e,t)=>
27{let r=cj(e,"priority")||100,n=cj(t,"priority")||100;return r>n?-1:+(r<n)})}get commands(){return this.extensions.reduce((e,t)=>{let r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:cB(t.name,this.schema)},n=cj(t,"addCommands",r);return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=c1.sort([...this.extensions].reverse()),r=[],n=[],i=t.map(t=>{let i={name:t.name,options:t.options,storage:t.storage,editor:e,type:cB(t.name,this.schema)},o=[],s=cj(t,"addKeyboardShortcuts",i),a={};if("mark"===t.type&&cj(t,"exitable",i)&&(a.ArrowRight=()=>cY.handleExit({editor:e,mark:t})),s){let t=Object.fromEntries(Object.entries(s()).map(([t,r])=>[t,()=>r({editor:e})]));a={...a,...t}}let l=new lw({props:{handleKeyDown:ci(a)}});o.push(l);let u=cj(t,"addInputRules",i);cH(t,e.options.enableInputRules)&&u&&r.push(...u());let d=cj(t,"addPasteRules",i);cH(t,e.options.enablePasteRules)&&d&&n.push(...d());let c=cj(t,"addProseMirrorPlugins",i);if(c){let e=c();o.push(...e)}return o}).flat();return[function(e){let{editor:t,rules:r}=e,n=new lw({state:{init:()=>null,apply(e,i,o){let s=e.getMeta(n);if(s)return s;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=cW(sB.from(e),o.schema));let{from:i}=a,s=i+e.length;cq({editor:t,from:i,to:s,text:e,rules:r,plugin:n})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>cq({editor:t,from:i,to:o,text:s,rules:r,plugin:n}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&cq({editor:t,from:i.pos,to:i.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&cq({editor:t,from:o.pos,to:o.pos,text:"\n",rules:r,plugin:n})}},isInputRules:!0});return n}({editor:e,rules:r}),...function(e){let t,{editor:r,rules:n}=e,i=null,o=!1,s=!1,a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let l=({state:e,from:n,to:i,rule:o,pasteEvt:s})=>{let l=e.tr;if(function(e){let{editor:t,state:r,from:n,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:d}=new cA({editor:t,state:r}),c=[];return r.doc.nodesBetween(n,i,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let p=Math.max(n,t),h=Math.min(i,t+e.content.size);((e,t,r)=>{if(cK(t))return[...e.matchAll(t)];let n=t(e,r);return n?n.map(t=>{let r=[t.text];return r.index=t.index,r.input=e,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(t.replaceWith)),r}):[]})(e.textBetween(p-t,h-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=p+e.index+1,n=t+e[0].length,i={from:r.tr.mapping.map(t),to:r.tr.mapping.map(n)},h=o.handler({state:r,range:i,match:e,commands:l,chain:u,can:d,pasteEvent:s,dropEvent:a});c.push(h)})}),c.every(e=>null!==e)}({editor:r,state:cE({state:e,transaction:l}),from:Math.max(n-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&l.steps.length){try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return n.map(e=>new lw({view(e){let t=t=>{var n;(i=(null==(n=e.dom.parentElement)?void 0:n.contains(t.target))?e.dom.parentElement:null)&&(c0=r)},n=()=>{c0&&(c0=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",n),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",n)}}},props:{handleDOMEvents:{drop:(e,r)=>{if(s=i===e.dom.parentElement,t=r,!s){let e=c0;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var r;let n=null==(r=t.clipboardData)?void 0:r.getData("text/html");return a=t,o=!!(null==n?void 0:n.includes("data-pm-slice")),!1}}},appendTransaction:(t,r,n)=>{let i=t[0],u="paste"===i.getMeta("uiEvent")&&!o,d="drop"===i.getMeta("uiEvent")&&!s,c=i.getMeta("applyPasteRules"),p=!!c;if(!u&&!d&&!p)return;if(p){var h,f;let t,{text:r}=c;"string"==typeof r||(r=cW(sB.from(r),n.schema));let{from:i}=c,o=i+r.length;return l({rule:e,state:n,from:i,to:{b:o},pasteEvt:(h=r,null==(f=(t=new ClipboardEvent("paste",{clipboardData:new DataTransfer})).clipboardData)||f.setData("text/html",h),t)})}
27let m=r.doc.content.findDiffStart(n.doc.content),g=r.doc.content.findDiffEnd(n.doc.content);if("number"==typeof m&&g&&m!==g.b)return l({rule:e,state:n,from:m,to:g,pasteEvt:a})}}))}({editor:e,rules:n}),...i]}get attributes(){return cz(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=cP(this.extensions);return Object.fromEntries(t.filter(e=>!!cj(e,"addNodeView")).map(t=>{let r=this.attributes.filter(e=>e.type===t.name),n={name:t.name,options:t.options,storage:t.storage,editor:e,type:cM(t.name,this.schema)},i=cj(t,"addNodeView",n);return i?[t.name,(n,o,s,a,l)=>{let u=cR(n,r);return i()({node:n,view:o,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:u})}]:[]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;let r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:cB(e.name,this.schema)};"mark"===e.type&&(null==(t=cU(cj(e,"keepOnSplit",r)))||t)&&this.splittableMarks.push(e.name);let n=cj(e,"onBeforeCreate",r),i=cj(e,"onCreate",r),o=cj(e,"onUpdate",r),s=cj(e,"onSelectionUpdate",r),a=cj(e,"onTransaction",r),l=cj(e,"onFocus",r),u=cj(e,"onBlur",r),d=cj(e,"onDestroy",r);n&&this.editor.on("beforeCreate",n),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class c4{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=cU(cj(this,"addOptions",{name:this.name}))),this.storage=cU(cj(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new c4(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>cX(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new c4({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=cU(cj(t,"addOptions",{name:t.name})),t.storage=cU(cj(t,"addStorage",{name:t.name,options:t.options})),t}}function c2(e,t,r){let{from:n,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=r||{},a="";return e.nodesBetween(n,i,(e,r,l,u)=>{var d;e.isBlock&&r>n&&(a+=o);let c=null==s?void 0:s[e.type.name];if(c)return l&&(a+=c({node:e,pos:r,parent:l,index:u,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(n,r)-r,i-r))}),a}function c6(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}let c3=c4.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new lw({key:new lS("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:r}=e,{doc:n,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),a=Math.max(...o.map(e=>e.$to.pos)),l=c6(r);return c2(n,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});function c9(e,t,r={strict:!0}){let n=Object.keys(t);return!n.length||n.every(n=>r.strict?t[n]===e[n]:cK(t[n])?t[n].test(e[n]):t[n]===e[n])}function c5(e,t,r={}){return e.find(e=>e.type===t&&c9(Object.fromEntries(Object.keys(r).map(t=>[t,e.attrs[t]])),r))}function c7(e,t,r={}){return!!c5(e,t,r)}function c8(e,t,r){var n;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some(e=>e.type===t)||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(e=>e.type===t)||(r=r||(null==(n=i.node.marks[0])?void 0:n.attrs),!c5([...i.node.marks],t,r)))return;let o=i.index,s=e.start()+i.offset,a=o+1,l=s+i.node.nodeSize;
27for(;o>0&&c7([...e.parent.child(o-1).marks],t,r);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&c7([...e.parent.child(a).marks],t,r);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function pe(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function pt(e){return e instanceof ll}function pr(e=0,t=0,r=0){return Math.min(Math.max(e,t),r)}function pn(e,t=null){if(!t)return null;let r=li.atStart(e),n=li.atEnd(e);if("start"===t||!0===t)return r;if("end"===t)return n;let i=r.from,o=n.to;return"all"===t?ll.create(e,pr(0,i,o),pr(e.content.size,i,o)):ll.create(e,pr(t,i,o),pr(t,i,o))}function pi(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function po(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let ps=e=>{let t=e.childNodes;for(let r=t.length-1;r>=0;r-=1){let n=t[r];3===n.nodeType&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?e.removeChild(n):1===n.nodeType&&ps(n)}return e};function pa(e){let t=`<body>${e}</body>`;return ps(new window.DOMParser().parseFromString(t,"text/html").body)}function pl(e,t,r){if(e instanceof s8||e instanceof sB)return e;r={slice:!0,parseOptions:{},...r};let n="object"==typeof e&&null!==e,i="string"==typeof e;if(n)try{if(Array.isArray(e)&&e.length>0)return sB.fromArray(e.map(e=>t.nodeFromJSON(e)));let n=t.nodeFromJSON(e);return r.errorOnInvalidContent&&n.check(),n}catch(n){if(r.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:n});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",n),pl("",t,r)}if(i){if(r.errorOnInvalidContent){let n=!1,i="",o=new af({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(n=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(r.slice?ag.fromSchema(o).parseSlice(pa(e),r.parseOptions):ag.fromSchema(o).parse(pa(e),r.parseOptions),r.errorOnInvalidContent&&n)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let n=ag.fromSchema(t);return r.slice?n.parseSlice(pa(e),r.parseOptions).content:n.parse(pa(e),r.parseOptions)}return pl("",t,r)}function pu(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}function pd(e,t,r={}){let{from:n,to:i,empty:o}=e.selection,s=t?cM(t,e.schema):null,a=[];e.doc.nodesBetween(n,i,(e,t)=>{if(e.isText)return;let r=Math.max(n,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:r,to:o})});let l=i-n,u=a.filter(e=>!s||s.name===e.node.type.name).filter(e=>c9(e.node.attrs,r,{strict:!1}));return o?!!u.length:u.reduce((e,t)=>e+t.to-t.from,0)>=l}function pc(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function pp(e,t){let r="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,n)=>(r.includes(n)||(t[n]=e[n]),t),{})}function ph(e,t,r={},n={}){return pl(e,t,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}function pf(e,t){let r=pe(t,e.schema),{from:n,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(n,i,e=>{s.push(...e.marks)});let a=s.find(e=>e.type.name===r.name);return a?{...a.attrs}:{}}function pm(e){return t=>(function(e,t){for(let r=e.depth;r>0;r-=1){let n=e.node(r);if(t(n))return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:n}}})(t.$from,e)}function pg(e,t){let r={from:0,to:e.content.size};return c2(e,r,t)}function pv(e,t){let r=pc("string"==typeof t?t:t.name,e.schema);return"node"===r?function(e,t){let r=cM(t,e.schema),{from:n,to:i}=e.selection,o=[];e.doc.nodesBetween(n,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===r.name);return s?{...s.attrs}:{}}(e,t):"mark"===r?pf(e,t):{}}function py(e,t,r){let n=[];return e===t?r.resolve(e).marks().forEach(t=>{let i=c8(r.resolve(e),t.type);i&&n.push({mark:t,...i})}):r.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&n.push(...e.marks.map(r=>({from:t,to:t+e.nodeSize,mark:r})))}),n}function pb(e,t,r){return Object.fromEntries(Object.entries(r).filter(([r])=>{let n=e.find(e=>e.type===t&&e.name===r);return!!n&&n.attribute.keepOnSplit}))}function px(e,t,r={}){let{empty:n,ranges:i}=e.selection,o=t?pe(t,e.schema):null;if(n)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>
27!o||o.name===e.type.name).find(e=>c9(e.attrs,r,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:t,$to:r})=>{let n=t.pos,i=r.pos;e.doc.nodesBetween(n,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let r=Math.max(n,t),o=Math.min(i,t+e.nodeSize);s+=o-r,a.push(...e.marks.map(e=>({mark:e,from:r,to:o})))})}),0===s)return!1;let l=a.filter(e=>!o||o.name===e.mark.type.name).filter(e=>c9(e.mark.attrs,r,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),u=a.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(l>0?l+u:l)>=s}function pk(e,t){let{nodeExtensions:r}=cP(t),n=r.find(t=>t.name===e);if(!n)return!1;let i={name:n.name,options:n.options,storage:n.storage},o=cU(cj(n,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function pw(e,{checkChildren:t=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(n=e.text)?n:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let n=!0;return e.content.forEach(e=>{!1!==n&&(pw(e,{ignoreWhitespace:r,checkChildren:t})||(n=!1))}),n}return!1}function p_(e){return e instanceof ld}function p$(e,t,r){let n=e.state.doc.content.size,i=pr(t,0,n),o=pr(r,0,n),s=e.coordsAtPos(i),a=e.coordsAtPos(o,-1),l=Math.min(s.top,a.top),u=Math.max(s.bottom,a.bottom),d=Math.min(s.left,a.left),c=Math.max(s.right,a.right),p={top:l,bottom:u,left:d,right:c,width:c-d,height:u-l,x:d,y:l};return{...p,toJSON:()=>p}}function pS(e,t){let r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(r){let n=r.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(n)}}let pI=(e,t)=>{let r=pm(e=>e.type===t)(e.selection);if(!r)return!0;let n=e.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(void 0===n)return!0;let i=e.doc.nodeAt(n);return!(r.node.type===(null==i?void 0:i.type)&&aX(e.doc,r.pos))||(e.join(r.pos),!0)},pO=(e,t)=>{let r=pm(e=>e.type===t)(e.selection);if(!r)return!0;let n=e.doc.resolve(r.start).after(r.depth);if(void 0===n)return!0;let i=e.doc.nodeAt(n);return!(r.node.type===(null==i?void 0:i.type)&&aX(e.doc,n))||(e.join(n),!0)};var pC=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var r;e.isDestroyed||(t.dom.blur(),null==(r=null==window?void 0:window.getSelection())||r.removeAllRanges())}),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:r})=>{let{selection:n}=t,{ranges:i}=n;return!r||(i.forEach(({$from:r,$to:n})=>{e.doc.nodesBetween(r.pos,n.pos,(e,r)=>{if(e.type.isText)return;let{doc:n,mapping:i}=t,o=n.resolve(i.map(r)),s=n.resolve(i.map(r+e.nodeSize)),a=o.blockRange(s);if(!a)return;let l=aH(a);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)})}),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>cb(e,t),cut:(e,t)=>({editor:r,tr:n})=>{let{state:i}=r,o=i.doc.slice(e.from,e.to);n.deleteRange(e.from,e.to);let s=n.mapping.map(t);return n.insert(s,o.content),n.setSelection(new ll(n.doc.resolve(Math.max(s-1,0)))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{let{selection:r}=e,n=r.$anchor.node();if(n.content.size>0)return!1;let i=e.selection.$anchor;for(let r=i.depth;r>0;r-=1)if(i.node(r).type===n.type){if(t){let t=i.before(r),n=i.after(r);e.delete(t,n).scrollIntoView()}return!0}return!1},deleteNode:e=>({tr:t,state:r,dispatch:n})=>{let i=cM(e,r.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(n){let r=o.before(e),n=o.after(e);t.delete(r,n).scrollIntoView()}return!0}return!1},deleteRange:e=>({tr:t,dispatch:r})=>{let{from:n,to:i}=e;return r&&t.delete(n,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>co(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>cy(e,t),extendMarkRange:(e,t={})=>({tr:r,state:n,dispatch:i})=>{let o=pe(e,n.schema),{doc:s,selection:a}=r,{$from:l,from:u,to:d}=a;if(i){let e=c8(l,o,t);if(e&&e.from<=u&&e.to>=d){let t=ll.create(s,e.from,e.to);r.setSelection(t)}}return!0},first:e=>t=>{let r="function"==typeof e?e(t):e;for(let e=0;e<r.length;e+=1)if(r[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:r,view:n,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(po()||pi())&&n.dom.focus(),requestAnimationFrame(()=>{!r.isDestroyed&&(n.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!po()&&!pi()&&n.dom.focus({preventScroll:!0}))})};if(n.hasFocus()&&null===e||!1===e)return!0;
27if(o&&null===e&&!pt(r.state.selection))return s(),!0;let a=pn(i.doc,e)||r.state.selection,l=r.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>r=>e.every((e,n)=>t(e,{...r,index:n})),insertContent:(e,t)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},e,t),insertContentAt:(e,t,r)=>({tr:n,dispatch:i,editor:o})=>{var s;if(i){let i,a;r={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let l=e=>{o.emit("contentError",{editor:o,error:e,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{pl(t,o.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(e){l(e)}try{i=pl(t,o.schema,{parseOptions:u,errorOnInvalidContent:null!=(s=r.errorOnInvalidContent)?s:o.options.enableContentCheck})}catch(e){return l(e),!1}let{from:d,to:c}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},p=!0,h=!0;if((!("type"in i)?i:[i]).forEach(e=>{e.check(),p=!!p&&e.isText&&0===e.marks.length,h=!!h&&e.isBlock}),d===c&&h){let{parent:e}=n.doc.resolve(d);!e.isTextblock||e.type.spec.code||e.childCount||(d-=1,c+=1)}if(p){if(Array.isArray(t))a=t.map(e=>e.text||"").join("");else if(t instanceof sB){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),a=e}else a="object"==typeof t&&t&&t.text?t.text:t;n.insertText(a,d,c)}else a=i,n.replaceWith(d,c,a);r.updateSelection&&function(e,t){let r=e.steps.length-1;if(r<t)return;let n=e.steps[r];if(!(n instanceof aU||n instanceof aV))return;let i=e.mapping.maps[r],o=0;i.forEach((e,t,r,n)=>{0===o&&(o=n)}),e.setSelection(li.near(e.doc.resolve(o),-1))}(n,n.steps.length-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:d,text:a}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:d,text:a})}return!0},joinBackward:()=>({state:e,dispatch:t})=>ca(e,t),joinDown:()=>({state:e,dispatch:t})=>((e,t)=>{let r=e.selection,n;if(r instanceof ld){if(r.node.isTextblock||!aX(e.doc,r.to))return!1;n=r.to}else if(null==(n=aQ(e.doc,r.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),joinForward:()=>({state:e,dispatch:t})=>ch(e,t),joinItemBackward:()=>({state:e,dispatch:t,tr:r})=>{try{let n=aQ(e.doc,e.selection.$from.pos,-1);if(null==n)return!1;return r.join(n,2),t&&t(r),!0}catch{return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:r})=>{try{let n=aQ(e.doc,e.selection.$from.pos,1);if(null==n)return!1;return r.join(n,2),t&&t(r),!0}catch{return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>((e,t,r)=>{let n=cs(e,r);if(!n)return!1;let i=cc(n);return!!i&&cl(e,i,t)})(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>((e,t,r)=>{let n=cp(e,r);if(!n)return!1;let i=cm(n);return!!i&&cl(e,i,t)})(e,t),joinUp:()=>({state:e,dispatch:t})=>((e,t)=>{let r=e.selection,n=r instanceof ld,i;if(n){if(r.node.isTextblock||!aX(e.doc,r.from))return!1;i=r.from}else if(null==(i=aQ(e.doc,r.from,-1)))return!1;if(t){let r=e.tr.join(i);n&&r.setSelection(ld.create(r.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),keyboardShortcut:e=>({editor:t,view:r,tr:n,dispatch:i})=>{let o=(function(e){let t,r,n,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))n=!0;else if(/^mod$/i.test(s))po()||pu()?i=!0:r=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),n&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{r.someProp("handleKeyDown",e=>e(r,a))});
27return null==l||l.steps.forEach(e=>{let t=e.map(n.mapping);t&&i&&n.maybeStep(t)}),!0},lift:(e,t={})=>({state:r,dispatch:n})=>{let i=cM(e,r.schema);return!!pd(r,i,t)&&((e,t)=>{let{$from:r,$to:n}=e.selection,i=r.blockRange(n),o=i&&aH(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(r,n)},liftEmptyBlock:()=>({state:e,dispatch:t})=>cx(e,t),liftListItem:e=>({state:t,dispatch:r})=>{var n;return(n=cM(e,t.schema),function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,e=>e.childCount>0&&e.firstChild.type==n);return!!o&&(!t||(r.node(o.depth-1).type==n?function(e,t,r,n){let i=e.tr,o=n.end,s=n.$to.end(n.depth);o<s&&(i.step(new aV(o-1,s,o,s,new sG(sB.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new s5(i.doc.resolve(n.$from.pos),i.doc.resolve(s),n.depth));let a=aH(n);if(null==a)return!1;i.lift(n,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return aX(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0}(e,t,n,o):function(e,t,r){let n=e.tr,i=r.parent;for(let e=r.end,t=r.endIndex-1,o=r.startIndex;t>o;t--)e-=i.child(t).nodeSize,n.delete(e-1,e+1);let o=n.doc.resolve(r.start),s=o.nodeAfter;if(n.mapping.map(r.end)!=r.start+o.nodeAfter.nodeSize)return!1;let a=0==r.startIndex,l=r.endIndex==i.childCount,u=o.node(-1),d=o.index(-1);if(!u.canReplace(d+ +!a,d+1,s.content.append(l?sB.empty:sB.from(i))))return!1;let c=o.pos,p=c+s.nodeSize;return n.step(new aV(c-!!a,p+ +!!l,c+1,p-1,new sG((a?sB.empty:sB.from(i.copy(sB.empty))).append(l?sB.empty:sB.from(i.copy(sB.empty))),+!a,+!l),+!a)),t(n.scrollIntoView()),!0}(e,t,o)))})(t,r)},newlineInCode:()=>({state:e,dispatch:t})=>cg(e,t),resetAttributes:(e,t)=>({tr:r,state:n,dispatch:i})=>{let o=null,s=null,a=pc("string"==typeof e?e:e.name,n.schema);return!!a&&("node"===a&&(o=cM(e,n.schema)),"mark"===a&&(s=pe(e,n.schema)),i&&r.selection.ranges.forEach(e=>{n.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,n)=>{o&&o===e.type&&r.setNodeMarkup(n,void 0,pp(e.attrs,t)),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&r.addMark(n,n+e.nodeSize,s.create(pp(i.attrs,t)))})})}),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,dispatch:t})=>{if(t){let t=new lp(e.doc);e.setSelection(t)}return!0},selectNodeBackward:()=>({state:e,dispatch:t})=>cd(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>cf(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:r,to:n}=e.selection,i,o=r.sharedDepth(n);return 0!=o&&(i=r.before(o),t&&t(e.tr.setSelection(ld.create(e.doc,i))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>c$(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>c_(e,t),setContent:(e,t=!1,r={},n={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;let{doc:d}=o;if("full"!==r.preserveWhitespace){let a=ph(e,i.schema,r,{errorOnInvalidContent:null!=(l=n.errorOnInvalidContent)?l:i.options.enableContentCheck});return s&&o.replaceWith(0,d.content.size,a).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:d.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=(u=n.errorOnInvalidContent)?u:i.options.enableContentCheck})},setMark:(e,t={})=>({tr:r,state:n,dispatch:i})=>{let{selection:o}=r,{empty:s,ranges:a}=o,l=pe(e,n.schema);if(i)if(s){let e=pf(n,l);r.addStoredMark(l.create({...e,...t}))}else a.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;n.doc.nodesBetween(i,o,(e,n)=>{let s=Math.max(n,i),a=Math.min(n+e.nodeSize,o);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&r.addMark(s,a,l.create({...e.attrs,...t}))}):r.addMark(s,a,l.create(t))})});return function(e,t,r){var n;let{selection:i}=t,o=null;
27if(pt(i)&&(o=i.$cursor),o){let t=null!=(n=e.storedMarks)?n:o.marks();return!!r.isInSet(t)||!t.some(e=>e.type.excludes(r))}let{ranges:s}=i;return s.some(({$from:t,$to:n})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(r);return e.doc.nodesBetween(t.pos,n.pos,(e,t,n)=>{if(i)return!1;if(e.isInline){let t=!n||n.type.allowsMarkType(r),o=!!r.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(r));i=t&&o}return!i}),i})}(n,r,l)},setMeta:(e,t)=>({tr:r})=>(r.setMeta(e,t),!0),setNode:(e,t={})=>({state:r,dispatch:n,chain:i})=>{let o,s=cM(e,r.schema);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!cS(s,{...o,...t})(r)||e.clearNodes()).command(({state:e})=>cS(s,{...o,...t})(e,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:r})=>{if(r){let{doc:r}=t,n=pr(e,0,r.content.size),i=ld.create(r,n);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:r})=>{if(r){let{doc:r}=t,{from:n,to:i}="number"==typeof e?{from:e,to:e}:e,o=ll.atStart(r).from,s=ll.atEnd(r).to,a=pr(n,o,s),l=pr(i,o,s),u=ll.create(r,a,l);t.setSelection(u)}return!0},sinkListItem:e=>({state:t,dispatch:r})=>{var n;return(n=cM(e,t.schema),function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,e=>e.childCount>0&&e.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=n)return!1;if(t){let r=l.lastChild&&l.lastChild.type==a.type,i=sB.from(r?n.create():null),s=new sG(sB.from(n.create(null,sB.from(a.type.create(null,i)))),r?3:1,0),u=o.start,d=o.end;t(e.tr.step(new aV(u-(r?3:1),d,u,d,s,1,!0)).scrollIntoView())}return!0})(t,r)},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:r,dispatch:n,editor:i})=>{let{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=pb(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof ld&&o.node.isBlock)return!!a.parentOffset&&!!aG(s,a.pos)&&(n&&(e&&pS(r,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let d=l.parentOffset===l.parent.content.size,c=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:r}=e.edge(t);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=d&&c?[{type:c,attrs:u}]:void 0,h=aG(t.doc,t.mapping.map(a.pos),1,p);if(!p&&!h&&aG(t.doc,t.mapping.map(a.pos),1,c?[{type:c}]:void 0)&&(h=!0,p=c?[{type:c,attrs:u}]:void 0),n){if(h&&(o instanceof ll&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,p),c&&!d&&!a.parentOffset&&a.parent.type!==c)){let e=t.mapping.map(a.before()),r=t.doc.resolve(e);a.node(-1).canReplaceWith(r.index(),r.index()+1,c)&&t.setNodeMarkup(t.mapping.map(a.before()),c)}e&&pS(r,i.extensionManager.splittableMarks),t.scrollIntoView()}return h},splitListItem:(e,t={})=>({tr:r,state:n,dispatch:i,editor:o})=>{var s;let a=cM(e,n.schema),{$from:l,$to:u}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;let c=l.node(-1);if(c.type!==a)return!1;let p=o.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=sB.empty,n=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-n;t>=l.depth-3;t-=1)e=sB.from(l.node(t).copy(e));let i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,o={...pb(p,l.node().type.name,l.node().attrs),...t},u=(null==(s=a.contentMatch.defaultType)?void 0:s.createAndFill(o))||void 0;e=e.append(sB.from(a.createAndFill(null,u)||void 0));let d=l.before(l.depth-(n-1));r.replace(d,l.after(-i),new sG(e,4-n,0));let c=-1;r.doc.nodesBetween(d,r.doc.content.size,(e,t)=>{if(c>-1)return!1;e.isTextblock&&0===e.content.size&&(c=t+1)}),c>-1&&r.setSelection(ll.near(r.doc.resolve(c))),r.scrollIntoView()}return!0}let h=u.pos===l.end()?c.contentMatchAt(0).defaultType:null,f={...pb(p,c.type.name,c.attrs),...t},m={...pb(p,l.node().type.name,l.node().attrs),...t};r.delete(l.pos,u.pos);let g=h?[{type:a,attrs:f},{type:h,attrs:m}]:[{type:a,attrs:f}];if(!aG(r.doc,l.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=n,{splittableMarks:s}=o.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(r.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;let u=a.filter(e=>
27s.includes(e.type.name));r.ensureMarks(u)}return!0},toggleList:(e,t,r,n={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:d})=>{let{extensions:c,splittableMarks:p}=i.extensionManager,h=cM(e,s.schema),f=cM(t,s.schema),{selection:m,storedMarks:g}=s,{$from:v,$to:y}=m,b=v.blockRange(y),x=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;let k=pm(e=>pk(e.type.name,c))(m);if(b.depth>=1&&k&&b.depth-k.depth<=1){if(k.node.type===h)return u.liftListItem(f);if(pk(k.node.type.name,c)&&h.validContent(k.node.content)&&a)return l().command(()=>(o.setNodeMarkup(k.pos,h),!0)).command(()=>pI(o,h)).command(()=>pO(o,h)).run()}return r&&x&&a?l().command(()=>{let e=d().wrapInList(h,n),t=x.filter(e=>p.includes(e.type.name));return o.ensureMarks(t),!!e||u.clearNodes()}).wrapInList(h,n).command(()=>pI(o,h)).command(()=>pO(o,h)).run():l().command(()=>!!d().wrapInList(h,n)||u.clearNodes()).wrapInList(h,n).command(()=>pI(o,h)).command(()=>pO(o,h)).run()},toggleMark:(e,t={},r={})=>({state:n,commands:i})=>{let{extendEmptyMarkRange:o=!1}=r,s=pe(e,n.schema);return px(n,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,r={})=>({state:n,commands:i})=>{let o,s=cM(e,n.schema),a=cM(t,n.schema),l=pd(n,s,r);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),l)?i.setNode(a,o):i.setNode(s,{...o,...r})},toggleWrap:(e,t={})=>({state:r,commands:n})=>{let i=cM(e,r.schema);return pd(r,i,t)?n.lift(i):n.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{let r=e.plugins;for(let n=0;n<r.length;n+=1){let i,o=r[n];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,r=i.transform;for(let e=r.steps.length-1;e>=0;e-=1)t.step(r.steps[e].invert(r.docs[e]));if(i.text){let r=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,r))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{let{selection:r}=e,{empty:n,ranges:i}=r;
27return!!n||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},unsetMark:(e,t={})=>({tr:r,state:n,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=r,l=pe(e,n.schema),{$from:u,empty:d,ranges:c}=a;if(!i)return!0;if(d&&s){let{from:e,to:t}=a,n=null==(o=u.marks().find(e=>e.type===l))?void 0:o.attrs,i=c8(u,l,n);i&&(e=i.from,t=i.to),r.removeMark(e,t,l)}else c.forEach(e=>{r.removeMark(e.$from.pos,e.$to.pos,l)});return r.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:r,state:n,dispatch:i})=>{let o=null,s=null,a=pc("string"==typeof e?e:e.name,n.schema);return!!a&&("node"===a&&(o=cM(e,n.schema)),"mark"===a&&(s=pe(e,n.schema)),i&&r.selection.ranges.forEach(e=>{let i,a,l,u,d=e.$from.pos,c=e.$to.pos;r.selection.empty?n.doc.nodesBetween(d,c,(e,t)=>{o&&o===e.type&&(l=Math.max(t,d),u=Math.min(t+e.nodeSize,c),i=t,a=e)}):n.doc.nodesBetween(d,c,(e,n)=>{n<d&&o&&o===e.type&&(l=Math.max(n,d),u=Math.min(n+e.nodeSize,c),i=n,a=e),n>=d&&n<=c&&(o&&o===e.type&&r.setNodeMarkup(n,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type){let o=Math.max(n,d),a=Math.min(n+e.nodeSize,c);r.addMark(o,a,s.create({...i.attrs,...t}))}}))}),a&&(void 0!==i&&r.setNodeMarkup(i,void 0,{...a.attrs,...t}),s&&a.marks.length&&a.marks.forEach(e=>{s===e.type&&r.addMark(l,u,s.create({...e.attrs,...t}))}))}),!0)},wrapIn:(e,t={})=>({state:r,dispatch:n})=>(function(e,t=null){return function(r,n){let{$from:i,$to:o}=r.selection,s=i.blockRange(o),a=s&&aW(s,e,t);return!!a&&(n&&n(r.tr.wrap(s,a).scrollIntoView()),!0)}})(cM(e,r.schema),t)(r,n),wrapInList:(e,t={})=>({state:r,dispatch:n})=>(function(e,t=null){return function(r,n){let{$from:i,$to:o}=r.selection,s=i.blockRange(o);if(!s)return!1;let a=n?r.tr:null;return!!function(e,t,r,n=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(r)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);o=new s5(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new s5(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=aW(o,r,n,t);return!!a&&(e&&function(e,t,r,n,i){let o=sB.empty;for(let e=r.length-1;e>=0;e--)o=sB.from(r[e].type.create(r[e].attrs,o));e.step(new aV(t.start-2*!!n,t.end,t.start,t.end,new sG(o,0,0),r.length,!0));let s=0;for(let e=0;e<r.length;e++)r[e].type==i&&(s=e+1);let a=r.length-s,l=t.start+r.length-2*!!n,u=t.parent;for(let r=t.startIndex,n=t.endIndex,i=!0;r<n;r++,i=!1)!i&&aG(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(r).nodeSize}(e,t,a,i,r),!0)}(a,s,e,t)&&(n&&n(a.scrollIntoView()),!0)}})(cM(e,r.schema),t)(r,n)});let pN=c4.create({name:"commands",addCommands:()=>({...pC})}),pT=c4.create({name:"drop",addProseMirrorPlugins(){return[new lw({key:new lS("tiptapDrop"),props:{handleDrop:(e,t,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:r,moved:n})}}})]}}),pE=c4.create({name:"editable",addProseMirrorPlugins(){return[new lw({key:new lS("editable"),props:{editable:()=>this.editor.options.editable}})]}}),pA=new lS("focusEvents"),pD=c4.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new lw({key:pA,props:{handleDOMEvents:{focus:(t,r)=>
27{e.isFocused=!0;let n=e.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1},blur:(t,r)=>{e.isFocused=!1;let n=e.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1}}}})]}}),pj=c4.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:r,doc:n}=t,{empty:i,$anchor:o}=r,{pos:s,parent:a}=o,l=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,u=l.parent.type.spec.isolating,d=o.pos-o.parentOffset,c=u&&1===l.parent.childCount?d===o.pos:li.atStart(n).from===s;return!!i&&!!a.type.isTextblock&&!a.textContent.length&&!!c&&(!c||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},n={...r},i={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return po()||pu()?i:n},addProseMirrorPlugins(){return[new lw({key:new lS("clearDocument"),appendTransaction:(e,t,r)=>{if(e.some(e=>e.getMeta("composition")))return;let n=e.some(e=>e.docChanged)&&!t.doc.eq(r.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!n||i)return;let{empty:o,from:s,to:a}=t.selection,l=li.atStart(t.doc).from,u=li.atEnd(t.doc).to;if(o||s!==l||a!==u||!pw(r.doc))return;let d=r.tr,c=cE({state:r,transaction:d}),{commands:p}=new cA({editor:this.editor,state:c});if(p.clearNodes(),d.steps.length)return d}})]}}),pP=c4.create({name:"paste",addProseMirrorPlugins(){return[new lw({key:new lS("tiptapPaste"),props:{handlePaste:(e,t,r)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:r})}}})]}}),pz=c4.create({name:"tabindex",addProseMirrorPlugins(){return[new lw({key:new lS("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class pM{get name(){return this.node.type.name}constructor(e,t,r=!1,n=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=n}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?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(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);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}get parent(){if(0===this.depth)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1);return new pM(this.resolvedPos.doc.resolve(e),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 pM(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 pM(e,this.editor)}get children(){let e=[];return this.node.content.forEach((t,r)=>{let n=t.isBlock&&!t.isTextblock,i=t.isAtom&&!t.isText,o=this.pos+r+ +!i;if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;let s=this.resolvedPos.doc.resolve(o);if(!n&&s.depth<=this.depth)return;
27let a=new pM(s,this.editor,n,n?t:null);n&&(a.actualDepth=this.depth+1),e.push(new pM(s,this.editor,n,n?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,n=this.parent;for(;n&&!r;){if(n.node.type.name===e)if(Object.keys(t).length>0){let e=n.node.attrs,r=Object.keys(t);for(let n=0;n<r.length;n+=1){let i=r[n];if(e[i]!==t[i])break}}else r=n;n=n.parent}return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let n=[];if(!this.children||0===this.children.length)return n;let i=Object.keys(t);return this.children.forEach(o=>{r&&n.length>0||(o.node.type.name===e&&i.every(e=>t[e]===o.node.attrs[e])&&n.push(o),r&&n.length>0||(n=n.concat(o.querySelectorAll(e,t,r))))}),n}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}}let pZ=`.ProseMirror {
28  position: relative;
29}
30
31.ProseMirror {
32  word-wrap: break-word;
33  white-space: pre-wrap;
34  white-space: break-spaces;
35  -webkit-font-variant-ligatures: none;
36  font-variant-ligatures: none;
37  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
38}
39
40.ProseMirror [contenteditable="false"] {
41  white-space: normal;
42}
43
44.ProseMirror [contenteditable="false"] [contenteditable="true"] {
45  white-space: pre-wrap;
46}
47
48.ProseMirror pre {
49  white-space: pre-wrap;
50}
51
52img.ProseMirror-separator {
53  display: inline !important;
54  border: none !important;
55  margin: 0 !important;
56  width: 0 !important;
57  height: 0 !important;
58}
59
60.ProseMirror-gapcursor {
61  display: none;
62  pointer-events: none;
63  position: absolute;
64  margin: 0;
65}
66
67.ProseMirror-gapcursor:after {
68  content: "";
69  display: block;
70  position: absolute;
71  top: -2px;
72  width: 20px;
73  border-top: 1px solid black;
74  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
75}
76
77@keyframes ProseMirror-cursor-blink {
78  to {
79    visibility: hidden;
80  }
81}
82
83.ProseMirror-hideselection *::selection {
84  background: transparent;
85}
86
87.ProseMirror-hideselection *::-moz-selection {
88  background: transparent;
89}
90
91.ProseMirror-hideselection * {
92  caret-color: transparent;
93}
94
95.ProseMirror-focused .ProseMirror-gapcursor {
96  display: block;
97}
98
99.tippy-box[data-animation=fade][data-state=hidden] {
100  opacity: 0
101}`;class pR extends cD{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),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,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),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:e,slice:t,moved:r})=>this.options.onDrop(e,t,r)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}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&&document&&(this.css=function(e,t){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let n=document.createElement("style");return t&&n.setAttribute("nonce",t),n.setAttribute("data-tiptap-style",""),n.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(n),n}(pZ,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}
101),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){let r=cL(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,r=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;r=r.filter(e=>!e.key.startsWith(t))}),t.length===r.length)return;let n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}createExtensionManager(){var e,t;let r=[...this.options.enableCoreExtensions?[pE,c3.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),pN,pD,pj,pz,pT,pP].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new c1(r,this)}createCommandManager(){this.commandManager=new cA({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=ph(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:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),t=ph(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let r=pn(t,this.options.autofocus);this.view=new dQ(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null==(e=this.options.editorProps)?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:lk.create({doc:t,selection:r||void 0})});let n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let n=e.getMeta("focus"),i=e.getMeta("blur");n&&this.emit("focus",{editor:this,event:n.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!e.docChanged||e.getMeta("preventUpdate")||this.emit("update",{editor:this,transaction:e})}getAttributes(e){return pv(this.state,e)}isActive(e,t){let r="string"==typeof e?e:null,n="string"==typeof e?t:e;return function(e,t,r={}){if(!t)return pd(e,null,r)||px(e,null,r);let n=pc(t,e.schema);return"node"===n?pd(e,t,r):"mark"===n&&px(e,t,r)}(this.state,r,n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return cW(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t="\n\n",textSerializers:r={}}=e||{};return pg(this.state.doc,{blockSeparator:t,textSerializers:{...c6(this.schema),...r}})}get isEmpty(){return pw(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.
101content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(null==(e=this.view)?void 0:e.docView)}$node(e,t){var r;return(null==(r=this.$doc)?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return(null==(r=this.$doc)?void 0:r.querySelectorAll(e,t))||null}$pos(e){return new pM(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}}function pL(e){return new cJ({find:e.find,handler:({state:t,range:r,match:n})=>{let i=cU(e.getAttributes,void 0,n);if(!1===i||null===i)return null;let{tr:o}=t,s=n[n.length-1],a=n[0];if(s){let n=a.search(/\S/),l=r.from+a.indexOf(s),u=l+s.length;if(py(r.from,r.to,t.doc).filter(t=>t.mark.type.excluded.find(r=>r===e.type&&r!==t.mark.type)).filter(e=>e.to>l).length)return null;u<r.to&&o.delete(u,r.to),l>r.from&&o.delete(r.from+n,l);let d=r.from+n+s.length;o.addMark(r.from+n,d,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function pU(e){return new cJ({find:e.find,handler:({state:t,range:r,match:n})=>{let i=t.doc.resolve(r.from),o=cU(e.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,o)}})}function pV(e){return new cJ({find:e.find,handler:({state:t,range:r,match:n,chain:i})=>{let o=cU(e.getAttributes,void 0,n)||{},s=t.tr.delete(r.from,r.to),a=s.doc.resolve(r.from).blockRange(),l=a&&aW(a,e.type,o);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){let{selection:r,storedMarks:n}=t,{splittableMarks:i}=e.editor.extensionManager,o=n||r.$to.parentOffset&&r.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let u=s.doc.resolve(r.from-1).nodeBefore;u&&u.type===e.type&&aX(s.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(n,u))&&s.join(r.from-1)}})}class pF{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=cU(cj(this,"addOptions",{name:this.name}))),this.storage=cU(cj(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new pF(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>cX(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new pF(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=cU(cj(t,"addOptions",{name:t.name})),t.storage=cU(cj(t,"addStorage",{name:t.name,options:t.options})),t}}function pB(e){return new cQ({find:e.find,handler:({state:t,range:r,match:n,pasteEvent:i})=>{let o=cU(e.getAttributes,void 0,n,i);if(!1===o||null===o)return null;let{tr:s}=t,a=n[n.length-1],l=n[0],u=r.to;if(a){let n=l.search(/\S/),i=r.from+l.indexOf(a),d=i+a.length;if(py(r.from,r.to,t.doc).filter(t=>t.mark.type.excluded.find(r=>r===e.type&&r!==t.mark.type)).filter(e=>e.to>i).length)return null;d<r.to&&s.delete(d,r.to),i>r.from&&s.delete(r.from+n,i),u=r.from+n+a.length,s.addMark(r.from+n,u,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}function pH(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function pW(e){var t=pH(e).Element;return e instanceof t||e instanceof Element}function pK(e){var t=pH(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function pJ(e){if("u"<typeof ShadowRoot)return!1;var t=pH(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var pq=Math.max,pG=Math.min,pX=Math.round;function pY(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function pQ(){return!/^((?!chrome|android).)*safari/i.test(pY())}function p0(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),i=1,o=1;t&&pK(e)&&(i=e.offsetWidth>0&&pX(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&pX(n.height)/e.offsetHeight||1);
101var s=(pW(e)?pH(e):window).visualViewport,a=!pQ()&&r,l=(n.left+(a&&s?s.offsetLeft:0))/i,u=(n.top+(a&&s?s.offsetTop:0))/o,d=n.width/i,c=n.height/o;return{width:d,height:c,top:u,right:l+d,bottom:u+c,left:l,x:l,y:u}}function p1(e){var t=pH(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function p4(e){return e?(e.nodeName||"").toLowerCase():null}function p2(e){return((pW(e)?e.ownerDocument:e.document)||window.document).documentElement}function p6(e){return p0(p2(e)).left+p1(e).scrollLeft}function p3(e){return pH(e).getComputedStyle(e)}function p9(e){var t=p3(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function p5(e){var t=p0(e),r=e.offsetWidth,n=e.offsetHeight;return 1>=Math.abs(t.width-r)&&(r=t.width),1>=Math.abs(t.height-n)&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function p7(e){return"html"===p4(e)?e:e.assignedSlot||e.parentNode||(pJ(e)?e.host:null)||p2(e)}function p8(e,t){void 0===t&&(t=[]);var r,n=function e(t){return["html","body","#document"].indexOf(p4(t))>=0?t.ownerDocument.body:pK(t)&&p9(t)?t:e(p7(t))}(e),i=n===(null==(r=e.ownerDocument)?void 0:r.body),o=pH(n),s=i?[o].concat(o.visualViewport||[],p9(n)?n:[]):n,a=t.concat(s);return i?a:a.concat(p8(p7(s)))}function he(e){return pK(e)&&"fixed"!==p3(e).position?e.offsetParent:null}function ht(e){for(var t=pH(e),r=he(e);r&&["table","td","th"].indexOf(p4(r))>=0&&"static"===p3(r).position;)r=he(r);return r&&("html"===p4(r)||"body"===p4(r)&&"static"===p3(r).position)?t:r||function(e){var t=/firefox/i.test(pY());if(/Trident/i.test(pY())&&pK(e)&&"fixed"===p3(e).position)return null;var r=p7(e);for(pJ(r)&&(r=r.host);pK(r)&&0>["html","body"].indexOf(p4(r));){var n=p3(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var hr="bottom",hn="right",hi="left",ho="auto",hs=["top",hr,hn,hi],ha="start",hl="viewport",hu="popper",hd=hs.reduce(function(e,t){return e.concat([t+"-"+ha,t+"-end"])},[]),hc=[].concat(hs,[ho]).reduce(function(e,t){return e.concat([t,t+"-"+ha,t+"-end"])},[]),hp=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function hh(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&pJ(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function hf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function hm(e,t,r){var n,i,o,s,a,l,u,d,c,p;return t===hl?hf(function(e,t){var r=pH(e),n=p2(e),i=r.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=pQ();(u||!u&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+p6(e),y:l}}(e,r)):pW(t)?((n=p0(t,!1,"fixed"===r)).top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n):hf((i=p2(e),s=p2(i),a=p1(i),l=null==(o=i.ownerDocument)?void 0:o.body,u=pq(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=pq(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),c=-a.scrollLeft+p6(i),p=-a.scrollTop,"rtl"===p3(l||s).direction&&(c+=pq(s.clientWidth,l?l.clientWidth:0)-u),{width:u,height:d,x:c,y:p}))}function hg(e){return e.split("-")[0]}function hv(e){return e.split("-")[1]}function hy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function hb(e){var t,r=e.reference,n=e.element,i=e.placement,o=i?hg(i):null,s=i?hv(i):null,a=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(o){case"top":t={x:a,y:r.y-n.height};break;case hr:t={x:a,y:r.y+r.height};break;case hn:t={x:r.x+r.width,y:l};break;case hi:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var u=o?hy(o):null;if(null!=u){var d="y"===u?"height":"width";switch(s){case ha:t[u]=t[u]-(r[d]/2-n[d]/2);break;case"end":t[u]=t[u]+(r[d]/2-n[d]/2)}}return t}function hx(){return{top:0,right:0,bottom:0,left:0}}function hk(e){return Object.assign({},hx(),e)}function hw(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function h_(e,t){void 0===t&&(t={});var r,n,i,o,s,a,l,u,d=t,c=d.placement,p=void 0===c?e.placement:c,h=d.strategy,f=void 0===h?e.strategy:h,m=d.boundary,g=d.rootBoundary,v=d.elementContext,y=void 0===v?hu:v,b=d.altBoundary,x=d.padding,k=void 0===x?0:x,w=hk("number"!=typeof k?k:hw(k,hs)),_=e.rects.popper,$=e.elements[void 0!==b&&b?y===hu?"reference":hu:y],S=(r=pW($)?$:$.contextElement||p2(e.elements.popper),n=void 0===m?"clippingParents":m,i=void 0===g?hl:g,l=(a=[].concat("clippingParents"===n?(o=p8(p7(r)),!pW(s=["absolute","fixed"].indexOf(p3(r).position)>
101=0&&pK(r)?ht(r):r)?[]:o.filter(function(e){return pW(e)&&hh(e,s)&&"body"!==p4(e)})):[].concat(n),[i]))[0],(u=a.reduce(function(e,t){var n=hm(r,t,f);return e.top=pq(n.top,e.top),e.right=pG(n.right,e.right),e.bottom=pG(n.bottom,e.bottom),e.left=pq(n.left,e.left),e},hm(r,l,f))).width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u),I=p0(e.elements.reference),O=hb({reference:I,element:_,strategy:"absolute",placement:p}),C=hf(Object.assign({},_,O)),N=y===hu?C:I,T={top:S.top-N.top+w.top,bottom:N.bottom-S.bottom+w.bottom,left:S.left-N.left+w.left,right:N.right-S.right+w.right},E=e.modifiersData.offset;if(y===hu&&E){var A=E[p];Object.keys(T).forEach(function(e){var t=[hn,hr].indexOf(e)>=0?1:-1,r=["top",hr].indexOf(e)>=0?"y":"x";T[e]+=A[r]*t})}return T}var h$={placement:"bottom",modifiers:[],strategy:"absolute"};function hS(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}var hI={passive:!0},hO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hC(e){var t,r,n,i,o,s,a,l=e.popper,u=e.popperRect,d=e.placement,c=e.variation,p=e.offsets,h=e.position,f=e.gpuAcceleration,m=e.adaptive,g=e.roundOffsets,v=e.isFixed,y=p.x,b=void 0===y?0:y,x=p.y,k=void 0===x?0:x,w="function"==typeof g?g({x:b,y:k}):{x:b,y:k};b=w.x,k=w.y;var _=p.hasOwnProperty("x"),$=p.hasOwnProperty("y"),S=hi,I="top",O=window;if(m){var C=ht(l),N="clientHeight",T="clientWidth";C===pH(l)&&"static"!==p3(C=p2(l)).position&&"absolute"===h&&(N="scrollHeight",T="scrollWidth"),("top"===d||(d===hi||d===hn)&&"end"===c)&&(I=hr,k-=(v&&C===O&&O.visualVie
101wport?O.visualViewport.height:C[N])-u.height,k*=f?1:-1),(d===hi||("top"===d||d===hr)&&"end"===c)&&(S=hn,b-=(v&&C===O&&O.visualViewport?O.visualViewport.width:C[T])-u.width,b*=f?1:-1)}var E=Object.assign({position:h},m&&hO),A=!0===g?(t={x:b,y:k},r=pH(l),n=t.x,i=t.y,{x:pX(n*(o=r.devicePixelRatio||1))/o||0,y:pX(i*o)/o||0}):{x:b,y:k};return(b=A.x,k=A.y,f)?Object.assign({},E,((a={})[I]=$?"0":"",a[S]=_?"0":"",a.transform=1>=(O.devicePixelRatio||1)?"translate("+b+"px, "+k+"px)":"translate3d("+b+"px, "+k+"px, 0)",a)):Object.assign({},E,((s={})[I]=$?k+"px":"",s[S]=_?b+"px":"",s.transform="",s))}let hN={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},i=t.elements[e];pK(i)&&p4(i)&&(Object.assign(i.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});
101pK(n)&&p4(n)&&(Object.assign(n.style,o),Object.keys(i).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};var hT={left:"right",right:"left",bottom:"top",top:"bottom"};function hE(e){return e.replace(/left|right|bottom|top/g,function(e){return hT[e]})}var hA={start:"end",end:"start"};function hD(e){return e.replace(/start|end/g,function(e){return hA[e]})}function hj(e,t,r){return pq(e,pG(t,r))}function hP(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function hz(e){return["top",hn,hr,hi].some(function(t){return e[t]>=0})}var hM=(f=void 0===(h=(p={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,o=void 0===i||i,s=n.resize,a=void 0===s||s,l=pH(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(e){e.addEventListener("scroll",r.update,hI)}),a&&l.addEventListener("resize",r.update,hI),function(){o&&u.forEach(function(e){e.removeEventListener("scroll",r.update,hI)}),a&&l.removeEventListener("resize",r.update,hI)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=hb({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=r.adaptive,o=r.roundOffsets,s=void 0===o||o,a={placement:hg(t.placement),variation:hv(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===n||n,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,hC(Object.assign({},a,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,hC(Object.assign({},a,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},hN,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.offset,o=void 0===i?[0,0]:i,s=hc.reduce(function(e,r){var n,i,s,a,l,u;return e[r]=(n=t.rects,s=[hi,"top"].indexOf(i=hg(r))>=0?-1:1,l=(a="function"==typeof o?o(Object.assign({},n,{placement:r})):o)[0],u=a[1],l=l||0,u=(u||0)*s,[hi,hn].indexOf(i)>=0?{x:u,y:l}:{x:l,y:u}),e},{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[n]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,o=void 0===i||i,s=r.altAxis,a=void 0===s||s,l=r.fallbackPlacements,u=r.padding,d=r.boundary,c=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,f=void 0===h||h,m=r.allowedAutoPlacements,g=t.options.placement,v=hg(g)===g,y=l||(v||!f?[hE(g)]:function(e){if(hg(e)===ho)return[];var t=hE(e);return[hD(e),t,hD(t)]}(g)),b=[g].concat(y).reduce(function(e,r){var n,i,o,s,a,l,p,h,g,v,y,b;return e.concat(hg(r)===ho?(i=(n={placement:r,boundary:d,rootBoundary:c,padding:u,flipVariations:f,allowedAutoPlacements:m}).placement,o=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,h=void 0===(p=n.allowedAutoPlacements)?hc:p,0===(y=(v=(g=hv(i))?l?hd:hd.filter(function(e){return hv(e)===g}):hs).filter(function(e){return h.indexOf(e)>=0})).length&&(y=v),Object.keys(b=y.reduce(function(e,r){return e[r]=h_(t,{placement:r,boundary:o,rootBoundary:s,padding:a})[hg(r)],e},{})).sort(function(e,t){return b[e]-b[t]})):r)},[]),x=t.rects.reference,k=t.rects.popper,w=new Map,_=!0,$=b[0],S=0;S<b.length;S++){var I=b[S],O=hg(I),C=hv(I)===ha,N=["top",hr].indexOf(O)>=0,T=N?"width":"height",E=h_(t,{placement:I,boundary:d,rootBoundary:c,altBoundary:p,padding:u}),A=N?C?hn:hi:C?hr:"top";x[T]>k[T]&&(A=hE(A));var D=hE(A),j=[];if(o&&j.push(E[O]<=0),a&&j.push(E[A]<=0,E[D]<=0),j.every(function(e){return e})){$=I,_=!1;break}w.set(I,j)}if(_)for(var P=f?3:1,z=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return $=t,"break"},M=P;M>0&&"break"!==z(M);M--);t.placement!==$&&(t.modifiersData[n]._skip=!0,t.placement=$,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,o=r.altAxis,s=r.boun
101dary,a=r.rootBoundary,l=r.altBoundary,u=r.padding,d=r.tether,c=void 0===d||d,p=r.tetherOffset,h=void 0===p?0:p,f=h_(t,{boundary:s,rootBoundary:a,padding:u,altBoundary:l}),m=hg(t.placement),g=hv(t.placement),v=!g,y=hy(m),b="x"===y?"y":"x",x=t.modifiersData.popperOffsets,k=t.rects.reference,w=t.rects.popper,_="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,$="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(x){if(void 0===i||i){var O,C="y"===y?"top":hi,N="y"===y?hr:hn,T="y"===y?"height":"width",E=x[y],A=E+f[C],D=E-f[N],j=c?-w[T]/2:0,P=g===ha?k[T]:w[T],z=g===ha?-w[T]:-k[T],M=t.elements.arrow,Z=c&&M?p5(M):{width:0,height:0},R=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:hx(),L=R[C],U=R[N],V=hj(0,k[T],Z[T]),F=v?k[T]/2-j-V-L-$.mainAxis:P-V-L-$.mainAxis,B=v?-k[T]/2+j+V+U+$.mainAxis:z+V+U+$.mainAxis,H=t.elements.arrow&&ht(t.elements.arrow),W=H?"y"===y?H.clientTop||0:H.clientLeft||0:0,K=null!=(O=null==S?void 0:S[y])?O:0,J=hj(c?pG(A,E+F-K-W):A,E,c?pq(D,E+B-K):D);x[y]=J,I[y]=J-E}if(void 0!==o&&o){var q,G,X="x"===y?"top":hi,Y="x"===y?hr:hn,Q=x[b],ee="y"===b?"height":"width",et=Q+f[X],er=Q-f[Y],en=-1!==["top",hi].indexOf(m),ei=null!=(G=null==S?void 0:S[b])?G:0,eo=en?et:Q-k[ee]-w[ee]-ei+$.altAxis,es=en?Q+k[ee]+w[ee]-ei-$.altAxis:er,ea=c&&en?(q=hj(eo,Q,es))>es?es:q:hj(c?eo:et,Q,c?es:er);x[b]=ea,I[b]=ea-Q}t.modifiersData[n]=I}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,i=e.options,o=r.elements.arrow,s=r.modifiersData.popperOffsets,a=hg(r.placement),l=hy(a),u=[hi,hn].indexOf(a)>=0?"height":"width";if(o&&s){var d,c=(d=i.padding,hk("number"!=typeof(d="function"==typeof d?d(Object.assign({},r.rects,{placement:r.placement})):d)?d:hw(d,hs))),p=p5(o),h="y"===l?"top":hi,f="y"===l?hr:hn,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],g=s[l]-r.rects.reference[l],v=ht(o),y=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=c[h],x=y-p[u]-c[f],k=y/2-p[u]/2+(m/2-g/2),w=hj(b,k,x);r.modifiersData[n]=((t={})[l]=w,t.centerOffset=w-k,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null==n||("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&hh(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=h_(t,{elementContext:"reference"}),a=h_(t,{altBoundary:!0}),l=hP(s,n),u=hP(a,i,o),d=hz(l),c=hz(u);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:c},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":c})}}]}).defaultModifiers)?[]:h,g=void 0===(m=p.defaultOptions)?h$:m,function(e,t,r){void 0===r&&(r=g);var n,i,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},h$,g),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],a=!1,l={state:o,setOptions:function(r){var n,i,a,d,c,p,h="function"==typeof r?r(o.options):r;u(),o.options=Object.assign({},g,o.options,h),o.scrollParents={reference:pW(e)?p8(e):e.contextElement?p8(e.contextElement):[],popper:p8(t)};var m=(i=Object.keys(n=[].concat(f,o.options.modifiers).reduce(function(e,t){var r=e[t.name];return e[t.name]=r?Object.assign({},r,t,{options:Object.assign({},r.options,t.options),data:Object.assign({},r.data,t.data)}):t,e},{})).map(function(e){return n[e]}),a=new Map,d=new Set,c=[],i.forEach(function(e){a.set(e.name,e)}),i.forEach(function(e){d.has(e.name)||function e(t){d.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!d.has(t)){var r=a.get(t);r&&e(r)}}),c.push(t)}(e)}),p=c,hp.reduce(function(e,t){return e.concat(p.filter(function(e){return e.phase===t}))},[]));return o.orderedModifiers=m.filter(function(e){return e.enabled}
101),o.orderedModifiers.forEach(function(e){var t=e.name,r=e.options,n=e.effect;if("function"==typeof n){var i=n({state:o,name:t,instance:l,options:void 0===r?{}:r});s.push(i||function(){})}}),l.update()},forceUpdate:function(){if(!a){var e=o.elements,t=e.reference,r=e.popper;if(hS(t,r)){o.rects={reference:(n=ht(r),i="fixed"===o.options.strategy,s=pK(n),p=pK(n)&&(d=pX((u=n.getBoundingClientRect()).width)/n.offsetWidth||1,c=pX(u.height)/n.offsetHeight||1,1!==d||1!==c),h=p2(n),f=p0(t,p,i),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(s||!s&&!i)&&(("body"!==p4(n)||p9(h))&&(m=function(e){return e!==pH(e)&&pK(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:p1(e)}(n)),pK(n)?(g=p0(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):h&&(g.x=p6(h))),{x:f.left+m.scrollLeft-g.x,y:f.top+m.scrollTop-g.y,width:f.width,height:f.height}),popper:p5(r)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var n,i,s,u,d,c,p,h,f,m,g,v=0;v<o.orderedModifiers.length;v++){if(!0===o.reset){o.reset=!1,v=-1;continue}var y=o.orderedModifiers[v],b=y.fn,x=y.options,k=void 0===x?{}:x,w=y.name;"function"==typeof b&&(o=b({state:o,options:k,name:w,instance:l})||o)}}}},update:(n=function(){return new Promise(function(e){l.forceUpdate(),e(o)})},function(){return i||(i=new Promise(function(e){Promise.resolve().then(function(){i=void 0,e(n())})})),i}),destroy:function(){u(),a=!0}};if(!hS(e,t))return l;function u(){s.forEach(function(e){return e()}),s=[]}return l.setOptions(r).then(function(e){!a&&r.onFirstUpdate&&r.onFirstUpdate(e)}),l}),hZ="tippy-content",hR="tippy-arrow",hL="tippy-svg-arrow",hU={passive:!0,capture:!0},hV=function(){return document.body};function hF(e,t,r){if(Array.isArray(e)){var n=e[t];return null==n?Array.isArray(r)?r[t]:r:n}return e}function hB(e,t){var r=({}).toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function hH(e,t){return"function"==typeof e?e.apply(void 0,t):e}function hW(e,t){var r;return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function hK(e){return[].concat(e)}function hJ(e,t){-1===e.indexOf(t)&&e.push(t)}function hq(e){return[].slice.call(e)}function hG(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function hX(){return document.createElement("div")}function hY(e){return["Element","Fragment"].some(function(t){return hB(e,t)})}function hQ(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function h0(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function h1(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function h4(e,t){for(var r,n=t;n;){if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var h2={isTouch:!1},h6=0;function h3(){!h2.isTouch&&(h2.isTouch=!0,window.performance&&document.addEventListener("mousemove",h9))}function h9(){var e=performance.now();e-h6<20&&(h2.isTouch=!1,document.removeEventListener("mousemove",h9)),h6=e}function h5(){var e=document.activeElement;if(e&&e._tippy&&e._tippy.reference===e){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var h7=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,h8=Object.assign({appendTo:hV,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),fe=Object.keys(h8);function ft(e){var t=(e.plugins||[]).reduce(function(t,r){var n,i=r.name,o=r.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:null!=(n=h8[i])?n:o),t},{});return Object.assign({},e,t)}function fr(e,t){var r,n=Object.assign({},t,{content:hH(t.content,[e])},t.ignoreAttributes?{}:((r=t.plugins)?Object.keys(ft(Object.assign({},h8,{plugins:r}))):fe).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{}));return n.aria=Object.assign({},h8.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function fn(e,t){e.innerHTML=t}function fi(e){var t=hX();return!0===e?t.className=hR:(t.className=hL,hY(e)?t.appendChild(e):fn(t,e)),t}function fo(e,t){hY(t.content)?(fn(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?fn(e,t.content):e.textContent=t.content)}function fs(e){var t=e.firstElementChild,r=hq(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(hZ)}),arrow:r.find(function(e){return e.classList.contains(hR)||e.classList.contains(hL)}),backdrop:r.find(function(e){return e.classList.contains("tippy-backdrop")})}}function fa(e){var t=hX(),r=hX();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=hX();function i(r,n){var i=fs(t),o=i.box,s=i.content,a=i.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),(r.content!==n.content||r.allowHTML!==n.allowHTML)&&fo(s,e.props),n.arrow?a?r.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(fi(n.arrow))):o.appendChild(fi(n.arrow)):a&&o.removeChild(a)}return n.className=hZ,n.setAttribute("data-state","hidden"),fo(n,e.props),t.appendChild(r),r.appendChild(n),i(e.props,e.props),{popper:t,onUpdate:i}}fa.$$tippy=!0;var fl=1,fu=[],fd=[];function fc(e,t){void 0===t&&(t={});var r,n=h8.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",h3,hU),window.addEventListener("blur",h5);var i=Object.assign({},t,{plugins:n}),o=(hY(r=e)?[r]:hB(r,"NodeList")?hq(r):Array.isArray(r)?r:hq(document.querySelectorAll(r))).reduce(function(e,t){var r=t&&function(e,t){var r,n,i,o,s,a,l,u,d=fr(e,Object.assign({},h8,ft(hG(t)))),c=!1,p=!1,h=!1,f=!1,m=[],g=hW(H,d.interactiveDebounce),v=fl++,y=(r=d.plugins).filter(function(e,t){return r.indexOf(e)===t}),b={id:v,reference:e,popper:hX(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){if(!b.state.isDestroyed){E("onBeforeUpdate",[b,t]),F();var r=b.props,n=fr(e,Object.assign({},r,hG(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(j(),g=hW(H,n.interactiveDebounce)),r.triggerTarget&&!n.triggerTarget?hK(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded"),D(),T(),w&&w(r,n),b.popperInstance&&(q(),X().forEac
101h(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),E("onAfterUpdate",[b,t])}},setContent:function(e){b.setProps({content:e})},show:function(){var t=b.state.isVisible,r=b.state.isDestroyed,n=!b.state.isEnabled,i=h2.isTouch&&!b.props.touch,o=hF(b.props.duration,0,h8.duration);if(!(t||r||n||i||(u||e).hasAttribute("disabled"))&&(E("onShow",[b],!1),!1!==b.props.onShow(b))){if(b.state.isVisible=!0,O()&&(k.style.visibility="visible"),T(),Z(),b.state.isMounted||(k.style.transition="none"),O()){var s,a,d,c=fs(k);hQ([c.box,c.content],0)}l=function(){var e;if(b.state.isVisible&&!f){if(f=!0,k.offsetHeight,k.style.transition=b.props.moveTransition,O()&&b.props.animation){var t=fs(k),r=t.box,n=t.content;hQ([r,n],o),h0([r,n],"visible")}A(),D(),hJ(fd,b),null==(e=b.popperInstance)||e.forceUpdate(),E("onMount",[b]),b.props.animation&&O()&&L(o,function(){b.state.isShown=!0,E("onShown",[b])})}},a=b.props.appendTo,d=u||e,(s=b.props.interactive&&a===hV||"parent"===a?d.parentNode:hH(a,[d])).contains(k)||s.appendChild(k),b.state.isMounted=!0,q()}},hide:function(){var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=hF(b.props.duration,1,h8.duration);if(!e&&!t&&!r&&(E("onHide",[b],!1),!1!==b.props.onHide(b))){if(b.state.isVisible=!1,b.state.isShown=!1,f=!1,c=!1,O()&&(k.style.visibility="hidden"),j(),R(),T(!0),O()){var i,o=fs(k),s=o.box,a=o.content;b.props.animation&&(hQ([s,a],n),h0([s,a],"hidden"))}(A(),D(),b.props.animation)?O()&&(i=b.unmount,L(n,function(){!b.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&i()})):b.unmount()}},hideWithInteractivity:function(e){C().addEventListener("mousemove",g),hJ(fu,g),g(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide(),b.state.isMounted&&(G(),X().forEach(function(e){e._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),fd=fd.filter(function(e){return e!==b}),b.state.isMounted=!1,E("onHidden",[b]))},destroy:function(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),F(),delete e._tippy,b.state.isDestroyed=!0,E("onDestroy",[b]))}};if(!d.render)return b;var x=d.render(b),k=x.popper,w=x.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+b.id,b.popper=k,e._tippy=b,k._tippy=b;var _=y.map(function(e){return e.fn(b)}),$=e.hasAttribute("aria-expanded");return V(),D(),T(),E("onCreate",[b]),d.showOnCreate&&Y(),k.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&C().addEventListener("mousemove",g)}),b;function S(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function I(){return"hold"===S()[0]}function O(){var e;return!!(null!=(e=b.props.render)&&e.$$tippy)}function C(){var t,r,n=(u||e).parentNode;return n&&null!=(r=hK(n)[0])&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function N(e){return b.state.isMounted&&!b.state.isVisible||h2.isTouch||s&&"focus"===s.type?0:hF(b.props.delay,+!e,h8.delay)}function T(e){void 0===e&&(e=!1),k.style.pointerEvents=b.props.interactive&&!e?"":"none",k.style.zIndex=""+b.props.zIndex}function E(e,t,r){if(void 0===r&&(r=!0),_.forEach(function(r){r[e]&&r[e].apply(r,t)}),r){var n;(n=b.props)[e].apply(n,t)}}function A(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=k.id;hK(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var i=t&&t.replace(n,"").trim();i?e.setAttribute(r,i):e.removeAttribute(r)}})}}function D(){!$&&b.props.aria.expanded&&hK(b.props.triggerTarget||e).forEach(function(t){b.props.interactive?t.setAttribute("aria-expanded",b.state.isVisible&&t===(u||e)?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){C().removeEventListener("mousemove",g),fu=fu.filter(function(e){return e!==g})}function P(t){if(!h2.isTouch||!h&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!(b.props.interactive&&h4(k,r))){if(hK(b.props.triggerTarget||e).some(function(e){return h4
101(e,r)})){if(h2.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else E("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),p=!0,setTimeout(function(){p=!1}),b.state.isMounted||R())}}}function z(){h=!0}function M(){h=!1}function Z(){var e=C();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,hU),e.addEventListener("touchstart",M,hU),e.addEventListener("touchmove",z,hU)}function R(){var e=C();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,hU),e.removeEventListener("touchstart",M,hU),e.removeEventListener("touchmove",z,hU)}function L(e,t){var r=fs(k).box;function n(e){e.target===r&&(h1(r,"remove",n),t())}if(0===e)return t();h1(r,"remove",a),h1(r,"add",n),a=n}function U(t,r,n){void 0===n&&(n=!1),hK(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),m.push({node:e,eventType:t,handler:r,options:n})})}function V(){I()&&(U("touchstart",B,{passive:!0}),U("touchend",W,{passive:!0})),b.props.trigger.split(/\s+/).filter(Boolean).forEach(function(e){if("manual"!==e)switch(U(e,B),e){case"mouseenter":U("mouseleave",W);break;case"focus":U(h7?"focusout":"blur",K);break;case"focusin":U("focusout",K)}})}function F(){m.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,i=e.options;t.removeEventListener(r,n,i)}),m=[]}function B(e){var t,r=!1;if(!(!b.state.isEnabled||J(e))&&!p){var n=(null==(t=s)?void 0:t.type)==="focus";s=e,u=e.currentTarget,D(),!b.state.isVisible&&hB(e,"MouseEvent")&&fu.forEach(function(t){return t(e)}),"click"===e.type&&(0>b.props.trigger.indexOf("mouseenter")||c)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:Y(e),"click"===e.type&&(c=!r),r&&!n&&Q(e)}}function H(t){var r,n,i,o=t.target,s=(u||e).contains(o)||k.contains(o);("mousemove"!==t.type||!s)&&(r=X().concat(k).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:d}:null}).filter(Boolean),n=t.clientX,i=t.clientY,r.every(function(e){var t=e.popperRect,r=e.popperState,o=e.props.interactiveBorder,s=r.placement.split("-")[0],a=r.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,u="top"===s?a.bottom.y:0,d="right"===s?a.left.x:0,c="left"===s?a.right.x:0,p=t.top-i+l>o,h=i-t.bottom-u>o,f=t.left-n+d>o,m=n-t.right-c>o;return p||h||f||m})&&(j(),Q(t)))}function W(e){if(!(J(e)||b.props.trigger.indexOf("click")>=0&&c)){if(b.props.interactive)return void b.hideWithInteractivity(e);Q(e)}}function K(t){0>b.props.trigger.indexOf("focusin")&&t.target!==(u||e)||b.props.interactive&&t.relatedTarget&&k.contains(t.relatedTarget)||Q(t)}function J(e){return!!h2.isTouch&&I()!==e.type.indexOf("touch")>=0}function q(){G();var t=b.props,r=t.popperOptions,n=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,a=O()?fs(k).arrow:null,d=o?{getBoundingClientRect:o,contextElement:o.contextElement||u||e}:e,c=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(O()){var r=fs(k).box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}}];O()&&a&&c.push({name:"arrow",options:{element:a,padding:3}}),c.push.apply(c,(null==r?void 0:r.modifiers)||[]),b.popperInstance=hM(d,k,Object.assign({},r,{placement:n,onFirstUpdate:l,modifiers:c}))}function G(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function X(){return hq(k.querySelectorAll("[data-tippy-root]"))}function Y(e){b.clearDelayTimeouts(),e&&E("onTrigger",[b,e]),Z();var t=N(!0),r=S(),i=r[0],o=r[1];h2.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout(function(){b.show()},t):b.show()}function Q(e){if(b.clearDelayTimeouts(),E("onUntrigger",[b,e]),!b.state.isVisible)return void R();
101if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0)||!c){var t=N(!1);t?i=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}}(t,i);return r&&e.push(r),e},[]);return hY(e)?o[0]:o}fc.defaultProps=h8,fc.setDefaultProps=function(e){Object.keys(e).forEach(function(t){h8[t]=e[t]})},fc.currentInput=h2,Object.assign({},hN,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),fc.setDefaultProps({render:fa});class fp{constructor({editor:e,element:t,view:r,tippyOptions:n={},updateDelay:i=250,shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:r,to:n})=>{let{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(r,n).length&&pt(t.selection),l=this.element.contains(document.activeElement);return!!(e.hasFocus()||l)&&!s&&!a&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.handleDebouncedUpdate=(e,t)=>{let r=!(null==t?void 0:t.selection.eq(e.state.selection)),n=!(null==t?void 0:t.doc.eq(e.state.doc));(r||n)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,n,t)},this.updateDelay))},this.updateHandler=(e,t,r,n)=>{var i,o,s;let{state:a,composing:l}=e,{selection:u}=a;if(l||!t&&!r)return;this.createTooltip();let{ranges:d}=u,c=Math.min(...d.map(e=>e.$from.pos)),p=Math.max(...d.map(e=>e.$to.pos));(null==(i=this.shouldShow)?void 0:i.call(this,{editor:this.editor,element:this.element,view:e,state:a,oldState:n,from:c,to:p}))?(null==(o=this.tippy)||o.setProps({getReferenceClientRect:(null==(s=this.tippyOptions)?void 0:s.getReferenceClientRect)||(()=>{if(p_(a.selection)){let t=e.nodeDOM(c);if(t){let e=t.dataset.nodeViewWrapper?t:t.querySelector("[data-node-view-wrapper]");if(e&&(t=e.firstChild),t)return t.getBoundingClientRect()}}return p$(e,c,p)})}),this.show()):this.hide()},this.editor=e,this.element=t,this.view=r,this.updateDelay=i,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=n,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,t=!!e.parentElement;this.element.tabIndex=0,!this.tippy&&t&&(this.tippy=fc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){let{state:r}=e,n=r.selection.from!==r.selection.to;if(this.updateDelay>0&&n)return void this.handleDebouncedUpdate(e,t);let i=!(null==t?void 0:t.selection.eq(e.state.selection)),o=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,i,o,t)}show(){var e;null==(e=this.tippy)||e.show()}hide(){var e;null==(e=this.tippy)||e.hide()}destroy(){var e,t;(null==(e=this.tippy)?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null==(t=this.tippy)||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}let fh=e=>new lw({key:"string"==typeof e.pluginKey?new lS(e.pluginKey):e.pluginKey,view:t=>new fp({view:t,...e})});c4.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[fh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var ff=sD,fm=e.i(174080);
101class fg{getTextContent(e){return pg(e,{textSerializers:c6(this.editor.schema)})}constructor({editor:e,element:t,view:r,tippyOptions:n={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{let{selection:r}=t,{$anchor:n,empty:i}=r,o=1===n.depth,s=n.parent.isTextblock&&!n.parent.type.spec.code&&!n.parent.textContent&&0===n.parent.childCount&&!this.getTextContent(n.parent);return!!e.hasFocus()&&!!i&&!!o&&!!s&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.editor=e,this.element=t,this.view=r,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=n,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,t=!!e.parentElement;this.element.tabIndex=0,!this.tippy&&t&&(this.tippy=fc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){var r,n,i;let{state:o}=e,{doc:s,selection:a}=o,{from:l,to:u}=a;t&&t.doc.eq(s)&&t.selection.eq(a)||((this.createTooltip(),null==(r=this.shouldShow)?void 0:r.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null==(n=this.tippy)||n.setProps({getReferenceClientRect:(null==(i=this.tippyOptions)?void 0:i.getReferenceClientRect)||(()=>p$(e,l,u))}),this.show()):this.hide())}show(){var e;null==(e=this.tippy)||e.show()}hide(){var e;null==(e=this.tippy)||e.hide()}destroy(){var e,t;(null==(e=this.tippy)?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null==(t=this.tippy)||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}c4.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){let e;return this.options.element?[new lw({key:"string"==typeof(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow}).pluginKey?new lS(e.pluginKey):e.pluginKey,view:t=>new fg({view:t,...e})})]:[]}});var fv={exports:{}},fy={};fv.exports=function(){if(y)return fy;y=1;var e=ff.default,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,n=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function s(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}var a="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),l=r({inst:{value:a,getSnapshot:t}}),u=l[0].inst,d=l[1];return i(function(){u.value=a,u.getSnapshot=t,s(u)&&d({inst:u})},[e,a,t]),n(function(){return s(u)&&d({inst:u}),e(function(){s(u)&&d({inst:u})})},[e]),o(a),a};return fy.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:a,fy}();var fb=fv.exports;let fx=({contentComponent:e})=>{let t=fb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return ff.default.createElement(ff.default.Fragment,null,Object.values(t))};class fk extends ff.default.Component{constructor(e){var t;super(e),this.editorContentRef=ff.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){let t,r;if(e.contentComponent)return;let n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),t=new Set,r={},e.contentComponent={subscribe:e=>(t.add(e),()=>{t.delete(e)}),getSnapshot:()=>r,getServerSnapshot:()=>r,setRenderer(e,n){r={...r,[e]:fm.default.createPortal(n.reactElement,n.element,e)}
101,t.forEach(e=>e())},removeRenderer(e){let n={...r};delete n[e],r=n,t.forEach(e=>e())}},this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){let e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;let t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){let{editor:e,innerRef:t,...r}=this.props;return ff.default.createElement(ff.default.Fragment,null,ff.default.createElement("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...r}),(null==e?void 0:e.contentComponent)&&ff.default.createElement(fx,{contentComponent:e.contentComponent}))}}let fw=(0,ff.forwardRef)((e,t)=>{let r=ff.default.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return ff.default.createElement(fk,{key:r,innerRef:t,...e})}),f_=ff.default.memo(fw);var f$=(v=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],r.get(i[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(t[i]!==r[i])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((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var n,i,o,s=o[i];if(("_owner"!==s||!t.$$typeof)&&!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}).__esModule&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v,fS={exports:{}},fI={};fS.exports=function(){if(b)return fI;b=1;var e=ff.default,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=fb.useSyncExternalStore,n=e.useRef,i=e.useEffect,o=e.useMemo,s=e.useDebugValue;return fI.useSyncExternalStoreWithSelector=function(e,a,l,u,d){var c=n(null);if(null===c.current){var p={hasValue:!1,value:null};c.current=p}else p=c.current;var h=r(e,(c=o(function(){function e(e){if(!i){if(i=!0,r=e,e=u(e),void 0!==d&&p.hasValue){var o=p.value;if(d(o,e))return n=o}return n=e}if(o=n,t(r,e))return o;var s=u(e);return void 0!==d&&d(o,s)?o:(r=e,n=s)}var r,n,i=!1,o=void 0===l?null:l;return[function(){return e(a())},null===o?void 0:function(){return e(o())}]},[a,l,u,d]))[0],c[1]);return i(function(){p.hasValue=!0,p.value=h},[h]),s(h),h},fI}();var fO=fS.exports;let fC="u">typeof window?ff.useLayoutEffect:ff.useEffect;class fN{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>
101{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}}let fT="u"<typeof window,fE=fT||!!("u">typeof window&&window.next);class fA{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(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?fT||fE?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender)?this.createEditor():null}createEditor(){return new pR({...this.options.current,onBeforeCreate:(...e)=>{var t,r;return null==(r=(t=this.options.current).onBeforeCreate)?void 0:r.call(t,...e)},onBlur:(...e)=>{var t,r;return null==(r=(t=this.options.current).onBlur)?void 0:r.call(t,...e)},onCreate:(...e)=>{var t,r;return null==(r=(t=this.options.current).onCreate)?void 0:r.call(t,...e)},onDestroy:(...e)=>{var t,r;return null==(r=(t=this.options.current).onDestroy)?void 0:r.call(t,...e)},onFocus:(...e)=>{var t,r;return null==(r=(t=this.options.current).onFocus)?void 0:r.call(t,...e)},onSelectionUpdate:(...e)=>{var t,r;return null==(r=(t=this.options.current).onSelectionUpdate)?void 0:r.call(t,...e)},onTransaction:(...e)=>{var t,r;return null==(r=(t=this.options.current).onTransaction)?void 0:r.call(t,...e)},onUpdate:(...e)=>{var t,r;return null==(r=(t=this.options.current).onUpdate)?void 0:r.call(t,...e)},onContentError:(...e)=>{var t,r;return null==(r=(t=this.options.current).onContentError)?void 0:r.call(t,...e)},onDrop:(...e)=>{var t,r;return null==(r=(t=this.options.current).onDrop)?void 0:r.call(t,...e)},onPaste:(...e)=>{var t,r;return null==(r=(t=this.options.current).onPaste)?void 0:r.call(t,...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)||("extensions"===r&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,r)=>{var n;return e===(null==(n=t.extensions)?void 0:n[r])}):e[r]===t[r]))}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?fA.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(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,r)=>t===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let 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)}}let fD=(0,ff.createContext)({editor:null});fD.Consumer;let fj=(0,ff.createContext)({onDragStart:void 0});ff.default.forwardRef((e,t)=>{let{onDragStart:r}=(0,ff.useContext)(fj),n=e.as||"div";return ff.default.createElement(n,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}),e.s(["BubbleMenu",0,e=>{let[t,r]=(0,ff.useState)(null),{editor:n}=(0,ff.useContext)(fD);return(0,ff.useEffect)(()=>{var r;if(!t||(null==(r=e.editor)?void 0:r.isDestroyed)||(null==n?void 0:n.isDestroyed))return;let{pluginKey:i="bubbleMenu",editor:o,tippyOptions:s={},updateDelay:a,shouldShow:l=null}=e,u=o||n;if(!u)return void console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");let d=fh({updateDelay:a,editor:u,element:t,pluginKey:i,shouldShow:l,tippyOptions:s});return u.registerPlugin(d),()=>{u.unregisterPlugin(i)}},[e.editor,n,t]),ff.default.createElement("div",{ref:r,className:e.className,style:{visibility:"hidden"}},e.children)},"EditorContent",0,f_,"useEditor",0,function(e={},t=[]){let r=(0,ff.useRef)(e);r.current=e;let[n]=(0,ff.useState)(()=>new fA(r)),i=fb.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return(0,ff.useDebugValue)(i),(0,ff.useEffect)(n.onRender(t)),!function(e){var t;let[r]=(0,ff.useState)(()=>new fN(e.editor)),n=fO.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:f$);fC(()=>r.watch(e.editor),[e.editor,r]),(0,ff.useDebugValue)(n)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}],494499);
101let fP=/^\s*>\s$/,fz=pF.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[pV({find:fP,type:this.type})]}}),fM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,fZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,fR=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,fL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,fU=cY.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
101,addInputRules(){return[pL({find:fM,type:this.type}),pL({find:fR,type:this.type})]},addPasteRules(){return[pB({find:fZ,type:this.type}),pB({find:fL,type:this.type})]}}),fV="textStyle",fF=/^\s*([-+*])\s$/,fB=pF.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(fV)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=pV({find:fF,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=pV({find:fF,type:this.t
101ype,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fV),editor:this.editor})),[e]}}),fH=/(^|[^`])`([^`]+)`(?!`)/,fW=/(^|[^`])`([^`]+)`(?!`)/g,fK=cY.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[pL({find:fH,type:this.type})]},addPasteRules(){return[pB({find:fW,type:this.type})]}}),fJ=/^```([a-z]+)?[\s\n]$/,fq=/^~~~([a-z]+)?[\s\n]$/,fG=pF.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:r}=this.options,n=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(r)).map(e=>e.replace(r,""))[0];return n||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",cZ(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,r=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!r||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:r}=t,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type)return!1;let o=n.parentOffset===n.parent.nodeSize-2,s=n.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:r,doc:n}=t,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(n.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(li.near(n.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[pU({find:fJ,type:this.type,getAttributes:e=>({language:e[1]})}),pU({find:fq,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new lw({key:new lS("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>
101{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let r=t.clipboardData.getData("text/plain"),n=t.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,o=null==i?void 0:i.mode;if(!r||!o)return!1;let{tr:s,schema:a}=e.state,l=a.text(r.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(ll.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),fX=pF.create({name:"doc",topNode:!0,content:"block+"});e.s(["Document",0,fX],604366);class fY{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(r=t.width)?r:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let r=e=>{this[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&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,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,r=this.editorView.state.doc.resolve(this.cursorPos),n=!r.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),a=s.width/o.offsetWidth,l=s.height/o.offsetHeight;if(n){let e=r.nodeBefore,t=r.nodeAfter;if(e||t){let r=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(r){let n=r.getBoundingClientRect(),o=e?n.bottom:n.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*l;i={left:n.left,right:n.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let u=this.editorView.dom.offsetParent;if(!this.element&&(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),u&&(u!=document.body||"static"!=getComputedStyle(u).position)){let r=u.getBoundingClientRect(),n=r.width/u.offsetWidth,i=r.height/u.offsetHeight;e=r.left-u.scrollLeft*n,t=r.top-u.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/a+"px",this.element.style.top=(i.top-t)/l+"px",this.element.style.width=(i.right-i.left)/a+"px",this.element.style.height=(i.bottom-i.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),n=r&&r.type.spec.disableDropCursor,i="function"==typeof n?n(this.editorView,t,e):n;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=a0(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}let fQ=c4.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new lw({view:t=>new fY(t,e)})}(this.options)]}});class f0 extends li{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return f0.valid(r)?new f0(r):li.near(r)}content(){return sG.empty}eq(e){return e instanceof f0&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new f0(e.resolve(t.pos))}getBookmark(){return new f1(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(0==r){if(n.type.spec.isolating)return!0;continue}for(let e=n.child(r-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||f4(e.type))return!0;
101if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let e=n.child(r);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||f4(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let r=t.type.spec.allowGapCursor;if(null!=r)return r;let n=t.contentMatchAt(e.index()).defaultType;return n&&n.isTextblock}static findGapCursorFrom(e,t,r=!1){n:for(;;){if(!r&&f0.valid(e))return e;let n=e.pos,i=null;for(let r=e.depth;;r--){let o=e.node(r);if(t>0?e.indexAfter(r)<o.childCount:e.index(r)>0){i=o.child(t>0?e.indexAfter(r):e.index(r)-1);break}if(0==r)return null;n+=t;let s=e.doc.resolve(n);if(f0.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!ld.isSelectable(i)){e=e.doc.resolve(n+i.nodeSize*t),r=!1;continue n}break}i=o,n+=t;let s=e.doc.resolve(n);if(f0.valid(s))return s}return null}}}f0.prototype.visible=!1,f0.findFrom=f0.findGapCursorFrom,li.jsonID("gapcursor",f0);class f1{constructor(e){this.pos=e}map(e){return new f1(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return f0.valid(t)?new f0(t):li.near(t)}}function f4(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let f2=ci({ArrowLeft:f6("horiz",-1),ArrowRight:f6("horiz",1),ArrowUp:f6("vert",-1),ArrowDown:f6("vert",1)});function f6(e,t){let r="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,n,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof ll){if(!i.endOfTextblock(r)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=f0.findGapCursorFrom(s,t,a);return!!l&&(n&&n(e.tr.setSelection(new f0(l))),!0)}}function f3(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!f0.valid(n))return!1;let i=e.posAtCoords({left:r.clientX,top:r.clientY});return!(i&&i.inside>-1&&ld.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new f0(n))),!0)}function f9(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof f0))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let i=sB.empty;for(let e=n.length-1;e>=0;e--)i=sB.from(n[e].createAndFill(null,i));let o=e.state.tr.replace(r.pos,r.pos,new sG(i,0,0));return o.setSelection(ll.near(o.doc.resolve(r.pos+1))),e.dispatch(o),!1}function f5(e){if(!(e.selection instanceof f0))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",dT.create(e.doc,[dO.widget(e.selection.head,t,{key:"gapcursor"})])}let f7=c4.create({name:"gapCursor",addProseMirrorPlugins:()=>[new lw({props:{decorations:f5,createSelectionBetween:(e,t,r)=>t.pos==r.pos&&f0.valid(r)?new f0(r):null,handleClick:f3,handleKeyDown:f2,handleDOMEvents:{beforeinput
101:f9}}})],extendNodeSchema(e){var t;let r={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=cU(cj(e,"allowGapCursor",r)))?t:null}}}),f8=pF.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",cZ(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:r,editor:n})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=r;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=n.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&o){let t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),me=pF.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let r=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${r}`,cZ(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,...{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}}),{})},addInputRules(){return this.options.levels.map(e=>pU({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
101)\\s$`),type:this.type,getAttributes:{level:e}}))}});var mt=function(){};mt.prototype.append=function(e){return e.length?(e=mt.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},mt.prototype.prepend=function(e){return e.length?mt.from(e).append(this):this},mt.prototype.appendInner=function(e){return new mn(this,e)},mt.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?mt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},mt.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},mt.prototype.forEach=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},mt.prototype.map=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length);var n=[];return this.forEach(function(t,r){return n.push(e(t,r))},t,r),n},mt.from=function(e){return e instanceof mt?e:e&&e.length?new mr(e):mt.empty};var mr=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,r){return 0==e&&r==this.length?this:new t(this.values.slice(e,r))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,r,n){for(var i=t;i<r;i++)if(!1===e(this.values[i],n+i))return!1},t.prototype.forEachInvertedInner=function(e,t,r,n){for(var i=t-1;i>=r;i--)if(!1===e(this.values[i],n+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(mt);mt.empty=new mr([]);var mn=function(e){function t(t,r){e.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,r,n){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(r,i),n)||r>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,r)-i,n+i))return!1},t.prototype.forEachInvertedInner=function(e,t,r,n){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(r,i)-i,n+i)||r<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),r,n))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var r=this.left.length;return t<=r?this.left.slice(e,t):e>=r?this.right.slice(e-r,t-r):this.left.slice(e,r).append(this.right.slice(0,t-r))},t.prototype.leafAppend=function(e){var r=this.right.leafAppend(e);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(e){var r=this.left.leafPrepend(e);if(r)return new t(r,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(mt);class mi{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let r,n,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(n=(r=this.remapping(s,this.items.length)).maps.length);let a=e.tr,l=[],u=[];return this.items.forEach((e,t)=>{if(!e.step){r||(n=(r=this.remapping(s,t+1)).maps.length),n--,u.push(e);return}if(r){u.push(new mo(e.map));let t=e.step.map(r.slice(n)),i;t&&a.maybeStep(t).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],l.push(new mo(i,void 0,void 0,l.length+u.length))),n--,i&&r.appendMap(i,n)}else a.maybeStep(e.step);if(e.selection)return i=r?e.selection.map(r.slice(n)):e.selection,o=new mi(this.items.slice(0,s).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(e,t,r,n){var i,o;let s,a=[],l=this.eventCount,u=this.items,d=!n&&u.length?u.get(u.length-1):null;for(let r=0;r<e.steps.length;r++){let i=e.steps[r].invert(e.docs[r]),o=new mo(e.mapping.maps[r],i,t),s;(s=d&&d.merge(o))&&(o=s,r?a.pop():u=u.slice(0,u.length-1)),a.push(o),t&&(l++,t=void 0),n||(d=o)}let c=l-r.depth;return c>
101ma&&(i=u,o=c,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),u=i.slice(s),l-=c),new mi(u.append(a),l)}remapping(e,t){let r=new aA;return this.items.forEach((t,n)=>{let i=null!=t.mirrorOffset&&n-t.mirrorOffset>=e?r.maps.length-t.mirrorOffset:void 0;r.appendMap(t.map,i)},e,t),r}addMaps(e){return 0==this.eventCount?this:new mi(this.items.append(e.map(e=>new mo(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],n=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},n);let a=t;this.items.forEach(t=>{let n=i.getMirror(--a);if(null==n)return;o=Math.min(o,n);let l=i.maps[n];if(t.step){let o=e.steps[n].invert(e.docs[n]),u=t.selection&&t.selection.map(i.slice(a+1,n));u&&s++,r.push(new mo(l,o,u))}else r.push(new mo(l))},n);let l=[];for(let e=t;e<o;e++)l.push(new mo(i.maps[e]));let u=new mi(this.items.slice(0,n).append(l).append(r),s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-r.length)),u}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,n=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)n.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(r)),s=e&&e.getMap();if(r--,s&&t.appendMap(s,r),e){let a=o.selection&&o.selection.map(t.slice(r));a&&i++;let l=new mo(s.invert(),e,a),u,d=n.length-1;(u=n.length&&n[d].merge(l))?n[d]=u:n.push(l)}}else o.map&&r--},this.items.length,0),new mi(mt.from(n.reverse()),i)}}mi.empty=new mi(mt.empty,0);class mo{constructor(e,t,r,n){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=n}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new mo(t.getMap().invert(),t,this.selection)}}}class ms{constructor(e,t,r,n,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=n,this.prevComposition=i}}let ma=20;function ml(e){let t=[];for(let r=e.length-1;r>=0&&0==t.length;r--)e[r].forEach((e,r,n,i)=>t.push(n,i));return t}function mu(e,t){if(!e)return null;let r=[];for(let n=0;n<e.length;n+=2){let i=t.map(e[n],1),o=t.map(e[n+1],-1);i<=o&&r.push(i,o)}return r}let md=!1,mc=null;function mp(e){let t=e.plugins;if(mc!=t){md=!1,mc=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){md=!0;break}}return md}let mh=new lS("history"),mf=new lS("closeHistory");function mm(e,t){return(r,n)=>{let i=mh.getState(r);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(n){let o=function(e,t,r){let n=mp(t),i=mh.get(t).spec.config,o=(r?e.undone:e.done).popEvent(t,n);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(r?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,n),l=new ms(r?a:o.remaining,r?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(mh,{redo:r,historyState:l})}(i,r,e);o&&n(t?o.scrollIntoView():o)}return!0}}let mg=mm(!1,!0),mv=mm(!0,!0);mm(!1,!1),mm(!0,!1);let my=c4.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>mg(e,t),redo:()=>({state:e,dispatch:t})=>mv(e,t)}),addProseMirrorPlugins(){return[function(e={}){return new lw({key:mh,state:{init:()=>new ms(mi.empty,mi.empty,null,0,-1),apply:(t,r,n)=>(function(e,t,r,n){let i=r.getMeta(mh),o;if(i)return i.historyState;r.getMeta(mf)&&(e=new ms(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(0==r.steps.length)return e;if(s&&s.getMeta(mh))if(s.getMeta(mh).redo)return new ms(e.done.addTransform(r,void 0,n,mp(t)),e.undone,ml(r.mapping.maps),e.prevTime,e.prevComposition);else return new ms(e.done,e.undone.addTransform(r,void 0,n,mp(t)),null,e.prevTime,e.prevComposition);if(!1===r.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=r.getMeta("rebased"))return new ms(e.done.rebased(r,o),e.undone.rebased(r,o),mu(e.prevRanges,r.mapping),e.prevTime,e.prevComposition);else return new ms(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),mu(e.prevRanges,r.mapping),e.prevTime,e.prevComposition);{let i=r.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(r.time||0)-n.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;
101return e.mapping.maps[0].forEach((e,n)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&n>=t[i]&&(r=!0)}),r}(r,e.prevRanges)),a=s?mu(e.prevRanges,r.mapping):ml(r.mapping.maps);return new ms(e.done.addTransform(r,o?t.selection.getBookmark():void 0,n,mp(t)),mi.empty,a,r.time,null==i?e.prevComposition:i)}})(r,n,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,n="historyUndo"==r?mg:"historyRedo"==r?mv:null;return!!n&&!!e.editable&&(t.preventDefault(),n(e.state,e.dispatch))}}}})}(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()}}});e.s(["History",0,my],99659);let mb=pF.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",cZ(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){let{selection:r}=e,{$from:n}=r;if(r instanceof ld){let e=n.index();return n.parent.canReplaceWith(e,e+1,t)}let i=n.depth;for(;i>=0;){let e=n.index(i);if(n.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}(t,t.schema.nodes[this.name]))return!1;let{selection:r}=t,{$from:n,$to:i}=r,o=e();return 0===n.parentOffset?o.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):p_(r)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:e,dispatch:t})=>{var r;if(t){let{$to:t}=e.selection,n=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(ll.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(ld.create(e.doc,t.pos)):e.setSelection(ll.create(e.doc,t.pos));else{let i=null==(r=t.parent.type.contentMatch.defaultType)?void 0:r.create();i&&(e.insert(n,i),e.setSelection(ll.create(e.doc,n+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){var e;return[new cJ({find:(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
101ype}).find,handler:({state:t,range:r,match:n})=>{let i=cU(e.getAttributes,void 0,n)||{},{tr:o}=t,s=r.from,a=r.to,l=e.type.create(i);if(n[1]){let e=s+n[0].lastIndexOf(n[1]);e>a?e=a:a=e+n[1].length;let t=n[0][n[0].length-1];o.insertText(t,s+n[0].length-1),o.replaceWith(e,a,l)}else if(n[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})]}}),mx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,mk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,mw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,m_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,m$=cY.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
101,addInputRules(){return[pL({find:mx,type:this.type}),pL({find:mw,type:this.type})]},addPasteRules(){return[pB({find:mk,type:this.type}),pB({find:m_,type:this.type})]}}),mS=pF.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",cZ(this.options.HTMLAttributes,e),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)}}}),mI="textStyle",mO=/^(\d+)\.\s$/,mC=pF.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...r}=e;return 1===t?["ol",cZ(this.options.HTMLAttributes,r),0]:["ol",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(mI)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=pV({find:mO,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)&&(e=pV({find:mO,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(mI)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),mN=pF.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});e.s(["Paragraph",0,mN],690256);let mT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,mE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,mA=cY.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[pL({find:mT,type:this.type})]}
101,addPasteRules(){return[pB({find:mE,type:this.type})]}}),mD=pF.create({name:"text",group:"inline"});e.s(["Text",0,mD],649717);let mj=c4.create({name:"starterKit",addExtensions(){let e=[];return!1!==this.options.bold&&e.push(fU.configure(this.options.bold)),!1!==this.options.blockquote&&e.push(fz.configure(this.options.blockquote)),!1!==this.options.bulletList&&e.push(fB.configure(this.options.bulletList)),!1!==this.options.code&&e.push(fK.configure(this.options.code)),!1!==this.options.codeBlock&&e.push(fG.configure(this.options.codeBlock)),!1!==this.options.document&&e.push(fX.configure(this.options.document)),!1!==this.options.dropcursor&&e.push(fQ.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&e.push(f7.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&e.push(f8.configure(this.options.hardBreak)),!1!==this.options.heading&&e.push(me.configure(this.options.heading)),!1!==this.options.history&&e.push(my.configure(this.options.history)),!1!==this.options.horizontalRule&&e.push(mb.configure(this.options.horizontalRule)),!1!==this.options.italic&&e.push(m$.configure(this.options.italic)),!1!==this.options.listItem&&e.push(mS.configure(this.options.listItem)),!1!==this.options.orderedList&&e.push(mC.configure(this.options.orderedList)),!1!==this.options.paragraph&&e.push(mN.configure(this.options.paragraph)),!1!==this.options.strike&&e.push(mA.configure(this.options.strike)),!1!==this.options.text&&e.push(mD.configure(this.options.text)),e}});e.s(["default",0,mj],256378);let mP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,mz=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,mM=cY.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",cZ(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[pL({find:mP,type:this.type})]},addPasteRules(){return[pB({find:mz,type:this.type})]}});e.s(["default",0,mM],103819);let mZ=c4.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new lw({key:new lS("placeholder"),props:{decorations:({doc:e,selection:t})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=t,i=[];if(!r)return null;let o=this.editor.isEmpty;return e.descendants((e,t)=>{let r=n>=t&&n<=t+e.nodeSize,s=!e.isLeaf&&pw(e);if((r||!this.options.showOnlyCurrent)&&s){let n=[this.options.emptyNodeClass];o&&n.push(this.options.emptyEditorClass);let s=dO.node(t,t+e.nodeSize,{class:n.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:r}):this.options.placeholder});i.push(s)}return this.options.includeChildren}),dT.create(e,i)}}})]}});e.s(["default",0,mZ],224929);let mR="numeric",mL="ascii",mU="alpha",mV="asciinumeric",mF="alphanumeric",mB="domain",mH="emoji",mW="whitespace";function mK(e,t,r){for(let n in t[mR]&&(t[mV]=!0,t[mF]=!0),t[mL]&&(t[mV]=!0,t[mU]=!0),t[mV]&&(t[mF]=!0),t[mU]&&(t[mF]=!0),t[mF]&&(t[mB]=!0),t[mH]&&(t[mB]=!0),t){let t=(n in r||(r[n]=[]),r[n]);0>t.indexOf(e)&&t.push(e)}}function mJ(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}mJ.groups={},mJ.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let r=this.jr[t][0],n=this.jr[t][1];if(n&&r.test(e))return n}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,r,n){for(let i=0;i<e.length;i++)this.tt(e[i],t,r,n)},tr(e,t,r,n){let i;return n=n||mJ.groups,t&&t.j?i=t:(i=new mJ(t),r&&n&&mK(t,r,n)),this.jr.push([e,i]),i},ts(e,t,r,n){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,r,n)},tt(e,t,r,n){if(n=n||mJ.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new mJ).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new mJ,t&&(n&&(i.t&&"string"==typeof i.t?mK(t,Object.assign(function(e,t){let r={};for(let n in t)t[n].indexOf(e)>=0&&(r[n]=!0);return r}(i.t,n),r),n):r&&mK(t,r,n)),i.t=t),this.j[e]=i,i}};let mq=(e,t,r,n,i)=>e.ta(t,r,n,i),mG=(e,t,r,n,i)=>e.tr(t,r,n,i),mX=(e,t,r,n,i)=>e.ts(t,r,n,i),mY=(e,t,r,n,i)=>e.tt(t,r,n,i),mQ="WORD",m0="UWORD",m1="ASCIINUMERICAL",m4="ALPHANUMERICAL",m2="LOCALHOST",m6="UTLD",m3="SCHEME",m9="SLASH_SCHEME",m5="OPENBRACE",m7="CLOSEBRACE",m8="OPENBRACKET",ge="CLOSEBRACKET",gt="OPENPAREN",gr="CLOSEPAREN",g
101n="OPENANGLEBRACKET",gi="CLOSEANGLEBRACKET",go="FULLWIDTHLEFTPAREN",gs="FULLWIDTHRIGHTPAREN",ga="LEFTCORNERBRACKET",gl="RIGHTCORNERBRACKET",gu="LEFTWHITECORNERBRACKET",gd="RIGHTWHITECORNERBRACKET",gc="FULLWIDTHLESSTHAN",gp="FULLWIDTHGREATERTHAN",gh="AMPERSAND",gf="APOSTROPHE",gm="ASTERISK",gg="BACKSLASH",gv="BACKTICK",gy="CARET",gb="COLON",gx="COMMA",gk="DOLLAR",gw="EQUALS",g_="EXCLAMATION",g$="HYPHEN",gS="PERCENT",gI="PIPE",gO="PLUS",gC="POUND",gN="QUERY",gT="QUOTE",gE="FULLWIDTHMIDDLEDOT",gA="SEMI",gD="SLASH",gj="TILDE",gP="UNDERSCORE",gz="EMOJI";var gM=Object.freeze({__proto__:null,ALPHANUMERICAL:m4,AMPERSAND:gh,APOSTROPHE:gf,ASCIINUMERICAL:m1,ASTERISK:gm,AT:"AT",BACKSLASH:gg,BACKTICK:gv,CARET:gy,CLOSEANGLEBRACKET:gi,CLOSEBRACE:m7,CLOSEBRACKET:ge,CLOSEPAREN:gr,COLON:gb,COMMA:gx,DOLLAR:gk,DOT:"DOT",EMOJI:gz,EQUALS:gw,EXCLAMATION:g_,FULLWIDTHGREATERTHAN:gp,FULLWIDTHLEFTPAREN:go,FULLWIDTHLESSTHAN:gc,FULLWIDTHMIDDLEDOT:gE,FULLWIDTHRIGHTPAREN:gs,HYPHEN:g$,LEFTCORNERBRACKET:ga,LEFTWHITECORNERBRACKET:gu,LOCALHOST:m2,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:gn,OPENBRACE:m5,OPENBRACKET:m8,OPENPAREN:gt,PERCENT:gS,PIPE:gI,PLUS:gO,POUND:gC,QUERY:gN,QUOTE:gT,RIGHTCORNERBRACKET:gl,RIGHTWHITECORNERBRACKET:gd,SCHEME:m3,SEMI:gA,SLASH:gD,SLASH_SCHEME:m9,SYM:"SYM",TILDE:gj,TLD:"TLD",UNDERSCORE:gP,UTLD:m6,UWORD:m0,WORD:mQ,WS:"WS"});let gZ=/[a-z]/,gR=/\p{L}/u,gL=/\p{Emoji}/u,gU=/\d/,gV=/\s/,gF=null,gB=null;function gH(e,t){let r=function(e){let t=[],r=e.length,n=0;for(;n<r;){let i,o=e.charCodeAt(n),s=o<55296||o>56319||n+1===r||(i=e.charCodeAt(n+1))<56320||i>57343?e[n]:e.slice(n,n+2);t.push(s),n+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),n=r.length,i=[],o=0,s=0;for(;s<n;){let a=e,l=null,u=0,d=null,c=-1,p=-1;for(;s<n&&(l=a.go(r[s]));)(a=l).accepts()?(c=0,p=0,d=a):c>=0&&(c+=r[s].length,p++),u+=r[s].length,o+=r[s].length,s++;o-=c,s-=p,u-=c,i.push({t:d.t,v:t.slice(o-u,o),s:o-u,e:o})}return i}function gW(e,t,r,n,i){let o,s=t.length;for(let r=0;r<s-1;r++){let s=t[r];e.j[s]?o=e.j[s]:((o=new mJ(n)).jr=i.slice(),e.j[s]=o),e=o}return(o=new mJ(r)).jr=i.slice(),e.j[t[s-1]]=o,o}function gK(e){let t=[],r=[],n=0;for(;n<e.length;){let i=0;for(;"0123456789".indexOf(e[n+i])>=0;)i++;if(i>0){t.push(r.join(""));for(let t=parseInt(e.substring(n,n+i),10);t>0;t--)r.pop();n+=i}else r.push(e[n]),n++}return t}let gJ={defaultProtocol:"http",events:null,format:gG,formatHref:gG,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function gq(e,t=null){let r=Object.assign({},gJ);e&&(r=Object.assign(r,e instanceof gq?e.o:e));let n=r.ignoreTags,i=[];for(let e=0;e<n.length;e++)i.push(n[e].toUpperCase());this.o=r,t&&(this.defaultRender=t),this.ignoreTags=i}function gG(e){return e}function gX(e,t){this.t="token",this.v=e,this.tk=t}function gY(e,t){class r extends gX{constructor(t,r){super(t,r),this.t=e}}for(let e in t)r.prototype[e]=t[e];return r.t=e,r}gq.prototype={o:gJ,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,r){let n=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=r.t in i?i[r.t]:gJ[e])&&n&&(i=i(t,r)):"function"==typeof i&&n&&(i=i(t,r.t,r))),i},getObj(e,t,r){let n=this.o[e];return"function"==typeof n&&null!=t&&(n=n(t,r.t,r)),n},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},gX.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),r=e.get("truncate",t,this),n=e.get("format",t,this);return r&&n.length>r?n.substring(0,r)+"…":n},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=gJ.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",t,this),n=e.get("tagName",t,this),i=this.toFormattedString(e),o={}
101,s=e.get("className",t,this),a=e.get("target",t,this),l=e.get("rel",t,this),u=e.getObj("attributes",t,this),d=e.getObj("events",t,this);return o.href=r,s&&(o.class=s),a&&(o.target=a),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:n,attributes:o,content:i,eventListeners:d}}};let gQ=gY("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),g0=gY("text"),g1=gY("nl"),g4=gY("url",{isLink:!0,toHref(e=gJ.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==m2&&e[1].t===gb}}),g2=e=>new mJ(e);function g6(e,t,r){let n=r[0].s,i=r[r.length-1].e;return new e(t.slice(n,i),r)}let g3="u">typeof console&&console&&console.warn||(()=>{}),g9={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function g5(e,t=!1){if(g9.initialized&&g3(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
1021. Must only contain digits, lowercase ASCII letters or "-"
1032. Cannot start or end with "-"
1043. "-" cannot repeat`);g9.customSchemes.push([e,t])}function g7(e){return g9.initialized||function(){g9.scanner=function(e=[]){let t={};mJ.groups=t;let r=new mJ;null==gF&&(gF=gK("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
104ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==gB&&(gB=gK("ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
104ºÐ´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")),mY(r,"'",gf),mY(r,"{",m5),mY(r,"}",m7),mY(r,"[",m8),mY(r,"]",ge),mY(r,"(",gt),mY(r,")",gr),mY(r,"<",gn),mY(r,">",gi),mY(r,"(",go),mY(r,")",gs),mY(r,"「",ga),mY(r,"」",gl),mY(r,"『",gu),mY(r,"』",gd),mY(r,"<",gc),mY(r,">",gp),mY(r,"&",gh),mY(r,"*",gm),mY(r,"@","AT"),mY(r,"`",gv),mY(r,"^",gy),mY(r,":",gb),mY(r,",",gx),mY(r,"$",gk),mY(r,".","DOT"),mY(r,"=",gw),mY(r,"!",g_),mY(r,"-",g$),mY(r,"%",gS),mY(r,"|",gI),mY(r,"+",gO),mY(r,"#",gC),mY(r,"?",gN),mY(r,'"',gT),mY(r,"/",gD),mY(r,";",gA),mY(r,"~",gj),mY(r,"_",gP),mY(r,"\\",gg),mY(r,"・",gE);let n=mG(r,gU,"NUM",{[mR]:!0});mG(n,gU,n);let i=mG(n,gZ,m1,{[mV]:!0}),o=mG(n,gR,m4,{[mF]:!0}),s=mG(r,gZ,mQ,{[mL]:!0});mG(s,gU,i),mG(s,gZ,s),mG(i,gU,i),mG(i,gZ,i);let a=mG(r,gR,m0,{[mU]:!0});mG(a,gZ),mG(a,gU,o),mG(a,gR,a),mG(o,gU,o),mG(o,gZ),mG(o,gR,o);let l=mY(r,"\n","NL",{[mW]:!0}),u=mY(r,"\r","WS",{[mW]:!0}),d=mG(r,gV,"WS",{[mW]:!0});mY(r,"",d),mY(u,"\n",l),mY(u,"",d),mG(u,gV,d),mY(d,"\r"),mY(d,"\n"),mG(d,gV,d),mY(d,"",d);let c=mG(r,gL,gz,{[mH]:!0});mY(c,"#"),mG(c,gL,c),mY(c,"️",c);let p=mY(c,"‍");mY(p,"#"),mG(p,gL,c);let h=[[gZ,s],[gU,i]],f=[[gZ,null],[gR,a],[gU,o]];for(let e=0;e<gF.length;e++)gW(r,gF[e],"TLD",mQ,h);for(let e=0;e<gB.length;e++)gW(r,gB[e],m6,m0,f);mK("TLD",{tld:!0,ascii:!0},t),mK(m6,{utld:!0,alpha:!0},t),gW(r,"file",m3,mQ,h),gW(r,"mailto",m3,mQ,h),gW(r,"http",m9,mQ,h),gW(r,"https",m9,mQ,h),gW(r,"ftp",m9,mQ,h),gW(r,"ftps",m9,mQ,h),mK(m3,{scheme:!0,ascii:!0},t),mK(m9,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let n=e[t][0],i=e[t][1]?{scheme:!0}:{slashscheme:!0};n.indexOf("-")>=0?i[mB]=!0:gZ.test(n)?gU.test(n)?i[mV]=!0:i[mL]=!0:i[mR]=!0,mX(r,n,n,i)}return mX(r,"localhost",m2,{ascii:!0}),r.jd=new mJ("SYM"),{start:r,tokens:Object.assign({groups:t},gM)}}(g9.customSchemes);for(let e=0;e<g9.tokenQueue.length;e++)g9.tokenQueue[e][1]({scanner:g9.scanner});g9.parser=function({groups:e}){let t=e.domain.concat([gh,gm,"AT",gg,gv,gy,gk,gw,g$,"NUM",gS,gI,gO,gC,gD,"SYM",gj,gP]),r=[gf,gb,gx,"DOT",g_,gS,gN,gT,gA,gn,gi,m5,m7,ge,m8,gt,gr,go,gs,ga,gl,gu,gd,gc,gp],n=[gh,gf,gm,gg,gv,gy,gk,gw,g$,m5,m7,gS,gI,gO,gC,gN,gD,"SYM",gj,gP],i=g2(),o=mY(i,gj);mq(o,n,o),mq(o,e.domain,o);let s=g2(),a=g2(),l=g2();mq(i,e.domain,s),mq(i,e.scheme,a),mq(i,e.slashscheme,l),mq(s,n,o),mq(s,e.domain,s);let u=mY(s,"AT");mY(o,"AT",u),mY(a,"AT",u),mY(l,"AT",u);let d=mY(o,"DOT");mq(d,n,o),mq(d,e.domain,o);let c=g2();mq(u,e.domain,c),mq(c,e.domain,c);let p=mY(c,"DOT");mq(p,e.domain,c);let h=g2(gQ);mq(p,e.tld,h),mq(p,e.utld,h),mY(u,m2,h);let f=mY(c,g$);mY(f,g$,f),mq(f,e.domain,c),mq(h,e.domain,c),mY(h,"DOT",p),mY(h,g$,f);let m=mY(s,g$),g=mY(s,"DOT");mY(m,g$,m),mq(m,e.domain,s),mq(g,n,o),mq(g,e.domain,s);let v=g2(g4);mq(g,e.tld,v),mq(g,e.utld,v),mq(v,e.domain,s),mq(v,n,o),mY(v,"DOT",g),mY(v,g$,m),mY(v,"AT",u);let y=mY(v,gb),b=g2(g4);mq(y,e.numeric,b);let x=g2(g4),k=g2();mq(x,t,x),mq(x,r,k),mq(k,t,x),mq(k,r,k),mY(v,gD,x),mY(b,gD,x);let w=mY(a,gb),_=mY(l,gb),$=mY(_,gD),S=mY($,gD);mq(a,e.domain,s),mY(a,"DOT",g),mY(a,g$,m),mq(l,e.domain,s),mY(l,"DOT",g),mY(l,g$,m),mq(w,e.domain,x),mY(w,gD,x),mY(w,gN,x),mq(S,e.domain,x),mq(S,t,x),mY(S,gD,x);let I=[[m5,m7],[m8,ge],[gt,gr],[gn,gi],[go,gs],[ga,gl],[gu,gd],[gc,gp]];for(let e=0;e<I.length;e++){let[n,i]=I[e],o=mY(x,n);mY(k,n,o);let s=g2(g4);mq(o,t,s);let a=g2();mq(o,r,a),mY(o,i,x),mq(s,t,s),mq(s,r,a),mq(a,t,s),mq(a,r,a),mY(s,i,x),mY(a,i,x)}return mY(i,m2,v),mY(i,"NL",g1),{start:i,tokens:gM}}(g9.scanner.tokens);for(let e=0;e<g9.pluginQueue.length;e++)g9.pluginQueue[e][1]({scanner:g9.scanner,parser:g9.parser});g9.initialized=!0}(),function(e,t,r){let n=r.length,i=0,o=[],s=[];for(;i<n;){let a=e,l=null,u=null,d=0,c=null,p=-1;for(;i<n&&!(l=a.go(r[i].t));)s.push(r[i++]);for(;i<n&&(u=l||a.go(r[i].t));)l=null,(a=u).accepts()?(p=0,c=a):p>=0&&p++,i++,d++;if(p<0)(i-=d)<n&&(s.push(r[i]),i++);else{s.length>0&&(o.push(g6(g0,t,s)),s=[]),i-=p,d-=p;let e=c.t,n=r.slice(i-d,i);o.push(g6(e,t,n))}}return s.length>0&&o.push(g6(g0,t,s)),o}(g9.parser.start,e,gH(g9.scanner.start,e))}function g8(e,t=null,r=null){if(t&&"object"==typeof t){if(r)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);r=t,t=null}let n=new gq(r),i=g7(e),o=[];for(let e=0;e<i.length;e++){let r=i[e];r.isLink&&(!t||r.t===t)&&n.check(r)&&o.push(r.toFormattedObject(n))}return o}g7.scan=gH;let ve="[\0-   ᠎ -\u2029  ]",vt=new RegExp(ve),vr=RegExp(`${ve}$`),vn=RegExp(ve,"g");function vi(e,t){let r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];
104return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&r.push(t)}),!e||e.replace(vn,"").match(RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}let vo=cY.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(e=>{"string"==typeof e?g5(e):g5(e.scheme,e.optionalSlashes)})},onDestroy(){mJ.groups={},g9.scanner=null,g9.parser=null,g9.tokenQueue=[],g9.pluginQueue=[],g9.customSchemes=[],g9.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!vi(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.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:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!vi(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!vi(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",cZ(this.options.HTMLAttributes,e),0]:["a",cZ(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{let{href:r}=e;return!!this.options.isAllowedUri(r,{defaultValidate:e=>!!vi(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:r}=e;return!!this.options.isAllowedUri(r,{defaultValidate:e=>!!vi(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[pB({find:e=>{let t=[];if(e){let{protocols:r,defaultProtocol:n}=this.options,i=g8(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!vi(e,r),protocols:r,defaultProtocol:n}));i.length&&i.forEach(e=>t.push({text:e.value,data:{href:e.href},index:e.start}))}return t}
104,type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,r;let n=[],{protocols:i,defaultProtocol:o}=this.options;return this.options.autolink&&n.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!vi(e,i),protocols:i,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new lw({key:new lS("autolink"),appendTransaction:(t,r,n)=>{var i,o;let s,a=t.some(e=>e.docChanged)&&!r.doc.eq(n.doc),l=t.some(e=>e.getMeta("preventAutolink"));if(!a||l)return;let{tr:u}=n;if((function(e){let t,{mapping:r,steps:n}=e,i=[];return r.maps.forEach((e,t)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:r}=n[t];if(void 0===e||void 0===r)return;o.push({from:e,to:r})}o.forEach(({from:e,to:n})=>{let o=r.slice(t).map(e,-1),s=r.slice(t).map(n),a=r.invert().map(o,-1),l=r.invert().map(s);i.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})})}),1===(t=function(e,t=JSON.stringify){let r={};return e.filter(e=>{let n=t(e);return!Object.prototype.hasOwnProperty.call(r,n)&&(r[n]=!0)})}(i)).length?t:t.filter((e,r)=>!t.filter((e,t)=>t!==r).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))})((i=r.doc,o=[...t],s=new lr(i),o.forEach(e=>{e.steps.forEach(e=>{s.step(e)})}),s)).forEach(({newRange:t})=>{var r,i;let o,s,a,l=(r=n.doc,i=e=>e.isTextblock,a=[],r.nodesBetween(t.from,t.to,(e,t)=>{i(e)&&a.push({node:e,pos:t})}),a);if(l.length>1)o=l[0],s=n.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(l.length){let e=n.doc.textBetween(t.from,t.to," "," ");if(!vr.test(e))return;o=l[0],s=n.doc.textBetween(o.pos,t.to,void 0," ")}if(o&&s){let t=s.split(vt).filter(Boolean);if(t.length<=0)return!1;let r=t[t.length-1],i=o.pos+s.lastIndexOf(r);if(!r)return!1;let a=g7(r).map(t=>t.toObject(e.defaultProtocol));if(!(1===a.length?a[0].isLink:3===a.length&&!!a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;a.filter(e=>e.isLink).map(e=>({...e,from:i+e.start+1,to:i+e.end+1})).filter(e=>!n.schema.marks.code||!n.doc.rangeHasMark(e.from,e.to,n.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{py(t.from,t.to,n.doc).some(t=>t.mark.type===e.type)||u.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),u.steps.length)return u}}))),!0===this.options.openOnClick&&n.push((t={type:this.type},new lw({key:new lS("handleClickLink"),props:{handleClick:(e,r,n)=>{var i,o;if(0!==n.button||!e.editable)return!1;let s=n.target,a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find(e=>"A"===e.nodeName))return!1;let l=pv(e.state,t.type.name),u=n.target,d=null!=(i=null==u?void 0:u.href)?i:l.href,c=null!=(o=null==u?void 0:u.target)?o:l.target;return!!u&&!!d&&(window.open(d,c),!0)}}}))),this.options.linkOnPaste&&n.push((r={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type},new lw({key:new lS("handlePasteLink"),props:{handlePaste:(e,t,n)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";n.content.forEach(e=>{a+=e.textContent});let l=g8(a,{defaultProtocol:r.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!!a&&!!l&&r.editor.commands.setMark(r.type,{href:l.href})}}}))),n}});e.s(["default",0,vo],963612)},184762,e=>{"use strict";var t=e.i(843476),r=e.i(647163);e.s(["Textarea",0,function({className:e,...n}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...n})}])},319036,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(981140),i=e.i(820783),o=e.i(30030),s=e.i(369340),a=e.i(999682),l=e.i(635804),u=e.i(248425),d="Switch",[c,p]=(0,o.createContextScope)(d),[h,f]=c(d),m=r.forwardRef((e,o)=>{let{__scopeSwitch:a,name:l,checked:c,defaultChecked:p,required:f,disabled:m,value:g="on",onCheckedChange:v,form:x,...k}=e,[w,_]=r.useState(null),$=(0,i.useComposedRefs)(o,e=>_(e)),S=r.useRef(!1),I=!w||x||!!w.closest("form"),[O,C]=(0,s.useControllableState)({prop:c,defaultProp:p??!1,onChange:v,caller:d});return(0,t.jsxs)(h,{scope:a,checked:O,disabled:m,children:[(0,t.jsx)(u.Primitive.button,{type:"button",role:"switch","aria-checked":O,"aria-required":f,"data-state":b(O),"data-disabled":m?"":void 0,disabled:m,value:g,...k,ref:$,onClick:(0,n.composeEventHandlers)(e.onClick,e=>{C(e=>!e),I&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),I&&(0,t.jsx)(y,{control:w,bubbles:!S.current,name:l,value:g,checked:O,required:f,disabled:m,form:
104x,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var g="SwitchThumb",v=r.forwardRef((e,r)=>{let{__scopeSwitch:n,...i}=e,o=f(g,n);return(0,t.jsx)(u.Primitive.span,{"data-state":b(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:r})});v.displayName=g;var y=r.forwardRef(({__scopeSwitch:e,control:n,checked:o,bubbles:s=!0,...u},d)=>{let c=r.useRef(null),p=(0,i.useComposedRefs)(c,d),h=(0,a.usePrevious)(o),f=(0,l.useSize)(n);return r.useEffect(()=>{let e=c.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:s});t.call(e,o),e.dispatchEvent(r)}},[h,o,s]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...u,tabIndex:-1,ref:p,style:{...u.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function b(e){return e?"checked":"unchecked"}y.displayName="SwitchBubbleInput";var x=e.i(647163);e.s(["Switch",0,function({className:e,...r}){return(0,t.jsx)(m,{"data-slot":"switch",className:(0,x.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:(0,t.jsx)(v,{"data-slot":"switch-thumb",className:(0,x.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}],319036)},218321,694689,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(37727),i=e.i(994179),o=e.i(167881),s=e.i(23750),a=e.i(59377),l=e.i(647163);let u=r.forwardRef(({className:e,value:u,onChange:d,suggestions:c,...p},h)=>{let[f,m]=r.useState(""),[g,v]=r.useState(!1),[y,b]=r.useState(!1),[x,k]=r.useState(-1),w=r.useRef(null),_=r.useRef([]),$=r.useId(),S=r.useCallback(e=>{w.current=e,"function"==typeof h?h(e):h&&(h.current=e)},[h]);r.useEffect(()=>{if(f.includes(",")){let e=f.split(",").map(e=>e.trim()).filter(e=>e.length>0);e.length>0&&(d(Array.from(new Set([...u,...e]))),m(""))}},[f,d,u]);let I=()=>{f.trim()&&(d(Array.from(new Set([...u,f.trim()]))),m(""))},O=e=>{let t=e.trim();t&&(d(Array.from(new Set([...u,t]))),m(""))},C=r.useMemo(()=>{if(!c||0===c.length)return[];let e=f.trim().toLowerCase();return c.filter(t=>!u.includes(t)&&(""===e||t.toLowerCase().includes(e)))},[c,u,f]),N=!!c&&c.length>0,T=N&&g&&!y&&C.length>0;r.useEffect(()=>{k(-1)},[f,u,c]),r.useEffect(()=>{x>=0&&_.current[x]?.scrollIntoView({block:"nearest"})},[x]);let E=N&&x>=0?`${$}-option-${x}`:void 0,A=(0,t.jsx)(s.Input,{ref:S,value:f,onChange:e=>{m(e.target.value),b(!1)},onKeyDown:e=>{if(T){if("ArrowDown"===e.key){e.preventDefault(),k(e=>e+1>=C.length?0:e+1);return}if("ArrowUp"===e.key){e.preventDefault(),k(e=>e<=0?C.length-1:e-1);return}if("Escape"===e.key){e.preventDefault(),b(!0);return}}"Enter"===e.key||","===e.key?(e.preventDefault(),T&&x>=0&&x<C.length?O(C[x]):I()):"Backspace"===e.key&&0===f.length&&u.length>0&&(e.preventDefault(),d(u.slice(0,-1)))},onFocus:()=>{v(!0),b(!1)},onBlur:()=>
104{v(!1),I()},role:N?"combobox":void 0,"aria-expanded":N?T:void 0,"aria-controls":N?$:void 0,"aria-autocomplete":N?"list":void 0,"aria-activedescendant":E,...p}),D=(0,t.jsxs)(t.Fragment,{children:[u.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:u.map(e=>(0,t.jsxs)(i.Badge,{variant:"secondary",className:"max-w-60",children:[(0,t.jsx)("span",{className:"truncate",children:e}),(0,t.jsx)(o.Button,{type:"button",variant:"ghost",size:"icon",className:"ml-1 h-4 w-4",onMouseDown:e=>e.preventDefault(),onClick:()=>{d(u.filter(t=>t!==e)),w.current?.focus()},children:(0,t.jsx)(n.X,{className:"!h-3 !w-3"})})]},e))}),A]});return N?(0,t.jsxs)(a.Popover,{open:T,children:[(0,t.jsx)(a.PopoverAnchor,{asChild:!0,children:(0,t.jsx)("div",{className:(0,l.cn)("flex w-full flex-col gap-2",e),children:D})}),(0,t.jsx)(a.PopoverContent,{align:"start",sideOffset:8,className:"max-h-60 w-(--radix-popover-trigger-width) overflow-y-auto p-1",onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{e.target===w.current&&e.preventDefault()},role:"listbox",id:$,children:C.map((e,r)=>(0,t.jsx)("button",{id:`${$}-option-${r}`,ref:e=>{_.current[r]=e},type:"button",role:"option","aria-selected":r===x,className:(0,l.cn)("flex w-full items-center rounded-sm px-2 py-1.5 text-left text-sm outline-none",r===x?"bg-accent text-accent-foreground":"hover:bg-accent hover:text-accent-foreground"),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>k(r),onClick:()=>{O(e),w.current?.focus()},children:(0,t.jsx)("span",{className:"truncate",children:e})},e))})]}):(0,t.jsx)("div",{className:(0,l.cn)("flex w-full flex-col gap-2",e),children:D})});u.displayName="InputTags",e.s(["InputTags",0,u],218321);var d=e.i(225913);e.i(184762);let c=(0,d.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}}),p=(0,d.cva)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});e.s(["InputGroup",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,l.cn)("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...r})},"InputGroupAddon",0,function({className:e,align:r="inline-start",...n}){return(0,t.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":r,className:(0,l.cn)(c({align:r}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...n})},"InputGroupButton",0,function({className:e,type:r="button",variant:n="ghost",size:i="xs",...s}){return(0,t.jsx)(o.Button,{type:r,"data-size":i,variant:n,className:(0,l.cn)(p({size:i}),e),...s})},"InputGroupInput",0,function({className:e,...r}){return(0,t.jsx)(s.Input,{"data-slot":"input-group-control",className:(0,l.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e),...r})},"InputGroupText",0,function({className:e,...r}){return(0,t.jsx)("span",{className:(0,l.cn)("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",e),...r})}],694689)},753751,54943,e=>{"use strict";var t=e.i(843476),r=/[\\\/_+.#"@\[\(\{&]/,n=/[\\\/_+.#"@\[\(\{&]/g,i=/[\s-]/,o=/[\s-]/g;function s(e){return e.toLowerCase().replace(o," ")}var a=e.i(326999),l=e.i(271645);e.i(174080);var u=e.i(991918),d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let n=(0,u.createSlot)(`Primitive.${r}`),i=l.forwardRef((e,i)=>{let{asChild:o,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o?n:r,{...s,ref:i})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),c=e.i(610772),p=e.i(820783),h='[cmdk-group=""]',f='[cmdk-group-items=""]',m='[cmdk-item=""]',g=`${m}:not([aria-disabled="true"])`,v="cmdk-item-select",y="data-value",b=(e,t,a)=>{var l;return l=e,function e(t,s,a,l,u,d,c){if(d===s.length)return u===t.length?1:.99;var p=`${u},${d}`;if(void 0!==c[p])return c[p];for(var h,f,m,g,v=l.charAt(d),y=a.indexOf(v,u),b=0;y>=0;)(h=e(t,s,a,l,y+1,d+1,c))>b&&(y===u?h*=1:r.test(t.charAt(y-1))?(h*=.8,(m=t.slice(u,y-1).match(n))&&u>0&&(h*=Math.pow(.999,m.length))):i.test(t.charAt(y-1))?(h*=.9,(g=t.slice(u,y-1).match(o)
104)&&u>0&&(h*=Math.pow(.999,g.length))):(h*=.17,u>0&&(h*=Math.pow(.999,y-u))),t.charAt(y)!==s.charAt(d)&&(h*=.9999)),(h<.1&&a.charAt(y-1)===l.charAt(d+1)||l.charAt(d+1)===l.charAt(d)&&a.charAt(y-1)!==l.charAt(d))&&.1*(f=e(t,s,a,l,y+1,d+2,c))>h&&(h=.1*f),h>b&&(b=h),y=a.indexOf(v,y+1);return c[p]=b,b}(l=a&&a.length>0?`${l+" "+a.join(" ")}`:l,t,s(l),s(t),0,0,{})},x=l.createContext(void 0),k=l.createContext(void 0),w=l.createContext(void 0),_=l.forwardRef((e,t)=>{let r=D(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=D(()=>new Set),i=D(()=>new Map),o=D(()=>new Map),s=D(()=>new Set),a=E(e),{label:u,children:p,value:w,onValueChange:_,filter:$,shouldFilter:S,loop:I,disablePointerSelection:O=!1,vimBindings:C=!0,...N}=e,T=(0,c.useId)(),j=(0,c.useId)(),P=(0,c.useId)(),R=l.useRef(null),L=z();A(()=>{if(void 0!==w){let e=w.trim();r.current.value=e,U.emit()}},[w]),A(()=>{L(6,K)},[]);let U=l.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var i,o,s,l;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)W(),B(),L(1,H);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(P);e?e.focus():null==(i=document.getElementById(T))||i.focus()}if(L(7,()=>{var e;r.current.selectedItemId=null==(e=J())?void 0:e.id,U.emit()}),n||L(5,K),(null==(o=a.current)?void 0:o.value)!==void 0){null==(l=(s=a.current).onValueChange)||l.call(s,null!=t?t:"");return}}U.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),V=l.useMemo(()=>({value:(e,t,n)=>{var i;t!==(null==(i=o.current.get(e))?void 0:i.value)&&(o.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,F(t,n)),L(2,()=>{B(),U.emit()}))},item:(e,t)=>(n.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),L(3,()=>{W(),B(),r.current.value||H(),U.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=J();L(4,()=>{W(),(null==t?void 0:t.getAttribute("id"))===e&&H(),U.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>a.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:T,inputId:P,labelId:j,listInnerRef:R}),[]);function F(e,t){var n,i;let o=null!=(i=null==(n=a.current)?void 0:n.filter)?i:b;return e?o(e,r.current.search,t):0}function B(){if(!r.current.search||!1===a.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=i.current.get(r),o=0;n.forEach(t=>{o=Math.max(e.get(t),o)}),t.push([r,o])});let n=R.current;q().sort((t,r)=>{var n,i;let o=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(i=e.get(o))?i:0)}).forEach(e=>{let t=e.closest(f);t?t.appendChild(e.parentElement===t?e:e.closest(`${f} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${f} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=R.current)?void 0:t.querySelector(`${h}[${y}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function H(){let e=q().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(y);U.setState("value",t||void 0)}function W(){var e,t,s,l;if(!r.current.search||!1===a.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let u=0;for(let i of n.current){let n=F(null!=(t=null==(e=o.current.get(i))?void 0:e.value)?t:"",null!=(l=null==(s=o.current.get(i))?void 0:s.keywords)?l:[]);r.current.filtered.items.set(i,n),n>0&&u++}for(let[e,t]of i.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=u}function K(){var e,t,r;let n=J();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(h))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function J(){var e;return null==(e=R.current)?void 0:e.querySelector(`${m}[aria-selected="true"]`)}function q(){var e;return Array.from((null==(e=R.current)?void 0:e.querySelectorAll(g))||[])}function G(e){let t=q()[e];t&&U.setState("value",t.getAttribute(y))}function X(e){var t;let r=J(),n=q(),i=n.findIndex(e=>e===r),o=n[i+e];null!=(t=a.current)&&t.loop&&(o=i+e<0?n[n.length-1]:i+e===n.length?n[0]:n[i+e]),o&&U.setState("value",o.getAttribute(y))}
104function Y(e){let t=J(),r=null==t?void 0:t.closest(h),n;for(;r&&!n;)n=null==(r=e>0?function(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}(r,h):function(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}(r,h))?void 0:r.querySelector(g);n?U.setState("value",n.getAttribute(y)):X(e)}let Q=()=>G(q().length-1),ee=e=>{e.preventDefault(),e.metaKey?Q():e.altKey?Y(1):X(1)},et=e=>{e.preventDefault(),e.metaKey?G(0):e.altKey?Y(-1):X(-1)};return l.createElement(d.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=N.onKeyDown)||t.call(N,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":C&&e.ctrlKey&&ee(e);break;case"ArrowDown":ee(e);break;case"p":case"k":C&&e.ctrlKey&&et(e);break;case"ArrowUp":et(e);break;case"Home":e.preventDefault(),G(0);break;case"End":e.preventDefault(),Q();break;case"Enter":{e.preventDefault();let t=J();if(t){let e=new Event(v);t.dispatchEvent(e)}}}}},l.createElement("label",{"cmdk-label":"",htmlFor:V.inputId,id:V.labelId,style:Z},u),M(e,e=>l.createElement(k.Provider,{value:U},l.createElement(x.Provider,{value:V},e))))}),$=l.forwardRef((e,t)=>{var r,n;let i=(0,c.useId)(),o=l.useRef(null),s=l.useContext(w),a=l.useContext(x),u=E(e),h=null!=(n=null==(r=u.current)?void 0:r.forceMount)?n:null==s?void 0:s.forceMount;A(()=>{if(!h)return a.item(i,null==s?void 0:s.id)},[h]);let f=P(i,o,[e.value,e.children,o],e.keywords),m=l.useContext(k),g=j(e=>e.value&&e.value===f.current),y=j(e=>!!h||!1===a.filter()||!e.search||e.filtered.items.get(i)>0);function b(){var e,t;_(),null==(t=(e=u.current).onSelect)||t.call(e,f.current)}function _(){m.setState("value",f.current,!0)}if(l.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(v,b),()=>t.removeEventListener(v,b)},[y,e.onSelect,e.disabled]),!y)return null;let{disabled:$,value:S,onSelect:I,forceMount:O,keywords:C,...N}=e;return l.createElement(d.div,{ref:(0,p.composeRefs)(o,t),...N,id:i,"cmdk-item":"",role:"option","aria-disabled":!!$,"aria-selected":!!g,"data-disabled":!!$,"data-selected":!!g,onPointerMove:$||a.getDisablePointerSelection()?void 0:_,onClick:$?void 0:b},e.children)}),S=l.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...o}=e,s=(0,c.useId)(),a=l.useRef(null),u=l.useRef(null),h=(0,c.useId)(),f=l.useContext(x),m=j(e=>!!i||!1===f.filter()||!e.search||e.filtered.groups.has(s));A(()=>f.group(s),[]),P(s,a,[e.value,e.heading,u]);let g=l.useMemo(()=>({id:s,forceMount:i}),[i]);return l.createElement(d.div,{ref:(0,p.composeRefs)(a,t),...o,"cmdk-group":"",role:"presentation",hidden:!m||void 0},r&&l.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),M(e,e=>l.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},l.createElement(w.Provider,{value:g},e))))}),I=l.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=l.useRef(null),o=j(e=>!e.search);return r||o?l.createElement(d.div,{ref:(0,p.composeRefs)(i,t),...n,"cmdk-separator":"",role:"separator"}):null}),O=l.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=null!=e.value,o=l.useContext(k),s=j(e=>e.search),a=j(e=>e.selectedItemId),u=l.useContext(x);return l.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),l.createElement(d.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":a,id:u.inputId,type:"text",value:i?e.value:s,onChange:e=>{i||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),C=l.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,o=l.useRef(null),s=l.useRef(null),a=j(e=>e.selectedItemId),u=l.useContext(x);return l.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;t.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),l.createElement(d.div,{ref:(0,p.composeRefs)(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":n,id:u.listId},M(e,e=>l.createElement("div",{ref:(0,p.composeRefs)(s,u.listInnerRef),"cmdk-list-sizer":""},e)))}),N=l.forwardRef((e,t)=>
104{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:o,container:s,...u}=e;return l.createElement(a.Root,{open:r,onOpenChange:n},l.createElement(a.Portal,{container:s},l.createElement(a.Overlay,{"cmdk-overlay":"",className:i}),l.createElement(a.Content,{"aria-label":e.label,"cmdk-dialog":"",className:o},l.createElement(_,{ref:t,...u}))))}),T=Object.assign(_,{List:C,Item:$,Input:O,Group:S,Separator:I,Dialog:N,Empty:l.forwardRef((e,t)=>j(e=>0===e.filtered.count)?l.createElement(d.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:l.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...o}=e;return l.createElement(d.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},M(e,e=>l.createElement("div",{"aria-hidden":!0},e)))})});function E(e){let t=l.useRef(e);return A(()=>{t.current=e}),t}var A="u"<typeof window?l.useEffect:l.useLayoutEffect;function D(e){let t=l.useRef();return void 0===t.current&&(t.current=e()),t}function j(e){let t=l.useContext(k),r=()=>e(t.snapshot());return l.useSyncExternalStore(t.subscribe,r,r)}function P(e,t,r,n=[]){let i=l.useRef(),o=l.useContext(x);return A(()=>{var s;let a=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),l=n.map(e=>e.trim());o.value(e,a,l),null==(s=t.current)||s.setAttribute(y,a),i.current=a}),i}var z=()=>{let[e,t]=l.useState(),r=D(()=>new Map);return A(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function M({asChild:e,children:t},r){let n;return e&&l.isValidElement(t)?l.cloneElement("function"==typeof(n=t.type)?n(t.props):"render"in n?n.render(t.props):t,{ref:t.ref},r(t.props.children)):r(t)}var Z={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};let R=(0,e.i(475254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,R],54943);var L=e.i(647163),U=e.i(630374);function V({className:e,...r}){return(0,t.jsx)(T,{"data-slot":"command",className:(0,L.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...r})}e.s(["Command",0,V,"CommandDialog",0,function({title:e="Command Palette",description:r="Search for a command to run...",children:n,className:i,showCloseButton:o=!0,...s}){return(0,t.jsxs)(U.Dialog,{...s,children:[(0,t.jsxs)(U.DialogHeader,{className:"sr-only",children:[(0,t.jsx)(U.DialogTitle,{children:e}),(0,t.jsx)(U.DialogDescription,{children:r})]}),(0,t.jsx)(U.DialogContent,{className:(0,L.cn)("overflow-hidden p-0",i),showCloseButton:o,children:(0,t.jsx)(V,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})]})},"CommandEmpty",0,function({...e}){return(0,t.jsx)(T.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})},"CommandGroup",0,function({className:e,...r}){return(0,t.jsx)(T.Group,{"data-slot":"command-group",className:(0,L.cn)("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...r})},"CommandInput",0,function({className:e,...r}){return(0,t.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,t.jsx)(R,{className:"size-4 shrink-0 opacity-50"}),(0,t.jsx)(T.Input,{"data-slot":"command-input",className:(0,L.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})},"CommandItem",0,function({className:e,...r}){return(0,t.jsx)(T.Item,{"data-slot":"command-item",className:(0,L.cn)("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})},"CommandList",0,function({className:e,...r}){return(0,t.jsx)(T.List,{"data-slot":"command-list",className:(0,L.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...r})},"CommandShortcut",0,function({className:e,...r}){return(0,t.jsx)("span",{"data-slot":"command-shortcut",className:(0,L.cn)("text-muted-foreground ml-auto text-xs tracking-widest",e),...r})}],753751)},690377,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(286536),i=e.i(77705),o=e.i(643531),s=e.i(344523),a=e.i(204753),l=e.i(915085),u=e.i(274768),d=e.i(370956),c=e.i(448876),p=e.i(758472),h=e.i(221345),f=e.i(40325),m=e.i(921430),g=e.i(989359),v=e.i(531278),y=e.i(367240),b=e.i(174886),x=e.i(747697),k=e.i(37727),w=e.i(952571),_=e.i(681307),$=e.i(974559),S=e.i(494499),I=e.i(256378),O=e.i(1038
10419),C=e.i(224929),N=e.i(604366),T=e.i(690256),E=e.i(649717),A=e.i(99659),D=e.i(963612),j=e.i(299378),P=e.i(885697),z=e.i(861745),M=e.i(688690),Z=e.i(59377),R=e.i(874946),L=e.i(23750),U=e.i(184762),V=e.i(157734),F=e.i(319036),B=e.i(218321),H=e.i(413592),W=e.i(62870),K=e.i(694689),J=e.i(10708),q=e.i(167881),G=e.i(728231),X=e.i(753751),Y=e.i(647163);function Q(e,{max:t,min:r=0,loop:n=!1}){let i=parseInt(e,10);return isNaN(i)?"00":(n?(i>t&&(i=r),i<r&&(i=t)):(i>t&&(i=t),i<r&&(i=r)),i.toString().padStart(2,"0"))}function ee(e){return/^(0[0-9]|1[0-9]|2[0-3])$/.test(e)?e:Q(e,{max:23})}function et(e){return/^(0[1-9]|1[0-2])$/.test(e)?e:Q(e,{min:1,max:12})}function er(e){return/^[0-5][0-9]$/.test(e)?e:Q(e,{max:59})}function en(e,{min:t,max:r,step:n}){let i=parseInt(e,10);return isNaN(i)?"00":Q(String(i+=n),{min:t,max:r,loop:!0})}function ei(e,t,r,n){switch(r){case"minutes":let i;return i=er(t),e.setMinutes(parseInt(i,10)),e;case"seconds":let o;return o=er(t),e.setSeconds(parseInt(o,10)),e;case"hours":let s;return s=ee(t),e.setHours(parseInt(s,10)),e;case"12hours":let a;if(!n)return e;return a=function(e,t){if("PM"===t){if(e<=11)return e+12}else if("AM"===t&&12===e)return 0;return e}(parseInt(et(t),10),n),e.setHours(a),e;default:return e}}function eo(e){return 0===e||12===e?"12":e>=22?`${e-12}`:e%12>9?`${e}`:`0${e%12}`}let es=r.default.forwardRef(({className:e,type:n="tel",value:i,id:o,name:s,date:a=new Date(new Date().setHours(0,0,0,0)),setDate:l,onChange:u,onKeyDown:d,picker:c,period:p,onLeftFocus:h,onRightFocus:f,...m},g)=>{let[v,y]=r.default.useState(!1),[b,x]=r.default.useState("0");r.default.useEffect(()=>{if(v){let e=setTimeout(()=>{y(!1)},2e3);return()=>clearTimeout(e)}},[v]);let k=r.default.useMemo(()=>(function(e,t){switch(t){case"minutes":return er(String(e.getMinutes()));case"seconds":return er(String(e.getSeconds()));case"hours":return ee(String(e.getHours()));case"12hours":return et(String(eo(e.getHours())));default:return"00"}})(a,c),[a,c]);return(0,t.jsx)(L.Input,{ref:g,id:o||c,name:s||c,className:(0,Y.cn)("focus:bg-accent focus:text-accent-foreground w-[48px] text-center font-mono text-base tabular-nums caret-transparent [&::-webkit-inner-spin-button]:appearance-none",e),value:i||k,onChange:e=>{e.preventDefault(),u?.(e)},type:n,inputMode:"decimal",onKeyDown:e=>{var t;if(d?.(e),"Tab"!==e.key){if(e.preventDefault(),"ArrowRight"===e.key&&f?.(),"ArrowLeft"===e.key&&h?.(),["ArrowUp","ArrowDown"].includes(e.key)){let t=function(e,t,r){switch(r){case"minutes":case"seconds":return en(e,{min:0,max:59,step:t});case"hours":return en(e,{min:0,max:23,step:t});case"12hours":return en(e,{min:1,max:12,step:t});default:return"00"}}(k,"ArrowUp"===e.key?1:-1,c);v&&y(!1),l(ei(new Date(a),t,c,p))}if(e.key>="0"&&e.key<="9"){"12hours"===c&&x(e.key);let r=(t=e.key,"12hours"===c&&v&&"1"===k.slice(1,2)&&"0"===b?"0"+t:v?k.slice(1,2)+t:"0"+t);v&&f?.(),y(e=>!e),l(ei(new Date(a),r,c,p))}}},...m})});es.displayName="TimePickerInput";let ea=r.forwardRef(({period:e,setPeriod:r,date:n,setDate:i,onLeftFocus:o,onRightFocus:s},a)=>(0,t.jsx)("div",{className:"flex h-10 items-center",children:(0,t.jsxs)(W.Select,{value:e,onValueChange:t=>{r(t),n&&i(ei(new Date(n),eo(n.getHours()).toString(),"12hours","AM"===e?"PM":"AM"))},children:[(0,t.jsx)(W.SelectTrigger,{ref:a,className:"focus:bg-accent focus:text-accent-foreground",onKeyDown:e=>{"ArrowRight"===e.key&&s?.(),"ArrowLeft"===e.key&&o?.()},children:(0,t.jsx)(W.SelectValue,{})}),(0,t.jsxs)(W.SelectContent,{children:[(0,t.jsx)(W.SelectItem,{value:"AM",children:"AM"}),(0,t.jsx)(W.SelectItem,{value:"PM",children:"PM"})]})]})}));function el({date:e,setDate:n}){let[i,o]=r.useState("PM"),s=r.useRef(null),a=r.useRef(null),l=r.useRef(null),u=r.useRef(null);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(es,{picker:"12hours",period:i,date:e,setDate:n,ref:a,onRightFocus:()=>s.current?.focus()}),(0,t.jsx)(es,{picker:"minutes",date:e,setDate:n,ref:s,onLeftFocus:()=>a.current?.focus(),onRightFocus:()=>l.current?.focus()}),(0,t.jsx)(ea,{period:i,setPeriod:o,date:e,setDate:n,ref:u,onLeftFocus:()=>l.current?.focus()})]})}ea.displayName="TimePeriodSelect";var eu=e.i(820115),ed=e.i(399231);let ec=({hint:e})=>(0,t.jsx)(G.TooltipProvider,{children:(0,t.jsxs)(G.Tooltip,{children:[(0,t.jsx)(G.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(w.Info,{className:"text-primary h-3 w-3 cursor-help"})}),(0,t.jsx)(G.TooltipContent,{children:(0,t.jsx)("p",{children:e})})]})});e.s(["BooleanField",0,({name:e,label:r,form:n,className:i,recommendedValue:o,yesText:s="Yes",noText:a="No",noRecommendedText:l="No (Recommended)"})=>(0,t.jsx)(R.FormField,{control:n.control,name:e,render:({field:n})=>(0,t.jsxs)(R.FormItem,{className:i,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(R.FormLabel,{htmlFor:e,children:r}),(0,t.jsxs)("div",{className:"border-input bg-background flex h-9 items-center justify-between rounded-md border px-3",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:n.value?s:!1===o?a:l}),(0,t.jsx)(R.FormControl,{children:(0,t.jsx)(F.Switch,{id:e,checked:n.value,onCheckedChange:n.onChange})})]})]}),(0,t.jsx)(R.FormMessage,{})]})}),"ComboboxField",0,({name:e,label:n,placeholder:i,form:a,className:l,options:u,emptyText:d="No results found.",itemSize:c=35,listHeight:p=300,required:h=!1,disabled:f=!1,clearText:m="Clear",renderValue:g,renderItem:v})=>{let[y,b]=(0,r.useState)(!1),[x,w]=(0,r.useState)(u),[_,S]=(0,r.useState)("");(0,r.useEffect)(()=>{w(u)},[u]);let I=e=>{S(e),w(u.filter(t=>"string"==typeof t?t.toLowerCase().includes(e.toLowerCase()):t.label.toLowerCase().includes(e.toLowerCase())))},O=e=>"string"==typeof e?e:e.value,C=e=>"string"==typeof e?e:e.label,N=e=>null!=e&&(""!==e||u.some(e=>""===O(e))),T=e=>{if(!N(e))return null;if(g)return g(e,u);let t=u.find(t=>O(t)===e);return t?C(t):e};return(0,t.jsx)(R.FormField,{control:a.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:l,children:[(0,t.jsx)(R.FormLabel,{children:n}),(0,t.jsx)(R.FormControl,{children:(0,t.jsxs)(Z.Popover,{open:y,onOpenChange:b,modal:!0,children:[(0,t.jsxs)(K.InputGroup,{"data-disabled":f?"true":void 0,className:(0,Y.cn)(f&&"opacity-50"),children:[(0,t.jsx)(Z.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(q.Button,{"data-slot":"input-group-control",variant:"ghost",role:"combobox","aria-expanded":y,className:(0,Y.cn)("w-full min-w-0 shrink justify-between rounded-none border-0 bg-transparent px-3 font-normal shadow-none hover:bg-transparent focus-visible:ring-0 dark:bg-transparent dark:hover:bg-transparent",N(e.value)?"hover:text-foreground":"text-muted-foreground hover:text-muted-foreground"),disabled:f,children:[(0,t.jsx)("span",{className:"truncate",title:N(e.value)?String(T(e.value)):void 0,children:N(e.value)?T(e.value):i||n}),(0,t.jsx)(s.ChevronsUpDown,{className:"text-muted-foreground size-4 shrink-0 opacity-50"})]})}),N(e.value)&&!h&&(0,t.jsx)(K.InputGroupAddon,{align:"inline-end",children:(0,t.jsx)(K.InputGroupButton,{size:"icon-xs","aria-label":m,title:m,disabled:f,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onChange("")},children:(0,t.jsx)(k.X,{className:"opacity-50 hover:opacity-100"})})})]}),(0,t.jsx)(Z.PopoverContent,{className:"w-full p-0",children:(0,t.jsxs)(X.Command,{children:[(0,t.jsx)(X.CommandInput,{placeholder:i,value:_,onValueChange:I}),(0,t.jsx)(X.CommandEmpty,{children:d}),(0,t.jsx)(X.CommandGroup,{className:"overflow-hidden p-0",children:(0,t.jsx)($.FixedSizeList,{height:p,itemCount:x.length,itemSize:c,width:"100%",children:({index:r,style:n})=>{let i=x[r],s=O(i),a=e.value===s;return(0,t.jsxs)(X.CommandItem,{value:C(i),onSelect:()=>{e.onChange(s!==e.value||h?s:""),b(!1)},className:"cursor-pointer",style:n,children:[v?v(i):(0,t.jsx)("span",{children:C(i)}),(0,t.jsx)(o.Check,{className:(0,Y.cn)("ml-auto",a?"opacity-100":"opacity-0")})]})}})})]})})]})}),(0,t.jsx)(R.FormMessage,{})]})})}
104,"DatePickerField",0,({name:e,label:r,description:n,form:i,className:o,minDate:s,maxDate:a,time:l,placeholder:u="Pick a date",modal:d=!1,clearable:c=!1})=>{let{currentProperty:p}=(0,eu.usePropertyStore)(),h=(0,z.useLocale)(),f=(0,ed.getDayPickerLocale)(h);return(0,t.jsx)(R.FormField,{control:i.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:(0,Y.cn)("flex flex-col",o),children:[r&&(0,t.jsx)(R.FormLabel,{children:r}),(0,t.jsxs)(Z.Popover,{modal:d,children:[(0,t.jsx)(Z.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(R.FormControl,{children:(0,t.jsxs)(q.Button,{variant:"outline",className:(0,Y.cn)("w-full justify-start text-left font-normal",!e.value&&"text-muted-foreground"),children:[(0,t.jsx)(x.CalendarIcon,{}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.value?(0,ed.formatDate)(e.value,l?"PPP hh:mm a":"PPP",h):u}),c&&e.value&&(0,t.jsx)(q.Button,{type:"button",variant:"ghost",size:"icon",className:"ml-auto h-4 w-4 p-0 hover:bg-transparent",onClick:t=>{t.stopPropagation(),t.preventDefault(),e.onChange("")},children:(0,t.jsx)(k.X,{className:"text-muted-foreground opacity-50 hover:opacity-100"})})]})})}),(0,t.jsxs)(Z.PopoverContent,{className:"w-auto p-0",align:"start",children:[(0,t.jsx)(V.Calendar,{autoFocus:!0,mode:"single",captionLayout:"dropdown",endMonth:a??(0,P.endOfYear)((0,j.addYears)(new Date,3)),selected:e.value,onSelect:e.onChange,disabled:e=>!!(a&&e>a||s&&e<s),timeZone:p?.timezone,locale:f}),l&&(0,t.jsx)("div",{className:"border-border border-t p-3",children:(0,t.jsx)(el,{date:e.value,setDate:e.onChange})})]})]}),n&&(0,t.jsx)(R.FormDescription,{children:n}),(0,t.jsx)(R.FormMessage,{})]})})},"DateRangePickerField",0,({startField:e,endField:r,label:n,form:i,className:o,modal:s=!1})=>(0,t.jsxs)(R.FormItem,{className:o,children:[(0,t.jsx)(R.FormLabel,{children:n}),(0,t.jsx)(R.FormControl,{children:(0,t.jsx)(H.DateRangePicker,{from:i.watch(e),to:i.watch(r),onFromChange:t=>i.setValue(e,t),onToChange:e=>i.setValue(r,e),modal:s})}),(0,t.jsx)(R.FormMessage,{})]}),"EmailField",0,({name:e="email",label:r="Email",disabled:n,placeholder:i="Enter email",form:o,className:s})=>(0,t.jsx)(R.FormField,{control:o.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:s,children:[r&&(0,t.jsx)(R.FormLabel,{children:r}),(0,t.jsx)(R.FormControl,{children:(0,t.jsx)(L.Input,{type:"email",placeholder:i,...e,disabled:n})}),(0,t.jsx)(R.FormMessage,{})]})}),"EmailTagsField",0,({name:e,label:r,placeholder:n,form:i,className:o})=>(0,t.jsx)(R.FormField,{control:i.control,name:e,render:({field:s})=>(0,t.jsxs)(R.FormItem,{className:o,children:[(0,t.jsx)(R.FormLabel,{children:r}),(0,t.jsx)(R.FormControl,{children:(0,t.jsx)(B.InputTags,{value:s.value,onChange:s.onChange,placeholder:n??"Add email addresses...",type:"email"})}),i.formState.errors[e]&&(0,t.jsx)("p",{"data-slot":"form-message",className:"text-destructive-foreground text-sm",children:Array.isArray(i.formState.errors[e])?i.formState.errors[e].find(e=>!!e)?.message:i.formState.errors[e].message})]})}),"FieldHint",0,ec,"NumberField",0,({name:e,label:r,placeholder:n,form:i,className:o,disabled:s,step:a="1",min:l,max:u,endText:d,onBlur:c,selectProps:p})=>(0,t.jsx)(R.FormField,{control:i.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:o,children:[r&&(0,t.jsx)(R.FormLabel,{children:r}),(0,t.jsx)(R.FormControl,{children:(0,t.jsxs)(K.InputGroup,{"data-disabled":s?"true":void 0,className:(0,Y.cn)(s&&"opacity-50"),children:[(0,t.jsx)(K.InputGroupInput,{type:"number",step:a,min:l,max:u,placeholder:n??r,disabled:s,...e,onBlur:()=>{e.onBlur(),c?.()}}),p&&(0,t.jsx)(K.InputGroupAddon,{align:"inline-end",className:"cursor-default pr-1",children:(0,t.jsx)(R.FormField,{control:i.control,name:p.name,render:({field:e})=>(0,t.jsxs)(W.Select,{value:e.value,onValueChange:e.onChange,onOpenChange:t=>{t||e.onBlur()},disabled:s,children:[(0,t.jsx)(W.SelectTrigger,{"data-slot":"input-group-control",className:(0,Y.cn)("border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",p.className),children:(0,t.jsx)(W.SelectValue,{})}),(0,t.jsx)(W.SelectContent,{children:p.options.map(e=>(0,t.jsx)(W.SelectItem,{value:e.value,children:e.label},e.value))})]})})}),d&&!p&&(0,t.jsx)(K.InputGroupAddon,{align:"inline-end",children:(0,t.jsx)(K.InputGroupText,{children:d})})]})}),(0,t.jsx)(R.FormMessage,{})]})}),"PasswordField",0,({name:e,label:o,placeholder:s,form:a,className:l,disabled:u,readOnly:d,children:c,onCopy:p,onReset:h})=>{let[f,m]=(0,r.useState)(!1),[g,x]=(0,r.useState)(!1),k=async()=>
104{if(h){x(!0);try{await h()}finally{x(!1)}}};return(0,t.jsx)(R.FormField,{control:a.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:l,children:[(0,t.jsx)(R.FormLabel,{children:o}),(0,t.jsx)(R.FormControl,{children:(0,t.jsxs)(K.InputGroup,{"data-disabled":u?"true":void 0,className:(0,Y.cn)(u&&"opacity-50"),children:[(0,t.jsx)(K.InputGroupInput,{type:f?"text":"password",placeholder:s,disabled:u,readOnly:d,...e}),(0,t.jsxs)(K.InputGroupAddon,{align:"inline-end",children:[h&&(0,t.jsx)(K.InputGroupButton,{size:"icon-xs",disabled:u||g,onClick:k,children:g?(0,t.jsx)(v.Loader2,{className:"animate-spin"}):(0,t.jsx)(y.RotateCcw,{})}),p&&(0,t.jsx)(K.InputGroupButton,{size:"icon-xs",disabled:u,onClick:p,children:(0,t.jsx)(b.Copy,{})}),!p&&(0,t.jsx)(K.InputGroupButton,{size:"icon-xs",disabled:u,onClick:()=>m(!f),tabIndex:-1,children:f?(0,t.jsx)(i.EyeOff,{}):(0,t.jsx)(n.Eye,{})})]})]})}),(0,t.jsx)(R.FormMessage,{}),c&&(0,t.jsx)("div",{className:"text-muted-foreground text-xs",children:c})]})})},"SelectField",0,({name:e,label:r,placeholder:n,form:i,className:o,disabled:s,options:a,clearText:l="Clear",required:u=!1})=>(0,t.jsx)(R.FormField,{control:i.control,name:e,render:({field:e})=>{let i=!u&&!!e.value;return(0,t.jsxs)(R.FormItem,{className:o,children:[r&&(0,t.jsx)(R.FormLabel,{children:r}),(0,t.jsxs)(W.Select,{onValueChange:e.onChange,value:e.value,onOpenChange:t=>{t||e.onBlur()},disabled:s,children:[(0,t.jsx)(R.FormControl,{children:i?(0,t.jsxs)(K.InputGroup,{"data-disabled":s?"true":void 0,className:(0,Y.cn)(s&&"opacity-50"),children:[(0,t.jsx)(W.SelectTrigger,{"data-slot":"input-group-control",className:"w-full rounded-none border-0 bg-transparent shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent",children:(0,t.jsx)(W.SelectValue,{placeholder:n??r})}),(0,t.jsx)(K.InputGroupAddon,{align:"inline-end",children:(0,t.jsx)(K.InputGroupButton,{size:"icon-xs","aria-label":l,title:l,disabled:s,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onChange("")},children:(0,t.jsx)(k.X,{className:"opacity-50 hover:opacity-100"})})})]}):(0,t.jsx)(W.SelectTrigger,{className:"w-full",children:(0,t.jsx)(W.SelectValue,{placeholder:n??r})})}),(0,t.jsx)(W.SelectContent,{children:a.map(e=>(0,t.jsx)(W.SelectItem,{value:e.value,children:e.label},e.value))})]}),(0,t.jsx)(R.FormMessage,{})]},e.value)}}),"SwitchField",0,({name:e,label:r,description:n,disabled:i,form:o,className:s,checked:a,onChange:l})=>
104{if(void 0!==a&&l)return(0,t.jsxs)("div",{className:(0,Y.cn)("space-y-2",s),children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,t.jsx)(J.Label,{className:"!text-foreground !font-medium",children:r}),(0,t.jsx)(F.Switch,{checked:a,onCheckedChange:l,disabled:i})]}),n&&(0,t.jsx)("p",{"data-slot":"form-message",className:"text-muted-foreground text-sm",children:"string"==typeof n?n.split("\n").map((e,r)=>(0,t.jsx)("span",{className:"block",children:e},r)):n})]});if(!o||!e)throw Error("SwitchField requires either (checked + onChange) or (form + name)");return(0,t.jsx)(R.FormField,{control:o.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:s,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,t.jsx)(R.FormLabel,{className:"!text-foreground !font-medium",children:r}),(0,t.jsx)(R.FormControl,{children:(0,t.jsx)(F.Switch,{checked:e.value,onCheckedChange:e.onChange,disabled:i})})]}),n&&(0,t.jsx)(R.FormDescription,{children:"string"==typeof n?n.split("\n").map((e,r)=>(0,t.jsx)("span",{className:"block",children:e},r)):n})]}),(0,t.jsx)(R.FormMessage,{})]})})},"TagsField",0,({name:e,label:r,placeholder:n,form:i,className:o,suggestions:s})=>(0,t.jsx)(R.FormField,{control:i.control,name:e,render:({field:a})=>(0,t.jsxs)(R.FormItem,{className:o,children:[(0,t.jsx)(R.FormLabel,{children:r}),(0,t.jsx)(R.FormControl,{children:(0,t.jsx)(B.InputTags,{value:a.value,onChange:a.onChange,placeholder:n??"Add tags...",suggestions:s})}),i.formState.errors[e]&&(0,t.jsx)("p",{"data-slot":"form-message",className:"text-destructive-foreground text-sm",children:Array.isArray(i.formState.errors[e])?i.formState.errors[e].find(e=>!!e)?.message:i.formState.errors[e].message})]})}),"TextField",0,({name:e,label:r,placeholder:n,description:i,prefix:o,form:s,className:a,hint:l})=>(0,t.jsx)(R.FormField,{control:s.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:a,children:[r&&(0,t.jsxs)(R.FormLabel,{children:[r,l&&(0,t.jsx)(ec,{hint:l})]}),(0,t.jsx)(R.FormControl,{children:o?(0,t.jsxs)(K.InputGroup,{children:[(0,t.jsx)(K.InputGroupAddon,{align:"inline-start",className:"bg-muted border-input self-stretch rounded-l-md border-r pr-3 font-normal",children:(0,t.jsx)(K.InputGroupText,{className:"whitespace-nowrap",children:o})}),(0,t.jsx)(K.InputGroupInput,{placeholder:n??r,...e})]}):(0,t.jsx)(L.Input,{placeholder:n??r,...e})}),i&&(0,t.jsx)(R.FormDescription,{children:i}),(0,t.jsx)(R.FormMessage,{})]})}),"TextareaField",0,({name:e,label:r,placeholder:n,form:i,className:o})=>(0,t.jsx)(R.FormField,{control:i.control,name:e,render:({field:e})=>(0,t.jsxs)(R.FormItem,{className:o,children:[(0,t.jsx)(R.FormLabel,{children:r}),(0,t.jsx)(R.FormControl,{children:(0,t.jsx)(U.Textarea,{placeholder:n??r,...e})}),(0,t.jsx)(R.FormMessage,{})]})}),"VariableTextField",0,({name:e,label:n,placeholder:i,description:o,form:v,className:y,selectProps:b,multiline:x=!1,rich:k=!1,modal:w=!1,autoSpace:$=!0,disabled:j=!1})=>{let[P,z]=(0,r.useState)(!1),L=(0,r.useRef)(!1),U=(0,r.useRef)(null),V=e=>{if(!e||!b?.options||L.current)return;L.current=!0;let t=e.state.selection.$head.pos;try{let r=e.getText(),n=[];b.options.forEach(e=>{let t,i=RegExp(`\\[${e.value}\\]`,"g");for(;null!==(t=i.exec(r));)n.push({from:t.index+1,to:t.index+t[0].length+1})}),e.chain().setTextSelection({from:0,to:r.length+1}
104).unsetHighlight().run(),n.forEach(({from:t,to:r})=>{e.chain().setTextSelection({from:t,to:r}).setHighlight().run()}),e.commands.setTextSelection(t)}finally{L.current=!1}},F=(0,S.useEditor)({extensions:[...k?[I.default.configure({heading:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1}),D.default.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(e,t)=>{try{let r=new URL(e.includes(":")?e:`${t.defaultProtocol}://${e}`);if(!t.defaultValidate(r.href))return!1;return _.z.url({protocol:/^https?$/,hostname:_.z.regexes.domain}).safeParse(r.href).success}catch{return!1}}})]:[N.Document,T.Paragraph,E.Text,A.History],C.default.configure({placeholder:i}),O.default],content:"",editable:!j,editorProps:{attributes:{class:(0,Y.cn)("prose prose-sm dark:prose-invert max-w-none","w-full outline-none text-foreground selection:bg-primary selection:text-primary-foreground",x?"min-h-[10rem]":"h-full flex items-center overflow-hidden whitespace-nowrap")},handleKeyDown:(e,t)=>x||"Enter"!==t.key?"["===t.key&&(t.preventDefault(),z(!0),!0):(t.preventDefault(),!0)},onUpdate:({editor:t})=>{if(!t||L.current)return;let r=k?t.getHTML():t.getText();v.setValue(e,r),V(t)}});U.current=F,(0,r.useEffect)(()=>{F?.setEditable(!j,!1)},[F,j]);let B=v.watch(e);return(0,r.useEffect)(()=>{if(F){if(F.isEmpty&&B){if(k)if(/<[^>]*>/.test(B))F.commands.setContent(B);else{let e=B.split("\n\n").filter(e=>""!==e.trim()).map(e=>{let t=e.split("\n").map(e=>(0,M.default)(e.trim())).join("<br>");return`<p>${t}</p>`}).join("");F.commands.setContent(e)}else{let e=B.split("\n\n").filter(e=>""!==e.trim()).map(e=>{let t=e.split("\n").map(e=>(0,M.default)(e.trim())).join("<br>");return`<p>${t}</p>`}).join("");F.commands.setContent(e)}V(F)}""===B&&F.commands.setContent("")}},[F,B,k]),(0,r.useEffect)(()=>()=>{U.current&&U.current.destroy()},[]),(0,t.jsx)(R.FormField,{control:v.control,name:e,render:()=>(0,t.jsxs)(R.FormItem,{className:y,children:[n&&(0,t.jsx)(R.FormLabel,{children:n}),(0,t.jsx)(R.FormControl,{children:(0,t.jsxs)(K.InputGroup,{className:(0,Y.cn)("px-3 py-1 text-sm","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",x&&"h-auto min-h-40 items-start py-2",j&&"opacity-50"),"data-disabled":j?"true":void 0,children:[F&&k&&(0,t.jsx)(S.BubbleMenu,{tippyOptions:{duration:100,maxWidth:1e3},editor:F,children:(0,t.jsxs)("div",{className:"bg-background border-border flex items-center gap-1 rounded-md border p-1 shadow-md",children:[(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().toggleBold().run(),className:(0,Y.cn)("hover:bg-muted rounded p-1.5 transition-colors",F.isActive("bold")?"bg-muted":""),title:"Bold",children:(0,t.jsx)(a.Bold,{className:"h-4 w-4"})}),(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().toggleItalic().run(),className:(0,Y.cn)("hover:bg-muted rounded p-1.5 transition-colors",F.isActive("italic")?"bg-muted":""),title:"Italic",children:(0,t.jsx)(l.Italic,{className:"h-4 w-4"})}),(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().toggleStrike().run(),className:(0,Y.cn)("hover:bg-muted rounded p-1.5 transition-colors",F.isActive("strike")?"bg-muted":""),title:"Strikethrough",children:(0,t.jsx)(u.Strikethrough,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"bg-border mx-1 h-6 w-px"}),(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().toggleBulletList().run(),className:(0,Y.cn)("hover:bg-muted rounded p-1.5 transition-colors",F.isActive("bulletList")?"bg-muted":""),title:"Bullet List",children:(0,t.jsx)(d.List,{className:"h-4 w-4"})}),(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().toggleOrderedList().run(),className:(0,Y.cn)("hover:bg-muted rounded p-1.5 transition-colors",F.isActive("orderedList")?"bg-muted":""),title:"Ordered List",children:(0,t.jsx)(c.ListOrdered,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"bg-border mx-1 h-6 w-px"}),(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().toggleCode().run(),className:(0,Y.cn)("hover:bg-muted rounded p-1.5 transition-colors",F.isActive("code")?"bg-muted":""),title:"Code",children:(0,t.jsx)(p.Code,{className:"h-4 w-4"})}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e=window.prompt("Enter URL");e&&F.chain().focus().setLink({href:e}).run()},className:(0,Y.cn)("hover:bg-muted rounded p-1.5 transition-colors",F.isActive("link")?"bg-muted":""),title:"Add Link",children:(0,t.jsx)(h.Link,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"bg-border mx-1 h-6 w-px"}),(0,t.jsx)("button",{type:"button",onClick:()=>
104F.chain().focus().undo().run(),className:"hover:bg-muted rounded p-1.5 transition-colors",title:"Undo",children:(0,t.jsx)(f.Undo,{className:"h-4 w-4"})}),(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().redo().run(),className:"hover:bg-muted rounded p-1.5 transition-colors",title:"Redo",children:(0,t.jsx)(m.Redo,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"bg-border mx-1 h-6 w-px"}),(0,t.jsx)("button",{type:"button",onClick:()=>F.chain().focus().clearNodes().unsetAllMarks().run(),className:"hover:bg-muted rounded p-1.5 transition-colors",title:"Clear Formatting",children:(0,t.jsx)(g.Eraser,{className:"h-4 w-4"})})]})}),(0,t.jsx)(S.EditorContent,{editor:F,className:(0,Y.cn)("w-full min-w-0 flex-1",x&&"max-h-[20rem] overflow-y-auto pr-8")}),b&&!j&&(0,t.jsxs)(Z.Popover,{open:P,onOpenChange:z,modal:w,children:[x?(0,t.jsx)(Z.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(K.InputGroupButton,{size:"icon-sm",className:(0,Y.cn)("absolute top-1 right-1",b.className),children:(0,t.jsx)(s.ChevronsUpDown,{className:"opacity-50"})})}):(0,t.jsx)(K.InputGroupAddon,{align:"inline-end",className:"pr-0",children:(0,t.jsx)(Z.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(K.InputGroupButton,{size:"icon-xs",className:b.className,children:(0,t.jsx)(s.ChevronsUpDown,{className:"opacity-50"})})})}),(0,t.jsx)(Z.PopoverContent,{className:(0,Y.cn)("w-[200px] p-0",b.options.some(e=>e.description)&&"w-[300px]"),align:"end",children:(0,t.jsxs)(X.Command,{children:[(0,t.jsx)(X.CommandInput,{placeholder:"Search..."}),(0,t.jsx)(X.CommandEmpty,{children:"No results found."}),(0,t.jsx)(X.CommandGroup,{className:"max-h-[200px] overflow-y-auto",children:b.options.map(e=>(0,t.jsx)(X.CommandItem,{value:e.value,onSelect:()=>(e=>{if(!F)return;let t=F.state.selection.$head,r=F.state.doc.textBetween(Math.max(0,t.pos-1),t.pos),n=F.state.doc.textBetween(t.pos,Math.min(t.pos+1,F.state.doc.content.size)),i=$&&r&&!/\s$/.test(r),o=$&&n&&!/^\s/.test(n),s=`${i?" ":""}[${e}]${o?" ":""}`;F.commands.insertContent(s),z(!1)})(e.value),children:(0,t.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,t.jsx)("span",{className:(0,Y.cn)(e.description&&"font-medium"),children:e.label}),e.description&&(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]})},e.value))})]})})]})]})}),o&&(0,t.jsx)(R.FormDescription,{children:o}),(0,t.jsx)(R.FormMessage,{})]})})}],690377)},795554,904783,169790,e=>{"use strict";var t,r,n;(n=t||(t={})).assertEqual=e=>{},n.assertIs=function(e){},n.assertNever=function(e){throw Error()},n.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},n.getValidEnumValues=e=>{let t=n.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return n.objectValues(r)},n.objectValues=e=>n.objectKeys(e).map(function(t){return e[t]}),n.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},n.find=(e,t)=>{for(let r of e)if(t(r))return r},n.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,n.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},n.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(r||(r={})).mergeShapes=(e,t)=>({...e,...t});let i=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);e.s(["ZodParsedType",0,i,"getParsedType",0,e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return Number.isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":if(Array.isArray(e))return i.array;if(null===e)return i.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return i.promise;if("u">typeof Map&&e instanceof Map)return i.map;if("u">typeof Set&&e instanceof Set)return i.set;if("u">typeof Date&&e instanceof Date)return i.date;return i.object;default:return i.unknown}},"objectUtil",0,r,"util",0,t],904783);
104let o=t.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof s))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,t.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>new s(e),e.s(["ZodError",0,s,"ZodIssueCode",0,o,"quotelessJson",0,e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:")],169790),e.s(["default",0,(e,r)=>{let n;switch(e.code){case o.invalid_type:n=e.received===i.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,t.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:n=`Unrecognized key(s) in object: ${t.joinValues(e.keys,", ")}`;break;case o.invalid_union:n="Invalid input";break;case o.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${t.joinValues(e.options)}`;break;case o.invalid_enum_value:n=`Invalid enum value. Expected ${t.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:n="Invalid function arguments";break;case o.invalid_return_type:n="Invalid function return type";break;case o.invalid_date:n="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:t.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:n="Invalid input";break;case o.invalid_intersection_types:n="Intersection results could not be merged";break;case o.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:n="Number must be finite";break;default:n=r.defaultError,t.assertNever(e)}return{message:n}}],795554)},937904,e=>{"use strict";let t=e.i(795554).default;e.s(["getErrorMap",0,function(){return t},"setErrorMap",0,function(e){t=e}])},665354,e=>{"use strict";var t=e.i(937904),r=e.i(795554);let n=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o};if(void 0!==i.message)return{...i,path:o,message:i.message};let a="";for(let e of n.filter(e=>!!e).slice().reverse())a=e(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}};class i{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return o;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return i.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return o;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}}let o=Object.freeze({status:"aborted"});e.s(["DIRTY",0,e=>({status:"dirty",value:e}),"EMPTY_PATH",0,[],"INVALID",0,o,"OK",0,e=>
104({status:"valid",value:e}),"ParseStatus",0,i,"addIssueToContext",0,function(e,i){let o=(0,t.getErrorMap)(),s=n({issueData:i,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,o,o===r.default?void 0:r.default].filter(e=>!!e)});e.common.issues.push(s)},"isAborted",0,e=>"aborted"===e.status,"isAsync",0,e=>"u">typeof Promise&&e instanceof Promise,"isDirty",0,e=>"dirty"===e.status,"isValid",0,e=>"valid"===e.status,"makeIssue",0,n])},845837,e=>{"use strict";var t=e.i(795554);e.s(["defaultErrorMap",()=>t.default])},340599,e=>{"use strict";var t,r;(r=t||(t={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},r.toString=e=>"string"==typeof e?e:e?.message,e.s(["errorUtil",0,t])},965638,e=>{"use strict";let t;var r,n,i=e.i(169790),o=e.i(845837),s=e.i(937904),a=e.i(340599),l=e.i(665354),u=e.i(904783);class d{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let c=(e,t)=>{if((0,l.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new i.ZodError(e.common.issues);return this._error=t,this._error}}};function p(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:o}=e;return"invalid_enum_value"===t.code?{message:o??i.defaultError}:void 0===i.data?{message:o??n??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:o??r??i.defaultError}},description:i}}class h{get description(){return this._def.description}_getType(e){return(0,u.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,u.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new l.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,u.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0,l.isAsync)(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.getParsedType)(e)},n=this._parseSync({data:e,path:r.path,parent:r});return c(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.getParsedType)(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return(0,l.isValid)(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>(0,l.isValid)(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.getParsedType)(e)},n=this._parse({data:e,path:r.path,parent:r});return c(r,await ((0,l.isAsync)(n)?n:Promise.resolve(n)))}refine(e,t){return this._refinement((r,n)=>{let o=e(r),s=()=>n.addIssue({code:i.ZodIssueCode.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&o instanceof Promise?o.then(e=>!!e||(s(),!1)):!!o||(s(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new ea({schema:this,typeName:n.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return el.create(this,this._def)}nullable(){return eu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this)}promise(){return es.create(this,this._def)}or(e){return W.create([this,e],this._def)}and(e){return q.create(this,e,this._def)}transform(e){return new ea({...p(this._def),schema:this,typeName:n.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ed({...p(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:n.ZodDefault})}brand(){return new ef({typeName:n.ZodBranded,type:this,...p(this._def)})}catch(e){return new ec({...p(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:n.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return em.create(this,e)}readonly(){return eg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let f=/^c[^\s-]{8,}
104$/i,m=/^[0-9a-z]+$/,g=/^[0-9A-HJKMNP-TV-Z]{26}$/i,v=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y=/^[a-z0-9_-]{21}$/i,b=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,x=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,k=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,S=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,I=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,O=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,C="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",N=RegExp(`^${C}$`);function T(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function E(e){let t=`${C}T${T(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}class A extends h{_parse(e){var r,n,o,s;let a;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.ZodParsedType.string){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.string,received:t.parsedType}),l.INVALID}let d=new l.ParseStatus;for(let c of this._def.checks)if("min"===c.kind)e.data.length<c.value&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),d.dirty());else if("max"===c.kind)e.data.length>c.value&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),d.dirty());else if("length"===c.kind){let t=e.data.length>c.value,r=e.data.length<c.value;(t||r)&&(a=this._getOrReturnCtx(e,a),t?(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):r&&(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),d.dirty())}else if("email"===c.kind)k.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"email",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty());else if("emoji"===c.kind)t||(t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"emoji",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty());else if("uuid"===c.kind)v.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"uuid",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty());else if("nanoid"===c.kind)y.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"nanoid",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty());else if("cuid"===c.kind)f.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"cuid",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty());else if("cuid2"===c.kind)m.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"cuid2",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty());else if("ulid"===c.kind)g.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"ulid",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty());else if("url"===c.kind)try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"url",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty()}else"regex"===c.kind?(c.regex.lastIndex=0,c.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"regex",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty())):"trim"===c.kind?e.data=e.data.trim():"includes"===c.kind?e.data.includes(c.value,c.position)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),d.dirty()):"toLowerCase"===c.kind?e.data=e.data.toLowerCase():"toUpperCase"===c.kind?e.data=e.data.toUpperCase():"startsWith"===c.kind?e.data.startsWith(c.value)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.invalid_string,validation:{startsWith:c.value},message:c.message}),d.dirty()):"endsWith"===c.kind?e.data.endsWith(c.value)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.invalid_string,validation:{endsWith:c.value},message:c.message}),d.dirty()):"datetime"===c.kind?E(c).test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.invalid_string,validation:"datetime",message:c.message}),d.dirty()):"date"===c.kind?N.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.invalid_string,validation:"date",message:c.message}),d.dirty()):"time"===c.kind?RegExp(`^${T(c)}$`).test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:i.ZodIssueCode.invalid_string,validation:"time",message:c.message}),d.dirty()):"duration"===c.kind?x.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"duration",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty()):"ip"===c.kind?(r=e.data,!(("v4"===(n=c.version)||!n)&&w.test(r)||("v6"===n||!n)&&$.test(r))&&1&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"ip",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty())):"jwt"===c.kind?!function(e,t){if(!b.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if("object"!=typeof i||null===i||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)return!1;return!0}catch{return!1}}(e.data,c.alg)&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"jwt",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty()):"cidr"===c.kind?(o=e.data,!(("v4"===(s=c.version)||!s)&&_.test(o)||("v6"===s||!s)&&S.test(o))&&1&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"cidr",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty())):"base64"===c.kind?I.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"base64",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty()):"base64url"===c.kind?O.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"base64url",code:i.ZodIssueCode.invalid_string,message:c.message}),d.dirty()):u.util.assertNever(c);return{status:d.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:i.ZodIssueCode.invalid_string,...a.errorUtil.errToObj(r)})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...a.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...a.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...a.errorUtil.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...a.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...a.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...a.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...a.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,a.errorUtil.errToObj(e))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}
104get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}A.create=e=>new A({checks:[],typeName:n.ZodString,coerce:e?.coerce??!1,...p(e)});class D extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.ZodParsedType.number){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.number,received:t.parsedType}),l.INVALID}let r=new l.ParseStatus;for(let n of this._def.checks)"int"===n.kind?u.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.not_finite,message:n.message}),r.dirty()):u.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,n){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(n)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.errorUtil.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&u.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}D.create=e=>new D({checks:[],typeName:n.ZodNumber,coerce:e?.coerce||!1,...p(e)});
104class j extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.ZodParsedType.bigint)return this._getInvalidInput(e);let r=new l.ParseStatus;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):u.util.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.bigint,received:t.parsedType}),l.INVALID}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,n){return new j({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(n)}]})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}j.create=e=>new j({checks:[],typeName:n.ZodBigInt,coerce:e?.coerce??!1,...p(e)});class P extends h{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.ZodParsedType.boolean){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.boolean,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}P.create=e=>new P({typeName:n.ZodBoolean,coerce:e?.coerce||!1,...p(e)});class z extends h{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.ZodParsedType.date){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.date,received:t.parsedType}),l.INVALID}if(Number.isNaN(e.data.getTime())){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_date}),l.INVALID}let r=new l.ParseStatus;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):u.util.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a.errorUtil.toString(t)})}
104get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}z.create=e=>new z({checks:[],coerce:e?.coerce||!1,typeName:n.ZodDate,...p(e)});class M extends h{_parse(e){if(this._getType(e)!==u.ZodParsedType.symbol){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.symbol,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}M.create=e=>new M({typeName:n.ZodSymbol,...p(e)});class Z extends h{_parse(e){if(this._getType(e)!==u.ZodParsedType.undefined){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.undefined,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}Z.create=e=>new Z({typeName:n.ZodUndefined,...p(e)});class R extends h{_parse(e){if(this._getType(e)!==u.ZodParsedType.null){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.null,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}R.create=e=>new R({typeName:n.ZodNull,...p(e)});class L extends h{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,l.OK)(e.data)}}L.create=e=>new L({typeName:n.ZodAny,...p(e)});class U extends h{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,l.OK)(e.data)}}U.create=e=>new U({typeName:n.ZodUnknown,...p(e)});class V extends h{_parse(e){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.never,received:t.parsedType}),l.INVALID}}V.create=e=>new V({typeName:n.ZodNever,...p(e)});class F extends h{_parse(e){if(this._getType(e)!==u.ZodParsedType.undefined){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.void,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}F.create=e=>new F({typeName:n.ZodVoid,...p(e)});class B extends h{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.ZodParsedType.array)return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.array,received:t.parsedType}),l.INVALID;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&((0,l.addIssueToContext)(t,{code:e?i.ZodIssueCode.too_big:i.ZodIssueCode.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&((0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&((0,l.addIssueToContext)(t,{code:i.ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new d(t,e,t.path,r)))).then(e=>l.ParseStatus.mergeArray(r,e));let o=[...t.data].map((e,r)=>n.type._parseSync(new d(t,e,t.path,r)));return l.ParseStatus.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new B({...this._def,minLength:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new B({...this._def,maxLength:{value:e,message:a.errorUtil.toString(t)}})}length(e,t){return new B({...this._def,exactLength:{value:e,message:a.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}B.create=(e,t)=>new B({type:e,minLength:null,maxLength:null,exactLength:null,typeName:n.ZodArray,...p(t)});class H extends h{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=u.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.ZodParsedType.object){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.object,received:t.parsedType}),l.INVALID}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof V&&"strip"===this._def.unknownKeys))for(let e in r.data)o.includes(e)||s.push(e);let a=[];for(let e of o){let t=n[e],i=r.data[e];
104a.push({key:{status:"valid",value:e},value:t._parse(new d(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof V){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of s)a.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)s.length>0&&((0,l.addIssueToContext)(r,{code:i.ZodIssueCode.unrecognized_keys,keys:s}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of s){let n=r.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new d(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of a){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>l.ParseStatus.mergeObjectSync(t,e)):l.ParseStatus.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return a.errorUtil.errToObj,new H({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:a.errorUtil.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(e){return new H({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new H({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:n.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new H({...this._def,catchall:e})}pick(e){let t={};for(let r of u.util.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new H({...this._def,shape:()=>t})}omit(e){let t={};for(let r of u.util.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new H({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof H){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=el.create(e(i))}return new H({...t._def,shape:()=>r})}if(t instanceof B)return new B({...t._def,type:e(t.element)});if(t instanceof el)return el.create(e(t.unwrap()));if(t instanceof eu)return eu.create(e(t.unwrap()));if(t instanceof G)return G.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of u.util.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new H({...this._def,shape:()=>t})}required(e){let t={};for(let r of u.util.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof el;)e=e._def.innerType;t[r]=e}return new H({...this._def,shape:()=>t})}keyof(){return en(u.util.objectKeys(this.shape))}}H.create=(e,t)=>new H({shape:()=>e,unknownKeys:"strip",catchall:V.create(),typeName:n.ZodObject,...p(t)}),H.strictCreate=(e,t)=>new H({shape:()=>e,unknownKeys:"strict",catchall:V.create(),typeName:n.ZodObject,...p(t)}),H.lazycreate=(e,t)=>new H({shape:e,unknownKeys:"strip",catchall:V.create(),typeName:n.ZodObject,...p(t)});class W extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new i.ZodError(e.ctx.common.issues));return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_union,unionErrors:r}),l.INVALID});{let e,n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let o=n.map(e=>new i.ZodError(e));return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_union,unionErrors:o}),l.INVALID}}get options(){return this._def.options}}W.create=(e,t)=>
104new W({options:e,typeName:n.ZodUnion,...p(t)});let K=e=>{if(e instanceof et)return K(e.schema);if(e instanceof ea)return K(e.innerType());if(e instanceof er)return[e.value];if(e instanceof ei)return e.options;if(e instanceof eo)return u.util.objectValues(e.enum);else if(e instanceof ed)return K(e._def.innerType);else if(e instanceof Z)return[void 0];else if(e instanceof R)return[null];else if(e instanceof el)return[void 0,...K(e.unwrap())];else if(e instanceof eu)return[null,...K(e.unwrap())];else if(e instanceof ef)return K(e.unwrap());else if(e instanceof eg)return K(e.unwrap());else if(e instanceof ec)return K(e._def.innerType);else return[]};class J extends h{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.ZodParsedType.object)return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.object,received:t.parsedType}),l.INVALID;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):((0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),l.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let i=new Map;for(let r of t){let t=K(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of t){if(i.has(n))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,r)}}return new J({typeName:n.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...p(r)})}}class q extends h{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if((0,l.isAborted)(e)||(0,l.isAborted)(n))return l.INVALID;let o=function e(t,r){let n=(0,u.getParsedType)(t),i=(0,u.getParsedType)(r);if(t===r)return{valid:!0,data:t};if(n===u.ZodParsedType.object&&i===u.ZodParsedType.object){let n=u.util.objectKeys(r),i=u.util.objectKeys(t).filter(e=>-1!==n.indexOf(e)),o={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};o[n]=i.data}return{valid:!0,data:o}}if(n===u.ZodParsedType.array&&i===u.ZodParsedType.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let o=e(t[i],r[i]);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}if(n===u.ZodParsedType.date&&i===u.ZodParsedType.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,n.value);return o.valid?(((0,l.isDirty)(e)||(0,l.isDirty)(n))&&t.dirty(),{status:t.value,value:o.data}):((0,l.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_intersection_types}),l.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}q.create=(e,t,r)=>new q({left:e,right:t,typeName:n.ZodIntersection,...p(r)});class G extends h{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.array)return(0,l.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.array,received:r.parsedType}),l.INVALID;if(r.data.length<this._def.items.length)return(0,l.addIssueToContext)(r,{code:i.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.INVALID;!this._def.rest&&r.data.length>this._def.items.length&&((0,l.addIssueToContext)(r,{code:i.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new d(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>l.ParseStatus.mergeArray(t,e)):l.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new G({...this._def,rest:e})}}G.create=(e,t)=>
104{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new G({items:e,typeName:n.ZodTuple,rest:null,...p(t)})};class X extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.object)return(0,l.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.object,received:r.parsedType}),l.INVALID;let n=[],o=this._def.keyType,s=this._def.valueType;for(let e in r.data)n.push({key:o._parse(new d(r,e,r.path,e)),value:s._parse(new d(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?l.ParseStatus.mergeObjectAsync(t,n):l.ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new X(t instanceof h?{keyType:e,valueType:t,typeName:n.ZodRecord,...p(r)}:{keyType:A.create(),valueType:e,typeName:n.ZodRecord,...p(t)})}}class Y extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.map)return(0,l.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.map,received:r.parsedType}),l.INVALID;let n=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([e,t],i)=>({key:n._parse(new d(r,e,r.path,[i,"key"])),value:o._parse(new d(r,t,r.path,[i,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of s){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return l.INVALID;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of s){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return l.INVALID;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}Y.create=(e,t,r)=>new Y({valueType:t,keyType:e,typeName:n.ZodMap,...p(r)});class Q extends h{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.set)return(0,l.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.set,received:r.parsedType}),l.INVALID;let n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&((0,l.addIssueToContext)(r,{code:i.ZodIssueCode.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&((0,l.addIssueToContext)(r,{code:i.ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let o=this._def.valueType;function s(e){let r=new Set;for(let n of e){if("aborted"===n.status)return l.INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let a=[...r.data.values()].map((e,t)=>o._parse(new d(r,e,r.path,t)));return r.common.async?Promise.all(a).then(e=>s(e)):s(a)}min(e,t){return new Q({...this._def,minSize:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new Q({...this._def,maxSize:{value:e,message:a.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Q.create=(e,t)=>new Q({valueType:e,minSize:null,maxSize:null,typeName:n.ZodSet,...p(t)});class ee extends h{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.ZodParsedType.function)return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.function,received:t.parsedType}),l.INVALID;function r(e,r){return(0,l.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),o.defaultErrorMap].filter(e=>!!e),issueData:{code:i.ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return(0,l.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),o.defaultErrorMap].filter(e=>!!e),issueData:{code:i.ZodIssueCode.invalid_return_type,returnTypeError:r}})}let a={errorMap:t.common.contextualErrorMap},d=t.data;if(this._def.returns instanceof es){let e=this;return(0,l.OK)(async function(...t){let o=new i.ZodError([]),s=await e._def.args.parseAsync(t,a).catch(e=>{throw o.addIssue(r(t,e)),o}),l=await Reflect.apply(d,this,s);return await e._def.returns._def.type.parseAsync(l,a).catch(e=>{throw o.addIssue(n(l,e)),o})})}{let e=this;return(0,l.OK)(function(...t){let o=e._def.args.safeParse(t,a);if(!o.success)throw new i.ZodError([r(t,o.error)]);let s=Reflect.apply(d,this,o.data),l=e._def.returns.safeParse(s,a);if(!l.success)throw new i.ZodError([n(s,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ee({...this._def,args:G.create(e).rest(U.create())})}returns(e){return new ee({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ee({args:e||G.create([]).rest(U.create()),returns:t||U.create(),typeName:n.ZodFunction,...p(r)})}}class et extends h{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}et.create=(e,t)=>
104new et({getter:e,typeName:n.ZodLazy,...p(t)});class er extends h{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{received:t.data,code:i.ZodIssueCode.invalid_literal,expected:this._def.value}),l.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function en(e,t){return new ei({values:e,typeName:n.ZodEnum,...p(t)})}er.create=(e,t)=>new er({value:e,typeName:n.ZodLiteral,...p(t)});class ei extends h{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,l.addIssueToContext)(t,{expected:u.util.joinValues(r),received:t.parsedType,code:i.ZodIssueCode.invalid_type}),l.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,l.addIssueToContext)(t,{received:t.data,code:i.ZodIssueCode.invalid_enum_value,options:r}),l.INVALID}return(0,l.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ei.create(e,{...this._def,...t})}exclude(e,t=this._def){return ei.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ei.create=en;class eo extends h{_parse(e){let t=u.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.ZodParsedType.string&&r.parsedType!==u.ZodParsedType.number){let e=u.util.objectValues(t);return(0,l.addIssueToContext)(r,{expected:u.util.joinValues(e),received:r.parsedType,code:i.ZodIssueCode.invalid_type}),l.INVALID}if(this._cache||(this._cache=new Set(u.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=u.util.objectValues(t);return(0,l.addIssueToContext)(r,{received:r.data,code:i.ZodIssueCode.invalid_enum_value,options:e}),l.INVALID}return(0,l.OK)(e.data)}get enum(){return this._def.values}}eo.create=(e,t)=>new eo({values:e,typeName:n.ZodNativeEnum,...p(t)});class es extends h{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.ZodParsedType.promise&&!1===t.common.async)return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.promise,received:t.parsedType}),l.INVALID;let r=t.parsedType===u.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,l.OK)(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}es.create=(e,t)=>new es({type:e,typeName:n.ZodPromise,...p(t)});class ea extends h{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{(0,l.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return l.INVALID;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?l.INVALID:"dirty"===n.status||"dirty"===t.value?(0,l.DIRTY)(n.value):n});{if("aborted"===t.value)return l.INVALID;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?l.INVALID:"dirty"===n.status||"dirty"===t.value?(0,l.DIRTY)(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?l.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?l.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>(0,l.isValid)(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):l.INVALID);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,l.isValid)(e))return l.INVALID;let o=n.transform(e.value,i);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}u.util.assertNever(n)}}ea.create=(e,t,r)=>new ea({schema:e,typeName:n.ZodEffects,effect:t,...p(r)}),ea.createWithPreprocess=(e,t,r)=>new ea({schema:t,effect:{type:"preprocess",transform:e},typeName:n.ZodEffects,...p(r)});class el extends h{_parse(e){return this._getType(e)===u.ZodParsedType.undefined?(0,l.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}el.create=(e,t)=>
104new el({innerType:e,typeName:n.ZodOptional,...p(t)});class eu extends h{_parse(e){return this._getType(e)===u.ZodParsedType.null?(0,l.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eu.create=(e,t)=>new eu({innerType:e,typeName:n.ZodNullable,...p(t)});class ed extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===u.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ed.create=(e,t)=>new ed({innerType:e,typeName:n.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...p(t)});class ec extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,l.isAsync)(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new i.ZodError(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new i.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ec.create=(e,t)=>new ec({innerType:e,typeName:n.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...p(t)});class ep extends h{_parse(e){if(this._getType(e)!==u.ZodParsedType.nan){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:u.ZodParsedType.nan,received:t.parsedType}),l.INVALID}return{status:"valid",value:e.data}}}ep.create=e=>new ep({typeName:n.ZodNaN,...p(e)});let eh=Symbol("zod_brand");class ef extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class em extends h{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?l.INVALID:"dirty"===e.status?(t.dirty(),(0,l.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?l.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new em({in:e,out:t,typeName:n.ZodPipeline})}}class eg extends h{_parse(e){let t=this._def.innerType._parse(e),r=e=>((0,l.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,l.isAsync)(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function ev(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function ey(e,t={},r){return e?L.create().superRefine((n,i)=>{let o=e(n);if(o instanceof Promise)return o.then(e=>{if(!e){let e=ev(t,n),o=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:o})}});if(!o){let e=ev(t,n),o=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:o})}}):L.create()}eg.create=(e,t)=>new eg({innerType:e,typeName:n.ZodReadonly,...p(t)});let eb={object:H.lazycreate};(r=n||(n={})).ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly";let ex=A.create,ek=D.create,ew=ep.create,e_=j.create,e$=P.create,eS=z.create,eI=M.create,eO=Z.create,eC=R.create,eN=L.create,eT=U.create,eE=V.create,eA=F.create,eD=B.create,ej=H.create,eP=H.strictCreate,ez=W.create,eM=J.create,eZ=q.create,eR=G.create,eL=X.create,eU=Y.create,eV=Q.create,eF=ee.create,eB=et.create,eH=er.create,eW=ei.create,eK=eo.create,eJ=es.create,eq=ea.create,eG=el.create,eX=eu.create,eY=ea.createWithPreprocess,eQ=em.create,e0=l.INVALID;e.s(["BRAND",0,eh,"NEVER",0,e0,"Schema",0,h,"ZodAny",0,L,"ZodArray",0,B,"ZodBigInt",0,j,"ZodBoolean",0,P,"ZodBranded",0,ef,"ZodCatch",0,ec,"ZodD
104ate",0,z,"ZodDefault",0,ed,"ZodDiscriminatedUnion",0,J,"ZodEffects",0,ea,"ZodEnum",0,ei,"ZodFirstPartyTypeKind",0,n,"ZodFunction",0,ee,"ZodIntersection",0,q,"ZodLazy",0,et,"ZodLiteral",0,er,"ZodMap",0,Y,"ZodNaN",0,ep,"ZodNativeEnum",0,eo,"ZodNever",0,V,"ZodNull",0,R,"ZodNullable",0,eu,"ZodNumber",0,D,"ZodObject",0,H,"ZodOptional",0,el,"ZodPipeline",0,em,"ZodPromise",0,es,"ZodReadonly",0,eg,"ZodRecord",0,X,"ZodSchema",0,h,"ZodSet",0,Q,"ZodString",0,A,"ZodSymbol",0,M,"ZodTransformer",0,ea,"ZodTuple",0,G,"ZodType",0,h,"ZodUndefined",0,Z,"ZodUnion",0,W,"ZodUnknown",0,U,"ZodVoid",0,F,"any",0,eN,"array",0,eD,"bigint",0,e_,"boolean",0,e$,"coerce",0,{string:e=>A.create({...e,coerce:!0}),number:e=>D.create({...e,coerce:!0}),boolean:e=>P.create({...e,coerce:!0}),bigint:e=>j.create({...e,coerce:!0}),date:e=>z.create({...e,coerce:!0})},"custom",0,ey,"date",0,eS,"datetimeRegex",0,E,"discriminatedUnion",0,eM,"effect",0,eq,"enum",0,eW,"function",0,eF,"instanceof",0,(e,t={message:`Input not instance of ${e.name}`})=>ey(t=>t instanceof e,t),"intersection",0,eZ,"late",0,eb,"lazy",0,eB,"literal",0,eH,"map",0,eU,"nan",0,ew,"nativeEnum",0,eK,"never",0,eE,"null",0,eC,"nullable",0,eX,"number",0,ek,"object",0,ej,"oboolean",0,()=>e$().optional(),"onumber",0,()=>ek().optional(),"optional",0,eG,"ostring",0,()=>ex().optional(),"pipeline",0,eQ,"preprocess",0,eY,"promise",0,eJ,"record",0,eL,"set",0,eV,"strictObject",0,eP,"string",0,ex,"symbol",0,eI,"transformer",0,eq,"tuple",0,eR,"undefined",0,eO,"union",0,ez,"unknown",0,eT,"void",0,eA])}]);
105
106//# debugId=03bcf1a8-c2b7-89ac-c501-ade6096593ca

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