PageSourceSearch

https://kitboard.co/assets/index-DwVidf72.js

js kitboard.co collected 2026-10-04 23:51:37 UTC 1,695,259 bytes, 733 lines download raw bytes

vendor: 5,605 bytes, lines 1-9
1var oA=t=>{throw TypeError(t)};var w0=(t,e,n)=>e.has(t)||oA("Cannot "+n);var R=(t,e,n)=>(w0(t,e,"read from private field"),n?n.call(t):e.get(t)),Ne=(t,e,n)=>e.has(t)?oA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ae=(t,e,n,r)=>(w0(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ve=(t,e,n)=>(w0(t,e,"access private method"),n);var Cm=(t,e,n,r)=>({set _(s){ae(t,e,s,n)},get _(){return R(t,e,r)}});function o8(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function S2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var k2={exports:{}},Nx={},C2={exports:{}},Ke={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Bp=Symbol.for("react.element"),a8=Symbol.for("react.portal"),l8=Symbol.for("react.fragment"),c8=Symbol.for("react.strict_mode"),u8=Symbol.for("react.profiler"),d8=Symbol.for("react.provider"),f8=Symbol.for("react.context"),h8=Symbol.for("react.forward_ref"),p8=Symbol.for("react.suspense"),m8=Symbol.for("react.memo"),g8=Symbol.for("react.lazy"),aA=Symbol.iterator;function y8(t){return t===null||typeof t!="object"?null:(t=aA&&t[aA]||t["@@iterator"],typeof t=="function"?t:null)}var N2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E2=Object.assign,_2={};function Td(t,e,n){this.props=t,this.context=e,this.refs=_2,this.updater=n||N2}Td.prototype.isReactComponent={};Td.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Td.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function T2(){}T2.prototype=Td.prototype;function XC(t,e,n){this.props=t,this.context=e,this.refs=_2,this.updater=n||N2}var ZC=XC.prototype=new T2;ZC.constructor=XC;E2(ZC,Td.prototype);ZC.isPureReactComponent=!0;var lA=Array.isArray,A2=Object.prototype.hasOwnProperty,eN={current:null},j2={key:!0,ref:!0,__self:!0,__source:!0};function P2(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)A2.call(e,r)&&!j2.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];s.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Bp,type:t,key:i,ref:o,props:s,_owner:eN.current}}function v8(t,e){return{$$typeof:Bp,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function tN(t){return typeof t=="object"&&t!==null&&t.$$typeof===Bp}function x8(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var cA=/\/+/g;function S0(t,e){return typeof t=="object"&&t!==null&&t.key!=null?x8(""+t.key):e.toString(36)}function Ag(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Bp:case a8:o=!0}}if(o)return o=t,s=s(o),t=r===""?"."+S0(o,0):r,lA(s)?(n="",t!=null&&(n=t.replace(cA,"$&/")+"/"),Ag(s,e,n,"",function(u){return u})):s!=null&&(tN(s)&&(s=v8(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(cA,"$&/")+"/")+t)),e.push(s)),1;if(o=0,r=r===""?".":r+":",lA(t))for(var a=0;a<t.length;a++){i=t[a];var l=r+S0(i,a);o+=Ag(i,e,n,l,s)}else if(l=y8(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=r+S0(i,a++),o+=Ag(i,e,n,l,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Nm(t,e,n){if(t==null)return t;var r=[],s=0;return Ag(t,r,"","",function(i){return e.call(n,i,s++)}),r}function b8(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var cr={current:null},jg={transition:null},w8={ReactCurrentDispatcher:cr,ReactCurrentBatchConfig:jg,ReactCurrentOwner:e
vendor: 8,511 bytes, lines 9-33
9N};function R2(){throw Error("act(...) is not supported in production builds of React.")}Ke.Children={map:Nm,forEach:function(t,e,n){Nm(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Nm(t,function(){e++}),e},toArray:function(t){return Nm(t,function(e){return e})||[]},only:function(t){if(!tN(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ke.Component=Td;Ke.Fragment=l8;Ke.Profiler=u8;Ke.PureComponent=XC;Ke.StrictMode=c8;Ke.Suspense=p8;Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w8;Ke.act=R2;Ke.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=E2({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=eN.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)A2.call(e,l)&&!j2.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Bp,type:t.type,key:s,ref:i,props:r,_owner:o}};Ke.createContext=function(t){return t={$$typeof:f8,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:d8,_context:t},t.Consumer=t};Ke.createElement=P2;Ke.createFactory=function(t){var e=P2.bind(null,t);return e.type=t,e};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(t){return{$$typeof:h8,render:t}};Ke.isValidElement=tN;Ke.lazy=function(t){return{$$typeof:g8,_payload:{_status:-1,_result:t},_init:b8}};Ke.memo=function(t,e){return{$$typeof:m8,type:t,compare:e===void 0?null:e}};Ke.startTransition=function(t){var e=jg.transition;jg.transition={};try{t()}finally{jg.transition=e}};Ke.unstable_act=R2;Ke.useCallback=function(t,e){return cr.current.useCallback(t,e)};Ke.useContext=function(t){return cr.current.useContext(t)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(t){return cr.current.useDeferredValue(t)};Ke.useEffect=function(t,e){return cr.current.useEffect(t,e)};Ke.useId=function(){return cr.current.useId()};Ke.useImperativeHandle=function(t,e,n){return cr.current.useImperativeHandle(t,e,n)};Ke.useInsertionEffect=function(t,e){return cr.current.useInsertionEffect(t,e)};Ke.useLayoutEffect=function(t,e){return cr.current.useLayoutEffect(t,e)};Ke.useMemo=function(t,e){return cr.current.useMemo(t,e)};Ke.useReducer=function(t,e,n){return cr.current.useReducer(t,e,n)};Ke.useRef=function(t){return cr.current.useRef(t)};Ke.useState=function(t){return cr.current.useState(t)};Ke.useSyncExternalStore=function(t,e,n){return cr.current.useSyncExternalStore(t,e,n)};Ke.useTransition=function(){return cr.current.useTransition()};Ke.version="18.3.1";C2.exports=Ke;var v=C2.exports;const z=S2(v),nN=o8({__proto__:null,default:z},[v]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var S8=v,k8=Symbol.for("react.element"),C8=Symbol.for("react.fragment"),N8=Object.prototype.hasOwnProperty,E8=S8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_8={key:!0,ref:!0,__self:!0,__source:!0};function M2(t,e,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)N8.call(e,r)&&!_8.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:k8,type:t,key:i,ref:o,props:s,_owner:E8.current}}Nx.Fragment=C8;Nx.jsx=M2;Nx.jsxs=M2;k2.exports=Nx;var c=k2.exports,O2={exports:{}},qr={},D2={exports:{}},I2={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(t){function e(A,O){var W=A.length;A.push(O);e:for(;0<W;){var Z=W-1>>>1,$=A[Z];if(0<s($,O))A[Z]=O,A[W]=$,W=Z;else break e}}function n(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var O=A[0],W=A.pop();if(W!==O){A[0]=W;e:for(var Z=0,$=A.length,Y=$>>>1;Z<Y;){var ee=2*(Z+1)-1,ne=A[ee],be=ee+1,G=A[be];if(0>s(ne,W))be<$&&0>s(G,ne)?(A[Z]=G,A[be]=W,Z=be):(A[Z]=ne,A[ee]=W,Z=ee);else if(be<$&&0>s(G,W))A[Z]=G,A[be]=W,Z=be;else break e}}return O}function s(A,O){var W=A.sortIndex-O.sortIndex;return W!==0?W:A.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(A){for(var O=n(u);O!==null;){if(O.callback===null)r(u);else if(O.startTime<=A)r(u),O.sortIndex=O.expirationTime,e(l,O);else break;O=n(u)}}function S(A){if(g=!1,w(A),!m)if(n(l)!==null)m=!0,D(C);else{var O=n(u);O!==null&&L(S,O.startTime-A)}}function C(A,O){m=!1,g&&(g=!1,b(E),E=-1),p=!0;var W=h;try{for(w(O),f=n(l);f!==null&&(!(f.expirationTime>O)||A&&!P());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var $=Z(f.expirationTime<=O);O=t.unstable_now(),typeof $=="function"?f.callback=$:f===n(l)&&r(l),w(O)}else r(l);f=n(l)}if(f!==null)var Y=!0;else{var ee=n(u);ee!==null&&L(S,ee.startTime-O),Y=!1}return Y}finally{f=null,h=W,p=!1}}var k=!1,N=null,E=-1,_=5,T=-1;function P(){return!(t.unstable_now()-T<_)}function j(){if(N!==null){var A=t.unstable_now();T=A;var O=!0;try{O=N(!0,A)}finally{O?F():(k=!1,N=null)}}else k=!1}var F;if(typeof x=="function")F=function(){x(j)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,U=B.port2;B.port1.onmessage=j,F=function(){U.postMessage(null)}}else F=function(){y(j,0)};function D(A){N=A,k||(k=!0,F())}function L(A,O){E=y(function(){A(t.unstable_now())},O)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(A){A.callback=null},t.unstable_continueExecution=function(){m||p||(m=!0,D(C))},t.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<A?Math.floor(1e3/A):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(A){switch(h){case 1:case 2:case 3:var O=3;break;default:O=h}var W=h;h=O;try{return A()}finally{h=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(A,O){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var W=h;h=A;try{return O()}finally{h=W}},t.unstable_scheduleCallback=function(A,O,W){var Z=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Z+W:Z):W=Z,A){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=W+$,A={id:d++,callback:O,priorityLevel:A,startTime:W,expirationTime:$,sortIndex:-1},W>Z?(A.sortIndex=W,e(u,A),n(l)===null&&A===n(u)&&(g?(b(E),E=-1):g=!0,L(S,W-Z))):(A.sortIndex=$,e(l,A),m||p||(m=!0,D(C))),A},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(A){var O=h;return function(){var W=h;h=O;try{return A.apply(this,arguments)}finally{h=W}}}})(I2);D2.exports=I2;var T8=D2.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var A8=v,Wr=T8;function X(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
vendor: 5,017 bytes, line 33
33var L2=new Set,Ah={};function bc(t,e){Hu(t,e),Hu(t+"Capture",e)}function Hu(t,e){for(Ah[t]=e,t=0;t<e.length;t++)L2.add(e[t])}var ho=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),B1=Object.prototype.hasOwnProperty,j8=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,uA={},dA={};function P8(t){return B1.call(dA,t)?!0:B1.call(uA,t)?!1:j8.test(t)?dA[t]=!0:(uA[t]=!0,!1)}function R8(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function M8(t,e,n,r){if(e===null||typeof e>"u"||R8(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ur(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var On={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){On[t]=new ur(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];On[e]=new ur(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){On[t]=new ur(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){On[t]=new ur(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){On[t]=new ur(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){On[t]=new ur(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){On[t]=new ur(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){On[t]=new ur(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){On[t]=new ur(t,5,!1,t.toLowerCase(),null,!1,!1)});var rN=/[\-:]([a-z])/g;function sN(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(rN,sN);On[e]=new ur(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(rN,sN);On[e]=new ur(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(rN,sN);On[e]=new ur(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){On[t]=new ur(t,1,!1,t.toLowerCase(),null,!1,!1)});On.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){On[t]=new ur(t,1,!1,t.toLowerCase(),null,!0,!0)});function iN(t,e,n,r){var s=On.hasOwnProperty(e)?On[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(M8(e,n,s,r)&&(n=null),r||s===null?P8(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):s.mustUseProperty?t[s.propertyName]=n===null?s.type===3?!1:"":n:(e=s.attributeName,r=s.attributeNamespace,n===null?t.removeAttribute(e):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}
vendor: 6,698 bytes, lines 33-37
33var wo=A8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Em=Symbol.for("react.element"),tu=Symbol.for("react.portal"),nu=Symbol.for("react.fragment"),oN=Symbol.for("react.strict_mode"),$1=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),B2=Symbol.for("react.context"),aN=Symbol.for("react.forward_ref"),V1=Symbol.for("react.suspense"),z1=Symbol.for("react.suspense_list"),lN=Symbol.for("react.memo"),Bo=Symbol.for("react.lazy"),$2=Symbol.for("react.offscreen"),fA=Symbol.iterator;function sf(t){return t===null||typeof t!="object"?null:(t=fA&&t[fA]||t["@@iterator"],typeof t=="function"?t:null)}var It=Object.assign,k0;function Of(t){if(k0===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);k0=e&&e[1]||""}return`
34`+k0+t}var C0=!1;function N0(t,e){if(!t||C0)return"";C0=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
35`),i=r.stack.split(`
36`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
37`+s[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{C0=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Of(t):""}function O8(t){switch(t.tag){case 5:return Of(t.type);case 16:return Of("Lazy");case 13:return Of("Suspense");case 19:return Of("SuspenseList");case 0:case 2:case 15:return t=N0(t.type,!1),t;case 11:return t=N0(t.type.render,!1),t;case 1:return t=N0(t.type,!0),t;default:return""}}function U1(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case nu:return"Fragment";case tu:return"Portal";case $1:return"Profiler";case oN:return"StrictMode";case V1:return"Suspense";case z1:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case B2:return(t.displayName||"Context")+".Consumer";case F2:return(t._context.displayName||"Context")+".Provider";case aN:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case lN:return e=t.displayName||null,e!==null?e:U1(t.type)||"Memo";case Bo:e=t._payload,t=t._init;try{return U1(t(e))}catch{}}return null}function D8(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U1(e);case 8:return e===oN?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Da(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function V2(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function I8(t){var e=V2(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function _m(t){t._valueTracker||(t._valueTracker=I8(t))}function z2(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=V2(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function fy(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function W1(t,e){var n=e.checked;return It({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function hA(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Da(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function U2(t,e){e=e.checked,e!=null&&iN(t,"checked",e,!1)}function H1(t,e){U2(t,e);var n=Da(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?q1(t,e.type,n):e.hasOwnProperty("defaultValue")&&q1(t,e.type,Da(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function pA(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function q1(t,e,n){(e!=="number"||fy(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Df=Array.isArray;function vu(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s<n.length;s++)e["$"+n[s]]=!0;for(n=0;n<t.length;n++)s=e.hasOwnProperty("$"+t[n].value),t[n].selected!==s&&(t[n].selected=s),s&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Da(n),e=null,s=0;s<t.length;s++){if(t[s].value===n){t[s].selected=!0,r&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function K1(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(X(91));return It({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function mA(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(X(92));
vendor: 11,240 bytes, line 37
37if(Df(n)){if(1<n.length)throw Error(X(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Da(n)}}function W2(t,e){var n=Da(e.value),r=Da(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function gA(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function H2(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function G1(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?H2(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Tm,q2=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,s){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Tm=Tm||document.createElement("div"),Tm.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Tm.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function jh(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Yf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},L8=["Webkit","ms","Moz","O"];Object.keys(Yf).forEach(function(t){L8.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Yf[e]=Yf[t]})});function K2(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Yf.hasOwnProperty(t)&&Yf[t]?(""+e).trim():e+"px"}function G2(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=K2(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var F8=It({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Y1(t,e){if(e){if(F8[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(X(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(X(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(X(61))}if(e.style!=null&&typeof e.style!="object")throw Error(X(62))}}function Q1(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var J1=null;function cN(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var X1=null,xu=null,bu=null;function yA(t){if(t=zp(t)){if(typeof X1!="function")throw Error(X(280));var e=t.stateNode;e&&(e=jx(e),X1(t.stateNode,t.type,e))}}function Y2(t){xu?bu?bu.push(t):bu=[t]:xu=t}function Q2(){if(xu){var t=xu,e=bu;if(bu=xu=null,yA(t),e)for(t=0;t<e.length;t++)yA(e[t])}}function J2(t,e){return t(e)}function X2(){}var E0=!1;function Z2(t,e,n){if(E0)return t(e,n);E0=!0;try{return J2(t,e,n)}finally{E0=!1,(xu!==null||bu!==null)&&(X2(),Q2())}}function Ph(t,e){var n=t.stateNode;if(n===null)return null;var r=jx(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(X(231,e,typeof n));return n}var Z1=!1;if(ho)try{var of={};Object.defineProperty(of,"passive",{get:function(){Z1=!0}}),window.addEventListener("test",of,of),window.removeEventListener("test",of,of)}catch{Z1=!1}function B8(t,e,n,r,s,i,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var Qf=!1,hy=null,py=!1,eS=null,$8={onError:function(t){Qf=!0,hy=t}};function V8(t,e,n,r,s,i,o,a,l){Qf=!1,hy=null,B8.apply($8,arguments)}function z8(t,e,n,r,s,i,o,a,l){if(V8.apply(this,arguments),Qf){if(Qf){var u=hy;Qf=!1,hy=null}else throw Error(X(198));py||(py=!0,eS=u)}}function wc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function eI(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function vA(t){if(wc(t)!==t)throw Error(X(188))}function U8(t){var e=t.alternate;if(!e){if(e=wc(t),e===null)throw Error(X(188));return e!==t?null:t}for(var n=t,r=e;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return vA(s),t;if(i===r)return vA(s),e;i=i.sibling}throw Error(X(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(X(189))}}if(n.alternate!==r)throw Error(X(190))}if(n.tag!==3)throw Error(X(188));return n.stateNode.current===n?t:e}function tI(t){return t=U8(t),t!==null?nI(t):null}function nI(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=nI(t);if(e!==null)return e;t=t.sibling}return null}var rI=Wr.unstable_scheduleCallback,xA=Wr.unstable_cancelCallback,W8=Wr.unstable_shouldYield,H8=Wr.unstable_requestPaint,Ht=Wr.unstable_now,q8=Wr.unstable_getCurrentPriorityLevel,uN=Wr.unstable_ImmediatePriority,sI=Wr.unstable_UserBlockingPriority,my=Wr.unstable_NormalPriority,K8=Wr.unstable_LowPriority,iI=Wr.unstable_IdlePriority,Ex=null,ki=null;function G8(t){if(ki&&typeof ki.onCommitFiberRoot=="function")try{ki.onCommitFiberRoot(Ex,t,void 0,(t.current.flags&128)===128)}catch{}}var zs=Math.clz32?Math.clz32:J8,Y8=Math.log,Q8=Math.LN2;function J8(t){return t>>>=0,t===0?32:31-(Y8(t)/Q8|0)|0}var Am=64,jm=4194304;function If(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function gy(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=If(a):(i&=o,i!==0&&(r=If(i)))}else o=n&~s,o!==0?r=If(o):i!==0&&(r=If(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-zs(e),s=1<<n,r|=t[n],e&=~s;return r}function X8(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Z8(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-zs(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=X8(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function tS(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function oI(){var t=Am;return Am<<=1,!(Am&4194240)&&(Am=64),t}function _0(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function $p(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-zs(e),t[e]=n}function eq(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var s=31-zs(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function dN(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-zs(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var ct=0;function aI(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var lI,fN,cI,uI,dI,nS=!1,Pm=[],ga=null,ya=null,va=null,Rh=new Map,Mh=new Map,Ho=[],tq="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function bA(t,e){switch(t){case"focusin":case"focusout":ga=null;break;case"dragenter":case"dragleave":ya=null;break;case"mouseover":case"mouseout":va=null;break;case"pointerover":case"pointerout":Rh.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mh.delete(e.pointerId)}}function af(t,e,n,r,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},e!==null&&(e=zp(e),e!==null&&fN(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function nq(t,e,n,r,s){switch(e){case"focusin":return ga=af(ga,t,e,n,r,s),!0;case"dragenter":return ya=af(ya,t,e,n,r,s),!0;case"mouseover":return va=af(va,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return Rh.set(i,af(Rh.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Mh.set(i,af(Mh.get(i)||null,t,e,n,r,s)),!0}return!1}function fI(t){var e=bl(t.target);if(e!==null){var n=wc(e);if(n!==null){if(e=n.tag,e===13){if(e=eI(n),e!==null){t.blockedOn=e,dI(t.priority,function(){cI(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Pg(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=rS(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);J1=r,n.target.dispatchEvent(r),J1=null}else return e=zp(n),e!==null&&fN(e),t.blockedOn=n,!1;e.shift()}return!0}function wA(t,e,n){Pg(t)&&n.delete(e)}function rq(){nS=!1,ga!==null&&Pg(ga)&&(ga=null),ya!==null&&Pg(ya)&&(ya=null),va!==null&&Pg(va)&&(va=null),Rh.forEac
vendor: 9,291 bytes, line 37
37h(wA),Mh.forEach(wA)}function lf(t,e){t.blockedOn===e&&(t.blockedOn=null,nS||(nS=!0,Wr.unstable_scheduleCallback(Wr.unstable_NormalPriority,rq)))}function Oh(t){function e(s){return lf(s,t)}if(0<Pm.length){lf(Pm[0],t);for(var n=1;n<Pm.length;n++){var r=Pm[n];r.blockedOn===t&&(r.blockedOn=null)}}for(ga!==null&&lf(ga,t),ya!==null&&lf(ya,t),va!==null&&lf(va,t),Rh.forEach(e),Mh.forEach(e),n=0;n<Ho.length;n++)r=Ho[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Ho.length&&(n=Ho[0],n.blockedOn===null);)fI(n),n.blockedOn===null&&Ho.shift()}var wu=wo.ReactCurrentBatchConfig,yy=!0;function sq(t,e,n,r){var s=ct,i=wu.transition;wu.transition=null;try{ct=1,hN(t,e,n,r)}finally{ct=s,wu.transition=i}}function iq(t,e,n,r){var s=ct,i=wu.transition;wu.transition=null;try{ct=4,hN(t,e,n,r)}finally{ct=s,wu.transition=i}}function hN(t,e,n,r){if(yy){var s=rS(t,e,n,r);if(s===null)L0(t,e,r,vy,n),bA(t,r);else if(nq(s,t,e,n,r))r.stopPropagation();else if(bA(t,r),e&4&&-1<tq.indexOf(t)){for(;s!==null;){var i=zp(s);if(i!==null&&lI(i),i=rS(t,e,n,r),i===null&&L0(t,e,r,vy,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else L0(t,e,r,null,n)}}var vy=null;function rS(t,e,n,r){if(vy=null,t=cN(r),t=bl(t),t!==null)if(e=wc(t),e===null)t=null;else if(n=e.tag,n===13){if(t=eI(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return vy=t,null}function hI(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(q8()){case uN:return 1;case sI:return 4;case my:case K8:return 16;case iI:return 536870912;default:return 16}default:return 16}}var la=null,pN=null,Rg=null;function pI(){if(Rg)return Rg;var t,e=pN,n=e.length,r,s="value"in la?la.value:la.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===s[i-r];r++);return Rg=s.slice(t,1<r?1-r:void 0)}function Mg(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Rm(){return!0}function SA(){return!1}function Kr(t){function e(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Rm:SA,this.isPropagationStopped=SA,this}return It(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Rm)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Rm)},persist:function(){},isPersistent:Rm}),e}var Ad={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mN=Kr(Ad),Vp=It({},Ad,{view:0,detail:0}),oq=Kr(Vp),T0,A0,cf,_x=It({},Vp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gN,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==cf&&(cf&&t.type==="mousemove"?(T0=t.screenX-cf.screenX,A0=t.screenY-cf.screenY):A0=T0=0,cf=t),T0)},movementY:function(t){return"movementY"in t?t.movementY:A0}}),kA=Kr(_x),aq=It({},_x,{dataTransfer:0}),lq=Kr(aq),cq=It({},Vp,{relatedTarget:0}),j0=Kr(cq),uq=It({},Ad,{animationName:0,elapsedTime:0,pseudoElement:0}),dq=Kr(uq),fq=It({},Ad,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),hq=Kr(fq),pq=It({},Ad,{data:0}),CA=Kr(pq),mq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gq={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yq={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vq(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=yq[t])?!!e[t]:!1}function gN(){return vq}var xq=It({},Vp,{key:function(t){if(t.key){var e=mq[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Mg(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?gq[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gN,charCode:function(t){return t.type==="keypress"?Mg(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Mg(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),bq=Kr(xq),wq=It({},_x,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),NA=Kr(wq),Sq=It({},Vp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gN}),kq=Kr(Sq),Cq=It({},Ad,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nq=Kr(Cq),Eq=It({},_x,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),_q=Kr(Eq),Tq=[9,13,27,32],yN=ho&&"CompositionEvent"in window,Jf=null;ho&&"documentMode"in document&&(Jf=document.documentMode);var Aq=ho&&"TextEvent"in window&&!Jf,mI=ho&&(!yN||Jf&&8<Jf&&11>=Jf),EA=" ",_A=!1;function gI(t,e){switch(t){case"keyup":return Tq.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yI(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ru=!1;function jq(t,e){switch(t){case"compositionend":return yI(e);case"keypress":return e.which!==32?null:(_A=!0,EA);case"textInput":return t=e.data,t===EA&&_A?null:t;default:return null}}function Pq(t,e){if(ru)return t==="compositionend"||!yN&&gI(t,e)?(t=pI(),Rg=pN=la=null,ru=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return mI&&e.locale!=="ko"?null:e.data;default:return null}}var Rq={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function TA(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Rq[t.type]:e==="textarea"}function vI(t,e,n,r){Y2(r),e=xy(e,"onChange"),0<e.length&&(n=new mN("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Xf=null,Dh=null;function Mq(t){AI(t,0)}function Tx(t){var e=ou(t);if(z2(e))return t}function Oq(t,e){if(t==="change")return e}var xI=!1;if(ho){var P0;if(ho){var R0="oninput"in document;if(!R0){var AA=document.createElement("div");AA.setAttribute("oninput","return;"),R0=typeof AA.oninput=="function"}P0=R0}else P0=!1;xI=P0&&(!document.documentMode||9<document.documentMode)}function jA(){Xf&&(Xf.detachEvent("onpropertychange",bI),Dh=Xf=null)}function bI(t){if(t.propertyName==="value"&&Tx(Dh)){var e=[];vI(e,Dh,t,cN(t)),Z2(Mq,e)}}function Dq(t,e,n){t==="focusin"?(jA(),Xf=e,Dh=n,Xf.attachEvent("onpropertychange",bI)):t==="focusout"&&jA()}function Iq(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tx(Dh)}function Lq(t,e){if(t==="click")return Tx(e)}function Fq(t,e){if(t==="input"||t==="change")return Tx(e)}function Bq(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Hs=typeof Object.is=="function"?Object.is:Bq;function Ih(t,e){if(Hs(t,e))return!0;
vendor: 4,808 bytes, line 37
37if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!B1.call(e,s)||!Hs(t[s],e[s]))return!1}return!0}function PA(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function RA(t,e){var n=PA(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=PA(n)}}function wI(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?wI(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function SI(){for(var t=window,e=fy();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=fy(t.document)}return e}function vN(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function $q(t){var e=SI(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&wI(n.ownerDocument.documentElement,n)){if(r!==null&&vN(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=RA(n,i);var o=RA(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Vq=ho&&"documentMode"in document&&11>=document.documentMode,su=null,sS=null,Zf=null,iS=!1;function MA(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;iS||su==null||su!==fy(r)||(r=su,"selectionStart"in r&&vN(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zf&&Ih(Zf,r)||(Zf=r,r=xy(sS,"onSelect"),0<r.length&&(e=new mN("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=su)))}function Mm(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var iu={animationend:Mm("Animation","AnimationEnd"),animationiteration:Mm("Animation","AnimationIteration"),animationstart:Mm("Animation","AnimationStart"),transitionend:Mm("Transition","TransitionEnd")},M0={},kI={};ho&&(kI=document.createElement("div").style,"AnimationEvent"in window||(delete iu.animationend.animation,delete iu.animationiteration.animation,delete iu.animationstart.animation),"TransitionEvent"in window||delete iu.transitionend.transition);function Ax(t){if(M0[t])return M0[t];if(!iu[t])return t;var e=iu[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in kI)return M0[t]=e[n];return t}var CI=Ax("animationend"),NI=Ax("animationiteration"),EI=Ax("animationstart"),_I=Ax("transitionend"),TI=new Map,OA="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ya(t,e){TI.set(t,e),bc(e,[t])}for(var O0=0;O0<OA.length;O0++){var D0=OA[O0],zq=D0.toLowerCase(),Uq=D0[0].toUpperCase()+D0.slice(1);Ya(zq,"on"+Uq)}Ya(CI,"onAnimationEnd");Ya(NI,"onAnimationIteration");Ya(EI,"onAnimationStart");Ya("dblclick","onDoubleClick");Ya("focusin","onFocus");Ya("focusout","onBlur");Ya(_I,"onTransitionEnd");Hu("onMouseEnter",["mouseout","mouseover"]);Hu("onMouseLeave",["mouseout","mouseover"]);Hu("onPointerEnter",["pointerout","pointerover"]);Hu("onPointerLeave",["pointerout","pointerover"]);bc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,442 bytes, line 37
37bc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));bc("onBeforeInput",["compositionend","keypress","textInput","paste"]);bc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));bc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));bc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Wq=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lf));function DA(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,z8(r,e,void 0,t),t.currentTarget=null}function AI(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],s=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;DA(s,a,u),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;DA(s,a,u),i=l}}}if(py)throw t=eS,py=!1,eS=null,t}function Ct(t,e){var n=e[uS];n===void 0&&(n=e[uS]=new Set);var r=t+"__bubble";n.has(r)||(jI(e,t,2,!1),n.add(r))}function I0(t,e,n){var r=0;e&&(r|=4),jI(n,t,r,e)}var Om="_reactListening"+Math.random().toString(36).slice(2);function Lh(t){if(!t[Om]){t[Om]=!0,L2.forEach(function(n){n!=="selectionchange"&&(Wq.has(n)||I0(n,!1,t),I0(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Om]||(e[Om]=!0,I0("selectionchange",!1,e))}}function jI(t,e,n,r){switch(hI(e)){case 1:var s=sq;break;case 4:s=iq;break;default:s=hN}n=s.bind(null,e,n,t),s=void 0,!Z1||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),r?s!==void 0?t.addEventListener(e,n,{capture:!0,passive:s}):t.addEventListener(e,n,!0):s!==void 0?t.addEventListener(e,n,{passive:s}):t.addEventListener(e,n,!1)}function L0(t,e,n,r,s){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=bl(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}Z2(function(){var u=i,d=cN(n),f=[];e:{var h=TI.get(t);if(h!==void 0){var p=mN,m=t;switch(t){case"keypress":if(Mg(n)===0)break e;case"keydown":case"keyup":p=bq;break;case"focusin":m="focus",p=j0;break;case"focusout":m="blur",p=j0;break;case"beforeblur":case"afterblur":p=j0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=kA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=lq;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=kq;break;case CI:case NI:case EI:p=dq;break;case _I:p=Nq;break;case"scroll":p=oq;break;case"wheel":p=_q;break;case"copy":case"cut":case"paste":p=hq;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=NA}var g=(e&4)!==0,y=!g&&t==="scroll",b=g?h!==null?h+"Capture":null:h;g=[];for(var x=u,w;x!==null;){w=x;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,b!==null&&(S=Ph(x,b),S!=null&&g.push(Fh(x,S,w)))),y)break;x=x.return}0<g.length&&(h=new p(h,m,null,n,d),f.push({event:h,listeners:g}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",h&&n!==J1&&(m=n.relatedTarget||n.fromElement)&&(bl(m)||m[po]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?bl(m):null,m!==null&&(y=wc(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(g=kA,S="onMouseLeave",b="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(g=NA,S="onPointerLeave",b="onPointerEnter",x="pointer"),y=p==null?h:ou(p),w=m==null?h:ou(m),h=new g(S,x+"leave",p,n,d),h.target=y,h.relatedTarget=w,S=null,bl(d)===u&&(g=ne
vendor: 6,249 bytes, lines 37-38
37w g(b,x+"enter",m,n,d),g.target=w,g.relatedTarget=y,S=g),y=S,p&&m)t:{for(g=p,b=m,x=0,w=g;w;w=jc(w))x++;for(w=0,S=b;S;S=jc(S))w++;for(;0<x-w;)g=jc(g),x--;for(;0<w-x;)b=jc(b),w--;for(;x--;){if(g===b||b!==null&&g===b.alternate)break t;g=jc(g),b=jc(b)}g=null}else g=null;p!==null&&IA(f,h,p,g,!1),m!==null&&y!==null&&IA(f,y,m,g,!0)}}e:{if(h=u?ou(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var C=Oq;else if(TA(h))if(xI)C=Fq;else{C=Iq;var k=Dq}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=Lq);if(C&&(C=C(t,u))){vI(f,C,n,d);break e}k&&k(t,h,u),t==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&q1(h,"number",h.value)}switch(k=u?ou(u):window,t){case"focusin":(TA(k)||k.contentEditable==="true")&&(su=k,sS=u,Zf=null);break;case"focusout":Zf=sS=su=null;break;case"mousedown":iS=!0;break;case"contextmenu":case"mouseup":case"dragend":iS=!1,MA(f,n,d);break;case"selectionchange":if(Vq)break;case"keydown":case"keyup":MA(f,n,d)}var N;if(yN)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else ru?gI(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(mI&&n.locale!=="ko"&&(ru||E!=="onCompositionStart"?E==="onCompositionEnd"&&ru&&(N=pI()):(la=d,pN="value"in la?la.value:la.textContent,ru=!0)),k=xy(u,E),0<k.length&&(E=new CA(E,t,null,n,d),f.push({event:E,listeners:k}),N?E.data=N:(N=yI(n),N!==null&&(E.data=N)))),(N=Aq?jq(t,n):Pq(t,n))&&(u=xy(u,"onBeforeInput"),0<u.length&&(d=new CA("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=N))}AI(f,e)})}function Fh(t,e,n){return{instance:t,listener:e,currentTarget:n}}function xy(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Ph(t,n),i!=null&&r.unshift(Fh(t,i,s)),i=Ph(t,e),i!=null&&r.push(Fh(t,i,s))),t=t.return}return r}function jc(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function IA(t,e,n,r,s){for(var i=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,s?(l=Ph(n,i),l!=null&&o.unshift(Fh(n,l,a))):s||(l=Ph(n,i),l!=null&&o.push(Fh(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var Hq=/\r\n?/g,qq=/\u0000|\uFFFD/g;function LA(t){return(typeof t=="string"?t:""+t).replace(Hq,`
38`).replace(qq,"")}function Dm(t,e,n){if(e=LA(e),LA(t)!==e&&n)throw Error(X(425))}function by(){}var oS=null,aS=null;function lS(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var cS=typeof setTimeout=="function"?setTimeout:void 0,Kq=typeof clearTimeout=="function"?clearTimeout:void 0,FA=typeof Promise=="function"?Promise:void 0,Gq=typeof queueMicrotask=="function"?queueMicrotask:typeof FA<"u"?function(t){return FA.resolve(null).then(t).catch(Yq)}:cS;function Yq(t){setTimeout(function(){throw t})}function F0(t,e){var n=e,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){t.removeChild(s),Oh(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Oh(e)}function xa(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function BA(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var jd=Math.random().toString(36).slice(2),yi="__reactFiber$"+jd,Bh="__reactProps$"+jd,po="__reactContainer$"+jd,uS="__reactEvents$"+jd,Qq="__reactListeners$"+jd,Jq="__reactHandles$"+jd;function bl(t){var e=t[yi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[po]||n[yi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=BA(t);t!==null;){if(n=t[yi])return n;t=BA(t)}return e}t=n,n=t.parentNode}return null}function zp(t){return t=t[yi]||t[po],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ou(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(X(33))}function jx(t){return t[Bh]||null}var dS=[],au=-1;function Qa(t){return{current:t}}function _t(t){0>au||(t.current=dS[au],dS[au]=null,au--)}function wt(t,e){au++,dS[au]=t.current,t.current=e}var Ia={},Un=Qa(Ia),kr=Qa(!1),Yl=Ia;function qu(t,e){var n=t.type.contextTypes;if(!n)return Ia;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function Cr(t){return t=t.childContextTypes,t!=null}function wy(){_t(kr),_t(Un)}function $A(t,e,n){if(Un.current!==Ia)throw Error(X(168));wt(Un,e),wt(kr,n)}function PI(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(X(108,D8(t)||"Unknown",s));return It({},n,r)}function Sy(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ia,Yl=Un.current,wt(Un,t),wt(kr,kr.current),!0}function VA(t,e,n){var r=t.stateNode;if(!r)throw Error(X(169));n?(t=PI(t,e,Yl),r.__reactInternalMemoizedMergedChildContext=t,_t(kr),_t(Un),wt(Un,t)):_t(kr),wt(kr,n)}var ro=null,Px=!1,B0=!1;function RI(t){ro===null?ro=[t]:ro.push(t)}function Xq(t){Px=!0,RI(t)}function Ja(){if(!B0&&ro!==null){B0=!0;var t=0,e=ct;try{var n=ro;for(ct=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}ro=null,Px=!1}catch(s){throw ro!==null&&(ro=ro.slice(t+1)),rI(uN,Ja),s}finally{ct=e,B0=!1}}return null}var lu=[],cu=0,ky=null,Cy=0,ts=[],ns=0,Ql=null,oo=1,ao="";function fl(t,e){lu[cu++]=Cy,lu[cu++]=ky,ky=t,Cy=e}function MI(t,e,n){ts[ns++]=oo,ts[ns++]=ao,ts[ns++]=Ql,Ql=t;var r=oo;t=ao;var s=32-zs(r)-1;r&=~(1<<s),n+=1;var i=32-zs(e)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,oo=1<<32-zs(e)+s|n<<s|r,ao=i+t}else oo=1<<i|n<<s|r,ao=t}
vendor: 26,125 bytes, lines 38-40
38function xN(t){t.return!==null&&(fl(t,1),MI(t,1,0))}function bN(t){for(;t===ky;)ky=lu[--cu],lu[cu]=null,Cy=lu[--cu],lu[cu]=null;for(;t===Ql;)Ql=ts[--ns],ts[ns]=null,ao=ts[--ns],ts[ns]=null,oo=ts[--ns],ts[ns]=null}var $r=null,Lr=null,jt=!1,Ds=null;function OI(t,e){var n=ss(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function zA(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,$r=t,Lr=xa(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,$r=t,Lr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ql!==null?{id:oo,overflow:ao}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=ss(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,$r=t,Lr=null,!0):!1;default:return!1}}function fS(t){return(t.mode&1)!==0&&(t.flags&128)===0}function hS(t){if(jt){var e=Lr;if(e){var n=e;if(!zA(t,e)){if(fS(t))throw Error(X(418));e=xa(n.nextSibling);var r=$r;e&&zA(t,e)?OI(r,n):(t.flags=t.flags&-4097|2,jt=!1,$r=t)}}else{if(fS(t))throw Error(X(418));t.flags=t.flags&-4097|2,jt=!1,$r=t}}}function UA(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;$r=t}function Im(t){if(t!==$r)return!1;if(!jt)return UA(t),jt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!lS(t.type,t.memoizedProps)),e&&(e=Lr)){if(fS(t))throw DI(),Error(X(418));for(;e;)OI(t,e),e=xa(e.nextSibling)}if(UA(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(X(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Lr=xa(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Lr=null}}else Lr=$r?xa(t.stateNode.nextSibling):null;return!0}function DI(){for(var t=Lr;t;)t=xa(t.nextSibling)}function Ku(){Lr=$r=null,jt=!1}function wN(t){Ds===null?Ds=[t]:Ds.push(t)}var Zq=wo.ReactCurrentBatchConfig;function uf(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(X(309));var r=n.stateNode}if(!r)throw Error(X(147,t));var s=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(X(284));if(!n._owner)throw Error(X(290,t))}return t}function Lm(t,e){throw t=Object.prototype.toString.call(e),Error(X(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function WA(t){var e=t._init;return e(t._payload)}function II(t){function e(b,x){if(t){var w=b.deletions;w===null?(b.deletions=[x],b.flags|=16):w.push(x)}}function n(b,x){if(!t)return null;for(;x!==null;)e(b,x),x=x.sibling;return null}function r(b,x){for(b=new Map;x!==null;)x.key!==null?b.set(x.key,x):b.set(x.index,x),x=x.sibling;return b}function s(b,x){return b=ka(b,x),b.index=0,b.sibling=null,b}function i(b,x,w){return b.index=w,t?(w=b.alternate,w!==null?(w=w.index,w<x?(b.flags|=2,x):w):(b.flags|=2,x)):(b.flags|=1048576,x)}function o(b){return t&&b.alternate===null&&(b.flags|=2),b}function a(b,x,w,S){return x===null||x.tag!==6?(x=q0(w,b.mode,S),x.return=b,x):(x=s(x,w),x.return=b,x)}function l(b,x,w,S){var C=w.type;return C===nu?d(b,x,w.props.children,S,w.key):x!==null&&(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Bo&&WA(C)===x.type)?(S=s(x,w.props),S.ref=uf(b,x,w),S.return=b,S):(S=$g(w.type,w.key,w.props,null,b.mode,S),S.ref=uf(b,x,w),S.return=b,S)}function u(b,x,w,S){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=K0(w,b.mode,S),x.return=b,x):(x=s(x,w.children||[]),x.return=b,x)}function d(b,x,w,S,C){return x===null||x.tag!==7?(x=Vl(w,b.mode,S,C),x.return=b,x):(x=s(x,w),x.return=b,x)}function f(b,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=q0(""+x,b.mode,w),x.return=b,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Em:return w=$g(x.type,x.key,x.props,null,b.mode,w),w.ref=uf(b,null,x),w.return=b,w;case tu:return x=K0(x,b.mode,w),x.return=b,x;case Bo:var S=x._init;return f(b,S(x._payload),w)}if(Df(x)||sf(x))return x=Vl(x,b.mode,w,null),x.return=b,x;Lm(b,x)}return null}function h(b,x,w,S){var C=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return C!==null?null:a(b,x,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Em:return w.key===C?l(b,x,w,S):null;case tu:return w.key===C?u(b,x,w,S):null;case Bo:return C=w._init,h(b,x,C(w._payload),S)}if(Df(w)||sf(w))return C!==null?null:d(b,x,w,S,null);Lm(b,w)}return null}function p(b,x,w,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return b=b.get(w)||null,a(x,b,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Em:return b=b.get(S.key===null?w:S.key)||null,l(x,b,S,C);case tu:return b=b.get(S.key===null?w:S.key)||null,u(x,b,S,C);case Bo:var k=S._init;return p(b,x,w,k(S._payload),C)}if(Df(S)||sf(S))return b=b.get(w)||null,d(x,b,S,C,null);Lm(x,S)}return null}function m(b,x,w,S){for(var C=null,k=null,N=x,E=x=0,_=null;N!==null&&E<w.length;E++){N.index>E?(_=N,N=null):_=N.sibling;var T=h(b,N,w[E],S);if(T===null){N===null&&(N=_);break}t&&N&&T.alternate===null&&e(b,N),x=i(T,x,E),k===null?C=T:k.sibling=T,k=T,N=_}if(E===w.length)return n(b,N),jt&&fl(b,E),C;if(N===null){for(;E<w.length;E++)N=f(b,w[E],S),N!==null&&(x=i(N,x,E),k===null?C=N:k.sibling=N,k=N);return jt&&fl(b,E),C}for(N=r(b,N);E<w.length;E++)_=p(N,b,E,w[E],S),_!==null&&(t&&_.alternate!==null&&N.delete(_.key===null?E:_.key),x=i(_,x,E),k===null?C=_:k.sibling=_,k=_);return t&&N.forEach(function(P){return e(b,P)}),jt&&fl(b,E),C}function g(b,x,w,S){var C=sf(w);if(typeof C!="function")throw Error(X(150));if(w=C.call(w),w==null)throw Error(X(151));for(var k=C=null,N=x,E=x=0,_=null,T=w.next();N!==null&&!T.done;E++,T=w.next()){N.index>E?(_=N,N=null):_=N.sibling;var P=h(b,N,T.value,S);if(P===null){N===null&&(N=_);break}t&&N&&P.alternate===null&&e(b,N),x=i(P,x,E),k===null?C=P:k.sibling=P,k=P,N=_}if(T.done)return n(b,N),jt&&fl(b,E),C;if(N===null){for(;!T.done;E++,T=w.next())T=f(b,T.value,S),T!==null&&(x=i(T,x,E),k===null?C=T:k.sibling=T,k=T);return jt&&fl(b,E),C}for(N=r(b,N);!T.done;E++,T=w.next())T=p(N,b,E,T.value,S),T!==null&&(t&&T.alternate!==null&&N.delete(T.key===null?E:T.key),x=i(T,x,E),k===null?C=T:k.sibling=T,k=T);return t&&N.forEach(function(j){return e(b,j)}),jt&&fl(b,E),C}function y(b,x,w,S){if(typeof w=="object"&&w!==null&&w.type===nu&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Em:e:{for(var C=w.key,k=x;k!==null;){if(k.key===C){if(C=w.type,C===nu){if(k.tag===7){n(b,k.sibling),x=s(k,w.props.children),x.return=b,b=x;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Bo&&WA(C)===k.type){n(b,k.sibling),x=s(k,w.props),x.ref=uf(b,k,w),x.return=b,b=x;break e}n(b,k);break}else e(b,k);k=k.sibling}w.type===nu?(x=Vl(w.props.children,b.mode,S,w.key),x.return=b,b=x):(S=$g(w.type,w.key,w.props,null,b.mode,S),S.ref=uf(b,x,w),S.return=b,b=S)}return o(b);case tu:e:{for(k=w.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(b,x.sibling),x=s(x,w.children||[]),x.return=b,b=x;break e}else{n(b,x);break}else e(b,x);x=x.sibling}x=K0(w,b.mode,S),x.return=b,b=x}return o(b);case Bo:return k=w._init,y(b,x,k(w._payload),S)}if(Df(w))return m(b,x,w,S);if(sf(w))return g(b,x,w,S);Lm(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(b,x.sibling),x=s(x,w),x.return=b,b=x):(n(b,x),x=q0(w,b.mode,S),x.return=b,b=x),o(b)):n(b,x)}return y}var Gu=II(!0),LI=II(!1),Ny=Qa(null),Ey=null,uu=null,SN=null;function kN(){SN=uu=Ey=null}function CN(t){var e=Ny.current;_t(Ny),t._currentValue=e}function pS(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Su(t,e){Ey=t,SN=uu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(wr=!0),t.firstContext=null)}function ps(t){var e=t._currentValue;if(SN!==t)if(t={context:t,memoizedValue:e,next:null},uu===null){if(Ey===null)throw Error(X(308));uu=t,Ey.dependencies={lanes:0,firstContext:t}}else uu=uu.next=t;return e}var wl=null;function NN(t){wl===null?wl=[t]:wl.push(t)}function FI(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,NN(e)):(n.next=s.next,s.next=n),e.interleaved=n,mo(t,r)}function mo(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var $o=!1;function EN(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function BI(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function co(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ba(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,tt&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,mo(t,n)}return s=r.interleaved,s===null?(e.next=e,NN(r)):(e.next=s.next,s.next=e),r.interleaved=e,mo(t,n)}function Og(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,dN(t,n)}}function HA(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function _y(t,e,n,r){var s=t.updateQueue;$o=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,d=u=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=t,g=a;switch(h=e,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=It({},f,h);break e;case 2:$o=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Xl|=o,t.lanes=o,t.memoizedState=f}}function qA(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(X(191,s));s.call(r)}}}var Up={},Ci=Qa(Up),$h=Qa(Up),Vh=Qa(Up);function Sl(t){if(t===Up)throw Error(X(174));return t}function _N(t,e){switch(wt(Vh,e),wt($h,t),wt(Ci,Up),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:G1(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=G1(e,t)}_t(Ci),wt(Ci,e)}function Yu(){_t(Ci),_t($h),_t(Vh)}function $I(t){Sl(Vh.current);var e=Sl(Ci.current),n=G1(e,t.type);e!==n&&(wt($h,t),wt(Ci,n))}function TN(t){$h.current===t&&(_t(Ci),_t($h))}var Rt=Qa(0);function Ty(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var $0=[];function AN(){for(var t=0;t<$0.length;t++)$0[t]._workInProgressVersionPrimary=null;$0.length=0}var Dg=wo.ReactCurrentDispatcher,V0=wo.ReactCurrentBatchConfig,Jl=0,Ot=null,ln=null,hn=null,Ay=!1,eh=!1,zh=0,eK=0;function In(){throw Error(X(321))}function jN(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Hs(t[n],e[n]))return!1;return!0}function PN(t,e,n,r,s,i){if(Jl=i,Ot=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Dg.current=t===null||t.memoizedState===null?sK:iK,t=n(r,s),eh){i=0;do{if(eh=!1,zh=0,25<=i)throw Error(X(301));i+=1,hn=ln=null,e.updateQueue=null,Dg.current=oK,t=n(r,s)}while(eh)}if(Dg.current=jy,e=ln!==null&&ln.next!==null,Jl=0,hn=ln=Ot=null,Ay=!1,e)throw Error(X(300));return t}function RN(){var t=zh!==0;return zh=0,t}function ii(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?Ot.memoizedState=hn=t:hn=hn.next=t,hn}function ms(){if(ln===null){var t=Ot.alternate;t=t!==null?t.memoizedState:null}else t=ln.next;var e=hn===null?Ot.memoizedState:hn.next;if(e!==null)hn=e,ln=t;else{if(t===null)throw Error(X(310));ln=t,t={memoizedState:ln.memoizedState,baseState:ln.baseState,baseQueue:ln.baseQueue,queue:ln.queue,next:null},hn===null?Ot.memoizedState=hn=t:hn=hn.next=t}return hn}function Uh(t,e){return typeof e=="function"?e(t):e}function z0(t){var e=ms(),n=e.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=t;var r=ln,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,u=i;do{var d=u.lane;if((Jl&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,Ot.lanes|=d,Xl|=d}u=u.next}while(u!==null&&u!==i);l===null?o=r:l.next=a,Hs(r,e.memoizedState)||(wr=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,Ot.lanes|=i,Xl|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function U0(t){var e=ms(),n=e.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=t;var r=n.dispatch,s=n.pending,i=e.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);Hs(i,e.memoizedState)||(wr=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function VI(){}function zI(t,e){var n=Ot,r=ms(),s=e(),i=!Hs(r.memoizedState,s);if(i&&(r.memoizedState=s,wr=!0),r=r.queue,MN(HI.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||hn!==null&&hn.memoizedState.tag&1){if(n.flags|=2048,Wh(9,WI.bind(null,n,r,s,e),void 0,null),gn===null)throw Error(X(349));Jl&30||UI(n,e,s)}return s}function UI(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ot.updateQueue,e===null?(e={lastEffect:null,stores:null},Ot.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function WI(t,e,n,r){e.value=n,e.getSnapshot=r,qI(e)&&KI(t)}function HI(t,e,n){return n(function(){qI(e)&&KI(t)})}function qI(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Hs(t,n)}catch{return!0}}function KI(t){var e=mo(t,1);e!==null&&Us(e,t,1,-1)}function KA(t){var e=ii();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Uh,lastRenderedState:t},e.queue=t,t=t.dispatch=rK.bind(null,Ot,t),[e.memoizedState,t]}function Wh(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Ot.updateQueue,e===null?(e={lastEffect:null,stores:null},Ot.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function GI(){return ms().memoizedState}function Ig(t,e,n,r){var s=ii();Ot.flags|=t,s.memoizedState=Wh(1|e,n,void 0,r===void 0?null:r)}function Rx(t,e,n,r){var s=ms();r=r===void 0?null:r;var i=void 0;if(ln!==null){var o=ln.memoizedState;if(i=o.destroy,r!==null&&jN(r,o.deps)){s.memoizedState=Wh(e,n,i,r);return}}Ot.flags|=t,s.memoizedState=Wh(1|e,n,i,r)}function GA(t,e){return Ig(8390656,8,t,e)}function MN(t,e){return Rx(2048,8,t,e)}function YI(t,e){return Rx(4,2,t,e)}function QI(t,e){return Rx(4,4,t,e)}function JI(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function XI(t,e,n){return n=n!=null?n.concat([t]):null,Rx(4,4,JI.bind(null,e,t),n)}function ON(){}function ZI(t,e){var n=ms();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&jN(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function eL(t,e){var n=ms();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&jN(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function tL(t,e,n){return Jl&21?(Hs(n,e)||(n=oI(),Ot.lanes|=n,Xl|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,wr=!0),t.memoizedState=n)}function tK(t,e){var n=ct;ct=n!==0&&4>n?n:4,t(!0);var r=V0.transition;V0.transition={};try{t(!1),e()}finally{ct=n,V0.transition=r}}function nL(){return ms().memoizedState}function nK(t,e,n){var r=Sa(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rL(t))sL(e,n);else if(n=FI(t,e,n,r),n!==null){var s=or();Us(n,t,r,s),iL(n,e,r)}}function rK(t,e,n){var r=Sa(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rL(t))sL(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Hs(a,o)){var l=e.interleaved;l===null?(s.next=s,NN(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=FI(t,e,s,r),n!==null&&(s=or(),Us(n,t,r,s),iL(n,e,r))}}function rL(t){var e=t.alternate;return t===Ot||e!==null&&e===Ot}function sL(t,e){eh=Ay=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function iL(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,dN(t,n)}}var jy={readContext:ps,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},sK={readContext:ps,useCallback:function(t,e){return ii().memoizedState=[t,e===void 0?null:e],t},useContext:ps,useEffect:GA,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ig(4194308,4,JI.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ig(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ig(4,2,t,e)},useMemo:function(t,e){var n=ii();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ii();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=nK.bind(null,Ot,t),[r.memoizedState,t]},useRef:function(t){var e=ii();return t={current:t},e.memoizedState=t},useState:KA,useDebugValue:ON,useDeferredValue:function(t){return ii().memoizedState=t},useTransition:function(){var t=KA(!1),e=t[0];return t=tK.bind(null,t[1]),ii().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ot,s=ii();if(jt){if(n===void 0)throw Error(X(407));n=n()}else{if(n=e(),gn===null)throw Error(X(349));Jl&30||UI(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,GA(HI.bind(null,r,i,t),[t]),r.flags|=2048,Wh(9,WI.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=ii(),e=gn.identifierPrefix;if(jt){var n=ao,r=oo;n=(r&~(1<<32-zs(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=zh++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=eK++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},iK={readContext:ps,useCallback:ZI,useContext:ps,useEffect:MN,useImperativeHandle:XI,useInsertionEffect:YI,useLayoutEffect:QI,useMemo:eL,useReducer:z0,useRef:GI,useState:function(){return z0(Uh)},useDebugValue:ON,useDeferredValue:function(t){var e=ms();return tL(e,ln.memoizedState,t)},useTransition:function(){var t=z0(Uh)[0],e=ms().memoizedState;return[t,e]},useMutableSource:VI,useSyncExternalStore:zI,useId:nL,unstable_isNewReconciler:!1},oK={readContext:ps,useCallback:ZI,useContext:ps,useEffect:MN,useImperativeHandle:XI,useInsertionEffect:YI,useLayoutEffect:QI,useMemo:eL,useReducer:U0,useRef:GI,useState:function(){return U0(Uh)},useDebugValue:ON,useDeferredValue:function(t){var e=ms();return ln===null?e.memoizedState=t:tL(e,ln.memoizedState,t)},useTransition:function(){var t=U0(Uh)[0],e=ms().memoizedState;return[t,e]},useMutableSource:VI,useSyncExternalStore:zI,useId:nL,unstable_isNewReconciler:!1};function js(t,e){if(t&&t.defaultProps){e=It({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function mS(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:It({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Mx={isMounted:function(t){return(t=t._reactInternals)?wc(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=or(),s=Sa(t),i=co(r,s);i.payload=e,n!=null&&(i.callback=n),e=ba(t,i,s),e!==null&&(Us(e,t,s,r),Og(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=or(),s=Sa(t),i=co(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=ba(t,i,s),e!==null&&(Us(e,t,s,r),Og(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=or(),r=Sa(t),s=co(n,r);s.tag=2,e!=null&&(s.callback=e),e=ba(t,s,r),e!==null&&(Us(e,t,r,n),Og(e,t,r))}};function YA(t,e,n,r,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,o):e.prototype&&e.prototype.isPureReactComponent?!Ih(n,r)||!Ih(s,i):!0}function oL(t,e,n){var r=!1,s=Ia,i=e.contextType;return typeof i=="object"&&i!==null?i=ps(i):(s=Cr(e)?Yl:Un.current,r=e.contextTypes,i=(r=r!=null)?qu(t,s):Ia),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Mx,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function QA(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Mx.enqueueReplaceState(e,e.state,null)}function gS(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},EN(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=ps(i):(i=Cr(e)?Yl:Un.current,s.context=qu(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(mS(t,e,i,n),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&Mx.enqueueReplaceState(s,s.state,null),_y(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function Qu(t,e){try{var n="",r=e;do n+=O8(r),r=r.return;while(r);var s=n}catch(i){s=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:t,source:e,stack:s,digest:null}}function W0(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function yS(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var aK=typeof WeakMap=="function"?WeakMap:Map;function aL(t,e,n){n=co(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Ry||(Ry=!0,_S=r),yS(t,e)},n}function lL(t,e,n){n=co(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){yS(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){yS(t,e),typeof r!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function JA(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new aK;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=wK.bind(null,t,e,n),e.then(t,t))}function XA(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function ZA(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=co(-1,1),e.tag=2,ba(n,e,1))),n.lanes|=1),t)}var lK=wo.ReactCurrentOwner,wr=!1;function Jn(t,e,n,r){e.child=t===null?LI(e,null,n,r):Gu(e,t.child,n,r)}function ej(t,e,n,r,s){n=n.render;var i=e.ref;return Su(e,s),r=PN(t,e,n,r,i,s),n=RN(),t!==null&&!wr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,go(t,e,s)):(jt&&n&&xN(e),e.flags|=1,Jn(t,e,r,s),e.child)}function tj(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!zN(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,cL(t,e,
vendor: 9,184 bytes, line 40
40i,r,s)):(t=$g(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ih,n(o,r)&&t.ref===e.ref)return go(t,e,s)}return e.flags|=1,t=ka(i,r),t.ref=e.ref,t.return=e,e.child=t}function cL(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Ih(i,r)&&t.ref===e.ref)if(wr=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(wr=!0);else return e.lanes=t.lanes,go(t,e,s)}return vS(t,e,n,r,s)}function uL(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(fu,Rr),Rr|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,wt(fu,Rr),Rr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,wt(fu,Rr),Rr|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,wt(fu,Rr),Rr|=r;return Jn(t,e,s,n),e.child}function dL(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function vS(t,e,n,r,s){var i=Cr(n)?Yl:Un.current;return i=qu(e,i),Su(e,s),n=PN(t,e,n,r,i,s),r=RN(),t!==null&&!wr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,go(t,e,s)):(jt&&r&&xN(e),e.flags|=1,Jn(t,e,n,s),e.child)}function nj(t,e,n,r,s){if(Cr(n)){var i=!0;Sy(e)}else i=!1;if(Su(e,s),e.stateNode===null)Lg(t,e),oL(e,n,r),gS(e,n,r,s),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=ps(u):(u=Cr(n)?Yl:Un.current,u=qu(e,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&QA(e,o,r,u),$o=!1;var h=e.memoizedState;o.state=h,_y(e,r,o,s),l=e.memoizedState,a!==r||h!==l||kr.current||$o?(typeof d=="function"&&(mS(e,n,d,r),l=e.memoizedState),(a=$o||YA(e,n,a,r,h,l,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,BI(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:js(e.type,a),o.props=u,f=e.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=ps(l):(l=Cr(n)?Yl:Un.current,l=qu(e,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&QA(e,o,r,l),$o=!1,h=e.memoizedState,o.state=h,_y(e,r,o,s);var m=e.memoizedState;a!==f||h!==m||kr.current||$o?(typeof p=="function"&&(mS(e,n,p,r),m=e.memoizedState),(u=$o||YA(e,n,u,r,h,m,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return xS(t,e,n,r,i,s)}function xS(t,e,n,r,s,i){dL(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&VA(e,n,!1),go(t,e,i);r=e.stateNode,lK.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Gu(e,t.child,null,i),e.child=Gu(e,null,a,i)):Jn(t,e,a,i),e.memoizedState=r.state,s&&VA(e,n,!0),e.child}function fL(t){var e=t.stateNode;e.pendingContext?$A(t,e.pendingContext,e.pendingContext!==e.context):e.context&&$A(t,e.context,!1),_N(t,e.containerInfo)}function rj(t,e,n,r,s){return Ku(),wN(s),e.flags|=256,Jn(t,e,n,r),e.child}var bS={dehydrated:null,treeContext:null,retryLane:0};function wS(t){return{baseLanes:t,cachePool:null,transitions:null}}function hL(t,e,n){var r=e.pendingProps,s=Rt.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),wt(Rt,s&1),t===null)return hS(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,i?(r=e.mode,i=e.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Ix(o,r,0,null),t=Vl(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=wS(n),e.memoizedState=bS,t):DN(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return cK(t,e,o,r,a,s,n);if(i){i=r.fallback,o=e.mode,s=t.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=ka(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=ka(a,i):(i=Vl(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,o=t.child.memoizedState,o=o===null?wS(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=bS,r}return i=t.child,t=i.sibling,r=ka(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function DN(t,e){return e=Ix({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Fm(t,e,n,r){return r!==null&&wN(r),Gu(e,t.child,null,n),t=DN(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function cK(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=W0(Error(X(422))),Fm(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=Ix({mode:"visible",children:r.children},s,0,null),i=Vl(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&Gu(e,t.child,null,o),e.child.memoizedState=wS(o),e.memoizedState=bS,i);if(!(e.mode&1))return Fm(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(X(419)),r=W0(i,r,void 0),Fm(t,e,o,r)}if(a=(o&t.childLanes)!==0,wr||a){if(r=gn,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,mo(t,s),Us(r,t,s,-1))}return VN(),r=W0(Error(X(421))),Fm(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=SK.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,Lr=xa(s.nextSibling),$r=e,jt=!0,Ds=null,t!==null&&(ts[ns++]=oo,ts[ns++]=ao,ts[ns++]=Ql,oo=t.id,ao=t.overflow,Ql=e),e=DN(e,r.children),e.flags|=4096,e)}function sj(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),pS(t.return,e,n)}function H0(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function pL(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(Jn(t,e,r.children,n),r=Rt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&sj(t,n,e);else if(t.tag===19)sj(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(wt(Rt,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&Ty(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),H0(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&Ty(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}H0(e,!0,n,null,i);break;case"together":H0(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Lg(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}
vendor: 4,679 bytes, line 40
40function go(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Xl|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(X(153));if(e.child!==null){for(t=e.child,n=ka(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ka(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function uK(t,e,n){switch(e.tag){case 3:fL(e),Ku();break;case 5:$I(e);break;case 1:Cr(e.type)&&Sy(e);break;case 4:_N(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;wt(Ny,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(wt(Rt,Rt.current&1),e.flags|=128,null):n&e.child.childLanes?hL(t,e,n):(wt(Rt,Rt.current&1),t=go(t,e,n),t!==null?t.sibling:null);wt(Rt,Rt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return pL(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),wt(Rt,Rt.current),r)break;return null;case 22:case 23:return e.lanes=0,uL(t,e,n)}return go(t,e,n)}var mL,SS,gL,yL;mL=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};SS=function(){};gL=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,Sl(Ci.current);var i=null;switch(n){case"input":s=W1(t,s),r=W1(t,r),i=[];break;case"select":s=It({},s,{value:void 0}),r=It({},r,{value:void 0}),i=[];break;case"textarea":s=K1(t,s),r=K1(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=by)}Y1(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ah.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ah.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ct("scroll",t),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};yL=function(t,e,n,r){n!==r&&(e.flags|=4)};function df(t,e){if(!jt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Ln(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function dK(t,e,n){var r=e.pendingProps;switch(bN(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ln(e),null;case 1:return Cr(e.type)&&wy(),Ln(e),null;case 3:return r=e.stateNode,Yu(),_t(kr),_t(Un),AN(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Im(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ds!==null&&(jS(Ds),Ds=null))),SS(t,e),Ln(e),null;case 5:TN(e);var s=Sl(Vh.current);if(n=e.type,t!==null&&e.stateNode!=null)gL(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(X(166));return Ln(e),null}if(t=Sl(Ci.current),Im(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[yi]=e,r[Bh]=i,t=(e.mode&1)!==0,n){case"dialog":Ct("cancel",r),Ct("close",r);break;case"iframe":case"object":case"embed":Ct("load",r);break;case"video":case"audio":for(s=0;s<Lf.length;s++)Ct(Lf[s],r);break;case"source":Ct("error",r);break;case"img":case"image":case"link":Ct("error",r),Ct("load",r);break;case"details":Ct("toggle",r);break;
vendor: 32,727 bytes, line 40
40case"input":hA(r,i),Ct("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ct("invalid",r);break;case"textarea":mA(r,i),Ct("invalid",r)}Y1(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Dm(r.textContent,a,t),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Dm(r.textContent,a,t),s=["children",""+a]):Ah.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ct("scroll",r)}switch(n){case"input":_m(r),pA(r,i,!0);break;case"textarea":_m(r),gA(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=by)}r=s,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=H2(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[yi]=e,t[Bh]=r,mL(t,e,!1,!1),e.stateNode=t;e:{switch(o=Q1(n,r),n){case"dialog":Ct("cancel",t),Ct("close",t),s=r;break;case"iframe":case"object":case"embed":Ct("load",t),s=r;break;case"video":case"audio":for(s=0;s<Lf.length;s++)Ct(Lf[s],t);s=r;break;case"source":Ct("error",t),s=r;break;case"img":case"image":case"link":Ct("error",t),Ct("load",t),s=r;break;case"details":Ct("toggle",t),s=r;break;case"input":hA(t,r),s=W1(t,r),Ct("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=It({},r,{value:void 0}),Ct("invalid",t);break;case"textarea":mA(t,r),s=K1(t,r),Ct("invalid",t);break;default:s=r}Y1(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?G2(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&q2(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&jh(t,l):typeof l=="number"&&jh(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ah.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ct("scroll",t):l!=null&&iN(t,i,l,o))}switch(n){case"input":_m(t),pA(t,r,!1);break;case"textarea":_m(t),gA(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Da(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?vu(t,!!r.multiple,i,!1):r.defaultValue!=null&&vu(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=by)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Ln(e),null;case 6:if(t&&e.stateNode!=null)yL(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(X(166));if(n=Sl(Vh.current),Sl(Ci.current),Im(e)){if(r=e.stateNode,n=e.memoizedProps,r[yi]=e,(i=r.nodeValue!==n)&&(t=$r,t!==null))switch(t.tag){case 3:Dm(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Dm(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[yi]=e,e.stateNode=r}return Ln(e),null;case 13:if(_t(Rt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(jt&&Lr!==null&&e.mode&1&&!(e.flags&128))DI(),Ku(),e.flags|=98560,i=!1;else if(i=Im(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(X(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(X(317));i[yi]=e}else Ku(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ln(e),i=!1}else Ds!==null&&(jS(Ds),Ds=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Rt.current&1?un===0&&(un=3):VN())),e.updateQueue!==null&&(e.flags|=4),Ln(e),null);case 4:return Yu(),SS(t,e),t===null&&Lh(e.stateNode.containerInfo),Ln(e),null;case 10:return CN(e.type._context),Ln(e),null;case 17:return Cr(e.type)&&wy(),Ln(e),null;case 19:if(_t(Rt),i=e.memoizedState,i===null)return Ln(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)df(i,!1);else{if(un!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Ty(t),o!==null){for(e.flags|=128,df(i,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return wt(Rt,Rt.current&1|2),e.child}t=t.sibling}i.tail!==null&&Ht()>Ju&&(e.flags|=128,r=!0,df(i,!1),e.lanes=4194304)}else{if(!r)if(t=Ty(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),df(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!jt)return Ln(e),null}else 2*Ht()-i.renderingStartTime>Ju&&n!==1073741824&&(e.flags|=128,r=!0,df(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ht(),e.sibling=null,n=Rt.current,wt(Rt,r?n&1|2:n&1),e):(Ln(e),null);case 22:case 23:return $N(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Rr&1073741824&&(Ln(e),e.subtreeFlags&6&&(e.flags|=8192)):Ln(e),null;case 24:return null;case 25:return null}throw Error(X(156,e.tag))}function fK(t,e){switch(bN(e),e.tag){case 1:return Cr(e.type)&&wy(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Yu(),_t(kr),_t(Un),AN(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return TN(e),null;case 13:if(_t(Rt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));Ku()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return _t(Rt),null;case 4:return Yu(),null;case 10:return CN(e.type._context),null;case 22:case 23:return $N(),null;case 24:return null;default:return null}}var Bm=!1,Vn=!1,hK=typeof WeakSet=="function"?WeakSet:Set,pe=null;function du(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zt(t,e,r)}else n.current=null}function kS(t,e,n){try{n()}catch(r){zt(t,e,r)}}var ij=!1;function pK(t,e){if(oS=yy,t=SI(),vN(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,f=t,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===t)break t;if(h===n&&++u===s&&(a=o),h===i&&++d===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(aS={focusedElem:t,selectionRange:n},yy=!1,pe=e;pe!==null;)if(e=pe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,pe=t;else for(;pe!==null;){e=pe;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,b=e.stateNode,x=b.getSnapshotBeforeUpdate(e.elementType===e.type?g:js(e.type,g),y);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(S){zt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,pe=t;break}pe=e.return}return m=ij,ij=!1,m}function th(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&kS(e,n,i)}s=s.next}while(s!==r)}}function Ox(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function CS(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function vL(t){var e=t.alternate;e!==null&&(t.alternate=null,vL(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[yi],delete e[Bh],delete e[uS],delete e[Qq],delete e[Jq])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function xL(t){return t.tag===5||t.tag===3||t.tag===4}function oj(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||xL(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function NS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=by));else if(r!==4&&(t=t.child,t!==null))for(NS(t,e,n),t=t.sibling;t!==null;)NS(t,e,n),t=t.sibling}function ES(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(ES(t,e,n),t=t.sibling;t!==null;)ES(t,e,n),t=t.sibling}var Cn=null,Os=!1;function Ao(t,e,n){for(n=n.child;n!==null;)bL(t,e,n),n=n.sibling}function bL(t,e,n){if(ki&&typeof ki.onCommitFiberUnmount=="function")try{ki.onCommitFiberUnmount(Ex,n)}catch{}switch(n.tag){case 5:Vn||du(n,e);case 6:var r=Cn,s=Os;Cn=null,Ao(t,e,n),Cn=r,Os=s,Cn!==null&&(Os?(t=Cn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Cn.removeChild(n.stateNode));break;case 18:Cn!==null&&(Os?(t=Cn,n=n.stateNode,t.nodeType===8?F0(t.parentNode,n):t.nodeType===1&&F0(t,n),Oh(t)):F0(Cn,n.stateNode));break;case 4:r=Cn,s=Os,Cn=n.stateNode.containerInfo,Os=!0,Ao(t,e,n),Cn=r,Os=s;break;case 0:case 11:case 14:case 15:if(!Vn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&kS(n,e,o),s=s.next}while(s!==r)}Ao(t,e,n);break;case 1:if(!Vn&&(du(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){zt(n,e,a)}Ao(t,e,n);break;case 21:Ao(t,e,n);break;case 22:n.mode&1?(Vn=(r=Vn)||n.memoizedState!==null,Ao(t,e,n),Vn=r):Ao(t,e,n);break;default:Ao(t,e,n)}}function aj(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new hK),e.forEach(function(r){var s=kK.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Ss(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Cn=a.stateNode,Os=!1;break e;case 3:Cn=a.stateNode.containerInfo,Os=!0;break e;case 4:Cn=a.stateNode.containerInfo,Os=!0;break e}a=a.return}if(Cn===null)throw Error(X(160));bL(i,o,s),Cn=null,Os=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){zt(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)wL(e,t),e=e.sibling}function wL(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ss(e,t),ri(t),r&4){try{th(3,t,t.return),Ox(3,t)}catch(g){zt(t,t.return,g)}try{th(5,t,t.return)}catch(g){zt(t,t.return,g)}}break;case 1:Ss(e,t),ri(t),r&512&&n!==null&&du(n,n.return);break;case 5:if(Ss(e,t),ri(t),r&512&&n!==null&&du(n,n.return),t.flags&32){var s=t.stateNode;try{jh(s,"")}catch(g){zt(t,t.return,g)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&U2(s,i),Q1(a,o);var u=Q1(a,i);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?G2(s,f):d==="dangerouslySetInnerHTML"?q2(s,f):d==="children"?jh(s,f):iN(s,d,f,u)}switch(a){case"input":H1(s,i);break;case"textarea":W2(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?vu(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?vu(s,!!i.multiple,i.defaultValue,!0):vu(s,!!i.multiple,i.multiple?[]:"",!1))}s[Bh]=i}catch(g){zt(t,t.return,g)}}break;case 6:if(Ss(e,t),ri(t),r&4){if(t.stateNode===null)throw Error(X(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(g){zt(t,t.return,g)}}break;case 3:if(Ss(e,t),ri(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Oh(e.containerInfo)}catch(g){zt(t,t.return,g)}break;case 4:Ss(e,t),ri(t);break;case 13:Ss(e,t),ri(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(FN=Ht())),r&4&&aj(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(Vn=(u=Vn)||d,Ss(e,t),Vn=u):Ss(e,t),ri(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(pe=t,d=t.child;d!==null;){for(f=pe=d;pe!==null;){switch(h=pe,p=h.child,h.tag){case 0:case 11:case 14:case 15:th(4,h,h.return);break;case 1:du(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,m.props=e.memoizedProps,m.state=e.memoizedState,m.componentWillUnmount()}catch(g){zt(r,n,g)}}break;case 5:du(h,h.return);break;case 22:if(h.memoizedState!==null){cj(f);continue}}p!==null?(p.return=h,pe=p):cj(f)}d=d.sibling}e:for(d=null,f=t;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=K2("display",o))}catch(g){zt(t,t.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){zt(t,t.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ss(e,t),ri(t),r&4&&aj(t);break;case 21:break;default:Ss(e,t),ri(t)}}function ri(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(xL(n)){var r=n;break e}n=n.return}throw Error(X(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(jh(s,""),r.flags&=-33);var i=oj(t);ES(t,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=oj(t);NS(t,a,o);break;default:throw Error(X(161))}}catch(l){zt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function mK(t,e,n){pe=t,SL(t)}function SL(t,e,n){for(var r=(t.mode&1)!==0;pe!==null;){var s=pe,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Bm;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Vn;a=Bm;var u=Vn;if(Bm=o,(Vn=l)&&!u)for(pe=s;pe!==null;)o=pe,l=o.child,o.tag===22&&o.memoizedState!==null?uj(s):l!==null?(l.return=o,pe=l):uj(s);for(;i!==null;)pe=i,SL(i),i=i.sibling;pe=s,Bm=a,Vn=u}lj(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,pe=i):lj(t)}}function lj(t){for(;pe!==null;){var e=pe;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Vn||Ox(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Vn)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:js(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&qA(e,i,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}qA(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Oh(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}Vn||e.flags&512&&CS(e)}catch(h){zt(e,e.return,h)}}if(e===t){pe=null;break}if(n=e.sibling,n!==null){n.return=e.return,pe=n;break}pe=e.return}}function cj(t){for(;pe!==null;){var e=pe;if(e===t){pe=null;break}var n=e.sibling;if(n!==null){n.return=e.return,pe=n;break}pe=e.return}}function uj(t){for(;pe!==null;){var e=pe;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Ox(4,e)}catch(l){zt(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(l){zt(e,s,l)}}var i=e.return;try{CS(e)}catch(l){zt(e,i,l)}break;case 5:var o=e.return;try{CS(e)}catch(l){zt(e,o,l)}}}catch(l){zt(e,e.return,l)}if(e===t){pe=null;break}var a=e.sibling;if(a!==null){a.return=e.return,pe=a;break}pe=e.return}}var gK=Math.ceil,Py=wo.ReactCurrentDispatcher,IN=wo.ReactCurrentOwner,ls=wo.ReactCurrentBatchConfig,tt=0,gn=null,Zt=null,Mn=0,Rr=0,fu=Qa(0),un=0,Hh=null,Xl=0,Dx=0,LN=0,nh=null,xr=null,FN=0,Ju=1/0,Zi=null,Ry=!1,_S=null,wa=null,$m=!1,ca=null,My=0,rh=0,TS=null,Fg=-1,Bg=0;function or(){return tt&6?Ht():Fg!==-1?Fg:Fg=Ht()}function Sa(t){return t.mode&1?tt&2&&Mn!==0?Mn&-Mn:Zq.transition!==null?(Bg===0&&(Bg=oI()),Bg):(t=ct,t!==0||(t=window.event,t=t===void 0?16:hI(t.type)),t):1}function Us(t,e,n,r){if(50<rh)throw rh=0,TS=null,Error(X(185));$p(t,n,r),(!(tt&2)||t!==gn)&&(t===gn&&(!(tt&2)&&(Dx|=n),un===4&&qo(t,Mn)),Nr(t,r),n===1&&tt===0&&!(e.mode&1)&&(Ju=Ht()+500,Px&&Ja()))}function Nr(t,e){var n=t.callbackNode;Z8(t,e);var r=gy(t,t===gn?Mn:0);if(r===0)n!==null&&xA(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&xA(n),e===1)t.tag===0?Xq(dj.bind(null,t)):RI(dj.bind(null,t)),Gq(function(){!(tt&6)&&Ja()}),n=null;else{switch(aI(r)){case 1:n=uN;break;case 4:n=sI;break;case 16:n=my;break;case 536870912:n=iI;break;default:n=my}n=jL(n,kL.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function kL(t,e){if(Fg=-1,Bg=0,tt&6)throw Error(X(327));var n=t.callbackNode;if(ku()&&t.callbackNode!==n)return null;var r=gy(t,t===gn?Mn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Oy(t,r);else{e=r;var s=tt;tt|=2;var i=NL();(gn!==t||Mn!==e)&&(Zi=null,Ju=Ht()+500,$l(t,e));do try{xK();break}catch(a){CL(t,a)}while(!0);kN(),Py.current=i,tt=s,Zt!==null?e=0:(gn=null,Mn=0,e=un)}if(e!==0){if(e===2&&(s=tS(t),s!==0&&(r=s,e=AS(t,s))),e===1)throw n=Hh,$l(t,0),qo(t,r),Nr(t,Ht()),n;if(e===6)qo(t,r);else{if(s=t.current.alternate,!(r&30)&&!yK(s)&&(e=Oy(t,r),e===2&&(i=tS(t),i!==0&&(r=i,e=AS(t,i))),e===1))throw n=Hh,$l(t,0),qo(t,r),Nr(t,Ht()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(X(345));case 2:hl(t,xr,Zi);break;case 3:if(qo(t,r),(r&130023424)===r&&(e=FN+500-Ht(),10<e)){if(gy(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){or(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=cS(hl.bind(null,t,xr,Zi),e);break}hl(t,xr,Zi);break;case 4:if(qo(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var o=31-zs(r);i=1<<o,o=e[o],o>s&&(s=o),r&=~i}if(r=s,r=Ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gK(r/1960))-r,10<r){t.timeoutHandle=cS(hl.bind(null,t,xr,Zi),r);break}hl(t,xr,Zi);break;case 5:hl(t,xr,Zi);break;default:throw Error(X(329))}}}return Nr(t,Ht()),t.callbackNode===n?kL.bind(null,t):null}function AS(t,e){var n=nh;return t.current.memoizedState.isDehydrated&&($l(t,e).flags|=256),t=Oy(t,e),t!==2&&(e=xr,xr=n,e!==null&&jS(e)),t}function jS(t){xr===null?xr=t:xr.push.apply(xr,t)}function yK(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Hs(i(),s))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function qo(t,e){for(e&=~LN,e&=~Dx,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-zs(e),r=1<<n;t[n]=-1,e&=~r}}function dj(t){if(tt&6)throw Error(X(327));ku();var e=gy(t,0);if(!(e&1))return Nr(t,Ht()),null;var n=Oy(t,e);if(t.tag!==0&&n===2){var r=tS(t);r!==0&&(e=r,n=AS(t,r))}if(n===1)throw n=Hh,$l(t,0),qo(t,e),Nr(t,Ht()),n;if(n===6)throw Error(X(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,hl(t,xr,Zi),Nr(t,Ht()),null}function BN(t,e){var n=tt;tt|=1;try{return t(e)}finally{tt=n,tt===0&&(Ju=Ht()+500,Px&&Ja())}}function Zl(t){ca!==null&&ca.tag===0&&!(tt&6)&&ku();var e=tt;tt|=1;var n=ls.transition,r=ct;try{if(ls.transition=null,ct=1,t)return t()}finally{ct=r,ls.transition=n,tt=e,!(tt&6)&&Ja()}}function $N(){Rr=fu.current,_t(fu)}function $l(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Kq(n)),Zt!==null)for(n=Zt.return;n!==null;){var r=n;switch(bN(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wy();break;case 3:Yu(),_t(kr),_t(Un),AN();break;case 5:TN(r);break;case 4:Yu();break;case 13:_t(Rt);break;case 19:_t(Rt);break;case 10:CN(r.type._context);break;case 22:case 23:$N()}n=n.return}if(gn=t,Zt=t=ka(t.current,null),Mn=Rr=e,un=0,Hh=null,LN=Dx=Xl=0,xr=nh=null,wl!==null){for(e=0;e<wl.length;e++)if(n=wl[e],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}wl=null}return t}function CL(t,e){do{var n=Zt;try{if(kN(),Dg.current=jy,Ay){for(var r=Ot.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ay=!1}if(Jl=0,hn=ln=Ot=null,eh=!1,zh=0,IN.current=null,n===null||n.return===null){un=1,Hh=e,Zt=null;break}e:{var i=t,o=n.return,a=n,l=e;if(e=Mn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=XA(o);if(p!==null){p.flags&=-257,ZA(p,o,a,i,e),p.mode&1&&JA(i,u,e),e=p,l=u;var m=e.updateQueue;if(m===null){var g=new Set;g.add(l),e.updateQueue=g}else m.add(l);break e}else{if(!(e&1)){JA(i,u,e),VN();break e}l=Error(X(426))}}else if(jt&&a.mode&1){var y=XA(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),ZA(y,o,a,i,e),wN(Qu(l,a));break e}}i=l=Qu(l,a),un!==4&&(un=2),nh===null?nh=[i]:nh.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var b=aL(i,l,e);HA(i,b);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(wa===null||!wa.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var S=lL(i,a,e);HA(i,S);break e}}i=i.return}while(i!==null)}_L(n)}catch(C){e=C,Zt===n&&n!==null&&(Zt=n=n.return);continue}break}while(!0)}function NL(){var t=Py.current;return Py.current=jy,t===null?jy:t}function VN(){(un===0||un===3||un===2)&&(un=4),gn===null||!(Xl&268435455)&&!(Dx&268435455)||qo(gn,Mn)}function Oy(t,e){var n=tt;tt|=2;var r=NL();(gn!==t||Mn!==e)&&(Zi=null,$l(t,e));do try{vK();break}catch(s){CL(t,s)}while(!0);if(kN(),tt=n,Py.current=r,Zt!==null)throw Error(X(261));return gn=null,Mn=0,un}function vK(){for(;Zt!==null;)EL(Zt)}function xK(){for(;Zt!==null&&!W8();)EL(Zt)}function EL(t){var e=AL(t.alternate,t,Rr);t.memoizedProps=t.pendingProps,e===null?_L(t):Zt=e,IN.current=null}function _L(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=fK(n,e),n!==null){n.flags&=32767,Zt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{un=6,Zt=null;return}}else if(n=dK(n,e,Rr),n!==null){Zt=n;return}if(e=e.sibling,e!==null){Zt=e;return}Zt=e=t}while(e!==null);un===0&&(un=5)}function hl(t,e,n){var r=ct,s=ls.transition;try{ls.transition=null,ct=1,bK(t,e,n,r)}finally{ls.transition=s,ct=r}return null}function bK(t,e,n,r){do ku();while(ca!==null);if(tt&6)throw Error(X(327));n=t.finishedWork;var s=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(X(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(eq(t,i),t===gn&&(Zt=gn=null,Mn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||$m||($m=!0,jL(my,function(){return ku(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ls.transition,ls.transition=null;var o=ct;ct=1;var a=tt;tt|=4,IN.current=null,pK(t,n),wL(n,t),$q(aS),yy=!!oS,aS=oS=null,t.current=n,mK(n),H8(),tt=a,ct=o,ls.transition=i}else t.current=n;if($m&&($m=!1,ca=t,My=s),i=t.pendingLanes,i===0&&(wa=null),G8(n.stateNode),Nr(t,Ht()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)s=e[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Ry)throw Ry=!1,t=_S,_S=null,t;return My&1&&t.tag!==0&&ku(),i=t.pendingLanes,i&1?t===TS?rh++:(rh=0,TS=t):rh=0,Ja(),null}function ku(){if(ca!==null){var t=aI(My),e=ls.transition,n=ct;try{if(ls.transition=null,ct=16>t?16:t,ca===null)var r=!1;else{if(t=ca,ca=null,My=0,tt&6)throw Error(X(331));var s=tt;for(tt|=4,pe=t.current;pe!==null;){var i=pe,o=i.child;if(pe.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(pe=u;pe!==null;){var d=pe;switch(d.tag){case 0:case 11:case 15:th(8,d,i)}var f=d.child;if(f!==null)f.return=d,pe=f;else for(;pe!==null;){d=pe;var h=d.sibling,p=d.return;if(vL(d),d===u){pe=null;break}if(h!==null){h.return=p,pe=h;break}pe=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}pe=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,pe=o;else e:for(;pe!==null;){if(i=pe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:th(9,i,i.return)}var b=i.sibling;if(b!==null){b.return=i.return,pe=b;break e}pe=i.return}}var x=t.current;for(pe=x;pe!==null;){o=pe;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,pe=w;else e:for(o=x;pe!==null;){if(a=pe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ox(9,a)}}catch(C){zt(a,a.return,C)}if(a===o){pe=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,pe=S;break e}pe=a.return}}if(tt=s,Ja(),ki&&typeof ki.onPostCommitFiberRoot=="function")try{ki.onPostCommitFiberRoot(Ex,t)}catch{}r=!0}return r}finally{ct=n,ls.transition=e}}return!1}function fj(t,e,n){e=Qu(n,e),e=aL(t,e,1),t=ba(t,e,1),e=or(),t!==null&&($p(t,1,e),Nr(t,e))}function zt(t,e,n){if(t.tag===3)fj(t,t,n);else for(;e!==null;){if(e.tag===3){fj(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(wa===null||!wa.has(r))){t=Qu(n,t),t=lL(e,t,1),e=ba(e,t,1),t=or(),e!==null&&($p(e,1,t),Nr(e,t));break}}e=e.return}}function wK(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=or(),t.pingedLanes|=t.suspendedLanes&n,gn===t&&(Mn&n)===n&&(un===4||un===3&&(Mn&130023424)===Mn&&500>Ht()-FN?$l(t,0):LN|=n),Nr(t,e)}function TL(t,e){e===0&&(t.mode&1?(e=jm,jm<<=1,!(jm&130023424)&&(jm=4194304)):e=1);var n=or();t=mo(t,e),t!==null&&($p(t,e,n),Nr(t,n))}function SK(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),TL(t,n)}function kK(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(e),TL(t,n)}var AL;AL=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||kr.current)wr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return wr=!1,uK(t,e,n);wr=!!(t.flags&131072)}else wr=!1,jt&&e.flags&1048576&&MI(e,Cy,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Lg(t,e),t=e.pendingProps;var s=qu(e,Un.current);Su(e,n),s=PN(null,e,r,t,s,n);var i=RN();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Cr(r)?(i=!0,Sy(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,EN(e),s.updater=Mx,e.stateNode=s,s._reactInternals=e,gS(e,r,t,n),e=xS(null,e,r,!0,i,n)):(e.tag=0,jt&&i&&xN(e),Jn(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Lg(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=NK(r),t=js(r,t),s){case 0:e=vS(null,e,r,t,n);break e;case 1:e=nj(null,e,r,t,n);break e;case 11:e=ej(null,e,r,t,n);break e;case 14:e=tj(null,e,r,js(r.type,t),n);break e}throw Error(X(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:js(r,s),vS(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:js(r,s),nj(t,e,r,s,n);case 3:e:{if(fL(e),t===null)throw Error(X(387));r=e.pendingProps,i=e.memoizedState,s=i.element,BI(t,e),_y(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Qu(Error(X(423)),e),e=rj(t,e,r,n,s);break e}else if(r!==s){s=Qu(Error(X(424)),e),e=rj(t,e,r,n,s);break e}else for(Lr=xa(e.stateNode.containerInfo.firstChild),$r=e,jt=!0,Ds=null,n=LI(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ku(),r===s){e=go(t,e,n);break e}Jn(t,e,r,n)}e=e.child}return e;case 5:return $I(e),t===null&&hS(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,lS(r,s)?o=null:i!==null&&lS(r,i)&&(e.flags|=32),dL(t,e),Jn(t,e,o,n),e.child;case 6:return t===null&&hS(e),null;case 13:return hL(t,e,n);case 4:return _N(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Gu(e,null,r,n):Jn(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:js(r,s),ej(t,e,r,s,n);case 7:return Jn(t,e,e.pendingProps,n),e.child;case 8:return Jn(t,e,e.pendingProps.children,n),e.child;case 12:return Jn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,wt(Ny,r._currentValue),r._currentValue=o,i!==null)if(Hs(i.value,o)){if(i.children===s.children&&!kr.current){e=go(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=co(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),pS(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(X(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),pS(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Jn(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Su(e,n),s=ps(s),r=r(s),e.flags|=1,Jn(t,e,r,n),e.child;case 14:return r=e.type,s=js(r,e.pendingProps),s=js(r.type,s),tj(t,e,r,s,n);case 15:return cL(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:js(r,s),Lg(t,e),e.tag=1,Cr(r)?(t=!0,Sy(e)):t=!1,Su(e,n),oL(e,r,s),gS(e,r,s,n),xS(null,e,r,!0,t,n);case 19:return pL(t,e,n);case 22:return uL(t,e,n)}throw Error(X(156,e.tag))};function jL(t,e){return rI(t,e)}function CK(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ss(t,e,n,r){return new CK(t,e,n,r)}function zN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function NK(t){if(typeof t=="function")return zN(t)?1:0;if(t!=null){if(t=t.$$typeof,t===aN)return 11;if(t===lN)return 14}return 2}function ka(t,e){var n=t.alternate;return n===null?(n=ss(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 5,099 bytes, line 40
40ons=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function $g(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")zN(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case nu:return Vl(n.children,s,i,e);case oN:o=8,s|=8;break;case $1:return t=ss(12,n,e,s|2),t.elementType=$1,t.lanes=i,t;case V1:return t=ss(13,n,e,s),t.elementType=V1,t.lanes=i,t;case z1:return t=ss(19,n,e,s),t.elementType=z1,t.lanes=i,t;case $2:return Ix(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case F2:o=10;break e;case B2:o=9;break e;case aN:o=11;break e;case lN:o=14;break e;case Bo:o=16,r=null;break e}throw Error(X(130,t==null?t:typeof t,""))}return e=ss(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Vl(t,e,n,r){return t=ss(7,t,r,e),t.lanes=n,t}function Ix(t,e,n,r){return t=ss(22,t,r,e),t.elementType=$2,t.lanes=n,t.stateNode={isHidden:!1},t}function q0(t,e,n){return t=ss(6,t,null,e),t.lanes=n,t}function K0(t,e,n){return e=ss(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function EK(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_0(0),this.expirationTimes=_0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_0(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function UN(t,e,n,r,s,i,o,a,l){return t=new EK(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=ss(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},EN(i),t}function _K(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:tu,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function PL(t){if(!t)return Ia;t=t._reactInternals;e:{if(wc(t)!==t||t.tag!==1)throw Error(X(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Cr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(X(171))}if(t.tag===1){var n=t.type;if(Cr(n))return PI(t,n,e)}return e}function RL(t,e,n,r,s,i,o,a,l){return t=UN(n,r,!0,t,s,i,o,a,l),t.context=PL(null),n=t.current,r=or(),s=Sa(n),i=co(r,s),i.callback=e??null,ba(n,i,s),t.current.lanes=s,$p(t,s,r),Nr(t,r),t}function Lx(t,e,n,r){var s=e.current,i=or(),o=Sa(s);return n=PL(n),e.context===null?e.context=n:e.pendingContext=n,e=co(i,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=ba(s,e,o),t!==null&&(Us(t,s,o,i),Og(t,s,o)),o}function Dy(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function hj(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function WN(t,e){hj(t,e),(t=t.alternate)&&hj(t,e)}function TK(){return null}var ML=typeof reportError=="function"?reportError:function(t){console.error(t)};function HN(t){this._internalRoot=t}Fx.prototype.render=HN.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(X(409));Lx(t,e,null,null)};Fx.prototype.unmount=HN.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Zl(function(){Lx(null,t,null,null)}),e[po]=null}};function Fx(t){this._internalRoot=t}Fx.prototype.unstable_scheduleHydration=function(t){if(t){var e=uI();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Ho.length&&e!==0&&e<Ho[n].priority;n++);Ho.splice(n,0,t),n===0&&fI(t)}};function qN(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Bx(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function pj(){}function AK(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=Dy(o);i.call(u)}}var o=RL(e,r,t,0,null,!1,!1,"",pj);return t._reactRootContainer=o,t[po]=o.current,Lh(t.nodeType===8?t.parentNode:t),Zl(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=Dy(l);a.call(u)}}var l=UN(t,0,!1,null,null,!1,!1,"",pj);return t._reactRootContainer=l,t[po]=l.current,Lh(t.nodeType===8?t.parentNode:t),Zl(function(){Lx(e,l,n,r)}),l}function $x(t,e,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=Dy(o);a.call(l)}}Lx(e,o,t,s)}else o=AK(n,e,t,s,r);return Dy(o)}lI=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=If(e.pendingLanes);
vendor: 4,598 bytes, line 40
40n!==0&&(dN(e,n|1),Nr(e,Ht()),!(tt&6)&&(Ju=Ht()+500,Ja()))}break;case 13:Zl(function(){var r=mo(t,1);if(r!==null){var s=or();Us(r,t,1,s)}}),WN(t,1)}};fN=function(t){if(t.tag===13){var e=mo(t,134217728);if(e!==null){var n=or();Us(e,t,134217728,n)}WN(t,134217728)}};cI=function(t){if(t.tag===13){var e=Sa(t),n=mo(t,e);if(n!==null){var r=or();Us(n,t,e,r)}WN(t,e)}};uI=function(){return ct};dI=function(t,e){var n=ct;try{return ct=t,e()}finally{ct=n}};X1=function(t,e,n){switch(e){case"input":if(H1(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var s=jx(r);if(!s)throw Error(X(90));z2(r),H1(r,s)}}}break;case"textarea":W2(t,n);break;case"select":e=n.value,e!=null&&vu(t,!!n.multiple,e,!1)}};J2=BN;X2=Zl;var jK={usingClientEntryPoint:!1,Events:[zp,ou,jx,Y2,Q2,BN]},ff={findFiberByHostInstance:bl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PK={bundleType:ff.bundleType,version:ff.version,rendererPackageName:ff.rendererPackageName,rendererConfig:ff.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:wo.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=tI(t),t===null?null:t.stateNode},findFiberByHostInstance:ff.findFiberByHostInstance||TK,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vm.isDisabled&&Vm.supportsFiber)try{Ex=Vm.inject(PK),ki=Vm}catch{}}qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jK;qr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qN(e))throw Error(X(200));return _K(t,e,null,n)};qr.createRoot=function(t,e){if(!qN(t))throw Error(X(299));var n=!1,r="",s=ML;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=UN(t,1,!1,null,null,n,!1,r,s),t[po]=e.current,Lh(t.nodeType===8?t.parentNode:t),new HN(e)};qr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(X(188)):(t=Object.keys(t).join(","),Error(X(268,t)));return t=tI(e),t=t===null?null:t.stateNode,t};qr.flushSync=function(t){return Zl(t)};qr.hydrate=function(t,e,n){if(!Bx(e))throw Error(X(200));return $x(null,t,e,!0,n)};qr.hydrateRoot=function(t,e,n){if(!qN(t))throw Error(X(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=ML;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=RL(e,null,t,1,n??null,s,!1,i,o),t[po]=e.current,Lh(t),r)for(t=0;t<r.length;t++)n=r[t],s=n._getVersion,s=s(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,s]:e.mutableSourceEagerHydrationData.push(n,s);return new Fx(e)};qr.render=function(t,e,n){if(!Bx(e))throw Error(X(200));return $x(null,t,e,!1,n)};qr.unmountComponentAtNode=function(t){if(!Bx(t))throw Error(X(40));return t._reactRootContainer?(Zl(function(){$x(null,null,t,!1,function(){t._reactRootContainer=null,t[po]=null})}),!0):!1};qr.unstable_batchedUpdates=BN;qr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Bx(n))throw Error(X(200));if(t==null||t._reactInternals===void 0)throw Error(X(38));return $x(t,e,n,!1,r)};qr.version="18.3.1-next-f1338f8080-20240426";function OL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(OL)}catch(t){console.error(t)}}OL(),O2.exports=qr;var Ii=O2.exports;const Vx=S2(Ii);var DL,mj=Ii;DL=mj.createRoot,mj.hydrateRoot;const RK=1,MK=1e6;let G0=0;function OK(){return G0=(G0+1)%Number.MAX_SAFE_INTEGER,G0.toString()}const Y0=new Map,gj=t=>{if(Y0.has(t))return;const e=setTimeout(()=>{Y0.delete(t),sh({type:"REMOVE_TOAST",toastId:t})},MK);Y0.set(t,e)},DK=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,RK)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;
40return n?gj(n):t.toasts.forEach(r=>{gj(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Vg=[];let zg={toasts:[]};function sh(t){zg=DK(zg,t),Vg.forEach(e=>{e(zg)})}function IK({...t}){const e=OK(),n=s=>sh({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>sh({type:"DISMISS_TOAST",toastId:e});return sh({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function ut(){const[t,e]=v.useState(zg);return v.useEffect(()=>(Vg.push(e),()=>{const n=Vg.indexOf(e);n>-1&&Vg.splice(n,1)}),[t]),{...t,toast:IK,dismiss:n=>sh({type:"DISMISS_TOAST",toastId:n})}}function fe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function yj(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ec(...t){return e=>{let n=!1;const r=t.map(s=>{const i=yj(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():yj(t[s],null)}}}}function We(...t){return v.useCallback(ec(...t),t)}function LK(t,e){const n=v.createContext(e),r=i=>{const{children:o,...a}=i,l=v.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function s(i){const o=v.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function dr(t,e=[]){let n=[];function r(i,o){const a=v.createContext(o),l=n.length;n=[...n,o];const u=f=>{var b;const{scope:h,children:p,...m}=f,g=((b=h==null?void 0:h[t])==null?void 0:b[l])||a,y=v.useMemo(()=>m,Object.values(m));return c.jsx(g.Provider,{value:y,children:p})};u.displayName=i+"Provider";function d(f,h){var g;const p=((g=h==null?void 0:h[t])==null?void 0:g[l])||a,m=v.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const s=()=>{const i=n.map(o=>v.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,FK(s,...e)]}function FK(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...a,...f}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function tc(t){const e=BK(t),n=v.forwardRef((r,s)=>{const{children:i,...o}=r,a=v.Children.toArray(i),l=a.find($K);if(l){const u=l.props.children,d=a.map(f=>f===l?v.Children.count(u)>1?v.Children.only(null):v.isValidElement(u)?u.props.children:null:f);return c.jsx(e,{...o,ref:s,children:v.isValidElement(u)?v.cloneElement(u,void 0,d):null})}return c.jsx(e,{...o,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var Pd=tc("Slot");function BK(t){const e=v.forwardRef((n,r)=>{const{children:s,...i}=n;if(v.isValidElement(s)){const o=zK(s),a=VK(i,s.props);return s.type!==v.Fragment&&(a.ref=r?ec(r,o):o),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var IL=Symbol("radix.slottable");function LL(t){const e=({children:n})=>c.jsx(c.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=IL,e}function $K(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===IL}function VK(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function zK(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.
vendor: 9,582 bytes, line 40
40isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function zx(t){const e=t+"CollectionProvider",[n,r]=dr(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:b}=g,x=z.useRef(null),w=z.useRef(new Map).current;return c.jsx(s,{scope:y,itemMap:w,collectionRef:x,children:b})};o.displayName=e;const a=t+"CollectionSlot",l=tc(a),u=z.forwardRef((g,y)=>{const{scope:b,children:x}=g,w=i(a,b),S=We(y,w.collectionRef);return c.jsx(l,{ref:S,children:x})});u.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",h=tc(d),p=z.forwardRef((g,y)=>{const{scope:b,children:x,...w}=g,S=z.useRef(null),C=We(y,S),k=i(d,b);return z.useEffect(()=>(k.itemMap.set(S,{ref:S,...w}),()=>void k.itemMap.delete(S))),c.jsx(h,{[f]:"",ref:C,children:x})});p.displayName=d;function m(g){const y=i(t+"CollectionConsumer",g);return z.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((k,N)=>w.indexOf(k.ref.current)-w.indexOf(N.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},m,r]}var UK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],he=UK.reduce((t,e)=>{const n=tc(`Primitive.${e}`),r=v.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function FL(t,e){t&&Ii.flushSync(()=>t.dispatchEvent(e))}function en(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function WK(t,e=globalThis==null?void 0:globalThis.document){const n=en(t);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var HK="DismissableLayer",PS="dismissableLayer.update",qK="dismissableLayer.pointerDownOutside",KK="dismissableLayer.focusOutside",vj,BL=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rd=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=v.useContext(BL),[d,f]=v.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),m=We(e,N=>f(N)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),x=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=YK(N=>{const E=N.target,_=[...u.branches].some(T=>T.contains(E));!S||_||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},h),k=QK(N=>{const E=N.target;[...u.branches].some(T=>T.contains(E))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},h);return WK(N=>{x===u.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},h),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(vj=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),xj(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=vj)}},[d,h,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),xj())},[d,u]),v.useEffect(()=>{const N=()=>p({});return document.addEventListener(PS,N),()=>document.removeEventListener(PS,N)},[]),c.jsx(he.div,{...l,ref:m,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:fe(t.onFocusCapture,k.onFocusCapture),onBlurCapture:fe(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:fe(t.onPointerDownCapture,C.onPointerDownCapture)})});Rd.displayName=HK;var GK="DismissableLayerBranch",$L=v.forwardRef((t,e)=>{const n=v.useContext(BL),r=v.useRef(null),s=We(e,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(he.div,{...t,ref:s})});$L.displayName=GK;function YK(t,e=globalThis==null?void 0:globalThis.document){const n=en(t),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){VL(qK,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function QK(t,e=globalThis==null?void 0:globalThis.document){const n=en(t),r=v.useRef(!1);return v.useEffect(()=>{const s=i=>{i.target&&!r.current&&VL(KK,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xj(){const t=new CustomEvent(PS);document.dispatchEvent(t)}function VL(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?FL(s,i):s.dispatchEvent(i)}var JK=Rd,XK=$L,Wt=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},ZK="Portal",Wp=v.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=v.useState(!1);Wt(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Vx.createPortal(c.jsx(he.div,{...r,ref:e}),o):null});Wp.displayName=ZK;function e9(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}var fr=t=>{const{present:e,children:n}=t,r=t9(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=We(r.ref,n9(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null};fr.displayName="Presence";function t9(t){const[e,n]=v.useState(),r=v.useRef(null),s=v.useRef(t),i=v.useRef("none"),o=t?"mounted":"unmounted",[a,l]=e9(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=zm(r.current);i.current=a==="mounted"?u:"none"},[a]),Wt(()=>{const u=r.current,d=s.current;if(d!==t){const h=i.current,p=zm(u);t?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),Wt(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=p=>{const g=zm(r.current).includes(p.animationName);if(p.target===e&&g&&(l("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},h=p=>{p.target===e&&(i.current=zm(r.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function zm(t){return(t==null?void 0:t.animationName)||"none"}function n9(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var r9=nN[" useInsertionEffect ".trim().toString()]||Wt;function gs({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,o]=s9({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:s;{const d=v.useRef(t!==void 0);v.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=v.useCallback(d=>{var f;if(a){const h=i9(d)?d(t):d;h!==t&&((f=o.current)==null||f.call(o,h))}else i(d)},[a,t,i,o]);return[l,u]}function s9({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return r9(()=>{i.current=e},[e]),v.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function i9(t){return typeof t=="function"}var zL=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o9="VisuallyHidden",Ux=v.forwardRef((t,e)=>c.jsx(he.span,{...t,ref:e,style:{...zL,...t.style}}));Ux.displayName=o9;var a9=Ux,KN="ToastProvider",[GN,l9,c9]=zx("Toast"),[UL,pTe]=dr("Toast",[c9]),[u9,Wx]=UL(KN),WL=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=v.useState(null),[u,d]=v.useState(0),f=v.useRef(!1),h=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${KN}\`. Expected non-empty \`string\`.`),c.jsx(GN.Provider,{scope:e,children:c.jsx(u9,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:
40a,onViewportChange:l,onToastAdd:v.useCallback(()=>d(p=>p+1),[]),onToastRemove:v.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};WL.displayName=KN;var HL="ToastViewport",d9=["F8"],RS="toast.viewportPause",MS="toast.viewportResume",qL=v.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=d9,label:s="Notifications ({hotkey})",...i}=t,o=Wx(HL,n),a=l9(n),l=v.useRef(null),u=v.useRef(null),d=v.useRef(null),f=v.useRef(null),h=We(e,f,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;v.useEffect(()=>{const y=b=>{var w;r.length!==0&&r.every(S=>b[S]||b.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),v.useEffect(()=>{const y=l.current,b=f.current;if(m&&y&&b){const x=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(RS);b.dispatchEvent(k),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(MS);b.dispatchEvent(k),o.isClosePausedRef.current=!1}},S=k=>{!y.contains(k.relatedTarget)&&w()},C=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",x),y.addEventListener("focusout",S),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",S),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",w)}}},[m,o.isClosePausedRef]);const g=v.useCallback(({tabbingDirection:y})=>{const x=a().map(w=>{const S=w.ref.current,C=[S,...C9(S)];return y==="forwards"?C:C.reverse()});return(y==="forwards"?x.reverse():x).flat()},[a]);return v.useEffect(()=>{const y=f.current;if(y){const b=x=>{var C,k,N;const w=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!w){const E=document.activeElement,_=x.shiftKey;if(x.target===y&&_){(C=u.current)==null||C.focus();return}const j=g({tabbingDirection:_?"backwards":"forwards"}),F=j.findIndex(B=>B===E);Q0(j.slice(F+1))?x.preventDefault():_?(k=u.current)==null||k.focus():(N=d.current)==null||N.focus()}};return y.addEventListener("keydown",b),()=>y.removeEventListener("keydown",b)}},[a,g]),c.jsxs(XK,{ref:l,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&c.jsx(OS,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});Q0(y)}}),c.jsx(GN.Slot,{scope:n,children:c.jsx(he.ol,{tabIndex:-1,...i,ref:h})}),m&&c.jsx(OS,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});Q0(y)}})]})});qL.displayName=HL;var KL="ToastFocusProxy",OS=v.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Wx(KL,n);return c.jsx(Ux,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});OS.displayName=KL;var Hp="Toast",f9="toast.swipeStart",h9="toast.swipeMove",p9="toast.swipeCancel",m9="toast.swipeEnd",GL=v.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=gs({prop:r,defaultProp:s??!0,onChange:i,caller:Hp});return c.jsx(fr,{present:n||a,children:c.jsx(v9,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:en(t.onPause),onResume:en(t.onResume),onSwipeStart:fe(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:fe(t.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:fe(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:fe(t.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});GL.displayName=Hp;var[g9,y9]=UL(Hp,{onClose(){}}),v9=v.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:p,...m}=t,g=Wx(Hp,n),[y,b]=v.useState(null),x=We(e,B=>b(B)),w=v.useRef(null),S=v.useRef(null),C=s||g.duration,k=v.useRef(0),N=v.useRef(C),E=v.useRef(0),{onToastAdd:_,onToastRemove:T}=g,P=en(()=>{var U;(y==null?void 0:y.contains(document.activeElement))&&((U=g.viewport)==null||U.focus()),o()}),j=v.useCallback(B=>
40{!B||B===1/0||(window.clearTimeout(E.current),k.current=new Date().getTime(),E.current=window.setTimeout(P,B))},[P]);v.useEffect(()=>{const B=g.viewport;if(B){const U=()=>{j(N.current),u==null||u()},D=()=>{const L=new Date().getTime()-k.current;N.current=N.current-L,window.clearTimeout(E.current),l==null||l()};return B.addEventListener(RS,D),B.addEventListener(MS,U),()=>{B.removeEventListener(RS,D),B.removeEventListener(MS,U)}}},[g.viewport,C,l,u,j]),v.useEffect(()=>{i&&!g.isClosePausedRef.current&&j(C)},[i,C,g.isClosePausedRef,j]),v.useEffect(()=>(_(),()=>T()),[_,T]);const F=v.useMemo(()=>y?tF(y):null,[y]);return g.viewport?c.jsxs(c.Fragment,{children:[F&&c.jsx(x9,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),c.jsx(g9,{scope:n,onClose:P,children:Ii.createPortal(c.jsx(GN.ItemSlot,{scope:n,children:c.jsx(JK,{asChild:!0,onEscapeKeyDown:fe(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||P(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(he.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...m,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:fe(t.onKeyDown,B=>{B.key==="Escape"&&(a==null||a(B.nativeEvent),B.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:fe(t.onPointerDown,B=>{B.button===0&&(w.current={x:B.clientX,y:B.clientY})}),onPointerMove:fe(t.onPointerMove,B=>{if(!w.current)return;const U=B.clientX-w.current.x,D=B.clientY-w.current.y,L=!!S.current,A=["left","right"].includes(g.swipeDirection),O=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,W=A?O(0,U):0,Z=A?0:O(0,D),$=B.pointerType==="touch"?10:2,Y={x:W,y:Z},ee={originalEvent:B,delta:Y};L?(S.current=Y,Um(h9,f,ee,{discrete:!1})):bj(Y,g.swipeDirection,$)?(S.current=Y,Um(f9,d,ee,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(U)>$||Math.abs(D)>$)&&(w.current=null)}),onPointerUp:fe(t.onPointerUp,B=>{const U=S.current,D=B.target;if(D.hasPointerCapture(B.pointerId)&&D.releasePointerCapture(B.pointerId),S.current=null,w.current=null,U){const L=B.currentTarget,A={originalEvent:B,delta:U};bj(U,g.swipeDirection,g.swipeThreshold)?Um(m9,p,A,{discrete:!0}):Um(p9,h,A,{discrete:!0}),L.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),x9=t=>{const{__scopeToast:e,children:n,...r}=t,s=Wx(Hp,e),[i,o]=v.useState(!1),[a,l]=v.useState(!1);return S9(()=>o(!0)),v.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(Wp,{asChild:!0,children:c.jsx(Ux,{...r,children:i&&c.jsxs(c.Fragment,{children:[s.label," ",n]})})})},b9="ToastTitle",YL=v.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(he.div,{...r,ref:e})});YL.displayName=b9;var w9="ToastDescription",QL=v.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(he.div,{...r,ref:e})});QL.displayName=w9;var JL="ToastAction",XL=v.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?c.jsx(eF,{altText:n,asChild:!0,children:c.jsx(YN,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${JL}\`. Expected non-empty \`string\`.`),null)});XL.displayName=JL;var ZL="ToastClose",YN=v.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=y9(ZL,n);return c.jsx(eF,{asChild:!0,children:c.jsx(he.button,{type:"button",...r,ref:e,onClick:fe(t.onClick,s.onClose)})})});YN.displayName=ZL;var eF=v.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return c.jsx(he.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function tF(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),k9(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...tF(r))}}),e}function Um(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?FL(s,i):s.dispatchEvent(i)}var bj=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function S9(t=()=>{}){const e=en(t);Wt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function k9(t){return t.nodeType===t.ELEMENT_NODE}function C9(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Q0(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var N9=WL,nF=qL,rF=GL,sF=YL,iF=QL,oF=XL,aF=YN;function lF(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=lF(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function cF(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=lF(t))&&(r&&(r+=" "),r+=e);return r}const wj=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Sj=cF,Sc=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Sj(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const h=wj(d)||wj(f);return s[u][h]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...u,f,h]:u},[]);return Sj(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const E9=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uF=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var _9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const T9=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>v.createElement("svg",{ref:l,..._9,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:uF("lucide",s),...a},[...o.map(([u,d])=>v.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const ve=(t,e)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(T9,{ref:i,iconNode:e,className:uF(`lucide-${E9(t)}`,r),...s}));return n.displayName=`${t}`,n};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const DS=ve("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
65-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const Iy=ve("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const Ly=ve("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const dF=ve("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const A9=ve("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const j9=ve("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const Fy=ve("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const P9=ve("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const xi=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const Hx=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const R9=ve("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const M9=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const O9=ve("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const D9=ve("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const fF=ve("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const By=ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const hF=ve("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const $y=ve("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const I9=ve("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const QN=ve("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const pF=ve("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const IS=ve("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const L9=ve("EyeOff",[["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"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const F9=ve("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"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const B9=ve("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const $9=ve("FileAudio",[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const V9=ve("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const z9=ve("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const qh=ve("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const U9=ve("FileVideo",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const LS=ve("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const W9=ve("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const mF=ve("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const Md=ve("Kanban",[["path",{d:"M6 5v11",key:"mdvv1e"}],["path",{d:"M12 5v6",key:"14ar3b"}],["path",{d:"M18 5v14",key:"7ji314"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const gF=ve("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const JN=ve("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const Kh=ve("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const H9=ve("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const q9=ve("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const gt=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const yF=ve("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const qx=ve("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const kj=ve("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const K9=ve("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const nc=ve("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const G9=ve("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const Y9=ve("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const Q9=ve("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const XN=ve("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const J9=ve("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const nn=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const X9=ve("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const Z9=ve("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}
325],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const Gh=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const qp=ve("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const e7=ve("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const Od=ve("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const qs=ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const vF=ve("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const Cj=ve("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const ZN=ve("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const Nj=ve("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const yo=ve("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const ji=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 9,097 bytes, line 380
380],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),eE="-",t7=t=>{const e=r7(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(eE);return a[0]===""&&a.length!==1&&a.shift(),xF(a,e)||n7(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},xF=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?xF(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(eE);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Ej=/^\[(.+)\]$/,n7=t=>{if(Ej.test(t)){const e=Ej.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},r7=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return i7(Object.entries(t.classGroups),n).forEach(([i,o])=>{FS(o,r,i,e)}),r},FS=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:_j(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(s7(s)){FS(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{FS(o,_j(e,i),n,r)})})},_j=(t,e)=>{let n=t;return e.split(eE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},s7=t=>t.isThemeGetter,i7=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,o7=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},bF="!",a7=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let u=0,d=0,f;for(let y=0;y<a.length;y++){let b=a[y];if(u===0){if(b===s&&(r||a.slice(y,y+i)===e)){l.push(a.slice(d,y)),d=y+i;continue}if(b==="/"){f=y;continue}}b==="["?u++:b==="]"&&u--}const h=l.length===0?a:a.substring(d),p=h.startsWith(bF),m=p?h.substring(1):h,g=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},l7=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},c7=t=>({cache:o7(t.cacheSize),parseClassName:a7(t),...t7(t)}),u7=/\s+/,d7=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(u7);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let m=!!p,g=r(m?h.substring(0,p):h);if(!g){if(!m){a=u+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=u+(a.length>0?" "+a:a);continue}m=!1}const y=l7(d).join(":"),b=f?y+bF:y,x=b+g;if(i.includes(x))continue;i.push(x);const w=s(g,m);for(let S=0;S<w.length;++S){const C=w[S];i.push(b+C)}a=u+(a.length>0?" "+a:a)}return a};function f7(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=wF(e))&&(r&&(r+=" "),r+=n);return r}const wF=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=wF(t[r]))&&(n&&(n+=" "),n+=e);return n};function h7(t,...e){let n,r,s,i=o;function o(l){const u=e.reduce((d,f)=>f(d),t());return n=c7(u),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=d7(l,n);return s(l,d),d}return function(){return i(f7.apply(null,arguments))}}const kt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},SF=/^\[(?:([a-z-]+):)?(.+)\]$/i,p7=/^\d+\/\d+$/,m7=new Set(["px","full","screen"]),g7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y7=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,x7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hi=t=>Cu(t)||m7.has(t)||p7.test(t),jo=t=>Dd(t,"length",T7),Cu=t=>!!t&&!Number.isNaN(Number(t)),J0=t=>Dd(t,"number",Cu),hf=t=>!!t&&Number.isInteger(Number(t)),w7=t=>t.endsWith("%")&&Cu(t.slice(0,-1)),Be=t=>SF.test(t),Po=t=>g7.test(t),S7=new Set(["length","size","percentage"]),k7=t=>Dd(t,S7,kF),C7=t=>Dd(t,"position",kF),N7=new Set(["image","url"]),E7=t=>Dd(t,N7,j7),_7=t=>Dd(t,"",A7),pf=()=>!0,Dd=(t,e,n)=>{const r=SF.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},T7=t=>y7.test(t)&&!v7.test(t),kF=()=>!1,A7=t=>x7.test(t),j7=t=>b7.test(t),P7=()=>{const t=kt("colors"),e=kt("spacing"),n=kt("blur"),r=kt("brightness"),s=kt("borderColor"),i=kt("borderRadius"),o=kt("borderSpacing"),a=kt("borderWidth"),l=kt("contrast"),u=kt("grayscale"),d=kt("hueRotate"),f=kt("invert"),h=kt("gap"),p=kt("gradientColorStops"),m=kt("gradientColorStopPositions"),g=kt("inset"),y=kt("margin"),b=kt("opacity"),x=kt("padding"),w=kt("saturate"),S=kt("scale"),C=kt("sepia"),k=kt("skew"),N=kt("space"),E=kt("translate"),_=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Be,e],j=()=>[Be,e],F=()=>["",Hi,jo],B=()=>["auto",Cu,Be],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",Be],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Cu,Be];return{cacheSize:500,separator:":",theme:{colors:[pf],spacing:[Hi,jo],blur:["none","",Po,Be],brightness:Z(),borderColor:[t],borderRadius:["none","","full",Po,Be],borderSpacing:j(),borderWidth:F(),contrast:Z(),grayscale:O(),hueRotate:Z(),invert:O(),gap:j(),gradientColorStops:[t],gradientColorStopPositions:[w7,jo],inset:P(),margin:P(),opacity:Z(),padding:j(),saturate:Z(),scale:Z(),sepia:O(),skew:Z(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",Be]}],container:["container"],columns:[{columns:[Po]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Be]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hf,Be]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Be]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",hf,Be]}],"grid-cols":[{"grid-cols":[pf]}],"col-start-end":[{col:["auto",{span:["full",hf,Be]},Be]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[pf]}],"row-start-end":[{row:["auto",{span:[hf,Be]},Be]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Be]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}
vendor: 8,339 bytes, line 380
380],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Be,e]}],"min-w":[{"min-w":[Be,e,"min","max","fit"]}],"max-w":[{"max-w":[Be,e,"none","full","min","max","fit","prose",{screen:[Po]},Po]}],h:[{h:[Be,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Be,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Be,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Be,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Po,jo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",J0]}],"font-family":[{font:[pf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Be]}],"line-clamp":[{"line-clamp":["none",Cu,J0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Hi,Be]}],"list-image":[{"list-image":["none",Be]}],"list-style-type":[{list:["none","disc","decimal",Be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Hi,jo]}],"underline-offset":[{"underline-offset":["auto",Hi,Be]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),C7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",k7]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},E7]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:D()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[Hi,Be]}],"outline-w":[{outline:[Hi,jo]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Hi,jo]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Po,_7]}],"shadow-color":[{shadow:[pf]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Po,Be]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Be]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",Be]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[hf,Be]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Be]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,484 bytes, line 380
380],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Hi,jo,J0]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},R7=h7(P7);function q(...t){return R7(cF(t))}const M7=N9,CF=v.forwardRef(({className:t,...e},n)=>c.jsx(nF,{ref:n,className:q("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));CF.displayName=nF.displayName;const O7=Sc("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),NF=v.forwardRef(({className:t,variant:e,...n},r)=>c.jsx(rF,{ref:r,className:q(O7({variant:e}),t),...n}));NF.displayName=rF.displayName;const D7=v.forwardRef(({className:t,...e},n)=>c.jsx(oF,{ref:n,className:q("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));
380D7.displayName=oF.displayName;const EF=v.forwardRef(({className:t,...e},n)=>c.jsx(aF,{ref:n,className:q("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:c.jsx(ji,{className:"h-4 w-4"})}));EF.displayName=aF.displayName;const _F=v.forwardRef(({className:t,...e},n)=>c.jsx(sF,{ref:n,className:q("text-sm font-semibold",t),...e}));_F.displayName=sF.displayName;const TF=v.forwardRef(({className:t,...e},n)=>c.jsx(iF,{ref:n,className:q("text-sm opacity-90",t),...e}));TF.displayName=iF.displayName;function I7(){const{toasts:t}=ut();return c.jsxs(M7,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return c.jsxs(NF,{...i,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(_F,{children:n}),r&&c.jsx(TF,{children:r})]}),s,c.jsx(EF,{})]},e)}),c.jsx(CF,{})]})}var Tj=["light","dark"],L7="(prefers-color-scheme: dark)",F7=v.createContext(void 0),B7={setTheme:t=>{},themes:[]},$7=()=>{var t;return(t=v.useContext(F7))!=null?t:B7};v.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?Tj.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(m,g=!1,y=!0)=>{let b=o?o[m]:m,x=g?m+"|| ''":`'${b}'`,w="";return s&&y&&!g&&Tj.includes(m)&&(w+=`d.style.colorScheme = '${m}';`),n==="class"?g||b?w+=`c.add(${x})`:w+="null":b&&(w+=`d[s](n,${x})`),w},p=t?`!function(){${d}${h(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${L7}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${f}}catch(t){}}();`;return v.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var V7=t=>{switch(t){case"success":return W7;case"info":return q7;case"warning":return H7;case"error":return K7;default:return null}},z7=Array(12).fill(0),U7=({visible:t,className:e})=>z.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},z.createElement("div",{className:"sonner-spinner"},z7.map((n,r)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),W7=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),H7=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),q7=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),K7=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),G7=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Y7=()=>{let[t,e]=z.useState(document.hidden);return z.useEffect(()=>{let n=()=>{e(document.hidden)};
380return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},BS=1,Q7=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:BS++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:n}),{...a,...t,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),s=n!==void 0,i,o=r.then(async l=>{if(i=["resolve",l],z.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(X7(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:u,description:d})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||BS++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},vr=new Q7,J7=(t,e)=>{let n=(e==null?void 0:e.id)||BS++;return vr.addToast({title:t,...e,id:n}),n},X7=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Z7=J7,eG=()=>vr.toasts,tG=()=>vr.getActiveToasts(),Fr=Object.assign(Z7,{success:vr.success,info:vr.info,warning:vr.warning,error:vr.error,custom:vr.custom,message:vr.message,promise:vr.promise,dismiss:vr.dismiss,loading:vr.loading},{getHistory:eG,getToasts:tG});function nG(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}nG(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
380left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
380:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
380--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
381`);function Wm(t){return t.label!==void 0}var rG=3,sG="32px",iG="16px",Aj=4e3,oG=356,aG=14,lG=20,cG=200;function ks(...t){return t.filter(Boolean).join(" ")}function uG(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var dG=t=>{var e,n,r,s,i,o,a,l,u,d,f;let{invert:h,toast:p,unstyled:m,interacting:g,setHeights:y,visibleToasts:b,heights:x,index:w,toasts:S,expanded:C,removeToast:k,defaultRichColors:N,closeButton:E,style:_,cancelButtonStyle:T,actionButtonStyle:P,className:j="",descriptionClassName:F="",duration:B,position:U,gap:D,loadingIcon:L,expandByDefault:A,classNames:O,icons:W,closeButtonAriaLabel:Z="Close toast",pauseWhenPageIsHidden:$}=t,[Y,ee]=z.useState(null),[ne,be]=z.useState(null),[G,Ae]=z.useState(!1),[Re,De]=z.useState(!1),[qe,je]=z.useState(!1),[Tt,qn]=z.useState(!1),[Zs,ei]=z.useState(!1),[Vi,Ac]=z.useState(0),[zi,M]=z.useState(0),V=z.useRef(p.duration||B||Aj),H=z.useRef(null),oe=z.useRef(null),ie=w===0,re=w+1<=b,de=p.type,Ge=p.dismissible!==!1,dt=p.className||"",hr=p.descriptionClassName||"",Ui=z.useMemo(()=>x.findIndex(Fe=>Fe.toastId===p.id)||0,[x,p.id]),ti=z.useMemo(()=>{var Fe;return(Fe=p.closeButton)!=null?Fe:E},[p.closeButton,E]),wm=z.useMemo(()=>p.duration||B||Aj,[p.duration,B]),il=z.useRef(0),ni=z.useRef(0),Sm=z.useRef(0),Wi=z.useRef(null),[x0,km]=U.split("-"),sA=z.useMemo(()=>x.reduce((Fe,ft,At)=>At>=Ui?Fe:Fe+ft.height,0),[x,Ui]),iA=Y7(),s8=p.invert||h,b0=de==="loading";ni.current=z.useMemo(()=>Ui*D+sA,[Ui,sA]),z.useEffect(()=>{V.current=wm},[wm]),z.useEffect(()=>{Ae(!0)},[]),z.useEffect(()=>{let Fe=oe.current;if(Fe){let ft=Fe.getBoundingClientRect().height;return M(ft),y(At=>[{toastId:p.id,height:ft,position:p.position},...At]),()=>y(At=>At.filter(xs=>xs.toastId!==p.id))}},[y,p.id]),z.useLayoutEffect(()=>{if(!G)return;let Fe=oe.current,ft=Fe.style.height;Fe.style.height="auto";let At=Fe.getBoundingClientRect().height;Fe.style.height=ft,M(At),y(xs=>xs.find(bs=>bs.toastId===p.id)?xs.map(bs=>bs.toastId===p.id?{...bs,height:At}:bs):[{toastId:p.id,height:At,position:p.position},...xs])},[G,p.title,p.description,y,p.id]);let Eo=z.useCallback(()=>{De(!0),Ac(ni.current),y(Fe=>Fe.filter(ft=>ft.toastId!==p.id)),setTimeout(()=>{k(p)},cG)},[p,k,y,ni]);z.useEffect(()=>{if(p.promise&&de==="loading"||p.duration===1/0||p.type==="loading")return;let Fe;return C||g||$&&iA?(()=>{if(Sm.current<il.current){let ft=new Date().getTime()-il.current;V.current=V.current-ft}
381Sm.current=new Date().getTime()})():V.current!==1/0&&(il.current=new Date().getTime(),Fe=setTimeout(()=>{var ft;(ft=p.onAutoClose)==null||ft.call(p,p),Eo()},V.current)),()=>clearTimeout(Fe)},[C,g,p,de,$,iA,Eo]),z.useEffect(()=>{p.delete&&Eo()},[Eo,p.delete]);function i8(){var Fe,ft,At;return W!=null&&W.loading?z.createElement("div",{className:ks(O==null?void 0:O.loader,(Fe=p==null?void 0:p.classNames)==null?void 0:Fe.loader,"sonner-loader"),"data-visible":de==="loading"},W.loading):L?z.createElement("div",{className:ks(O==null?void 0:O.loader,(ft=p==null?void 0:p.classNames)==null?void 0:ft.loader,"sonner-loader"),"data-visible":de==="loading"},L):z.createElement(U7,{className:ks(O==null?void 0:O.loader,(At=p==null?void 0:p.classNames)==null?void 0:At.loader),visible:de==="loading"})}return z.createElement("li",{tabIndex:0,ref:oe,className:ks(j,dt,O==null?void 0:O.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,O==null?void 0:O.default,O==null?void 0:O[de],(n=p==null?void 0:p.classNames)==null?void 0:n[de]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:N,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":G,"data-promise":!!p.promise,"data-swiped":Zs,"data-removed":Re,"data-visible":re,"data-y-position":x0,"data-x-position":km,"data-index":w,"data-front":ie,"data-swiping":qe,"data-dismissible":Ge,"data-type":de,"data-invert":s8,"data-swipe-out":Tt,"data-swipe-direction":ne,"data-expanded":!!(C||A&&G),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${Re?Vi:ni.current}px`,"--initial-height":A?"auto":`${zi}px`,..._,...p.style},onDragEnd:()=>{je(!1),ee(null),Wi.current=null},onPointerDown:Fe=>
381{b0||!Ge||(H.current=new Date,Ac(ni.current),Fe.target.setPointerCapture(Fe.pointerId),Fe.target.tagName!=="BUTTON"&&(je(!0),Wi.current={x:Fe.clientX,y:Fe.clientY}))},onPointerUp:()=>{var Fe,ft,At,xs;if(Tt||!Ge)return;Wi.current=null;let bs=Number(((Fe=oe.current)==null?void 0:Fe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),_o=Number(((ft=oe.current)==null?void 0:ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ol=new Date().getTime()-((At=H.current)==null?void 0:At.getTime()),ws=Y==="x"?bs:_o,To=Math.abs(ws)/ol;if(Math.abs(ws)>=lG||To>.11){Ac(ni.current),(xs=p.onDismiss)==null||xs.call(p,p),be(Y==="x"?bs>0?"right":"left":_o>0?"down":"up"),Eo(),qn(!0),ei(!1);return}je(!1),ee(null)},onPointerMove:Fe=>{var ft,At,xs,bs;if(!Wi.current||!Ge||((ft=window.getSelection())==null?void 0:ft.toString().length)>0)return;let _o=Fe.clientY-Wi.current.y,ol=Fe.clientX-Wi.current.x,ws=(At=t.swipeDirections)!=null?At:uG(U);!Y&&(Math.abs(ol)>1||Math.abs(_o)>1)&&ee(Math.abs(ol)>Math.abs(_o)?"x":"y");let To={x:0,y:0};Y==="y"?(ws.includes("top")||ws.includes("bottom"))&&(ws.includes("top")&&_o<0||ws.includes("bottom")&&_o>0)&&(To.y=_o):Y==="x"&&(ws.includes("left")||ws.includes("right"))&&(ws.includes("left")&&ol<0||ws.includes("right")&&ol>0)&&(To.x=ol),(Math.abs(To.x)>0||Math.abs(To.y)>0)&&ei(!0),(xs=oe.current)==null||xs.style.setProperty("--swipe-amount-x",`${To.x}px`),(bs=oe.current)==null||bs.style.setProperty("--swipe-amount-y",`${To.y}px`)}},ti&&!p.jsx?z.createElement("button",{"aria-label":Z,"data-disabled":b0,"data-close-button":!0,onClick:b0||!Ge?()=>{}:()=>{var Fe;Eo(),(Fe=p.onDismiss)==null||Fe.call(p,p)},className:ks(O==null?void 0:O.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=W==null?void 0:W.close)!=null?i:G7):null,p.jsx||v.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:z.createElement(z.Fragment,null,de||p.icon||p.promise?z.createElement("div",{"data-icon":"",className:ks(O==null?void 0:O.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||i8():null,p.type!=="loading"?p.icon||(W==null?void 0:W[de])||V7(de):null):null,z.createElement("div",{"data-content":"",className:ks(O==null?void 0:O.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},z.createElement("div",{"data-title":"",className:ks(O==null?void 0:O.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?z.createElement("div",{"data-description":"",className:ks(F,hr,O==null?void 0:O.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),v.isValidElement(p.cancel)?p.cancel:p.cancel&&Wm(p.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:Fe=>{var ft,At;Wm(p.cancel)&&Ge&&((At=(ft=p.cancel).onClick)==null||At.call(ft,Fe),Eo())},className:ks(O==null?void 0:O.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,v.isValidElement(p.action)?p.action:p.action&&Wm(p.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:Fe=>{var ft,At;Wm(p.action)&&((At=(ft=p.action).onClick)==null||At.call(ft,Fe),!Fe.defaultPrevented&&Eo())},className:ks(O==null?void 0:O.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function jj(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function fG(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?iG:sG;function l(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var hG=v.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:m=rG,toastOptions:g,dir:y=jj(),gap:b=aG,loadingIcon:x,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=t,[k,N]=z.useState([]),E=z.useMemo(()=>Array.from(new Set([r].concat(k.filter($=>$.position).map($=>$.position)))),[k,r]),[_,T]=z.useState([]),[P,j]=z.useState(!1),[F,B]=z.useState(!1),[U,D]=z.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
381k":"light"),L=z.useRef(null),A=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=z.useRef(null),W=z.useRef(!1),Z=z.useCallback($=>{N(Y=>{var ee;return(ee=Y.find(ne=>ne.id===$.id))!=null&&ee.delete||vr.dismiss($.id),Y.filter(({id:ne})=>ne!==$.id)})},[]);return z.useEffect(()=>vr.subscribe($=>{if($.dismiss){N(Y=>Y.map(ee=>ee.id===$.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{Vx.flushSync(()=>{N(Y=>{let ee=Y.findIndex(ne=>ne.id===$.id);return ee!==-1?[...Y.slice(0,ee),{...Y[ee],...$},...Y.slice(ee+1)]:[$,...Y]})})})}),[]),z.useEffect(()=>{if(d!=="system"){D(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?D("dark"):D("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Y})=>{D(Y?"dark":"light")})}catch{$.addListener(({matches:ee})=>{try{D(ee?"dark":"light")}catch(ne){console.error(ne)}})}},[d]),z.useEffect(()=>{k.length<=1&&j(!1)},[k]),z.useEffect(()=>{let $=Y=>{var ee,ne;s.every(be=>Y[be]||Y.code===be)&&(j(!0),(ee=L.current)==null||ee.focus()),Y.code==="Escape"&&(document.activeElement===L.current||(ne=L.current)!=null&&ne.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),z.useEffect(()=>{if(L.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,W.current=!1)}},[L.current]),z.createElement("section",{ref:e,"aria-label":`${S} ${A}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map(($,Y)=>{var ee;let[ne,be]=$.split("-");return k.length?z.createElement("ol",{key:$,dir:y==="auto"?jj():y,tabIndex:-1,ref:L,className:a,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":ne,"data-lifted":P&&k.length>1&&!i,"data-x-position":be,style:{"--front-toast-height":`${((ee=_[0])==null?void 0:ee.height)||0}px`,"--width":`${oG}px`,"--gap":`${b}px`,...p,...fG(l,u)},onBlur:G=>{W.current&&!G.currentTarget.contains(G.relatedTarget)&&(W.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||W.current||(W.current=!0,O.current=G.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{F||j(!1)},onDragEnd:()=>j(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},k.filter(G=>!G.position&&Y===0||G.position===$).map((G,Ae)=>{var Re,De;return z.createElement(dG,{key:G.id,icons:w,index:Ae,toast:G,defaultRichColors:f,duration:(Re=g==null?void 0:g.duration)!=null?Re:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:m,closeButton:(De=g==null?void 0:g.closeButton)!=null?De:o,interacting:F,position:$,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Z,toasts:k.filter(qe=>qe.position==G.position),heights:_.filter(qe=>qe.position==G.position),setHeights:T,expandByDefault:i,gap:b,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});const pG=({...t})=>{const{theme:e="system"}=$7();return c.jsx(hG,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var mG=nN[" useId ".trim().toString()]||(()=>{}),gG=0;function yn(t){const[e,n]=v.useState(mG());return Wt(()=>{n(r=>r??String(gG++))},[t]),e?`radix-${e}`:""}const yG=["top","right","bottom","left"],La=Math.min,Or=Math.max,Vy=Math.round,Hm=Math.floor,Ni=t=>({x:t,y:t}
vendor: 11,919 bytes, line 381
381),vG={left:"right",right:"left",bottom:"top",top:"bottom"},xG={start:"end",end:"start"};function $S(t,e,n){return Or(t,La(e,n))}function vo(t,e){return typeof t=="function"?t(e):t}function xo(t){return t.split("-")[0]}function Id(t){return t.split("-")[1]}function tE(t){return t==="x"?"y":"x"}function nE(t){return t==="y"?"height":"width"}const bG=new Set(["top","bottom"]);function bi(t){return bG.has(xo(t))?"y":"x"}function rE(t){return tE(bi(t))}function wG(t,e,n){n===void 0&&(n=!1);const r=Id(t),s=rE(t),i=nE(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=zy(o)),[o,zy(o)]}function SG(t){const e=zy(t);return[VS(t),e,VS(e)]}function VS(t){return t.replace(/start|end/g,e=>xG[e])}const Pj=["left","right"],Rj=["right","left"],kG=["top","bottom"],CG=["bottom","top"];function NG(t,e,n){switch(t){case"top":case"bottom":return n?e?Rj:Pj:e?Pj:Rj;case"left":case"right":return e?kG:CG;default:return[]}}function EG(t,e,n,r){const s=Id(t);let i=NG(xo(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(VS)))),i}function zy(t){return t.replace(/left|right|bottom|top/g,e=>vG[e])}function _G(t){return{top:0,right:0,bottom:0,left:0,...t}}function AF(t){return typeof t!="number"?_G(t):{top:t,right:t,bottom:t,left:t}}function Uy(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function Mj(t,e,n){let{reference:r,floating:s}=t;const i=bi(e),o=rE(e),a=nE(o),l=xo(e),u=i==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[a]/2-s[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Id(e)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const TG=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:f}=Mj(u,r,l),h=r,p={},m=0;for(let g=0;g<a.length;g++){const{name:y,fn:b}=a[g],{x,y:w,data:S,reset:C}=await b({x:d,y:f,initialPlacement:r,placement:h,strategy:s,middlewareData:p,rects:u,platform:o,elements:{reference:t,floating:e}});d=x??d,f=w??f,p={...p,[y]:{...p[y],...S}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):C.rects),{x:d,y:f}=Mj(u,h,l)),g=-1)}return{x:d,y:f,placement:h,strategy:s,middlewareData:p}};async function Yh(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=vo(e,t),m=AF(p),y=a[h?f==="floating"?"reference":"floating":f],b=Uy(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),x=f==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Uy(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-C.top+m.top)/S.y,bottom:(C.bottom-b.bottom+m.bottom)/S.y,left:(b.left-C.left+m.left)/S.x,right:(C.right-b.right+m.right)/S.x}}const AG=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:d=0}=vo(t,e)||{};if(u==null)return{};const f=AF(d),h={x:n,y:r},p=rE(s),m=nE(p),g=await o.getDimensions(u),y=p==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[p]-h[p]-i.floating[m],C=h[p]-i.reference[p],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=k?k[w]:0;(!N||!await(o.isElement==null?void 0:o.isElement(k)))&&(N=a.floating[w]||i.floating[m]);const E=S/2-C/2,_=N/2-g[m]/2-1,T=La(f[b],_),P=La(f[x],_),j=T,F=N-g[m]-P,B=N/2-g[m]/2+E,U=$S(j,B,F),D=!l.arrow&&Id(s)!=null&&B!==U&&i.reference[m]/2-(B<j?T:P)-g[m]/2<0,L=D?B<j?B-j:B-F:0;return{[p]:h[p]+L,data:{[p]:U,centerOffset:B-U-L,...D&&{alignmentOffset:L}},reset:D}}}),jG=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=vo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=xo(s),x=bi(a),w=xo(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=h||(w||!g?[zy(a)]:SG(a)),k=m!=="none";!h&&k&&C.push(...EG(a,g,m,S));const N=[a,...C],E=await Yh(e,y),_=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push(E[b]),f){const B=wG(s,o,S);_.push(E[B[0]],E[B[1]])}if(T=[...T,{placement:s,overflows:_}],!_.every(B=>B<=0)){var P,j;const B=(((P=i.flip)==null?void 0:P.index)||0)+1,U=N[B];if(U&&(!(f==="alignment"?x!==bi(U):!1)||T.every(A=>A.overflows[0]>0&&bi(A.placement)===x)))return{data:{index:B,overflows:T},reset:{placement:U}};let D=(j=T.filter(L=>L.overflows[0]<=0).sort((L,A)=>L.overflows[1]-A.overflows[1])[0])==null?void 0:j.placement;if(!D)switch(p){case"bestFit":{var F;const L=(F=T.filter(A=>{if(k){const O=bi(A.placement);return O===x||O==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(O=>O>0).reduce((O,W)=>O+W,0)]).sort((A,O)=>A[1]-O[1])[0])==null?void 0:F[0];L&&(D=L);break}case"initialPlacement":D=a;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function Oj(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dj(t){return yG.some(e=>t[e]>=0)}const PG=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=vo(t,e);switch(r){case"referenceHidden":{const i=await Yh(e,{...s,elementContext:"reference"}),o=Oj(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Dj(o)}}}case"escaped":{const i=await Yh(e,{...s,altBoundary:!0}),o=Oj(i,n.floating);return{data:{escapedOffsets:o,escaped:Dj(o)}}}default:return{}}}}},jF=new Set(["left","top"]);async function RG(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=xo(n),a=Id(n),l=bi(n)==="y",u=jF.has(o)?-1:1,d=i&&l?-1:1,f=vo(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const MG=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await RG(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},OG=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=vo(t,e),u={x:n,y:r},d=await Yh(e,l),f=bi(xo(s)),h=tE(f);let p=u[h],m=u[f];if(i){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[y],w=p-d[b];p=$S(x,p,w)}if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=m+d[y],w=m-d[b];m=$S(x,m,w)}const g=a.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[f]:o}}}}}},DG=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=vo(t,e),d={x:n,y:r},f=bi(s),h=tE(f);let p=d[h],m=d[f];const g=vo(a,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=h==="y"?"height":"width",S=i.reference[h]-i.floating[w]+y.mainAxis,C=i.reference[h]+i.reference[w]-y.mainAxis;p<S?p=S:p>C&&(p=C)}if(u){var b,x;const w=h==="y"?"width":"height",S=jF.has(xo(s)),C=i.reference[f]-i.floating[w]+(S&&((b=o.offset)==null?void 0:b[f])||0)+(S?0:y.crossAxis),k=i.reference[f]+i.reference[w]+(S?0:((x=o.offset)==null?void 0:x[f])||0)-(S?y.crossAxis:0);m<C?m=C:m>k&&(m=k)}return{[h]:p,[f]:m}}}},IG=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...u}=vo(t,e),d=await Yh(e,u),f=xo(s),h=Id(s),p=bi(s)==="y",{width:m,height:g}=i.floating;let y,b;f==="top"||f==="bottom"?(y=f,b=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,y=h==="end"?"top":"bottom");const x=g-d.top-d.bottom,w=m-d.left-d.right,S=La(g-d[y],x),C=La(m-d[b],w),k=!e.middlewareData.shift;let N=S,E=C;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(E=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(N=x),k&&!h){const T=Or(d.left,0),P=Or(d.right,0),j=Or(d.top,0),F=Or(d.bottom,0);p?E=m-2*(T!==0||P!==0?T+P:Or(d.left,d.right)):N=g-2*(j!==0||F!==0?j+F:Or(d.top,d.bottom))}await l({...e,availableWidth:E,availableHeight:N});const _=await o.getDimensions(a.floating);return m!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function Kx(){return typeof window<"u"}function Ld(t){return PF(t)?(t.nodeName||"").toLowerCase():"#document"}function Vr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Li(t){var e;return(e=(PF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function PF(t){return Kx()?t instanceof Node||t instanceof Vr(t).Node:!1}function Ks(t){return Kx()?t instanceof Element||t instanceof Vr(t).Element:!1}function Pi(t){return Kx()?t instanceof HTMLElement||t instanceof Vr(t).HTMLElement:!1}function Ij(t){return!Kx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Vr(t).ShadowRoot}const LG=new Set(["inline","contents"]);function Kp(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Gs(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!LG.has(s)}const FG=new Set(["table","td","th"]);function BG(t){return FG.has(Ld(t))}const $G=[":popover-open",":modal"];function Gx(t){return $G.some(e=>{try{return t.matches(e)}catch{return!1}})}const VG=["transform","translate","scale","rotate","perspective"],zG=["transform","translate","scale","rotate","perspective","filter"],UG=["paint","layout","strict","content"];function sE(t){const e=iE(),n=Ks(t)?Gs(t):t;return VG.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||zG.some(r=>(n.willChange||"").includes(r))||UG.some(r=>(n.contain||"").includes(r))}function WG(t){let e=Fa(t);for(;Pi(e)&&!Xu(e);){if(sE(e))return e;if(Gx(e))return null;e=Fa(e)}return null}function iE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const HG=new Set(["html","body","#document"]);function Xu(t){return HG.has(Ld(t))}function Gs(t){return Vr(t).getComputedStyle(t)}function Yx(t){return Ks(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fa(t){if(Ld(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ij(t)&&t.host||Li(t);return Ij(e)?e.host:e}function RF(t){const e=Fa(t);return Xu(e)?t.ownerDocument?t.ownerDocument.body:t.body:Pi(e)&&Kp(e)?e:RF(e)}function Qh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=RF(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Vr(s);if(i){const a=zS(o);
vendor: 4,409 bytes, line 381
381return e.concat(o,o.visualViewport||[],Kp(s)?s:[],a&&n?Qh(a):[])}return e.concat(s,Qh(s,[],n))}function zS(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function MF(t){const e=Gs(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Pi(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=Vy(n)!==i||Vy(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function oE(t){return Ks(t)?t:t.contextElement}function Nu(t){const e=oE(t);if(!Pi(e))return Ni(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=MF(e);let o=(i?Vy(n.width):n.width)/r,a=(i?Vy(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const qG=Ni(0);function OF(t){const e=Vr(t);return!iE()||!e.visualViewport?qG:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function KG(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Vr(t)?!1:e}function rc(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=oE(t);let o=Ni(1);e&&(r?Ks(r)&&(o=Nu(r)):o=Nu(t));const a=KG(i,n,r)?OF(i):Ni(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(i){const h=Vr(i),p=r&&Ks(r)?Vr(r):r;let m=h,g=zS(m);for(;g&&r&&p!==m;){const y=Nu(g),b=g.getBoundingClientRect(),x=Gs(g),w=b.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,S=b.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,f*=y.y,l+=w,u+=S,m=Vr(g),g=zS(m)}}return Uy({width:d,height:f,x:l,y:u})}function aE(t,e){const n=Yx(t).scrollLeft;return e?e.left+n:rc(Li(t)).left+n}function DF(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-(n?0:aE(t,r)),i=r.top+e.scrollTop;return{x:s,y:i}}function GG(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Li(r),a=e?Gx(e.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Ni(1);const d=Ni(0),f=Pi(r);if((f||!f&&!i)&&((Ld(r)!=="body"||Kp(o))&&(l=Yx(r)),Pi(r))){const p=rc(r);u=Nu(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=o&&!f&&!i?DF(o,l,!0):Ni(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-l.scrollTop*u.y+d.y+h.y}}function YG(t){return Array.from(t.getClientRects())}function QG(t){const e=Li(t),n=Yx(t),r=t.ownerDocument.body,s=Or(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Or(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+aE(t);const a=-n.scrollTop;return Gs(r).direction==="rtl"&&(o+=Or(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function JG(t,e){const n=Vr(t),r=Li(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const u=iE();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const XG=new Set(["absolute","fixed"]);function ZG(t,e){const n=rc(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Pi(t)?Nu(t):Ni(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,u=r*i.y;return{width:o,height:a,x:l,y:u}}function Lj(t,e,n){let r;if(e==="viewport")r=JG(t,n);else if(e==="document")r=QG(Li(t));else if(Ks(e))r=ZG(e,n);else{const s=OF(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Uy(r)}function IF(t,e){const n=Fa(t);return n===e||!Ks(n)||Xu(n)?!1:Gs(n).position==="fixed"||IF(n,e)}function eY(t,e){const n=e.get(t);if(n)return n;let r=Qh(t,[],!1).filter(a=>Ks(a)&&Ld(a)!=="body"),s=null;const i=Gs(t).position==="fixed";let o=i?Fa(t):t;for(;Ks(o)&&!Xu(o);){const a=Gs(o),l=sE(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&XG.has(s.position)||Kp(o)&&!l&&IF(t,o))?r=r.filter(d=>d!==o):s=a,o=Fa(o)}return e.set(t,r),r}function tY(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Gx(e)?[]:eY(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,d)=>{const f=Lj(e,d,s);return u.top=Or(f.top,u.top),u.right=La(f.right,u.right),u.bottom=La(f.bottom,u.bottom),u.left=Or(f.left,u.left),u},Lj(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function nY(t){const{width:e,height:n}=MF(t);return{width:e,height:n}}function rY(t,e,n){const r=Pi(e),s=Li(e),i=n==="fixed",o=rc(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=Ni(0);function u(){l.x=aE(s)}if(r||!r&&!i)if((Ld(e)!=="body"||Kp(s))&&(a=Yx(e)),r){const p=rc(e,!0,i,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else s&&u();i&&!r&&s&&u();
vendor: 9,503 bytes, line 381
381const d=s&&!r&&!i?DF(s,a):Ni(0),f=o.left+a.scrollLeft-l.x-d.x,h=o.top+a.scrollTop-l.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function X0(t){return Gs(t).position==="static"}function Fj(t,e){if(!Pi(t)||Gs(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Li(t)===n&&(n=n.ownerDocument.body),n}function LF(t,e){const n=Vr(t);if(Gx(t))return n;if(!Pi(t)){let s=Fa(t);for(;s&&!Xu(s);){if(Ks(s)&&!X0(s))return s;s=Fa(s)}return n}let r=Fj(t,e);for(;r&&BG(r)&&X0(r);)r=Fj(r,e);return r&&Xu(r)&&X0(r)&&!sE(r)?n:r||WG(t)||n}const sY=async function(t){const e=this.getOffsetParent||LF,n=this.getDimensions,r=await n(t.floating);return{reference:rY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iY(t){return Gs(t).direction==="rtl"}const oY={convertOffsetParentRelativeRectToViewportRelativeRect:GG,getDocumentElement:Li,getClippingRect:tY,getOffsetParent:LF,getElementRects:sY,getClientRects:YG,getDimensions:nY,getScale:Nu,isElement:Ks,isRTL:iY};function FF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function aY(t,e){let n=null,r;const s=Li(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=u;if(a||e(),!h||!p)return;const m=Hm(f),g=Hm(s.clientWidth-(d+h)),y=Hm(s.clientHeight-(f+p)),b=Hm(d),w={rootMargin:-m+"px "+-g+"px "+-y+"px "+-b+"px",threshold:Or(0,La(1,l))||1};let S=!0;function C(k){const N=k[0].intersectionRatio;if(N!==l){if(!S)return o();N?o(!1,N):r=setTimeout(()=>{o(!1,1e-7)},1e3)}N===1&&!FF(u,t.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(t)}return o(!0),i}function lY(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=oE(t),d=s||i?[...u?Qh(u):[],...Qh(e)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const f=u&&a?aY(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),n()}),u&&!l&&p.observe(u),p.observe(e));let m,g=l?rc(t):null;l&&y();function y(){const b=rc(t);g&&!FF(g,b)&&n(),g=b,m=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(x=>{s&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const cY=MG,uY=OG,dY=jG,fY=IG,hY=PG,Bj=AG,pY=DG,mY=(t,e,n)=>{const r=new Map,s={platform:oY,...n},i={...s.platform,_c:r};return TG(t,e,{...s,platform:i})};var gY=typeof document<"u",yY=function(){},Ug=gY?v.useLayoutEffect:yY;function Wy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Wy(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!Wy(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function BF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function $j(t,e){const n=BF(t);return Math.round(e*n)/n}function Z0(t){const e=v.useRef(t);return Ug(()=>{e.current=t}),e}function vY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[d,f]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,p]=v.useState(r);Wy(h,r)||p(r);const[m,g]=v.useState(null),[y,b]=v.useState(null),x=v.useCallback(A=>{A!==k.current&&(k.current=A,g(A))},[]),w=v.useCallback(A=>{A!==N.current&&(N.current=A,b(A))},[]),S=i||m,C=o||y,k=v.useRef(null),N=v.useRef(null),E=v.useRef(d),_=l!=null,T=Z0(l),P=Z0(s),j=Z0(u),F=v.useCallback(()=>{if(!k.current||!N.current)return;const A={placement:e,strategy:n,middleware:h};P.current&&(A.platform=P.current),mY(k.current,N.current,A).then(O=>{const W={...O,isPositioned:j.current!==!1};B.current&&!Wy(E.current,W)&&(E.current=W,Ii.flushSync(()=>{f(W)}))})},[h,e,n,P,j]);Ug(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[u]);const B=v.useRef(!1);Ug(()=>(B.current=!0,()=>{B.current=!1}),[]),Ug(()=>{if(S&&(k.current=S),C&&(N.current=C),S&&C){if(T.current)return T.current(S,C,F);F()}},[S,C,F,T,_]);const U=v.useMemo(()=>({reference:k,floating:N,setReference:x,setFloating:w}),[x,w]),D=v.useMemo(()=>({reference:S,floating:C}),[S,C]),L=v.useMemo(()=>{const A={position:n,left:0,top:0};if(!D.floating)return A;const O=$j(D.floating,d.x),W=$j(D.floating,d.y);return a?{...A,transform:"translate("+O+"px, "+W+"px)",...BF(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:W}},[n,a,D.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:F,refs:U,elements:D,floatingStyles:L}),[d,F,U,D,L])}const xY=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Bj({element:r.current,padding:s}).fn(n):{}:r?Bj({element:r,padding:s}).fn(n):{}}}},bY=(t,e)=>({...cY(t),options:[t,e]}),wY=(t,e)=>({...uY(t),options:[t,e]}),SY=(t,e)=>({...pY(t),options:[t,e]}),kY=(t,e)=>({...dY(t),options:[t,e]}),CY=(t,e)=>({...fY(t),options:[t,e]}),NY=(t,e)=>({...hY(t),options:[t,e]}),EY=(t,e)=>({...xY(t),options:[t,e]});var _Y="Arrow",$F=v.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return c.jsx(he.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});$F.displayName=_Y;var TY=$F;function VF(t){const[e,n]=v.useState(void 0);return Wt(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var lE="Popper",[zF,Fd]=dr(lE),[AY,UF]=zF(lE),WF=t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null);return c.jsx(AY,{scope:e,anchor:r,onAnchorChange:s,children:n})};WF.displayName=lE;var HF="PopperAnchor",qF=v.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=UF(HF,n),o=v.useRef(null),a=We(e,o);return v.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:c.jsx(he.div,{...s,ref:a})});qF.displayName=HF;var cE="PopperContent",[jY,PY]=zF(cE),KF=v.forwardRef((t,e)=>{var G,Ae,Re,De,qe,je;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=t,y=UF(cE,n),[b,x]=v.useState(null),w=We(e,Tt=>x(Tt)),[S,C]=v.useState(null),k=VF(S),N=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,_=r+(i!=="center"?"-"+i:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],j=P.length>0,F={padding:T,boundary:P.filter(MY),altBoundary:j},{refs:B,floatingStyles:U,placement:D,isPositioned:L,middlewareData:A}=vY({strategy:"fixed",placement:_,whileElementsMounted:(...Tt)=>lY(...Tt,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[bY({mainAxis:s+E,alignmentAxis:o}),l&&wY({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?SY():void 0,...F}),l&&kY({...F}),CY({...F,apply:({elements:Tt,rects:qn,availableWidth:Zs,availableHeight:ei})=>{const{width:Vi,height:Ac}=qn.reference,zi=Tt.floating.style;zi.setProperty("--radix-popper-available-width",`${Zs}px`),zi.setProperty("--radix-popper-available-height",`${ei}px`),zi.setProperty("--radix-popper-anchor-width",`${Vi}px`),zi.setProperty("--radix-popper-anchor-height",`${Ac}px`)}}),S&&EY({element:S,padding:a}),OY({arrowWidth:N,arrowHeight:E}),h&&NY({strategy:"referenceHidden",...F})]}),[O,W]=QF(D),Z=en(m);Wt(()=>{L&&(Z==null||Z())},[L,Z]);const $=(G=A.arrow)==null?void 0:G.x,Y=(Ae=A.arrow)==null?void 0:Ae.y,ee=((Re=A.arrow)==null?void 0:Re.centerOffset)!==0,[ne,be]=v.useState();return Wt(()=>{b&&be(window.getComputedStyle(b).zIndex)},[b]),c.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:L?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(De=A.transformOrigin)==null?void 0:De.x,(qe=A.transformOrigin)==null?void 0:qe.y].join(" "),...((je=A.hide)==null?void 0:je.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(jY,{scope:n,placedSide:O,onArrowChange:C,arrowX:$,arrowY:Y,shouldHideArrow:ee,children:c.jsx(he.div,{"data-side":O,"data-align":W,...g,ref:w,style:{...g.style,animation:L?void 0:"none"}})})})});KF.displayName=cE;var GF="PopperArrow",RY={top:"bottom",right:"left",bottom:"top",left:"r
381ight"},YF=v.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=PY(GF,r),o=RY[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(TY,{...s,ref:n,style:{...s.style,display:"block"}})})});YF.displayName=GF;function MY(t){return t!==null}var OY=t=>({name:"transformOrigin",options:t,fn(e){var y,b,x;const{placement:n,rects:r,middlewareData:s}=e,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,d]=QF(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((b=s.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=s.arrow)==null?void 0:x.y)??0)+l/2;let m="",g="";return u==="bottom"?(m=o?f:`${h}px`,g=`${-l}px`):u==="top"?(m=o?f:`${h}px`,g=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=o?f:`${p}px`):u==="left"&&(m=`${r.floating.width+l}px`,g=o?f:`${p}px`),{data:{x:m,y:g}}}});function QF(t){const[e,n="center"]=t.split("-");return[e,n]}var uE=WF,Qx=qF,dE=KF,fE=YF,[Jx,mTe]=dr("Tooltip",[Fd]),Xx=Fd(),JF="TooltipProvider",DY=700,US="tooltip.open",[IY,hE]=Jx(JF),XF=t=>{const{__scopeTooltip:e,delayDuration:n=DY,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=v.useRef(!0),a=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(IY,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};XF.displayName=JF;var Jh="Tooltip",[LY,Zx]=Jx(Jh),ZF=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=t,l=hE(Jh,t.__scopeTooltip),u=Xx(e),[d,f]=v.useState(null),h=yn(),p=v.useRef(0),m=o??l.disableHoverableContent,g=a??l.delayDuration,y=v.useRef(!1),[b,x]=gs({prop:r,defaultProp:s??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(US))):l.onClose(),i==null||i(N)},caller:Jh}),w=v.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),S=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),C=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),k=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},g)},[g,x]);return v.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(uE,{...u,children:c.jsx(LY,{scope:e,contentId:h,open:b,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:v.useCallback(()=>{l.isOpenDelayedRef.current?k():S()},[l.isOpenDelayedRef,k,S]),onTriggerLeave:v.useCallback(()=>{m?C():(window.clearTimeout(p.current),p.current=0)},[C,m]),onOpen:S,onClose:C,disableHoverableContent:m,children:n})})};ZF.displayName=Jh;var WS="TooltipTrigger",eB=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Zx(WS,n),i=hE(WS,n),o=Xx(n),a=v.useRef(null),l=We(e,a,s.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),f=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(Qx,{asChild:!0,...o,children:c.jsx(he.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:fe(t.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:fe(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:fe(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:fe(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:fe(t.onBlur,s.onClose),onClick:fe(t.onClick,s.onClose)})})});eB.displayName=WS;var FY="TooltipPortal",[gTe,BY]=Jx(FY,{forceMount:void 0}),Zu="TooltipContent",tB=v.forwardRef((t,e)=>{const n=BY(Zu,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Zx(Zu,t.__scopeTooltip);return c.jsx(fr,{present:r||o.open,children:o.disableHoverableContent?c.jsx(nB,{side:s,...i,ref:e}):c.jsx($Y,{side:s,...i,ref:e})})}),$Y=v.forwardRef((t,e)=>{const n=Zx(Zu,t.__scopeTooltip),r=hE(Zu,t.__scopeTooltip),s=v.useRef(null),i=We(e,s),[o,a]=v.useState(null),{trigger:l,onClose:u}=n,d=s.current,{onPointerInTransitChange:f}=r,h=v.useCallback(()=>{a(null),f(!1)},[f]),p=v.useCallback((m,g)=>{const y=m.currentTarget,b={x:m.clientX,y:m.clientY},x=HY(b,y.getBoundingClientRect()),w=qY(b,x),S=KY(g.getBoundingClientRect()),C=YY([...w,...S]);a(C),f(!0)},[f]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(l&&d){const m=y=>p(y,d),g=y=>p(y,l);return l.addEventListener("pointerleave",m),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",g)}}},[l,d,p,h]),v.useEffect(()=>{if(o){const m=g=>{const y=g.target,b={x:g.clientX,y:g.clientY},x=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),w=!GY(b,o);x?h():w&&(h(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,d,o,u,h]),c.jsx(nB,{...t,ref:i})}),[VY,zY]=Jx(Jh,{isInside:!1}),UY=LL("TooltipContent"),nB=v.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Zx(Zu,n),u=Xx(n),{onClose:d}=l;return v.useEffect(()=>(document.addEventListener(US,d),()=>document.removeEventListener(US,d)),[d]),v.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(Rd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(dE,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(UY,{children:r}),c.jsx(VY,{scope:n,isInside:!0,children:c.jsx(a9,{id:l.contentId,role:"tooltip",children:s||r})})]})})});tB.displayName=Zu;var rB="TooltipArrow",WY=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Xx(n);return zY(rB,n).isInside?null:c.jsx(fE,{...s,...r,ref:e})});WY.displayName=rB;function HY(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function qY(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function KY(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function GY(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i],l=e[o],u=a.x,d=a.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(s=!s)}return s}
381function YY(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),QY(e)}function QY(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var JY=XF,XY=ZF,ZY=eB,sB=tB;const iB=JY,eQ=XY,tQ=ZY,oB=v.forwardRef(({className:t,sideOffset:e=4,...n},r)=>c.jsx(sB,{ref:r,sideOffset:e,className:q("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));oB.displayName=sB.displayName;var Bd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sc=typeof window>"u"||"Deno"in globalThis;function Xn(){}function nQ(t,e){return typeof t=="function"?t(e):t}function HS(t){return typeof t=="number"&&t>=0&&t!==1/0}function aB(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ca(t,e){return typeof t=="function"?t(e):t}function Zr(t,e){return typeof t=="function"?t(e):t}function Vj(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==pE(o,e.options))return!1}else if(!Xh(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function zj(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(ic(e.options.mutationKey)!==ic(i))return!1}else if(!Xh(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function pE(t,e){return((e==null?void 0:e.queryKeyHashFn)||ic)(t)}function ic(t){return JSON.stringify(t,(e,n)=>qS(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Xh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Xh(t[n],e[n])):!1}function lB(t,e){if(t===e)return t;const n=Uj(t)&&Uj(e);if(n||qS(t)&&qS(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),o=i.length,a=n?[]:{},l=new Set(r);let u=0;for(let d=0;d<o;d++){const f=n?d:i[d];(!n&&l.has(f)||n)&&t[f]===void 0&&e[f]===void 0?(a[f]=void 0,u++):(a[f]=lB(t[f],e[f]),a[f]===t[f]&&t[f]!==void 0&&u++)}return s===o&&u===s?t:a}return e}function Hy(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Uj(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function qS(t){if(!Wj(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Wj(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Wj(t){return Object.prototype.toString.call(t)==="[object Object]"}function rQ(t){return new Promise(e=>{setTimeout(e,t)})}function KS(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?lB(t,e):e}function sQ(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function iQ(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var mE=Symbol();function cB(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===mE?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function uB(t,e){return typeof t=="function"?t(...e):!!t}var Pl,Xo,Mu,f2,oQ=(f2=class extends Bd{constructor(){super();Ne(this,Pl);Ne(this,Xo);Ne(this,Mu);ae(this,Mu,e=>{if(!sc&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){R(this,Xo)||this.setEventListener(R(this,Mu))}onUnsubscribe(){var e;this.hasListeners()||((e=R(this,Xo))==null||e.call(this),ae(this,Xo,void 0))}setEventListener(e){var n;ae(this,Mu,e),(n=R(this,Xo))==null||n.call(this),ae(this,Xo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){R(this,Pl)!==e&&(ae(this,Pl,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 4,924 bytes, line 381
381this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof R(this,Pl)=="boolean"?R(this,Pl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Pl=new WeakMap,Xo=new WeakMap,Mu=new WeakMap,f2),gE=new oQ,Ou,Zo,Du,h2,aQ=(h2=class extends Bd{constructor(){super();Ne(this,Ou,!0);Ne(this,Zo);Ne(this,Du);ae(this,Du,e=>{if(!sc&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){R(this,Zo)||this.setEventListener(R(this,Du))}onUnsubscribe(){var e;this.hasListeners()||((e=R(this,Zo))==null||e.call(this),ae(this,Zo,void 0))}setEventListener(e){var n;ae(this,Du,e),(n=R(this,Zo))==null||n.call(this),ae(this,Zo,e(this.setOnline.bind(this)))}setOnline(e){R(this,Ou)!==e&&(ae(this,Ou,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return R(this,Ou)}},Ou=new WeakMap,Zo=new WeakMap,Du=new WeakMap,h2),qy=new aQ;function GS(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function lQ(t){return Math.min(1e3*2**t,3e4)}function dB(t){return(t??"online")==="online"?qy.isOnline():!0}var fB=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ew(t){return t instanceof fB}function hB(t){let e=!1,n=0,r=!1,s;const i=GS(),o=g=>{var y;r||(h(new fB(g)),(y=t.abort)==null||y.call(t))},a=()=>{e=!0},l=()=>{e=!1},u=()=>gE.isFocused()&&(t.networkMode==="always"||qy.isOnline())&&t.canRun(),d=()=>dB(t.networkMode)&&t.canRun(),f=g=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,g),s==null||s(),i.resolve(g))},h=g=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,g),s==null||s(),i.reject(g))},p=()=>new Promise(g=>{var y;s=b=>{(r||u())&&g(b)},(y=t.onPause)==null||y.call(t)}).then(()=>{var g;s=void 0,r||(g=t.onContinue)==null||g.call(t)}),m=()=>{if(r)return;let g;const y=n===0?t.initialPromise:void 0;try{g=y??t.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(f).catch(b=>{var k;if(r)return;const x=t.retry??(sc?0:3),w=t.retryDelay??lQ,S=typeof w=="function"?w(n,b):w,C=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(e||!C){h(b);return}n++,(k=t.onFail)==null||k.call(t,n,b),rQ(S).then(()=>u()?void 0:p()).then(()=>{e?h(b):m()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?m():p().then(m),i)}}var cQ=t=>setTimeout(t,0);function uQ(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=cQ;const i=a=>{e?t.push(a):s(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var cn=uQ(),Rl,p2,pB=(p2=class{constructor(){Ne(this,Rl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),HS(this.gcTime)&&ae(this,Rl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(sc?1/0:5*60*1e3))}clearGcTimeout(){R(this,Rl)&&(clearTimeout(R(this,Rl)),ae(this,Rl,void 0))}},Rl=new WeakMap,p2),Iu,Ml,Xr,Ol,Bn,Dp,Dl,Rs,Ji,m2,dQ=(m2=class extends pB{constructor(e){super();Ne(this,Rs);Ne(this,Iu);Ne(this,Ml);Ne(this,Xr);Ne(this,Ol);Ne(this,Bn);Ne(this,Dp);Ne(this,Dl);ae(this,Dl,!1),ae(this,Dp,e.defaultOptions),this.setOptions(e.options),this.observers=[],ae(this,Ol,e.client),ae(this,Xr,R(this,Ol).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ae(this,Iu,fQ(this.options)),this.state=e.state??R(this,Iu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=R(this,Bn))==null?void 0:e.promise}setOptions(e){this.options={...R(this,Dp),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,Xr).remove(this)}setData(e,n){const r=KS(this.state.data,e,this.options);return Ve(this,Rs,Ji).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Ve(this,Rs,Ji).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=R(this,Bn))==null?void 0:r.promise;return(s=R(this,Bn))==null||s.cancel(e),n?n.then(Xn).catch(Xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(R(this,Iu))}isActive(){return this.observers.some(e=>Zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mE||this.state.dataUpdateCount+this.state.errorUpdate
381Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ca(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!aB(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=R(this,Bn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=R(this,Bn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),R(this,Xr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(R(this,Bn)&&(R(this,Dl)?R(this,Bn).cancel({revert:!0}):R(this,Bn).cancelRetry()),this.scheduleGc()),R(this,Xr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ve(this,Rs,Ji).call(this,{type:"invalidate"})}fetch(e,n){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(R(this,Bn))return R(this,Bn).continueRetry(),R(this,Bn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ae(this,Dl,!0),r.signal)})},i=()=>{const h=cB(this.options,n),m=(()=>{const g={client:R(this,Ol),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return ae(this,Dl,!1),this.options.persister?this.options.persister(h,m,this):h(m)},a=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:R(this,Ol),state:this.state,fetchFn:i};return s(h),h})();(u=this.options.behavior)==null||u.onFetch(a,this),ae(this,Ml,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Ve(this,Rs,Ji).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const l=h=>{var p,m,g,y;ew(h)&&h.silent||Ve(this,Rs,Ji).call(this,{type:"error",error:h}),ew(h)||((m=(p=R(this,Xr).config).onError)==null||m.call(p,h,this),(y=(g=R(this,Xr).config).onSettled)==null||y.call(g,this.state.data,h,this)),this.scheduleGc()};return ae(this,Bn,hB({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var p,m,g,y;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(b){l(b);return}(m=(p=R(this,Xr).config).onSuccess)==null||m.call(p,h,this),(y=(g=R(this,Xr).config).onSettled)==null||y.call(g,h,this.state.error,this),this.scheduleGc()},onError:l,onFail:(h,p)=>{Ve(this,Rs,Ji).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{Ve(this,Rs,Ji).call(this,{type:"pause"})},onContinue:()=>{Ve(this,Rs,Ji).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),R(this,Bn).start()}},Iu=new WeakMap,Ml=new WeakMap,Xr=new WeakMap,Ol=new WeakMap,Bn=new WeakMap,Dp=new WeakMap,Dl=new WeakMap,Rs=new WeakSet,Ji=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mB(r.data,this.options),fetchMeta:e.meta??null};case"success":return ae(this,Ml,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return ew(s)&&s.revert&&R(this,Ml)?{...R(this,Ml),fetchStatus:"idle"}
vendor: 3,703 bytes, line 381
381:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),cn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),R(this,Xr).notify({query:this,type:"updated",action:e})})},m2);function mB(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dB(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function fQ(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fi,g2,hQ=(g2=class extends Bd{constructor(e={}){super();Ne(this,fi);this.config=e,ae(this,fi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??pE(s,n);let o=this.get(i);return o||(o=new dQ({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){R(this,fi).has(e.queryHash)||(R(this,fi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=R(this,fi).get(e.queryHash);n&&(e.destroy(),n===e&&R(this,fi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){cn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return R(this,fi).get(e)}getAll(){return[...R(this,fi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Vj(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Vj(e,r)):n}notify(e){cn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){cn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fi=new WeakMap,g2),hi,Yn,Il,pi,Oo,y2,pQ=(y2=class extends pB{constructor(e){super();Ne(this,pi);Ne(this,hi);Ne(this,Yn);Ne(this,Il);this.mutationId=e.mutationId,ae(this,Yn,e.mutationCache),ae(this,hi,[]),this.state=e.state||gB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){R(this,hi).includes(e)||(R(this,hi).push(e),this.clearGcTimeout(),R(this,Yn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ae(this,hi,R(this,hi).filter(n=>n!==e)),this.scheduleGc(),R(this,Yn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){R(this,hi).length||(this.state.status==="pending"?this.scheduleGc():R(this,Yn).remove(this))}continue(){var e;return((e=R(this,Il))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,l,u,d,f,h,p,m,g,y,b,x,w,S,C,k,N,E;const n=()=>{Ve(this,pi,Oo).call(this,{type:"continue"})};ae(this,Il,hB({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(_,T)=>{Ve(this,pi,Oo).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{Ve(this,pi,Oo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,Yn).canRun(this)}));const r=this.state.status==="pending",s=!R(this,Il).canStart();try{if(r)n();else{Ve(this,pi,Oo).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=R(this,Yn).config).onMutate)==null?void 0:o.call(i,e,this));
381const T=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));T!==this.state.context&&Ve(this,pi,Oo).call(this,{type:"pending",context:T,variables:e,isPaused:s})}const _=await R(this,Il).start();return await((d=(u=R(this,Yn).config).onSuccess)==null?void 0:d.call(u,_,e,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,_,e,this.state.context)),await((m=(p=R(this,Yn).config).onSettled)==null?void 0:m.call(p,_,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,_,null,e,this.state.context)),Ve(this,pi,Oo).call(this,{type:"success",data:_}),_}catch(_){try{throw await((x=(b=R(this,Yn).config).onError)==null?void 0:x.call(b,_,e,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,_,e,this.state.context)),await((k=(C=R(this,Yn).config).onSettled)==null?void 0:k.call(C,void 0,_,this.state.variables,this.state.context,this)),await((E=(N=this.options).onSettled)==null?void 0:E.call(N,void 0,_,e,this.state.context)),_}finally{Ve(this,pi,Oo).call(this,{type:"error",error:_})}}finally{R(this,Yn).runNext(this)}}},hi=new WeakMap,Yn=new WeakMap,Il=new WeakMap,pi=new WeakSet,Oo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),cn.batch(()=>{R(this,hi).forEach(r=>{r.onMutationUpdate(e)}),R(this,Yn).notify({mutation:this,type:"updated",action:e})})},y2);function gB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var so,Ms,Ip,v2,mQ=(v2=class extends Bd{constructor(e={}){super();Ne(this,so);Ne(this,Ms);Ne(this,Ip);this.config=e,ae(this,so,new Set),ae(this,Ms,new Map),ae(this,Ip,0)}build(e,n,r){const s=new pQ({mutationCache:this,mutationId:++Cm(this,Ip)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){R(this,so).add(e);const n=qm(e);if(typeof n=="string"){const r=R(this,Ms).get(n);r?r.push(e):R(this,Ms).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(R(this,so).delete(e)){const n=qm(e);if(typeof n=="string"){const r=R(this,Ms).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&R(this,Ms).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=qm(e);if(typeof n=="string"){const r=R(this,Ms).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=qm(e);if(typeof n=="string"){const s=(r=R(this,Ms).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){cn.batch(()=>{R(this,so).forEach(e=>{this.notify({type:"removed",mutation:e})}),R(this,so).clear(),R(this,Ms).clear()})}getAll(){return Array.from(R(this,so))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>zj(n,r))}findAll(e={}){return this.getAll().filter(n=>zj(e,n))}notify(e){cn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return cn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Xn))))}},so=new WeakMap,Ms=new WeakMap,Ip=new WeakMap,v2);function qm(t){var e;return(e=t.options.scope)==null?void 0:e.id}function Ky(t){return{onFetch:(e,n)=>{var d,f,h,p,m;const r=e.options,s=(h=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((p=e.state.data)==null?void 0:p.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let g=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)}
vendor: 14,119 bytes, line 381
381)},b=cB(e.options,e.fetchOptions),x=async(w,S,C)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const N=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:C?"backward":"forward",meta:e.options.meta};return y(P),P})(),E=await b(N),{maxPages:_}=e.options,T=C?iQ:sQ;return{pages:T(w.pages,E,_),pageParams:T(w.pageParams,S,_)}};if(s&&i.length){const w=s==="backward",S=w?yB:YS,C={pages:i,pageParams:o},k=S(r,C);a=await x(C,k,w)}else{const w=t??i.length;do{const S=l===0?o[0]??r.initialPageParam:YS(r,a);if(l>0&&S==null)break;a=await x(a,S),l++}while(l<w)}return a};e.options.persister?e.fetchFn=()=>{var g,y;return(y=(g=e.options).persister)==null?void 0:y.call(g,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function YS(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function yB(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}function gQ(t,e){return e?YS(t,e)!=null:!1}function yQ(t,e){return!e||!t.getPreviousPageParam?!1:yB(t,e)!=null}var Bt,ea,ta,Lu,Fu,na,Bu,$u,x2,vQ=(x2=class{constructor(t={}){Ne(this,Bt);Ne(this,ea);Ne(this,ta);Ne(this,Lu);Ne(this,Fu);Ne(this,na);Ne(this,Bu);Ne(this,$u);ae(this,Bt,t.queryCache||new hQ),ae(this,ea,t.mutationCache||new mQ),ae(this,ta,t.defaultOptions||{}),ae(this,Lu,new Map),ae(this,Fu,new Map),ae(this,na,0)}mount(){Cm(this,na)._++,R(this,na)===1&&(ae(this,Bu,gE.subscribe(async t=>{t&&(await this.resumePausedMutations(),R(this,Bt).onFocus())})),ae(this,$u,qy.subscribe(async t=>{t&&(await this.resumePausedMutations(),R(this,Bt).onOnline())})))}unmount(){var t,e;Cm(this,na)._--,R(this,na)===0&&((t=R(this,Bu))==null||t.call(this),ae(this,Bu,void 0),(e=R(this,$u))==null||e.call(this),ae(this,$u,void 0))}isFetching(t){return R(this,Bt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return R(this,ea).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=R(this,Bt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=R(this,Bt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ca(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return R(this,Bt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=R(this,Bt).get(r.queryHash),i=s==null?void 0:s.state.data,o=nQ(e,i);if(o!==void 0)return R(this,Bt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return cn.batch(()=>R(this,Bt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=R(this,Bt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=R(this,Bt);cn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=R(this,Bt);return cn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=cn.batch(()=>R(this,Bt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Xn).catch(Xn)}invalidateQueries(t,e={}){return cn.batch(()=>(R(this,Bt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=cn.batch(()=>R(this,Bt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Xn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Xn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=R(this,Bt).build(this,e);return n.isStaleByTime(Ca(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Xn).catch(Xn)}fetchInfiniteQuery(t){return t.behavior=Ky(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Xn).catch(Xn)}ensureInfiniteQueryData(t){return t.behavior=Ky(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return qy.isOnline()?R(this,ea).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,Bt)}getMutationCache(){return R(this,ea)}getDefaultOptions(){return R(this,ta)}setDefaultOptions(t){ae(this,ta,t)}setQueryDefaults(t,e){R(this,Lu).set(ic(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...R(this,Lu).values()],n={};return e.forEach(r=>{Xh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){R(this,Fu).set(ic(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...R(this,Fu).values()],n={};return e.forEach(r=>{Xh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...R(this,ta).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=pE(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===mE&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...R(this,ta).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){R(this,Bt).clear(),R(this,ea).clear()}},Bt=new WeakMap,ea=new WeakMap,ta=new WeakMap,Lu=new WeakMap,Fu=new WeakMap,na=new WeakMap,Bu=new WeakMap,$u=new WeakMap,x2),mr,Qe,Lp,Qn,Ll,Vu,ra,sa,Fp,zu,Uu,Fl,Bl,ia,Wu,it,Ff,QS,JS,XS,ZS,ek,tk,nk,xB,b2,vB=(b2=class extends Bd{constructor(e,n){super();Ne(this,it);Ne(this,mr);Ne(this,Qe);Ne(this,Lp);Ne(this,Qn);Ne(this,Ll);Ne(this,Vu);Ne(this,ra);Ne(this,sa);Ne(this,Fp);Ne(this,zu);Ne(this,Uu);Ne(this,Fl);Ne(this,Bl);Ne(this,ia);Ne(this,Wu,new Set);this.options=n,ae(this,mr,e),ae(this,sa,null),ae(this,ra,GS()),this.options.experimental_prefetchInRender||R(this,ra).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Qe).addObserver(this),Hj(R(this,Qe),this.options)?Ve(this,it,Ff).call(this):this.updateResult(),Ve(this,it,ZS).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rk(R(this,Qe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rk(R(this,Qe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ve(this,it,ek).call(this),Ve(this,it,tk).call(this),R(this,Qe).removeObserver(this)}setOptions(e){const n=this.options,r=R(this,Qe);if(this.options=R(this,mr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Zr(this.options.enabled,R(this,Qe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ve(this,it,nk).call(this),R(this,Qe).setOptions(this.options),n._defaulted&&!Hy(this.options,n)&&R(this,mr).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Qe),observer:this});const s=this.hasListeners();s&&qj(R(this,Qe),r,this.options,n)&&Ve(this,it,Ff).call(this),this.updateResult(),s&&(R(this,Qe)!==r||Zr(this.options.enabled,R(this,Qe))!==Zr(n.enabled,R(this,Qe))||Ca(this.options.staleTime,R(this,Qe))!==Ca(n.staleTime,R(this,Qe)))&&Ve(this,it,QS).call(this);const i=Ve(this,it,JS).call(this);s&&(R(this,Qe)!==r||Zr(this.options.enabled,R(this,Qe))!==Zr(n.enabled,R(this,Qe))||i!==R(this,ia))&&Ve(this,it,XS).call(this,i)}getOptimisticResult(e){const n=R(this,mr).getQueryCache().build(R(this,mr),e),r=this.createResult(n,e);return bQ(this,r)&&(ae(this,Qn,r),ae(this,Vu,this.options),ae(this,Ll,R(this,Qe).state)),r}getCurrentResult(){return R(this,Qn)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){R(this,Wu).add(e)}getCurrentQuery(){return R(this,Qe)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=R(this,mr).defaultQueryOptions(e),r=R(this,mr).getQueryCache().build(R(this,mr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Ve(this,it,Ff).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,Qn)))}createResult(e,n){var _;const r=R(this,Qe),s=this.options,i=R(this,Qn),o=R(this,Ll),a=R(this,Vu),u=e!==r?e.state:R(this,Lp),{state:d}=e;let f={...d},h=!1,p;if(n._optimisticResults){const T=this.hasListeners(),P=!T&&Hj(e,n),j=T&&qj(e,r,n,s);(P||j)&&(f={...f,...mB(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:y}=f;p=f.data;let b=!1;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let T;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(T=i.data,b=!0):T=typeof n.placeholderData=="function"?n.placeholderData((_=R(this,Uu))==null?void 0:_.state.data,R(this,Uu)):n.placeholderData,T!==void 0&&(y="success",p=KS(i==null?void 0:i.data,T,n),h=!0)}if(n.select&&p!==void 0&&!b)if(i&&p===(o==null?void 0:o.data)&&n.select===R(this,Fp))p=R(this,zu);else try{ae(this,Fp,n.select),p=n.select(p),p=KS(i==null?void 0:i.data,p,n),ae(this,zu,p),ae(this,sa,null)}catch(T){ae(this,sa,T)}R(this,sa)&&(m=R(this,sa),p=R(this,zu),g=Date.now(),y="error");const x=f.fetchStatus==="fetching",w=y==="pending",S=y==="error",C=w&&x,k=p!==void 0,E={status:y,fetchStatus:f.fetchStatus,isPending:w,isSuccess:y==="success",isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!k,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&k,isStale:yE(e,n),refetch:this.refetch,promise:R(this,ra),isEnabled:Zr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=F=>{E.status==="error"?F.reject(E.error):E.data!==void 0&&F.resolve(E.data)},P=()=>{const F=ae(this,ra,E.promise=GS());T(F)},j=R(this,ra);switch(j.status){case"pending":e.queryHash===r.queryHash&&T(j);break;case"fulfilled":(E.status==="error"||E.data!==j.value)&&P();break;case"rejected":(E.status!=="error"||E.error!==j.reason)&&P();break}}return E}updateResult(){const e=R(this,Qn),n=this.createResult(R(this,Qe),this.options);if(ae(this,Ll,R(this,Qe).state),ae(this,Vu,this.options),R(this,Ll).data!==void 0&&ae(this,Uu,R(this,Qe)),Hy(n,e))return;ae(this,Qn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!R(this,Wu).size)return!0;const o=new Set(i??R(this,Wu));return this.options.throwOnError&&o.add("error"),Object.keys(R(this,Qn)).some(a=>{const l=a;return R(this,Qn)[l]!==e[l]&&o.has(l)})};Ve(this,it,xB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ve(this,it,ZS).call(this)}},mr=new WeakMap,Qe=new WeakMap,Lp=new WeakMap,Qn=new WeakMap,Ll=new WeakMap,Vu=new WeakMap,ra=new WeakMap,sa=new WeakMap,Fp=new WeakMap,zu=new WeakMap,Uu=new WeakMap,Fl=new WeakMap,Bl=new WeakMap,ia=new WeakMap,Wu=new WeakMap,it=new WeakSet,Ff=function(e){Ve(this,it,nk).call(this);let n=R(this,Qe).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Xn)),n},QS=function(){Ve(this,it,ek).call(this);const e=Ca(this.options.staleTime,R(this,Qe));if(sc||R(this,Qn).isStale||!HS(e))return;const r=aB(R(this,Qn).dataUpdatedAt,e)+1;ae(this,Fl,setTimeout(()=>{R(this,Qn).isStale||this.updateResult()},r))},JS=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Qe)):this.options.refetchInterval)??!1},XS=function(e){Ve(this,it,tk).call(this),ae(this,ia,e),!(sc||Zr(this.options.enabled,R(this,Qe))===!1||!HS(R(this,ia))||R(this,ia)===0)&&ae(this,Bl,setInterval(()=>{(this.options.refetchIntervalInBackground||gE.isFocused())&&Ve(this,it,Ff).call(this)},R(this,ia)))},ZS=function(){Ve(this,it,QS).call(this),Ve(this,it,XS).call(this,Ve(this,it,JS).call(this))},ek=function(){R(this,Fl)&&(clearTimeout(R(this,Fl)),ae(this,Fl,void 0))},tk=function(){R(this,Bl)&&(clearInterval(R(this,Bl)),ae(this,Bl,void 0))},nk=function(){const e=R(this,mr).getQueryCache().build(R(this,mr),this.options);if(e===R(this,Qe))return;const n=R(this,Qe);ae(this,Qe,e),ae(this,Lp,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},xB=function(e){cn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(R(this,Qn))}),R(this,mr).getQueryCache().notify({query:R(this,Qe),type:"observerResultsUpdated"})})},b2);function xQ(t,e){return Zr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Hj(t,e){return xQ(t,e)||t.state.data!==void 0&&rk(t,e,e.refetchOnMount)}function rk(t,e,n){if(Zr(e.enabled,t)!==!1&&Ca(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&yE(t,e)}return!1}function qj(t,e,n,r){return(t!==e||Zr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&yE(t,n)}function yE(t,e){return Zr(e.enabled,t)!==!1&&t.isStaleByTime(Ca(e.staleTime,t))}function bQ(t,e){return!Hy(t.getCurrentResult(),e)}var wQ=class extends vB{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Ky()})}getOptimisticResult(t){return t.behavior=Ky(),super.getOptimisticResult(t)}
381fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var m,g;const{state:n}=t,r=super.createResult(t,e),{isFetching:s,isRefetching:i,isError:o,isRefetchError:a}=r,l=(g=(m=n.fetchMeta)==null?void 0:m.fetchMore)==null?void 0:g.direction,u=o&&l==="forward",d=s&&l==="forward",f=o&&l==="backward",h=s&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:gQ(e,n.data),hasPreviousPage:yQ(e,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:a&&!u&&!f,isRefetching:i&&!d&&!h}}},oa,aa,gr,io,fo,Wg,sk,w2,SQ=(w2=class extends Bd{constructor(n,r){super();Ne(this,fo);Ne(this,oa);Ne(this,aa);Ne(this,gr);Ne(this,io);ae(this,oa,n),this.setOptions(r),this.bindMethods(),Ve(this,fo,Wg).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=R(this,oa).defaultMutationOptions(n),Hy(this.options,r)||R(this,oa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:R(this,gr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ic(r.mutationKey)!==ic(this.options.mutationKey)?this.reset():((s=R(this,gr))==null?void 0:s.state.status)==="pending"&&R(this,gr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=R(this,gr))==null||n.removeObserver(this)}onMutationUpdate(n){Ve(this,fo,Wg).call(this),Ve(this,fo,sk).call(this,n)}getCurrentResult(){return R(this,aa)}reset(){var n;(n=R(this,gr))==null||n.removeObserver(this),ae(this,gr,void 0),Ve(this,fo,Wg).call(this),Ve(this,fo,sk).call(this)}mutate(n,r){var s;return ae(this,io,r),(s=R(this,gr))==null||s.removeObserver(this),ae(this,gr,R(this,oa).getMutationCache().build(R(this,oa),this.options)),R(this,gr).addObserver(this),R(this,gr).execute(n)}},oa=new WeakMap,aa=new WeakMap,gr=new WeakMap,io=new WeakMap,fo=new WeakSet,Wg=function(){var r;const n=((r=R(this,gr))==null?void 0:r.state)??gB();ae(this,aa,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},sk=function(n){cn.batch(()=>{var r,s,i,o,a,l,u,d;if(R(this,io)&&this.hasListeners()){const f=R(this,aa).variables,h=R(this,aa).context;(n==null?void 0:n.type)==="success"?((s=(r=R(this,io)).onSuccess)==null||s.call(r,n.data,f,h),(o=(i=R(this,io)).onSettled)==null||o.call(i,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((l=(a=R(this,io)).onError)==null||l.call(a,n.error,f,h),(d=(u=R(this,io)).onSettled)==null||d.call(u,void 0,n.error,f,h))}this.listeners.forEach(f=>{f(R(this,aa))})})},w2),bB=v.createContext(void 0),xt=t=>{const e=v.useContext(bB);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},kQ=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(bB.Provider,{value:t,children:e})),wB=v.createContext(!1),CQ=()=>v.useContext(wB);wB.Provider;function NQ(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var EQ=v.createContext(NQ()),_Q=()=>v.useContext(EQ),TQ=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},AQ=t=>{v.useEffect(()=>{t.clearReset()},[t])},jQ=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||uB(n,[t.error,r])),PQ=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},RQ=(t,e)=>t.isLoading&&t.isFetching&&!e,MQ=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Kj=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function SB(t,e,n){var f,h,p,m,g;const r=CQ(),s=_Q(),i=xt(),o=i.defaultQueryOptions(t);(h=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,o),o._optimisticResults=r?"isRestoring":"optimistic",PQ(o),TQ(o,s),AQ(s);const a=!i.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new e(i,o)),u=l.getOptimisticResult(o),d=!r&&t.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(y=>{const b=d?l.subscribe(cn.batchCalls(y)):Xn;return l.updateResult(),b},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),MQ(o,u))throw Kj(o,l,s);if(jQ({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((m=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||m.call(p,o,u),o.experimental_prefetchInRender&&!sc&&RQ(u,r)){const y=a?Kj(o,l,s):(g=i.getQueryCache().get(o.queryHash))==null?void 0:g.promise;y==null||y.catch(Xn).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function ue(t,e){return SB(t,vB)}function Ee(t,e){const n=xt(),[r]=v.useState(()=>new SQ(n,t));v.useEffect(()=>{r.setOptions(t)},[r,t]);const s=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(cn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=v.useCallback((o,a)=>{r.mutate(o,a).catch(Xn)},[r]);if(s.error&&uB(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function kB(t,e){return SB(t,wQ)}/**
382 * @remix-run/router v1.23.0
383 *
384 * Copyright (c) Remix Software Inc.
385 *
386 * This source code is licensed under the MIT license found in the
387 * LICENSE.md file in the root directory of this source tree.
388 *
389 * @license MIT
390 */function Zh(){return Zh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Zh.apply(this,arguments)}var ua;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ua||(ua={}));const Gj="popstate";function OQ(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return ik("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Gy(s)}return IQ(e,n,null,t)}function Dt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function CB(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function DQ(){return Math.random().toString(36).substr(2,8)}function Yj(t,e){return{usr:t.state,key:t.key,idx:e}}function ik(t,e,n,r){return n===void 0&&(n=null),Zh({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?$d(e):e,{state:n,key:e&&e.key||r||DQ()})}function Gy(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function $d(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function IQ(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=ua.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(Zh({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=ua.Pop;let y=d(),b=y==null?null:y-u;u=y,l&&l({action:a,location:g.location,delta:b})}function h(y,b){a=ua.Push;let x=ik(g.location,y,b);u=d()+1;let w=Yj(x,u),S=g.createHref(x);try{o.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(S)}i&&l&&l({action:a,location:g.location,delta:1})}function p(y,b){a=ua.Replace;let x=ik(g.location,y,b);u=d();let w=Yj(x,u),S=g.createHref(x);o.replaceState(w,"",S),i&&l&&l({action:a,location:g.location,delta:0})}function m(y){let b=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof y=="string"?y:Gy(y);return x=x.replace(/ $/,"%20"),Dt(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let g={get action(){return a},get location(){return t(s,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Gj,f),l=y,()=>{s.removeEventListener(Gj,f),l=null}},createHref(y){return e(s,y)},createURL:m,encodeLocation(y){let b=m(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return g}var Qj;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Qj||(Qj={}));function LQ(t,e,n){return n===void 0&&(n="/"),FQ(t,e,n,!1)}function FQ(t,e,n,r){let s=typeof e=="string"?$d(e):e,i=ed(s.pathname||"/",n);if(i==null)return null;let o=NB(t);BQ(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=QQ(i);a=GQ(o[l],u,r)}return a}function NB(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Dt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not val
390id. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Na([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(Dt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),NB(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:qQ(u,i.index),routesMeta:d})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of EB(i.path))s(i,o,l)}),e}function EB(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=EB(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function BQ(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:KQ(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const $Q=/^:[\w-]+$/,VQ=3,zQ=2,UQ=1,WQ=10,HQ=-2,Jj=t=>t==="*";function qQ(t,e){let n=t.split("/"),r=n.length;return n.some(Jj)&&(r+=HQ),e&&(r+=zQ),n.filter(s=>!Jj(s)).reduce((s,i)=>s+($Q.test(i)?VQ:i===""?UQ:WQ),r)}function KQ(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function GQ(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,d=i==="/"?e:e.slice(i.length)||"/",f=Yy({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),h=l.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=Yy({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!f)return null;
vendor: 7,044 bytes, lines 390-399
390Object.assign(s,f.params),o.push({params:s,pathname:Na([i,f.pathname]),pathnameBase:eJ(Na([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Na([i,f.pathnameBase]))}return o}function Yy(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=YQ(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let g=a[f]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[f];return p&&!m?u[h]=void 0:u[h]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function YQ(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),CB(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function QQ(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return CB(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function ed(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function JQ(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?$d(t):t;return{pathname:n?n.startsWith("/")?n:XQ(n,e):e,search:tJ(r),hash:nJ(s)}}function XQ(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function tw(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ZQ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function vE(t,e){let n=ZQ(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xE(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=$d(t):(s=Zh({},t),Dt(!s.pathname||!s.pathname.includes("?"),tw("?","pathname","search",s)),Dt(!s.pathname||!s.pathname.includes("#"),tw("#","pathname","hash",s)),Dt(!s.search||!s.search.includes("#"),tw("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}a=f>=0?e[f]:"/"}let l=JQ(s,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Na=t=>t.join("/").replace(/\/\/+/g,"/"),eJ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),tJ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,nJ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function rJ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const _B=["post","put","patch","delete"];new Set(_B);const sJ=["get",..._B];new Set(sJ);/**
391 * React Router v6.30.1
392 *
393 * Copyright (c) Remix Software Inc.
394 *
395 * This source code is licensed under the MIT license found in the
396 * LICENSE.md file in the root directory of this source tree.
397 *
398 * @license MIT
399 */function ep(){return ep=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ep.apply(this,arguments)}const eb=v.createContext(null),TB=v.createContext(null),So=v.createContext(null),tb=v.createContext(null),Fi=v.createContext({outlet:null,matches:[],isDataRoute:!1}),AB=v.createContext(null);function iJ(t,e){let{relative:n}=e===void 0?{}:e;Vd()||Dt(!1);let{basename:r,navigator:s}=v.useContext(So),{hash:i,pathname:o,search:a}=nb(t,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:Na([r,o])),s.createHref({pathname:l,search:a,hash:i})}function Vd(){return v.useContext(tb)!=null}function Bi(){return Vd()||Dt(!1),v.useContext(tb).location}function jB(t){v.useContext(So).static||v.useLayoutEffect(t)}function Dn(){let{isDataRoute:t}=v.useContext(Fi);return t?wJ():oJ()}function oJ(){Vd()||Dt(!1);let t=v.useContext(eb),{basename:e,future:n,navigator:r}=v.useContext(So),{matches:s}=v.useContext(Fi),{pathname:i}=Bi(),o=JSON.stringify(vE(s,n.v7_relativeSplatPath)),a=v.useRef(!1);return jB(()=>{a.current=!0}),v.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=xE(u,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Na([e,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[e,r,o,i,t])}const aJ=v.createContext(null);function lJ(t){let e=v.useContext(Fi).outlet;return e&&v.createElement(aJ.Provider,{value:t},e)}function cJ(){let{matches:t}=v.useContext(Fi),e=t[t.length-1];return e?e.params:{}}function nb(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=v.useContext(So),{matches:s}=v.useContext(Fi),{pathname:i}=Bi(),o=JSON.stringify(vE(s,r.v7_relativeSplatPath));return v.useMemo(()=>xE(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function uJ(t,e){return dJ(t,e)}function dJ(t,e,n,r){Vd()||Dt(!1);let{navigator:s}=v.useContext(So),{matches:i}=v.useContext(Fi),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Bi(),d;if(e){var f;let y=typeof e=="string"?$d(e):e;l==="/"||(f=y.pathname)!=null&&f.startsWith(l)||Dt(!1),d=y}else d=u;let h=d.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=LQ(t,{pathname:p}),g=gJ(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Na([l,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Na([l,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return e&&g?v.createElement(tb.Provider,{value:{location:ep({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ua.Pop}},g):g}function fJ(){let t=bJ(),e=rJ(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application 
399Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},e),n?v.createElement("pre",{style:s},n):null,null)}const hJ=v.createElement(fJ,null);class pJ extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?v.createElement(Fi.Provider,{value:this.props.routeContext},v.createElement(AB.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mJ(t){let{routeContext:e,match:n,children:r}=t,s=v.useContext(eb);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Fi.Provider,{value:e},r)}function gJ(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Dt(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,m=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||m){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,m=!1,g=null,y=null;n&&(p=a&&f.route.id?a[f.route.id]:void 0,g=f.route.errorElement||hJ,l&&(u<0&&h===0?(m=!0,y=null):u===h&&(m=!0,y=f.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,h+1)),x=()=>{let w;return p?w=g:m?w=y:f.route.Component?w=v.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,v.createElement(mJ,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?v.createElement(pJ,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var PB=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(PB||{}),Qy=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Qy||{});function yJ(t){let e=v.useContext(eb);return e||Dt(!1),e}function vJ(t){let e=v.useContext(TB);return e||Dt(!1),e}function xJ(t){let e=v.useContext(Fi);return e||Dt(!1),e}function RB(t){let e=xJ(),n=e.matches[e.matches.length-1];return n.route.id||Dt(!1),n.route.id}function bJ(){var t;let e=v.useContext(AB),n=vJ(Qy.UseRouteError),r=RB(Qy.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function wJ(){let{router:t}=yJ(PB.UseNavigateStable),e=RB(Qy.UseNavigateStable),n=v.useRef(!1);return jB(()=>{n.current=!0}),v.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,ep({fromRouteId:e},i)))},[t,e])}function SJ(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Eu(t){let{to:e,replace:n,state:r,relative:s}=t;Vd()||Dt(!1);let{future:i,static:o}=v.useContext(So),{matches:a}=v.useContext(Fi),{pathname:l}=Bi(),u=Dn(),d=xE(e,vE(a,i.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return v.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function MB(t){return lJ(t.context)}function Xe(t){Dt(!1)}function kJ(t){let{basename:e="/",children:n=null,location:r,navigationType:s=ua.Pop,navigator:i,static:o=!1,future:a}=t;Vd()&&Dt(!1);let l=e.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:l,navigator:i,static:o,future:ep({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=$d(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:m="default"}=r,g=v.useMemo(()=>{let y=ed(d,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:m},navigationType:s}},[l,d,f,h,p,m,s]);return g==null?null:v.createElement(So.Provider,{value:u},v.createElement(tb.Provider,{children:n,value:g}))}function CJ(t){let{children:e,location:n}=t;return uJ(ok(e),n)}new Promise(()=>{});function ok(t,e){e===void 0&&(e=[]);let n=[];
399return v.Children.forEach(t,(r,s)=>{if(!v.isValidElement(r))return;let i=[...e,s];if(r.type===v.Fragment){n.push.apply(n,ok(r.props.children,i));return}r.type!==Xe&&Dt(!1),!r.props.index||!r.props.children||Dt(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=ok(r.props.children,i)),n.push(o)}),n}/**
400 * React Router DOM v6.30.1
401 *
402 * Copyright (c) Remix Software Inc.
403 *
404 * This source code is licensed under the MIT license found in the
405 * LICENSE.md file in the root directory of this source tree.
406 *
407 * @license MIT
408 */function Jy(){return Jy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Jy.apply(this,arguments)}function OB(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function NJ(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function EJ(t,e){return t.button===0&&(!e||e==="_self")&&!NJ(t)}function ak(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function _J(t,e){let n=ak(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const TJ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],AJ=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],jJ="6";try{window.__reactRouterVersion=jJ}catch{}const PJ=v.createContext({isTransitioning:!1}),RJ="startTransition",Xj=nN[RJ];function MJ(t){let{basename:e,children:n,future:r,window:s}=t,i=v.useRef();i.current==null&&(i.current=OQ({window:s,v5Compat:!0}));let o=i.current,[a,l]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=v.useCallback(f=>{u&&Xj?Xj(()=>l(f)):l(f)},[l,u]);return v.useLayoutEffect(()=>o.listen(d),[o,d]),v.useEffect(()=>SJ(r),[r]),v.createElement(kJ,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const OJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DJ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$e=v.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:d,viewTransition:f}=e,h=OB(e,TJ),{basename:p}=v.useContext(So),m,g=!1;if(typeof u=="string"&&DJ.test(u)&&(m=u,OJ))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=ed(S.pathname,p);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:g=!0}catch{}let y=iJ(u,{relative:s}),b=FJ(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:f});function x(w){r&&r(w),w.defaultPrevented||b(w)}return v.createElement("a",Jy({},h,{href:m||y,onClick:g||i?r:x,ref:n,target:l}))}),IJ=v.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:d}=e,f=OB(e,AJ),h=nb(l,{relative:f.relative}),p=Bi(),m=v.useContext(TB),{navigator:g,basename:y}=v.useContext(So),b=m!=null&&BJ(h)&&u===!0,x=g.encodeLocation?g.encodeLocation(h).pathname:h.pathname,w=p.pathname,S=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;s||(w=w.toLowerCase(),S=S?S.toLowerCase():null,x=x.toLowerCase()),S&&y&&(S=ed(S,y)||S);const C=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let k=w===x||!o&&w.startsWith(x)&&w.charAt(C)==="/",N=S!=null&&(S===x||!o&&S.startsWith(x)&&S.charAt(x.length)==="/"),E={isActive:k,isPending:N,isTransitioning:b},_=k?r:void 0,T;typeof i=="function"?T=i(E):T=[i,k?"active":null,N?"pending":null,b?"transitioning":null].filter(
408Boolean).join(" ");let P=typeof a=="function"?a(E):a;return v.createElement($e,Jy({},f,{"aria-current":_,className:T,ref:n,style:P,to:l,viewTransition:u}),typeof d=="function"?d(E):d)});var lk;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(lk||(lk={}));var Zj;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Zj||(Zj={}));function LJ(t){let e=v.useContext(eb);return e||Dt(!1),e}function FJ(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Dn(),u=Bi(),d=nb(t,{relative:o});return v.useCallback(f=>{if(EJ(f,n)){f.preventDefault();let h=r!==void 0?r:Gy(u)===Gy(d);l(t,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,d,r,s,n,t,i,o,a])}function kc(t){let e=v.useRef(ak(t)),n=v.useRef(!1),r=Bi(),s=v.useMemo(()=>_J(r.search,n.current?null:e.current),[r.search]),i=Dn(),o=v.useCallback((a,l)=>{const u=ak(typeof a=="function"?a(s):a);n.current=!0,i("?"+u,l)},[i,s]);return[s,o]}function BJ(t,e){e===void 0&&(e={});let n=v.useContext(PJ);n==null&&Dt(!1);let{basename:r}=LJ(lk.useViewTransitionState),s=nb(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=ed(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ed(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Yy(s.pathname,o)!=null||Yy(s.pathname,i)!=null}const nw=768;function $J(){const[t,e]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${nw-1}px)`),r=()=>{e(window.innerWidth<nw)};return n.addEventListener("change",r),e(window.innerWidth<nw),()=>n.removeEventListener("change",r)},[]),!!t}const tp=Sc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),K=v.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?Pd:"button";return c.jsx(o,{className:q(tp({variant:e,size:n,className:t})),ref:i,...s})});K.displayName="Button";const Je=v.forwardRef(({className:t,type:e,...n},r)=>c.jsx("input",{type:e,className:q("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Je.displayName="Input";var VJ="Separator",eP="horizontal",zJ=["horizontal","vertical"],DB=v.forwardRef((t,e)=>{const{decorative:n,orientation:r=eP,...s}=t,i=UJ(r)?r:eP,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return c.jsx(he.div,{"data-orientation":i,...a,...s,ref:e})});DB.displayName=VJ;function UJ(t){return zJ.includes(t)}var IB=DB;const _n=v.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>c.jsx(IB,{ref:s,decorative:n,orientation:e,className:q("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));_n.displayName=IB.displayName;var rw="focusScope.autoFocusOnMount",sw="focusScope.autoFocusOnUnmount",tP={bubbles:!1,cancelable:!0},WJ="FocusScope",rb=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=v.useState(null),u=en(s),d=en(i),f=v.useRef(null),h=We(e,g=>l(g)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let g=function(w){if(p.paused||!a)return;const S=w.target;a.contains(S)?f.current=S:Do(f.current,{select:!0})},y=function(w){if(p.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Do(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Do(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),v.useEffect(()=>{if(a){rP.add(p);const g=document.activeElement;if(!a.contains(g)){const b=new CustomEvent(rw,tP);a.addEventListener(rw,u),a.dispatchEvent(b),b.defaultPrevented||(HJ(QJ(LB(a)),{select:!0}),document.activeElement===g&&Do(a))}return()=>{a.removeEventListener(rw,u),setTimeout(()=>{const b=new CustomEvent(sw,tP);a.addEventListener(sw,d),a.dispatchEvent(b),b.defaultPrevented||Do(g??document.body,{select:!0}),a.removeEventListener(sw,d),rP.remove(p)}
vendor: 4,743 bytes, line 408
408,0)}}},[a,u,d,p]);const m=v.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(y&&b){const x=g.currentTarget,[w,S]=qJ(x);w&&S?!g.shiftKey&&b===S?(g.preventDefault(),n&&Do(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),n&&Do(S,{select:!0})):b===x&&g.preventDefault()}},[n,r,p.paused]);return c.jsx(he.div,{tabIndex:-1,...o,ref:h,onKeyDown:m})});rb.displayName=WJ;function HJ(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Do(r,{select:e}),document.activeElement!==n)return}function qJ(t){const e=LB(t),n=nP(e,t),r=nP(e.reverse(),t);return[n,r]}function LB(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function nP(t,e){for(const n of t)if(!KJ(n,{upTo:e}))return n}function KJ(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function GJ(t){return t instanceof HTMLInputElement&&"select"in t}function Do(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&GJ(t)&&e&&t.select()}}var rP=YJ();function YJ(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=sP(t,e),t.unshift(e)},remove(e){var n;t=sP(t,e),(n=t[0])==null||n.resume()}}}function sP(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function QJ(t){return t.filter(e=>e.tagName!=="A")}var iw=0;function bE(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??iP()),document.body.insertAdjacentElement("beforeend",t[1]??iP()),iw++,()=>{iw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),iw--}},[])}function iP(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var vi=function(){return vi=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vi.apply(this,arguments)};function zd(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function JJ(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})}function XJ(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Hg="right-scroll-bar-position",qg="width-before-scroll-bar",ZJ="with-scroll-bars-hidden",eX="--removed-body-scroll-bar-size";function ow(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function tX(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var nX=typeof window<"u"?v.useLayoutEffect:v.useEffect,oP=new WeakMap;function rX(t,e){var n=tX(null,function(r){return t.forEach(function(s){return ow(s,r)})});return nX(function(){var r=oP.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(a){i.has(a)||ow(a,null)}),i.forEach(function(a){s.has(a)||ow(a,o)})}oP.set(n,t)},[t]),n}function sX(t){return t}function iX(t,e){e===void 0&&(e=sX);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var l=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};
vendor: 4,534 bytes, lines 408-445
408u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function oX(t){t===void 0&&(t={});var e=iX(null);return e.options=vi({async:!0,ssr:!1},t),e}var FB=function(t){var e=t.sideCar,n=zd(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,vi({},n))};FB.isSideCarExport=!0;function aX(t,e){return t.useMedium(e),FB}var BB=oX(),aw=function(){},sb=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:aw,onWheelCapture:aw,onTouchMoveCapture:aw}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,p=t.noRelative,m=t.noIsolation,g=t.inert,y=t.allowPinchZoom,b=t.as,x=b===void 0?"div":b,w=t.gapMode,S=zd(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,k=rX([n,e]),N=vi(vi({},S),s);return v.createElement(v.Fragment,null,d&&v.createElement(C,{sideCar:BB,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),o?v.cloneElement(v.Children.only(a),vi(vi({},N),{ref:k})):v.createElement(x,vi({},N,{className:l,ref:k}),a))});sb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sb.classNames={fullWidth:qg,zeroRight:Hg};var lX=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cX(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=lX();return e&&t.setAttribute("nonce",e),t}function uX(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function dX(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var fX=function(){var t=0,e=null;return{add:function(n){t==0&&(e=cX())&&(uX(e,n),dX(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},hX=function(){var t=fX();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},$B=function(){var t=hX(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},pX={left:0,top:0,right:0,gap:0},lw=function(t){return parseInt(t||"",10)||0},mX=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[lw(n),lw(r),lw(s)]},gX=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return pX;var e=mX(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},yX=$B(),_u="data-scroll-locked",vX=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
409  .`.concat(ZJ,` {
410   overflow: hidden `).concat(r,`;
411   padding-right: `).concat(a,"px ").concat(r,`;
412  }
413  body[`).concat(_u,`] {
414    overflow: hidden `).concat(r,`;
415    overscroll-behavior: contain;
416    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
417    padding-left: `.concat(s,`px;
418    padding-top: `).concat(i,`px;
419    padding-right: `).concat(o,`px;
420    margin-left:0;
421    margin-top:0;
422    margin-right: `).concat(a,"px ").concat(r,`;
423    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
424  }
425  
426  .`).concat(Hg,` {
427    right: `).concat(a,"px ").concat(r,`;
428  }
429  
430  .`).concat(qg,` {
431    margin-right: `).concat(a,"px ").concat(r,`;
432  }
433  
434  .`).concat(Hg," .").concat(Hg,` {
435    right: 0 `).concat(r,`;
436  }
437  
438  .`).concat(qg," .").concat(qg,` {
439    margin-right: 0 `).concat(r,`;
440  }
441  
442  body[`).concat(_u,`] {
443    `).concat(eX,": ").concat(a,`px;
444  }
445`)},aP=function(){var t=parseInt(document.body.getAttribute(_u)||"0",10);return isFinite(t)?t:0},xX=function(){v.useEffect(function(){return document.body.setAttribute(_u,(aP()+1).toString()),function(){var t=aP()-1;t<=0?document.body.removeAttribute(_u):document.body.setAttribute(_u,t.toString())}},[])},bX=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;xX();var i=v.useMemo(function(){return gX(s)},[s]);return v.createElement(yX,{styles:vX(i,!e,s,n?"":"!important")})},ck=!1;if(typeof window<"u")try{var Km=Object.defineProperty({},"passive",{get:function(){return ck=!0,!0}});window.addEventListener("test",Km,Km),window.removeEventListener("test",Km,Km)}catch{ck=!1}
vendor: 5,200 bytes, lines 445-448
445var Pc=ck?{passive:!1}:!1,wX=function(t){return t.tagName==="TEXTAREA"},VB=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!wX(t)&&n[e]==="visible")},SX=function(t){return VB(t,"overflowY")},kX=function(t){return VB(t,"overflowX")},lP=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=zB(t,r);if(s){var i=UB(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CX=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},NX=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},zB=function(t,e){return t==="v"?SX(e):kX(e)},UB=function(t,e){return t==="v"?CX(e):NX(e)},EX=function(t,e){return t==="h"&&e==="rtl"?-1:1},_X=function(t,e,n,r,s){var i=EX(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,l=e.contains(a),u=!1,d=o>0,f=0,h=0;do{if(!a)break;var p=UB(t,a),m=p[0],g=p[1],y=p[2],b=g-y-i*m;(m||b)&&zB(t,a)&&(f+=b,h+=m);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(h)<1||!s))&&(u=!0),u},Gm=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},cP=function(t){return[t.deltaX,t.deltaY]},uP=function(t){return t&&"current"in t?t.current:t},TX=function(t,e){return t[0]===e[0]&&t[1]===e[1]},AX=function(t){return`
446  .block-interactivity-`.concat(t,` {pointer-events: none;}
447  .allow-interactivity-`).concat(t,` {pointer-events: all;}
448`)},jX=0,Rc=[];function PX(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(jX++)[0],i=v.useState($B)[0],o=v.useRef(t);v.useEffect(function(){o.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var g=XJ([t.lockRef.current],(t.shards||[]).map(uP),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=v.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var b=Gm(g),x=n.current,w="deltaX"in g?g.deltaX:x[0]-b[0],S="deltaY"in g?g.deltaY:x[1]-b[1],C,k=g.target,N=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&N==="h"&&k.type==="range")return!1;var E=lP(N,k);if(!E)return!0;if(E?C=N:(C=N==="v"?"h":"v",E=lP(N,k)),!E)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=C),!C)return!0;var _=r.current||C;return _X(_,y,g,_==="h"?w:S,!0)},[]),l=v.useCallback(function(g){var y=g;if(!(!Rc.length||Rc[Rc.length-1]!==i)){var b="deltaY"in y?cP(y):Gm(y),x=e.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&TX(C.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(uP).filter(Boolean).filter(function(C){return C.contains(y.target)}),S=w.length>0?a(y,w[0]):!o.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=v.useCallback(function(g,y,b,x){var w={name:g,delta:y,target:b,should:x,shadowParent:RX(b)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(g){n.current=Gm(g),r.current=void 0},[]),f=v.useCallback(function(g){u(g.type,cP(g),g.target,a(g,t.lockRef.current))},[]),h=v.useCallback(function(g){u(g.type,Gm(g),g.target,a(g,t.lockRef.current))},[]);v.useEffect(function(){return Rc.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Pc),document.addEventListener("touchmove",l,Pc),document.addEventListener("touchstart",d,Pc),function(){Rc=Rc.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,Pc),document.removeEventListener("touchmove",l,Pc),document.removeEventListener("touchstart",d,Pc)}},[]);var p=t.removeScrollBar,m=t.inert;return v.createElement(v.Fragment,null,m?v.createElement(i,{styles:AX(s)}):null,p?v.createElement(bX,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function RX(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const MX=aX(BB,PX);var ib=v.forwardRef(function(t,e){return v.createElement(sb,vi({},t,{ref:e,sideCar:MX}))});ib.classNames=sb.classNames;var OX=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Mc=new WeakMap,Ym=new WeakMap,Qm={},cw=0,WB=function(t){return t&&(t.host||WB(t.parentNode))},DX=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=WB(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},IX=function(t,e,n,r){var s=DX(e,Array.isArray(t)?t:[t]);Qm[n]||(Qm[n]=new WeakMap);var i=Qm[n],o=[],a=new Set,l=new Set(s),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};
vendor: 4,996 bytes, line 448
448s.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var p=h.getAttribute(r),m=p!==null&&p!=="false",g=(Mc.get(h)||0)+1,y=(i.get(h)||0)+1;Mc.set(h,g),i.set(h,y),o.push(h),g===1&&m&&Ym.set(h,!0),y===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return d(e),a.clear(),cw++,function(){o.forEach(function(f){var h=Mc.get(f)-1,p=i.get(f)-1;Mc.set(f,h),i.set(f,p),h||(Ym.has(f)||f.removeAttribute(r),Ym.delete(f)),p||f.removeAttribute(n)}),cw--,cw||(Mc=new WeakMap,Mc=new WeakMap,Ym=new WeakMap,Qm={})}},wE=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=OX(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),IX(r,s,n,"aria-hidden")):function(){return null}},ob="Dialog",[HB,qB]=dr(ob),[LX,Js]=HB(ob),KB=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=v.useRef(null),l=v.useRef(null),[u,d]=gs({prop:r,defaultProp:s??!1,onChange:i,caller:ob});return c.jsx(LX,{scope:e,triggerRef:a,contentRef:l,contentId:yn(),titleId:yn(),descriptionId:yn(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};KB.displayName=ob;var GB="DialogTrigger",YB=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(GB,n),i=We(e,s.triggerRef);return c.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":CE(s.open),...r,ref:i,onClick:fe(t.onClick,s.onOpenToggle)})});YB.displayName=GB;var SE="DialogPortal",[FX,QB]=HB(SE,{forceMount:void 0}),JB=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Js(SE,e);return c.jsx(FX,{scope:e,forceMount:n,children:v.Children.map(r,o=>c.jsx(fr,{present:n||i.open,children:c.jsx(Wp,{asChild:!0,container:s,children:o})}))})};JB.displayName=SE;var Xy="DialogOverlay",XB=v.forwardRef((t,e)=>{const n=QB(Xy,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Js(Xy,t.__scopeDialog);return i.modal?c.jsx(fr,{present:r||i.open,children:c.jsx($X,{...s,ref:e})}):null});XB.displayName=Xy;var BX=tc("DialogOverlay.RemoveScroll"),$X=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(Xy,n);return c.jsx(ib,{as:BX,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(he.div,{"data-state":CE(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),oc="DialogContent",ZB=v.forwardRef((t,e)=>{const n=QB(oc,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Js(oc,t.__scopeDialog);return c.jsx(fr,{present:r||i.open,children:i.modal?c.jsx(VX,{...s,ref:e}):c.jsx(zX,{...s,ref:e})})});ZB.displayName=oc;var VX=v.forwardRef((t,e)=>{const n=Js(oc,t.__scopeDialog),r=v.useRef(null),s=We(e,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return wE(i)},[]),c.jsx(e3,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:fe(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:fe(t.onFocusOutside,i=>i.preventDefault())})}),zX=v.forwardRef((t,e)=>{const n=Js(oc,t.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return c.jsx(e3,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),e3=v.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Js(oc,n),l=v.useRef(null),u=We(e,l);return bE(),c.jsxs(c.Fragment,{children:[c.jsx(rb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:c.jsx(Rd,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":CE(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(WX,{titleId:a.titleId}),c.jsx(qX,{contentRef:l,descriptionId:a.descriptionId})]})]})}),kE="DialogTitle",t3=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(kE,n);return c.jsx(he.h2,{id:s.titleId,...r,ref:e})});t3.displayName=kE;var n3="DialogDescription",r3=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(n3,n);return c.jsx(he.p,{id:s.descriptionId,...r,ref:e})});r3.displayName=n3;var s3="DialogClose",i3=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(s3,n);return c.jsx(he.button,{type:"button",...r,ref:e,onClick:fe(t.onClick,()=>s.onOpenChange(!1))})});
448i3.displayName=s3;function CE(t){return t?"open":"closed"}var o3="DialogTitleWarning",[UX,a3]=LK(o3,{contentName:oc,titleName:kE,docsSlug:"dialog"}),WX=({titleId:t})=>{const e=a3(o3),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
449
450If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
451
452For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},HX="DialogDescriptionWarning",qX=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a3(HX).contentName}}.`;return v.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},ab=KB,l3=YB,lb=JB,Ud=XB,Wd=ZB,Gp=t3,Yp=r3,cb=i3;const Qp=ab,KX=lb,c3=v.forwardRef(({className:t,...e},n)=>c.jsx(Ud,{className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));c3.displayName=Ud.displayName;const GX=Sc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out overflow-y-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Hd=v.forwardRef(({side:t="right",className:e,children:n,...r},s)=>c.jsxs(KX,{children:[c.jsx(c3,{}),c.jsxs(Wd,{ref:s,className:q(GX({side:t}),e),...r,children:[n,c.jsxs(cb,{className:"absolute right-4 top-4 roun
452ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(ji,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hd.displayName=Wd.displayName;const Jp=({className:t,...e})=>c.jsx("div",{className:q("flex flex-col space-y-2 text-center sm:text-left",t),...e});Jp.displayName="SheetHeader";const Xp=v.forwardRef(({className:t,...e},n)=>c.jsx(Gp,{ref:n,className:q("text-lg font-semibold text-foreground",t),...e}));Xp.displayName=Gp.displayName;const YX=v.forwardRef(({className:t,...e},n)=>c.jsx(Yp,{ref:n,className:q("text-sm text-muted-foreground",t),...e}));YX.displayName=Yp.displayName;function vt({className:t,...e}){return c.jsx("div",{className:q("animate-pulse rounded-md bg-muted",t),...e})}const QX="sidebar:state",JX=60*60*24*7,XX="16rem",ZX="18rem",eZ="3rem",tZ="b",u3=v.createContext(null);function qd(){const t=v.useContext(u3);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const d3=v.forwardRef(({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:s,children:i,...o},a)=>{const l=$J(),[u,d]=v.useState(!1),[f,h]=v.useState(t),p=e??f,m=v.useCallback(x=>{const w=typeof x=="function"?x(p):x;n?n(w):h(w),document.cookie=`${QX}=${w}; path=/; max-age=${JX}`},[n,p]),g=v.useCallback(()=>l?d(x=>!x):m(x=>!x),[l,m,d]);v.useEffect(()=>{const x=w=>{w.key===tZ&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[g]);const y=p?"expanded":"collapsed",b=v.useMemo(()=>({state:y,open:p,setOpen:m,isMobile:l,openMobile:u,setOpenMobile:d,toggleSidebar:g}),[y,p,m,l,u,d,g]);return c.jsx(u3.Provider,{value:b,children:c.jsx(iB,{delayDuration:0,children:c.jsx("div",{style:{"--sidebar-width":XX,"--sidebar-width-icon":eZ,...s},className:q("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:a,...o,children:i})})})});d3.displayName="SidebarProvider";const f3=v.forwardRef(({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:s,...i},o)=>{const{isMobile:a,state:l,openMobile:u,setOpenMobile:d}=qd();return n==="none"?c.jsx("div",{className:q("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:s}):a?c.jsx(Qp,{open:u,onOpenChange:d,...i,children:c.jsx(Hd,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ZX},side:t,children:c.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):c.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":e,"data-side":t,children:[c.jsx("div",{className:q("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),c.jsx("div",{className:q("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=right]:border-l",r),...i,children:c.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});f3.displayName="Sidebar";const NE=v.forwardRef(({className:t,onClick:e,...n},r)=>{const{toggleSidebar:s,state:i}=qd();return c.jsxs(K,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:q("h-7 w-7",t),onClick:o=>{e==null||e(o),s()},...n,children:[i==="expanded"?c.jsx(G9,{}):c.jsx(Y9,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});NE.displayName="SidebarTrigger";const nZ=v.forwardRef(({className:t,...e},n)=>{const{toggleSidebar:r}=qd();return c.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:q("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})});nZ.displayName="SidebarRail";const rZ=v.forwardRef(({className:t,...e},n)=>c.jsx("main",{ref:n,className:q("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
452h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e}));rZ.displayName="SidebarInset";const sZ=v.forwardRef(({className:t,...e},n)=>c.jsx(Je,{ref:n,"data-sidebar":"input",className:q("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...e}));sZ.displayName="SidebarInput";const h3=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,"data-sidebar":"header",className:q("flex flex-col gap-2 p-2",t),...e}));h3.displayName="SidebarHeader";const iZ=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,"data-sidebar":"footer",className:q("flex flex-col gap-2 p-2",t),...e}));iZ.displayName="SidebarFooter";const oZ=v.forwardRef(({className:t,...e},n)=>c.jsx(_n,{ref:n,"data-sidebar":"separator",className:q("mx-2 w-auto bg-sidebar-border",t),...e}));oZ.displayName="SidebarSeparator";const p3=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,"data-sidebar":"content",className:q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e}));p3.displayName="SidebarContent";const m3=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,"data-sidebar":"group",className:q("relative flex w-full min-w-0 flex-col p-2",t),...e}));m3.displayName="SidebarGroup";const aZ=v.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const s=e?Pd:"div";return c.jsx(s,{ref:r,"data-sidebar":"group-label",className:q("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})});aZ.displayName="SidebarGroupLabel";const lZ=v.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const s=e?Pd:"button";return c.jsx(s,{ref:r,"data-sidebar":"group-action",className:q("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...n})});lZ.displayName="SidebarGroupAction";const g3=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,"data-sidebar":"group-content",className:q("w-full text-sm",t),...e}));g3.displayName="SidebarGroupContent";const y3=v.forwardRef(({className:t,...e},n)=>c.jsx("ul",{ref:n,"data-sidebar":"menu",className:q("flex w-full min-w-0 flex-col gap-1",t),...e}));y3.displayName="SidebarMenu";const Ns=v.forwardRef(({className:t,...e},n)=>c.jsx("li",{ref:n,"data-sidebar":"menu-item",className:q("group/menu-item relative",t),...e}));Ns.displayName="SidebarMenuItem";const cZ=Sc("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Es=v.forwardRef(({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:s,className:i,...o},a)=>{const l=t?Pd:"button",{isMobile:u,state:d}=qd(),f=c.jsx(l,{ref:a,"data-sidebar":"menu-button","data-size":r,"data-active":e,className:q(cZ({variant:n,size:r}),i),...o});return s?(typeof s=="string"&&(s={children:s}),c.jsxs(eQ,{children:[c.jsx(tQ,{asChild:!0,children:f}),c.jsx(oB,{side:"right",align:"center",hidden:d!=="collapsed"||u,...s})]})):f});Es.displayName="SidebarMenuButton";const uZ=v.forwardRef(({className:t,asChild:e=!1,showOnHover:n=!1,...r},s)=>{const i=e?Pd:"button";return c.jsx(i,{ref:s,"data-sidebar":"menu-action",className:q("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...r})});uZ.displayName="SidebarMenuAction";const dZ=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:q("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e}));dZ.displayName="SidebarMenuBadge";const fZ=v.forwardRef(({className:t,showIcon:e=!1,...n},r)=>{const s=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return c.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:q("flex h-8 items-center gap-2 rounded-md px-2",t),...n,children:[e&&c.jsx(vt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),c.jsx(vt,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});fZ.displayName="SidebarMenuSkeleton";const hZ=v.forwardRef(({className:t,...e},n)=>c.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:q("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e}));hZ.displayName="SidebarMenuSub";const pZ=v.forwardRef(({...t},e)=>c.jsx("li",{ref:e,...t}));pZ.displayName="SidebarMenuSubItem";const mZ=v.forwardRef(({asChild:t=!1,size:e="md",isActive:n,className:r,...s},i)=>{const o=t?Pd:"a";return c.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:q("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...s})});mZ.displayName="SidebarMenuSubButton";const Mr=v.forwardRef(({className:t,activeClassName:e,pendingClassName:n,to:r,...s},i)=>c.jsx(IJ,{ref:i,to:r,className:({isActive:o,isPending:a})=>q(t,o&&e,a&&n),...s}));Mr.displayName="NavLink";const gZ=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);
452class EE extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class yZ extends EE{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class dP extends EE{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class fP extends EE{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var uk;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(uk||(uk={}));class vZ{constructor(e,{headers:n={},customFetch:r,region:s=uk.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=gZ(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return JJ(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:a,method:l,body:u,signal:d,timeout:f}=r;let h={},{region:p}=r;p||(p=this.region);const m=new URL(`${this.url}/${n}`);p&&p!=="any"&&(h["x-region"]=p,m.searchParams.set("forceFunctionRegion",p));let g;u&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(h["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(h["Content-Type"]="application/json",g=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?g=JSON.stringify(u):g=u;let y=d;f&&(o=new AbortController,i=setTimeout(()=>o.abort(),f),d?(y=o.signal,d.addEventListener("abort",()=>o.abort())):y=o.signal);const b=yield this.fetch(m.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:g,signal:y}).catch(C=>{throw new yZ(C)}),x=b.headers.get("x-relay-error");if(x&&x==="true")throw new dP(b);if(!b.ok)throw new fP(b);let w=((s=b.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),S;return w==="application/json"?S=yield b.json():w==="application/octet-stream"||w==="application/pdf"?S=yield b.blob():w==="text/event-stream"?S=b:w==="multipart/form-data"?S=yield b.formData():S=yield b.text(),{data:S,error:null,response:b}}catch(a){return{data:null,error:a,response:a instanceof fP||a instanceof dP?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const v3=3,hP=t=>Math.min(1e3*2**t,3e4),xZ=[520,503],x3=["GET","HEAD","OPTIONS"];var bZ=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
452de=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function pP(t,e){return new Promise(n=>{if(e!=null&&e.aborted){n();return}const r=setTimeout(()=>{e==null||e.removeEventListener("abort",s),n()},t);function s(){clearTimeout(r),n()}e==null||e.addEventListener("abort",s)})}function wZ(t,e,n,r){return!(!r||n>=v3||!x3.includes(t)||!xZ.includes(e))}var SZ=class{constructor(t){var e,n,r,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=t.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=t.retry)!==null&&i!==void 0?i:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let i=(async()=>{let o=0;for(;;){const u=new Headers(n.headers);o>0&&u.set("X-Retry-Count",String(o));let d;try{d=await r(n.url.toString(),{method:n.method,headers:u,body:JSON.stringify(n.body),signal:n.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!x3.includes(n.method))throw f;if(n.retryEnabled&&o<v3){const h=hP(o);o++,await pP(h,n.signal);continue}throw f}if(wZ(n.method,d.status,o,n.retryEnabled)){var a,l;const f=(a=(l=d.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,h=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:hP(o);await d.text(),o++,await pP(h,n.signal);continue}return await n.processResponse(d)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let l="",u="",d="";const f=o==null?void 0:o.cause;if(f){var h,p,m,g;const x=(h=f==null?void 0:f.message)!==null&&h!==void 0?h:"",w=(p=f==null?void 0:f.code)!==null&&p!==void 0?p:"";l=`${(m=o==null?void 0:o.name)!==null&&m!==void 0?m:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
453
454Caused by: ${(g=f==null?void 0:f.name)!==null&&g!==void 0?g:"Error"}: ${x}`,w&&(l+=` (${w})`),f!=null&&f.stack&&(l+=`
455${f.stack}`)}else{var y;l=(y=o==null?void 0:o.stack)!==null&&y!==void 0?y:""}const b=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(u+=`. Your request URL is ${b} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
455)),i.then(t,e)}async processResponse(t){var e=this;let n=null,r=null,s=null,i=t.status,o=t.statusText;if(t.ok){var a,l;if(e.method!=="HEAD"){var u;const h=await t.text();h===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((u=e.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?r=h:r=JSON.parse(h))}const d=(a=e.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),f=(l=t.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");d&&f&&f.length>1&&(s=parseInt(f[1])),e.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,i=406,o="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const d=await t.text();try{n=JSON.parse(d),Array.isArray(n)&&t.status===404&&(r=[],n=null,i=200,o="OK")}catch{t.status===404&&d===""?(i=204,o="No Content"):n={message:d}}if(n&&e.shouldThrowOnError)throw new bZ(n)}return{success:n===null,error:n,data:r,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},kZ=class extends SZ{select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(i,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:i="text"}={}){var o;const a=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const mP=new RegExp("[,()]");var Wc=class extends kZ{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&mP.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&mP.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${s}fts${i}.${e}`),this}match(t){return Object.entries(t).filter(([e,n])=>
455n!==void 0).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},CZ=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:i}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},s=n?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),r&&l.append("Prefer",`count=${r}`),new Wc({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),n||o.append("Prefer","missing=default"),Array.isArray(t)){const a=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(a.length>
4550){const l=[...new Set(a)].map(u=>`"${u}"`);i.searchParams.set("columns",l.join(","))}}return new Wc({method:s,url:i,headers:o,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),r&&l.append("Prefer",`count=${r}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);a.searchParams.set("columns",d.join(","))}}return new Wc({method:o,url:a,headers:l,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var n;const r="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Wc({method:r,url:s,headers:i,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Wc({method:n,url:r,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function np(t){"@babel/helpers - typeof";return np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},np(t)}function NZ(t,e){if(np(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function EZ(t){var e=NZ(t,"string");return np(e)=="symbol"?e:e+""}function _Z(t,e,n){return(e=EZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gP(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Jm(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gP(Object(n),!0).forEach(function(r){_Z(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gP(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var TZ=class b3{constructor(e,{headers:n={},schema:r,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:a}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=o;const l=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,d)=>{const f=new AbortController,h=setTimeout(()=>f.abort(),i),p=d==null?void 0:d.signal;if(p){if(p.aborted)return clearTimeout(h),l(u,d);const m=()=>{clearTimeout(h),f.abort()};return p.addEventListener("abort",m,{once:!0}),l(u,Jm(Jm({},d),{},{signal:f.signal})).finally(()=>{clearTimeout(h),p.removeEventListener("abort",m)})}return l(u,Jm(Jm({},d),{},{signal:f.signal})).finally(()=>clearTimeout(h))}:this.fetch=l,this.retry=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new CZ(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new b3(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,n={},{head:r=!1,get:s=!1,count:i}={}){var o;let a;const l=new URL(`${this.url}/rpc/${e}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),f=r&&Object.values(n).some(d);f?(a="POST",u=n):r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([p,m])=>m!==void 0).map(([p,m])=>[p,Array.isArray(m)?`{${m.join(",")}}`:`${m}
455`]).forEach(([p,m])=>{l.searchParams.append(p,m)})):(a="POST",u=n);const h=new Headers(this.headers);return f?h.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&h.set("Prefer",`count=${i}`),new Wc({method:a,url:l,headers:h,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class AZ{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const s=r.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
456import ws from "ws"
457new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=`
458
459Suggested solution: ${e.workaround}`),new Error(n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const jZ="2.103.0",PZ=`realtime-js/${jZ}`,RZ="1.0.0",w3="2.0.0",MZ=w3,OZ=1e4,DZ=100,Ko={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},S3={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},dk={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class IZ{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const s=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var n,r;const s=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,n,r){var s,i;const o=e.topic,a=(s=e.ref)!==null&&s!==void 0?s:"",l=(i=e.join_ref)!==null&&i!==void 0?i:"",u=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+u.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+h);let m=new DataView(p),g=0;m.setUint8(g++,this.KINDS.userBroadcastPush),m.setUint8(g++,l.length),m.setUint8(g++,a.length),m.setUint8(g++,o.length),m.setUint8(g++,u.length),m.setUint8(g++,f.length),m.setUint8(g++,n),Array.from(l,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(a,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(o,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(u,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(f,b=>m.setUint8(g++,b.charCodeAt(0)));var y=new Uint8Array(p.byteLength+r.byteLength);return y.set(new Uint8Array(p),0),y.set(new Uint8Array(r),p.byteLength),y.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[s,i,o,a,l]=r;
459return n({join_ref:s,ref:i,topic:o,event:a,payload:l})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,s)}}_decodeUserBroadcast(e,n,r){const s=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),a=n.getUint8(4);let l=this.HEADER_LENGTH+4;const u=r.decode(e.slice(l,l+s));l=l+s;const d=r.decode(e.slice(l,l+i));l=l+i;const f=r.decode(e.slice(l,l+o));l=l+o;const h=e.slice(l,e.byteLength),p=a===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,m={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(m.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}var bt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(bt||(bt={}));const yP=(t,e,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((i,o)=>(i[o]=LZ(o,t,e,s),i),{}):{}},LZ=(t,e,n,r)=>{const s=e.find(a=>a.name===t),i=s==null?void 0:s.type,o=n[t];return i&&!r.includes(i)?k3(i,o):fk(o)},k3=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return VZ(e,n)}switch(t){case bt.bool:return FZ(e);case bt.float4:case bt.float8:case bt.int2:case bt.int4:case bt.int8:case bt.numeric:case bt.oid:return BZ(e);case bt.json:case bt.jsonb:return $Z(e);case bt.timestamp:return zZ(e);case bt.abstime:case bt.date:case bt.daterange:case bt.int4range:case bt.int8range:case bt.money:case bt.reltime:case bt.text:case bt.time:case bt.timestamptz:case bt.timetz:case bt.tsrange:case bt.tstzrange:return fk(e);default:return fk(e)}},fk=t=>t,FZ=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},BZ=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},$Z=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},VZ=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let i;const o=t.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>k3(e,a))}return t},zZ=t=>typeof t=="string"?t.replace(" ","T"):t,C3=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var ih=t=>typeof t=="function"?t:function(){return t},UZ=typeof self<"u"?self:null,Hc=typeof window<"u"?window:null,ui=UZ||Hc||globalThis,WZ="2.0.0",HZ=1e4,qZ=1e3,mi={connecting:0,open:1,closing:2,closed:3},pr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},eo={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},hk={longpoll:"longpoll",websocket:"websocket"},KZ={complete:4},pk="base64url.bearer.phx.",Xm=class{constructor(t,e,n,r){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}
vendor: 20,330 bytes, lines 459-460
459matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},N3=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},GZ=class{constructor(t,e,n){this.state=pr.closed,this.topic=t,this.params=ih(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Xm(this,eo.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new N3(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=pr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=pr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=pr.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=pr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Xm(this,eo.leave,ih({}),this.timeout).send(),this.state=pr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(eo.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=pr.closed,this.bindings=[]}onClose(t){this.on(eo.close,t)}onError(t){return this.on(eo.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>"u"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Xm(this,t,function(){return e},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=pr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(eo.close,"leave")},n=new Xm(this,eo.leave,ih({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}filterBindings(t,e,n){return!0}isMember(t,e,n,r){return this.topic!==t?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=pr.joining,this.joinPush.resend(t))}trigger(t,e,n,r){let s=this.onMessage(t,e,n,r);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===t&&this.filterBindings(o,e,n));for(let o=0;o<i.length;o++)i[o].callback(s,n,r||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===pr.closed}isErrored(){return this.state===pr.errored}isJoined(){return this.state===pr.joined}isJoining(){return this.state===pr.joining}isLeaving(){return this.state===pr.leaving}},Zy=class{static request(t,e,n,r,s,i,o){if(ui.XDomainRequest){let a=new ui.XDomainRequest;return this.xdomainRequest(a,t,e,r,s,i,o)}else if(ui.XMLHttpRequest){let a=new ui.XMLHttpRequest;return this.xhrRequest(a,t,e,n,r,s,i,o)}else{if(ui.fetch&&ui.AbortController)return this.fetchRequest(t,e,n,r,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,n,r,s,i,o){let a={method:t,headers:n,body:r},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),a.signal=l.signal),ui.fetch(e,a).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),l}static xdomainRequest(t,e,n,r,s,i,o){return t.timeout=s,t.open(e,n),t.onload=()=>{let a=this.parseJSON(t.responseText);o&&o(a)},i&&(t.ontimeout=i),t.onprogress=()=>{},t.send(r),t}static xhrRequest(t,e,n,r,s,i,o,a){t.open(e,n,!0),t.timeout=i;for(let[l,u]of Object.entries(r))t.setRequestHeader(l,u);return t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===KZ.complete&&a){let l=this.parseJSON(t.responseText);a(l)}},o&&(t.ontimeout=o),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let s=e?`${e}[${r}]`:r,i=t[r];typeof i=="object"?n.push(this.serialize(i,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},YZ=t=>{let e="",n=new Uint8Array(t),r=n.byteLength;for(let s=0;s<r;s++)e+=String.fromCharCode(n[s]);return btoa(e)},Oc=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(pk)&&(this.authToken=atob(e[1].slice(pk.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=mi.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+hk.websocket),"$1/"+hk.longpoll)}endpointURL(){return Zy.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=mi.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===mi.open||this.readyState===mi.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:n,token:r,messages:s}=e;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=mi.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(t){typeof t!="string"&&(t=YZ(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
460`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,n){for(let s of this.reqs)s.abort();this.readyState=mi.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(t,e,n,r,s){let i,o=()=>{this.reqs.delete(i),r()};i=Zy.request(t,this.endpointURL(),e,n,this.timeout,o,a=>{this.reqs.delete(i),this.isActive()&&s(a)}),this.reqs.add(i)}},QZ=class Bf{constructor(e,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Bf.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=Bf.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel.on(r.diff,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Bf.syncDiff(this.state,s,i,o),a())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Bf.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,n,r,s){let i=this.clone(e),o={},a={};return this.map(i,(l,u)=>{n[l]||(a[l]=u)}),this.map(n,(l,u)=>{let d=i[l];if(d){let f=u.metas.map(g=>g.phx_ref),h=d.metas.map(g=>g.phx_ref),p=u.metas.filter(g=>h.indexOf(g.phx_ref)<0),m=d.metas.filter(g=>f.indexOf(g.phx_ref)<0);p.length>0&&(o[l]=u,o[l].metas=p),m.length>0&&(a[l]=this.clone(d),a[l].metas=m)}else o[l]=u}),this.syncDiff(i,{joins:o,leaves:a},r,s)}static syncDiff(e,n,r,s){let{joins:i,leaves:o}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(i,(a,l)=>{let u=e[a];if(e[a]=this.clone(l),u){let d=e[a].metas.map(h=>h.phx_ref),f=u.metas.filter(h=>d.indexOf(h.phx_ref)<0);e[a].metas.unshift(...f)}r(a,u,l)}),this.map(o,(a,l)=>{let u=e[a];if(!u)return;let d=l.metas.map(f=>f.phx_ref);u.metas=u.metas.filter(f=>d.indexOf(f.phx_ref)<0),s(a,u,l),u.metas.length===0&&delete e[a]}),e}static list(e,n){return n||(n=function(r,s){return s}),this.map(e,(r,s)=>n(r,s))}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Zm={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,r,s,i,o]=JSON.parse(t);return e({join_ref:n,ref:r,topic:s,event:i,payload:o})}},binaryEncode(t){let{join_ref:e,ref:n,event:r,topic:s,payload:i}=t,o=this.META_LENGTH+e.length+n.length+s.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,e.length),l.setUint8(u++,n.length),l.setUint8(u++,s.length),l.setUint8(u++,r.length),Array.from(e,f=>l.setUint8(u++,f.charCodeAt(0))),Array.from(n,f=>l.setUint8(u++,f.charCodeAt(0))),Array.from(s,f=>l.setUint8(u++,f.charCodeAt(0))),Array.from(r,f=>l.setUint8(u++,f.charCodeAt(0)));var d=new Uint8Array(a.byteLength+i.byteLength);return d.set(new Uint8Array(a),0),d.set(new Uint8Array(i),a.byteLength),d.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,r);case this.KINDS.reply:return this.decodeReply(t,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,r)}},decodePush(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(t.slice(o,o+r));o=o+r;let l=n.decode(t.slice(o,o+s));o=o+s;let u=n.decode(t.slice(o,o+i));o=o+i;let d=t.slice(o,t.byteLength);return{join_ref:a,ref:null,topic:l,event:u,payload:d}},decodeReply(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(t.slice(a,a+r));a=a+r;let u=n.decode(t.slice(a,a+s));a=a+s;let d=n.decode(t.slice(a,a+i));a=a+i;let f=n.decode(t.slice(a,a+o));a=a+o;let h=t.slice(a,t.byteLength),p={status:f,response:h};return{join_ref:l,ref:u,topic:d,event:eo.reply,payload:p}},decodeBroadcast(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),i=this.HEADER_LENGTH+2,o=n.decode(t.slice(i,i+r));i=i+r;let a=n.decode(t.slice(i,i+s));i=i+s;let l=t.slice(i,t.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},JZ=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||HZ,this.transport=e.transport||ui.WebSocket||Oc,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||ui&&ui.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Zm.encode.bind(Zm),this.defaultDecoder=Zm.decode.bind(Zm),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Oc?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Hc&&Hc.addEventListener&&(Hc.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Hc.addEventListener("pageshow",r=>{n===this.connectClock&&(n=null,this.connect())}),Hc.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=r=>e.rejoinAfterMs?e.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>e.reconnectAfterMs?e.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(r,s,i)=>{console.log(`${r}: ${s}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=ih(e.params||{}),this.endPoint=`${t}/${hk.websocket}`,this.vsn=e.vsn||WZ,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new N3(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Oc}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Zy.appendParams(Zy.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ih(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Oc?this.connectWithFallback(Oc,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let r=this.onMessage(s=>{s.ref===e&&(this.off([r]),t(Date.now()-n))});return!0}transportName(t){switch(t){case Oc:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${pk}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,s,i,o=this.transportName(t),a=l=>{this.log("transport",`falling back to ${o}...`,l),this.off([s,i]),r=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,e),i=this.onError(l=>{this.log("transport","error",l),r&&!n&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let l=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),qZ,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();const r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){}
vendor: 6,446 bytes, line 460
460,this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,n=1){if(n===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,n+1)},150*n)}waitForSocketClosed(t,e,n=1){if(n===5||t.readyState===mi.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,n+1)},150*n)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",t,e,n),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(eo.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case mi.connecting:return"connecting";case mi.open:return"open";case mi.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new GZ(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:r,ref:s,join_ref:i}=t;this.log("push",`${e} ${n} (${i}, ${s})`,r)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:n,event:r,payload:s,ref:i,join_ref:o}=e;if(i&&i===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${n} ${r} ${i&&"("+i+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(n,r,s,o)&&l.trigger(r,s,i,o)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([n,r])=>{try{r(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class oh{constructor(e,n){const r=ZZ(n);this.presence=new QZ(e.getChannel(),r),this.presence.onJoin((s,i,o)=>{const a=oh.onJoinPayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onLeave((s,i,o)=>{const a=oh.onLeavePayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return oh.transformState(this.presence.state)}static transformState(e){return e=XZ(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const s=e[r];return n[r]=Kg(s),n},{})}static onJoinPayload(e,n,r){const s=vP(n),i=Kg(r);return{event:"join",key:e,currentPresences:s,newPresences:i}}static onLeavePayload(e,n,r){const s=vP(n),i=Kg(r);return{event:"leave",key:e,currentPresences:s,leftPresences:i}}}function Kg(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function XZ(t){return JSON.parse(JSON.stringify(t))}function ZZ(t){return(t==null?void 0:t.events)&&{events:t.events}}function vP(t){return t!=null&&t.metas?Kg(t):[]}var xP;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(xP||(xP={}));class eee{get state(){return this.presenceAdapter.state}constructor(e,n){this.channel=e,this.presenceAdapter=new oh(this.channel.channelAdapter,n)}}class tee{constructor(e,n,r){const s=nee(r);this.channel=e.getSocket().channel(n,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,n){return this.channel.on(e,n)}off(e,n){this.channel.off(e,n)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,n,r){let s;try{s=this.channel.push(e,n,r)}catch{throw`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>DZ){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(e){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),e)}canPush(){return this.socket.isConnected()&&this.state===Ko.joined}isJoined(){return this.state===Ko.joined}isJoining(){return this.state===Ko.joining}isClosed(){return this.state===Ko.closed}isLeaving(){return this.state===Ko.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function nee(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var bP;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELET
460E="DELETE"})(bP||(bP={}));var hu;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(hu||(hu={}));var to;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(to||(to={}));class ah{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,n={config:{}},r){var s,i;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new tee(this.socket.socketAdapter,e,this.params),this.presence=new eee(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=C3(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:a,private:l}}=this.params,u=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[hu.PRESENCE]&&this.bindings[hu.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},h={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>{e==null||e(to.CHANNEL_ERROR,p)}),this._onClose(()=>e==null?void 0:e(to.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(to.SUBSCRIBED);return}this._updatePostgresBindings(p,e)}).receive("error",p=>{this.state=Ko.errored,e==null||e(to.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(to.TIMED_OUT)})}return this}_updatePostgresBindings(e,n){var r;const s=this.bindings.postgres_changes,i=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,o=[];for(let a=0;a<i;a++){const l=s[a],{filter:{event:u,schema:d,table:f,filter:h}}=l,p=e&&e[a];if(p&&p.event===u&&ah.isFilterValueEqual(p.schema,d)&&ah.isFilterValueEqual(p.table,f)&&ah.isFilterValueEqual(p.filter,h))o.push(Object.assign(Object.assign({},l),{id:p.id}));else{this.unsubscribe(),this.state=Ko.errored,n==null||n(to.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=Ko.errored&&n&&n(to.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===hu.PRESENCE||e===hu.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,n,r)}async httpSend(e,n,r={}){var s;if(n==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;
460try{const u=await a.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(e,n={}){var r,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const u=this.channelAdapter.push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_on(e,n,r){const s=e.toLocaleLowerCase(),i=this.channelAdapter.on(e,r),o={type:s,filter:n,callback:r,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,n,r)=>{var s,i,o,a,l,u,d;const f=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,r))return!1;const h=(s=this.bindings[f])===null||s===void 0?void 0:s.find(p=>p.ref===e.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in h){const p=h.id,m=(i=h.filter)===null||i===void 0?void 0:i.event;return p&&((o=n.ids)===null||o===void 0?void 0:o.includes(p))&&(m==="*"||(m==null?void 0:m.toLocaleLowerCase())===((a=n.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const p=(u=(l=h==null?void 0:h.filter)===null||l===void 0?void 0:l.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=n==null?void 0:n.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===f})}_notThisChannelEvent(e,n){const{close:r,error:s,leave:i,join:o}=S3;return n&&[r,s,i,o].includes(e)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:i,table:o,commit_timestamp:a,type:l,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:l,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return n})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in e.bindings)for(const r of e.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=yP(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=yP(e.columns,e.old_record)),n}}class ree{constructor(e,n){this.socket=new JZ(e,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,n,r,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{e(),i("ok")},n,r)})}push(e){this.socket.push(e)}log(e,n,r){this.socket.log(e,n,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==dk.connecting}isDisconnecting(){return this.socket.connectionState()==dk.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const see={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},iee=[1e3,2e3,5e3,1e4],oee=1e4,aee=`
461  addEventListener("message", (e) => {
462    if (e.data.event === "start") {
463      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
464    }
465  });`;class lee{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
465,this.ref=0,this.serializer=new IZ,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new ree(e,s),this.httpEndpoint=C3(e),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const n=e.message;throw n.includes("Node.js")?new Error(`${n}
466
467To use Realtime in Node.js, you need to provide a WebSocket implementation:
468
469Option 1: Use Node.js 22+ which has native WebSocket support
470Option 2: Install and provide the "ws" package:
471
472  npm install ws
473
474  import ws from "ws"
475  const client = new RealtimeClient(url, {
476    ...options,
477    transport: ws
478  })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,n){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,n)}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return n==="ok"&&e.teardown(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(e);return this.disconnect(),n}log(e,n,r){this.socketAdapter.log(e,n,r)}connectionState(){return this.socketAdapter.connectionState()||dk.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,n={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new ah(`realtime:${e}`,n,this);return this.channels.push(i),i}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const i={access_token:n,version:PZ};n&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(S3.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(n,r)=>{n=="sent"&&this._setAuthSafely(),e&&e(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([aee],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(e){var n,r,s,i,o,a,l,u,d;this.worker=(n=e==null?void 0:e.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=e==null?void 0:e.accessToken)!==null&&r!==void 0?r:null;const f={};
478f.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:OZ,f.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:see.HEARTBEAT_INTERVAL,f.transport=(o=e==null?void 0:e.transport)!==null&&o!==void 0?o:AZ.getWebSocketConstructor(),f.params=e==null?void 0:e.params,f.logger=e==null?void 0:e.logger,f.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),f.reconnectAfterMs=(a=e==null?void 0:e.reconnectAfterMs)!==null&&a!==void 0?a:g=>iee[g-1]||oee;let h,p;const m=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:MZ;switch(m){case RZ:h=(g,y)=>y(JSON.stringify(g)),p=(g,y)=>y(JSON.parse(g));break;case w3:h=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${f.vsn}`)}if(f.vsn=m,f.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:h,f.decode=(d=e==null?void 0:e.decode)!==null&&d!==void 0?d:p,f.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,f.params=Object.assign(Object.assign({},f.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,f.autoSendHeartbeat=!this.worker}return f}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var rp=class extends Error{constructor(t,e){var n;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function cee(t,e,n){const r=new URL(e,t);if(n)for(const[s,i]of Object.entries(n))i!==void 0&&r.searchParams.set(s,i);return r.toString()}async function uee(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function dee(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=cee(t.baseUrl,r,s),l=await uee(t.auth),u=await e(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),h=f&&d?JSON.parse(d):d;if(!u.ok){const p=f?h:void 0,m=p==null?void 0:p.error;throw new rp((m==null?void 0:m.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:m==null?void 0:m.type,icebergCode:m==null?void 0:m.code,details:p})}return{status:u.status,headers:u.headers,data:h}}}}function eg(t){return t.join("�")}var fee=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:eg(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${eg(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${eg(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${eg(t.namespace)}`}),!0}catch(e){if(e instanceof rp&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof rp&&n.status===409)return;throw n}}};function Dc(t){return t.join("�")}var hee=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Dc(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Dc(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Dc(t.namespace)}
478/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Dc(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Dc(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Dc(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof rp&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof rp&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},pee=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=dee({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new fee(this.client,e),this.tableOps=new hee(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}},ub=class extends Error{constructor(t,e="storage",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function db(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var mk=class extends ub{constructor(t,e,n,r="storage"){super(t,r,e,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},E3=class extends ub{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const mee=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),gee=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},gk=t=>{if(Array.isArray(t))return t.map(n=>gk(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=gk(r)}),e},yee=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function sp(t){"@babel/helpers - typeof";return sp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sp(t)}function vee(t,e){if(sp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(sp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xee(t){var e=vee(t,"string");return sp(e)=="symbol"?e:e+""}function bee(t,e,n){return(e=xee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wP(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Te(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
478e%2?wP(Object(n),!0).forEach(function(r){bee(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wP(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const SP=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},wee=async(t,e,n,r)=>{if(t!==null&&typeof t=="object"&&typeof t.json=="function"){const s=t;let i=parseInt(s.status,10);Number.isFinite(i)||(i=500),s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";e(new mk(SP(o),i,a,r))}).catch(()=>{const o=i+"";e(new mk(s.statusText||`HTTP ${i} error`,i,o,r))})}else e(new E3(SP(t),t,r))},See=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!r)return Te(Te({},s),n);if(gee(r)){var i;const o=(e==null?void 0:e.headers)||{};let a;for(const[l,u]of Object.entries(o))l.toLowerCase()==="content-type"&&(a=u);s.headers=kee(o,"Content-Type",(i=a)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return e!=null&&e.duplex&&(s.duplex=e.duplex),Te(Te({},s),n)};function kee(t,e,n){const r=Te({},t);for(const s of Object.keys(r))s.toLowerCase()===e.toLowerCase()&&delete r[s];return r[e]=n,r}async function mf(t,e,n,r,s,i,o){return new Promise((a,l)=>{t(n,See(e,r,s,i)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>a(u)).catch(u=>wee(u,l,r,o))})}function _3(t="storage"){return{get:async(e,n,r,s)=>mf(e,"GET",n,r,s,void 0,t),post:async(e,n,r,s,i)=>mf(e,"POST",n,s,i,r,t),put:async(e,n,r,s,i)=>mf(e,"PUT",n,s,i,r,t),head:async(e,n,r,s)=>mf(e,"HEAD",n,Te(Te({},r),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,n,r,s,i)=>mf(e,"DELETE",n,s,i,r,t)}}const Cee=_3("storage"),{get:ip,post:Ps,put:yk,head:Nee,remove:_E}=Cee,Dr=_3("vectors");var Kd=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=Object.fromEntries(Object.entries(e).map(([s,i])=>[s.toLowerCase(),i])),this.fetch=mee(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Te(Te({},this.headers),{},{[t.toLowerCase()]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(db(n))return{data:null,error:n};throw n}}},Eee=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(db(e))return{data:null,error:e};throw e}}};let T3;T3=Symbol.toStringTag;var _ee=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[T3]="BlobDownloadBuilder",this.promise=null}asStream(){return new Eee(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(db(e))return{data:null,error:e};throw e}}};const Tee={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},kP={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Aee=class extends Kd{constructor(t,e={},n,r){super(t,e,r,"storage"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=Te(Te({},kP),r);let a=Te(Te({},s.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers&&(a=Te(Te({},a),r.headers));const u=s._removeEmptyFolders(e),d=s._getFinalPath(u),f=await(t=="PUT"?yk:Ps)(s.fetch,`${s.url}/object/${d}`,i,Te({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var s=this;const i=s._removeEmptyFolders(t),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",e),s.handleOperation(async()=>{let l;const u=Te(Te({},kP),r),d=Te(Te({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:i,fullPath:(await yk(s.fetch,a.toString(),l,{headers:d})).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const s=Te({},n.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await Ps(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new ub("No token returned by API");return{signedUrl:o.toString(),path:t,token:a}})}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await Ps(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await Ps(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(t);const i=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await Ps(r.fetch,`${r.url}/object/sign/${s}
478`,Te({expiresIn:e},i?{transform:n.transform}:{}),{headers:r.headers});const a=new URLSearchParams;n!=null&&n.download&&a.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&a.set("cacheNonce",String(n.cacheNonce));const l=a.toString(),u=i&&o.signedURL.includes("/object/sign/")?o.signedURL.replace("/object/sign/","/render/image/sign/"):o.signedURL;return{signedUrl:encodeURI(`${r.url}${u}${l?`&${l}`:""}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const s=await Ps(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),i=new URLSearchParams;n!=null&&n.download&&i.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&i.set("cacheNonce",String(n.cacheNonce));const o=i.toString();return s.map(a=>Te(Te({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${o?`&${o}`:""}`):null}))})}download(t,e,n){const r=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const i=s.toString(),o=this._getFinalPath(t),a=()=>ip(this.fetch,`${this.url}/${r}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new _ee(a,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>gk(await ip(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await Nee(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(db(s)){var r;const i=s instanceof mk?s.status:s instanceof E3?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=new URLSearchParams;e!=null&&e.download&&r.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(r,e.transform),(e==null?void 0:e.cacheNonce)!=null&&r.set("cacheNonce",String(e.cacheNonce));const s=r.toString(),i=typeof(e==null?void 0:e.transform)<"u"?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await _E(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,n){var r=this;return r.handleOperation(async()=>{const s=Te(Te(Te({},Tee),e),{},{prefix:t||""});return await Ps(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{const r=Te({},t);return await Ps(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const jee="2.103.0",Zp={"X-Client-Info":`storage-js/${jee}`};var Pee=class extends Kd{constructor(t,e={},n,r){const s=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=Te(Te({},Zp),e);super(i,o,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await ip(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await ip(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await Ps(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await yk(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Ps(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await _E(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},Ree=class extends Kd{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Te(Te({},Zp),e);super(r,s,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Ps(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),s=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await ip(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await _E(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!yee(t))throw new ub("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new pee({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
478),r=this.shouldThrowOnError;return new Proxy(n,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(l){if(r)throw l;return{data:null,error:l}}}}})}},Mee=class extends Kd{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Te(Te({},Zp),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await Dr.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await Dr.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},Oee=class extends Kd{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Te(Te({},Zp),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},Dee=class extends Kd{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Te(Te({},Zp),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Dr.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},Iee=class extends Dee{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new Lee(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},Lee=class extends Mee{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,Te(Te({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,Te(Te({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new Fee(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},Fee=class extends Oee{constructor(t,e,n,r,s){super(t,e,s),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,Te(Te({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,Te(Te({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,Te(Te({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,Te(Te({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,Te(Te({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}}
478,Bee=class extends Pee{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new Aee(this.url,this.headers,t,this.fetch)}get vectors(){return new Iee(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Ree(this.url+"/iceberg",this.headers,this.fetch)}};const A3="2.103.0",qc=30*1e3,vk=3,uw=vk*qc,$ee="http://localhost:9999",Vee="supabase.auth.token",zee={"X-Client-Info":`gotrue-js/${A3}`},xk="X-Supabase-Api-Version",j3={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Uee=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Wee=10*60*1e3;class op extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function ye(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class Hee extends op{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function qee(t){return ye(t)&&t.name==="AuthApiError"}class vl extends op{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class ko extends op{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class Pr extends ko{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function tg(t){return ye(t)&&t.name==="AuthSessionMissingError"}class Ic extends ko{constructor(){super("Auth session or user missing","AuthInvalidToken
478ResponseError",500,void 0)}}class ng extends ko{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class rg extends ko{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function Kee(t){return ye(t)&&t.name==="AuthImplicitGrantRedirectError"}class CP extends ko{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Gee extends ko{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class bk extends ko{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function dw(t){return ye(t)&&t.name==="AuthRetryableFetchError"}class NP extends ko{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class wk extends ko{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const ev="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),EP=` 	
479\r=`.split(""),Yee=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<EP.length;e+=1)t[EP[e].charCodeAt(0)]=-2;for(let e=0;e<ev.length;e+=1)t[ev[e].charCodeAt(0)]=e;return t})();function _P(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(ev[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(ev[r]),e.queuedBits-=6}}function P3(t,e,n){const r=Yee[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function TP(t){const e=[],n=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{Xee(o,r,n)};for(let o=0;o<t.length;o+=1)P3(t.charCodeAt(o),s,i);return e.join("")}function Qee(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function Jee(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}Qee(r,e)}}function Xee(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function Tu(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)P3(t.charCodeAt(s),n,r);return new Uint8Array(e)}function Zee(t){const e=[];return Jee(t,n=>e.push(n)),new Uint8Array(e)}function kl(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};return t.forEach(s=>_P(s,n,r)),_P(null,n,r),e.join("")}function ete(t){return Math.round(Date.now()/1e3)+t}function tte(){return Symbol("auth-callback")}const kn=()=>typeof window<"u"&&typeof document<"u",al={tested:!1,writable:!1},R3=()=>{if(!kn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(al.tested)return al.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),al.tested=!0,al.writable=!0}catch{al.tested=!0,al.writable=!1}return al.writable};function nte(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
479h((s,i)=>{e[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const M3=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),rte=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Kc=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},ll=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Sn=async(t,e)=>{await t.removeItem(e)};class fb{constructor(){this.promise=new fb.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}fb.promiseConstructor=Promise;function sg(t){const e=t.split(".");if(e.length!==3)throw new wk("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!Uee.test(e[r]))throw new wk("JWT not in base64url format");return{header:JSON.parse(TP(e[0])),payload:JSON.parse(TP(e[1])),signature:Tu(e[2]),raw:{header:e[0],payload:e[1]}}}async function ste(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function ite(t,e){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await t(i);if(!e(i,null,o)){r(o);return}}catch(o){if(!e(i,o)){s(o);return}}})()})}function ote(t){return("0"+t.toString(16)).substr(-2)}function ate(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,ote).join("")}async function lte(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function cte(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const n=await lte(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Lc(t,e,n=!1){const r=ate();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Kc(t,`${e}-code-verifier`,s);const i=await cte(r);return[i,r===i?"plain":"s256"]}const ute=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function dte(t){const e=t.headers.get(xk);if(!e||!e.match(ute))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function fte(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function hte(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const pte=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Fc(t){if(!pte.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function fw(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function mte(t,e){return new Proxy(t,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(n,r,s)}})}function AP(t){return JSON.parse(JSON.stringify(t))}const pl=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),gte=[502,503,504];async function jP(t){var e;if(!rte(t))throw new bk(pl(t),0);if(gte.includes(t.status))throw new bk(pl(t),t.status);let n;try{n=await t.json()}catch(i){throw new vl(pl(i),i)}let r;const s=dte(t);if(s&&s.getTime()>=j3["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new NP(pl(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Pr}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((i,o)=>
479i&&typeof o=="string",!0))throw new NP(pl(n),t.status,n.weak_password.reasons);throw new Hee(pl(n),t.status||500,r)}const yte=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function Ce(t,e,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[xk]||(i[xk]=j3["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await vte(t,e,n+a,{headers:i,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function vte(t,e,n,r,s,i){const o=yte(e,r,s,i);let a;try{a=await t(n,Object.assign({},o))}catch(l){throw console.error(l),new bk(pl(l),0)}if(a.ok||await jP(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await jP(l)}}function _s(t){var e;let n=null;wte(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=ete(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function PP(t){const e=_s(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Go(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function xte(t){return{data:t,error:null}}function bte(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=t,o=zd(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function RP(t){return t}function wte(t){return t.access_token&&t.refresh_token&&t.expires_in}const hw=["global","local","others"];class Ste{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=M3(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,n=hw[0]){if(hw.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${hw.join(", ")}`);try{return await Ce(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ye(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Ce(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Go})}catch(r){if(ye(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=zd(e,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Ce(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:bte,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ye(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Ce(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Go})}catch(n){if(ye(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Ce(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:RP});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>
4790&&(p.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(m.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(ye(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Fc(e);try{return await Ce(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Go})}catch(n){if(ye(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){Fc(e);try{return await Ce(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Go})}catch(r){if(ye(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){Fc(e);try{return await Ce(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Go})}catch(r){if(ye(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){Fc(e.userId);try{const{data:n,error:r}=await Ce(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _deleteFactor(e){Fc(e.userId),Fc(e.id);try{return{data:await Ce(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Ce(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:RP});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(m.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(ye(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await Ce(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Ce(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Ce(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ye(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Ce(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Ce(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _listCustomProviders(e){try{const n={};return e!=null&&e.type&&(n.type=e.type),await Ce(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(ye(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(e){try{return await Ce(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _getCustomProvider(e){try{return await Ce(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _updateCustomProvider(e,n){try{return await Ce(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ye(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await Ce(this.fetch,"DELET
479E",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}}}function MP(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const si={debug:!!(globalThis&&R3()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class O3 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class OP extends O3{}async function kte(t,e,n){si.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{r.abort(),si.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){clearTimeout(s),si.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await n()}finally{si.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw si.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new OP(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(si.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await n()}})}catch(i){if(e>0&&clearTimeout(s),(i==null?void 0:i.name)==="AbortError"&&e>0){if(r.signal.aborted)return si.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async o=>{if(o){si.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await n()}finally{si.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw si.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new OP(`Lock "${t}" was released because another request stole it`)}throw i}}function Cte(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function D3(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function Nte(t){return parseInt(t,16)}function Ete(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function _te(t){var e;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:u,scheme:d,uri:f,version:h}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);
479if(!((e=t.statement)===null||e===void 0)&&e.includes(`
480`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const p=D3(t.address),m=d?`${d}://${r}`:r,g=t.statement?`${t.statement}
481`:"",y=`${m} wants you to sign in with your Ethereum account:
482${p}
483
484${g}`;let b=`URI: ${f}
485Version: ${h}
486Chain ID: ${n}${o?`
487Nonce: ${o}`:""}
488Issued At: ${i.toISOString()}`;if(s&&(b+=`
489Expiration Time: ${s.toISOString()}`),a&&(b+=`
490Not Before: ${a.toISOString()}`),l&&(b+=`
491Request ID: ${l}`),u){let x=`
492Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);x+=`
493- ${w}`}b+=x}return`${y}
494${b}`}class Yt extends Error{constructor({message:e,code:n,cause:r,name:s}){var i;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class tv extends Yt{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function Tte({error:t,options:e}){var n,r,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Yt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Yt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Yt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Yt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Yt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Yt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new Yt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Yt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(I3(o)){if(i.rp.id!==o)return new Yt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Yt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Yt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Yt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Yt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Ate({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Yt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Yt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(I3(r)){if(n.rpId!==r)return new Yt({message:`The RP ID "${n.rpId}
494" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Yt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Yt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Yt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class jte{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Pte=new jte;function Rte(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,s=zd(t,["challenge","user","excludeCredentials"]),i=Tu(e).buffer,o=Object.assign(Object.assign({},n),{id:Tu(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const u=r[l];a.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:Tu(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function Mte(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=zd(t,["challenge","allowCredentials"]),s=Tu(e).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const a=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:Tu(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function Ote(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:kl(new Uint8Array(t.response.attestationObject)),clientDataJSON:kl(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Dte(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:kl(new Uint8Array(s.authenticatorData)),clientDataJSON:kl(new Uint8Array(s.clientDataJSON)),signature:kl(new Uint8Array(s.signature)),userHandle:s.userHandle?kl(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function I3(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function DP(){var t,e;return!!(kn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function Ite(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new tv("Browser returned unexpected credential type",e)}:{data:null,error:new tv("Empty credential response",e)}}catch(e){return{data:null,error:Tte({error:e,options:t})}}}async function Lte(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}
494:{data:null,error:new tv("Browser returned unexpected credential type",e)}:{data:null,error:new tv("Empty credential response",e)}}catch(e){return{data:null,error:Ate({error:e,options:t})}}}const Fte={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Bte={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function nv(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of t)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(e(o)){const a=r[i];e(a)?r[i]=nv(a,o):r[i]=nv(o)}else r[i]=o}return r}function $te(t,e){return nv(Fte,t,e||{})}function Vte(t,e){return nv(Bte,t,e||{})}class zte{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:s},i){var o;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!a)return{data:null,error:l};const u=s??Pte.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:d}=a.webauthn.credential_options.publicKey;if(!d.name){const f=r;if(f)d.name=`${d.id}:${f}`;else{const p=(await this.client.getUser()).data.user,m=((o=p==null?void 0:p.user_metadata)===null||o===void 0?void 0:o.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${m}`}}d.displayName||(d.displayName=d.name)}switch(a.webauthn.type){case"create":{const d=$te(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:f,error:h}=await Ite({publicKey:d,signal:u});return f?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}case"request":{const d=Vte(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:f,error:h}=await Lte(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}}}catch(a){return ye(a)?{data:null,error:a}:{data:null,error:new vl("Unexpected error in challenge",a)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new op("rpId is required for WebAuthn authentication")};try{if(!DP())return{data:null,error:new vl("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:l}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(o){return ye(o)?{data:null,error:o}:{data:null,error:new vl("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new op("rpId is required for WebAuthn registration")};try{if(!DP())return{data:null,error:new vl("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===e&&h.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:a};const{data:l,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(o){return ye(o)?{data:null,error:o}:{data:null,error:new vl("Unexpected error in register",o)}}}}Cte();const Ute={url:$ee,storageKey:Vee,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:zee,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function IP(t,e,n){return await n()}const Bc={};class ap{get jwks(){var e,n;return(n=(e=Bc[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){Bc[this.storageKey]=Object.assign(Object.assign({},Bc[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=Bc[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Bc[this.storageKey]=Object.assign(Object.assign({},Bc[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},Ute),e);if(this.storageKey=i.storageKey,this.instanceID=(n=ap.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,ap.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&kn()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new Ste({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=M3(i.fetch),this.lock=i.lock||IP,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&kn()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=kte:this.lock=IP,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new zte(this)}
494,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:R3()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=MP(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=MP(this.memoryStorage)),kn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${A3}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let n={},r="none";if(kn()&&(n=nte(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),kn()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),Kee(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ye(n)?this._returnResult({error:n}):this._returnResult({error:new vl("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const i=await Ce(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:_s}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(ye(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var n,r,s;try{let i;if("email"in e){const{email:d,password:f,options:h}=e;let p=null,m=null;this.flowType==="pkce"&&([p,m]=await Lc(this.storage,this.storageKey)),i=await Ce(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:f,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:m},xform:_s})}else if("phone"in e){const{phone:d,password:f,options:h}=e;i=await Ce(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},channel:(s=h==null?void 0:h.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:_s})}else throw new ng("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await Sn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(await Sn(this.storage,`${this.storageKey}-code-verifier`),ye(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let n;if("email"in e){const{email:i,password:o,options:a}=e;n=await Ce(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:PP})}else if("phone"in e){const{phone:i,password:o,options:a}=e;n=await Ce(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:PP})}else throw new ng("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const i=new Ic;return this._returnResult({data:{user:null,session:null},error:i})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,s,i,o,a,l,u,d,f,h;let p,m;if("message"in e)p=e.message,m=e.signature;else{const{chain:g,wallet:y,statement:b,options:x}=e;let w;if(kn())if(typeof y=="object")w=y;else{const _=window;if("ethereum"in _&&typeof _.ethereum=="object"&&"request"in _.ethereum&&typeof _.ethereum.request=="function")w=_.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=y}const S=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href),C=await w.request({method:"eth_requestAccounts"}).then(_=>_).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!C||C.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=D3(C[0]);let N=(r=x==null?void 0:x.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!N){const _=await w.request({method:"eth_chainId"});N=Nte(_)}const E={domain:S.host,address:k,statement:b,uri:S.href,version:"1",chainId:N,nonce:(s=x==null?void 0:x.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=x==null?void 0:x.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=x==null?void 0:x.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=x==null?void 0:x.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=x==null?void 0:x.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=x==null?void 0:x.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=_te(E),m=await w.request({method:"personal_sign",params:[Ete(p),k]})}try{const{data:g,error:y}=await Ce(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:m},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:_s});if(y)throw y;if(!g||!g.session||!g.user){const b=new Ic;return this._returnResult({data:{user:null,session:null},error:b})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(ye(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var n,r,s,i,o,a,l,u,d,f,h,p;let m,g;if("message"in e)m=e.message,g=e.signature;else{const{chain:y,wallet:b,statement:x,options:w}=e;let S;if(kn())if(typeof b=="object")S=b;
494else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))S=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=b}const C=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const k=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:C.host,uri:C.href}),x?{statement:x}:null));let N;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")N=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)N=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)m=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),g=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${C.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...x?["",x,""]:[""],"Version: 1",`URI: ${C.href}`,`Issued At: ${(s=(r=w==null?void 0:w.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((f=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...w.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(`
495`);const k=await S.signMessage(new TextEncoder().encode(m),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=k}}try{const{data:y,error:b}=await Ce(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:kl(g)},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:_s});if(b)throw b;if(!y||!y.session||!y.user){const x=new Ic;return this._returnResult({data:{user:null,session:null},error:x})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:b})}catch(y){if(ye(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(e){const n=await ll(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new Gee;const{data:i,error:o}=await Ce(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:_s});if(await Sn(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new Ic;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await Sn(this.storage,`${this.storageKey}-code-verifier`),ye(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=e,a=await Ce(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:_s}),{data:l,error:u}=a;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const d=new Ic;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(n){if(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,s,i,o;try{if("email"in e){const{email:a,options:l}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Lc(this.storage,this.storageKey));const{error:f}=await Ce(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in e){const{phone:a,options:l}=e,{data:u,error:d}=await Ce(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new ng("You must provide either an email or phone number.")}catch(a){if(await Sn(this.storage,`${this.storageKey}-code-verifier`),ye(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(e){var n,r;try{let s,i;"options"in e&&(s=(n=e.options)===null||n===void 0?void 0:n.redirectTo,i=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await Ce(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:_s});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,u=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(ye(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var n,r,s,i,o;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Lc(this.storage,this.storageKey));const u=await Ce(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:xte});return!((i=u.data)===null||i===void 0)&&i.url&&kn()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(a){if(await Sn(this.storage,`${this.storageKey}-code-verifier`),ye(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new Pr;const{error:s}=await Ce(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(ye(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:s,options:i}=e,{error:o}=await Ce(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:r,type:s,options:i}=e,{data:o,error:a}=await Ce(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new ng("You must provide either an email or phone number and a type")}catch(n){if(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await ll(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not val
495id"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<uw:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const o=await ll(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=fw()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=mte(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await Ce(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Go}):await this._useSession(async n=>{var r,s,i;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Pr}:await Ce(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:Go})})}catch(n){if(ye(n))return tg(n)&&(await this._removeSession(),await Sn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new Pr;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await Lc(this.storage,this.storageKey));const{data:u,error:d}=await Ce(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:Go});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await Sn(this.storage,`${this.storageKey}-code-verifier`),ye(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Pr;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=sg(e.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{data:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(ye(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:o,error:a}=n;if(a)throw a;e=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new Pr;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!kn())throw new rg("No browser detected.");
495if(e.error||e.error_description||e.error_code)throw new rg(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new CP("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new rg("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new CP("No code detected.");const{data:x,error:w}=await this._exchangeCodeForSession(e.code);if(w)throw w;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:x.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=e;if(!i||!a||!o||!u)throw new rg("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(a);let h=d+f;l&&(h=parseInt(l));const p=h-d;p*1e3<=qc&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const m=h-f;d-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,d):d-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,d);const{data:g,error:y}=await this._getUser(i);if(y)throw y;const b={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:f,expires_at:h,refresh_token:o,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:e.type},error:null})}catch(r){if(ye(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await ll(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i&&!tg(i))return this._returnResult({error:i});const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(qee(a)&&(a.status===404||a.status===401||a.status===403)||tg(a)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await Sn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=tte(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),tg(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(e,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Lc(this.storage,this.storageKey,!0));try{return await Ce(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await Sn(this.storage,`${this.storageKey}-code-verifier`),ye(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:s}=await this._useSession(async i=>{var o,a,l,u,d;const{data:f,error:h}=i;if(h)throw h;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await Ce(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return kn()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(ye(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;
495if(s)throw s;const{options:o,provider:a,token:l,access_token:u,nonce:d}=e,f=await Ce(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.access_token)!==null&&r!==void 0?r:void 0,body:{provider:a,id_token:l,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:_s}),{data:h,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Ic}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:p}))}catch(s){if(await Sn(this.storage,`${this.storageKey}-code-verifier`),ye(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await Ce(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await ite(async s=>(s>0&&await ste(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Ce(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:_s})),(s,i)=>{const o=200*Math.pow(2,s);return i&&dw(i)&&Date.now()+o-r<qc})}catch(r){if(this._debug(n,"error",r),ye(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),kn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await ll(this.storage,this.storageKey);if(s&&this.userStorage){let o=await ll(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Kc(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:fw()}else if(s&&!s.user&&!s.user){const o=await ll(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Sn(this.storage,this.storageKey+"-user"),await Kc(this.storage,this.storageKey,s)):s.user=fw()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<uw;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${uw}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),dw(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new Pr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new fb;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new Pr;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),ye(i)){const o={data:null,error:i};return dw(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,n,r=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,n)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Sn(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Kc(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=AP(s);await Kc(this.storage,this.storageKey,i)}else{const s=AP(n);await Kc(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Sn(this.storage,this.storageKey),await Sn(this.storage,this.storageKey+"-code-verifier"),await Sn(this.storage,this.storageKey+"-user"),this.userStorage&&await Sn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&kn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
495catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),qc);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-e)/qc);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${qc}ms, refresh threshold is ${vk} ticks`),s<=vk&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof O3)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!kn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await Lc(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?this._returnResult({data:null,error:i}):await Ce(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;
495if(o)return this._returnResult({data:null,error:o});const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await Ce(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Ote(e.webauthn.credential_response):Dte(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await Ce(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await Ce(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Rte(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Mte(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,s,i;if(e)try{const{payload:p}=sg(e);let m=null;p.aal&&(m=p.aal);let g=m;const{data:{user:y},error:b}=await this.getUser(e);if(b)return this._returnResult({data:null,error:b});((r=(n=y==null?void 0:y.factors)===null||n===void 0?void 0:n.filter(S=>S.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(g="aal2");const w=p.amr||[];return{data:{currentLevel:m,nextLevel:g,currentAuthenticationMethods:w},error:null}}catch(p){if(ye(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:a}
495=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=sg(o.access_token);let u=null;l.aal&&(u=l.aal);let d=u;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const h=l.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await Ce(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Pr})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Pr});const o=await Ce(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&kn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ye(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Pr});const o=await Ce(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&kn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ye(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await Ce(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Pr})})}catch(e){if(ye(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await Ce(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Pr})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(a=>a.kid===e);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(a=>a.kid===e),r&&this.jwks_cached_at+Wee>s)return r;const{data:i,error:o}=await Ce(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,r=i.keys.find(a=>a.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:p,error:m}
495=await this.getSession();if(m||!p.session)return this._returnResult({data:null,error:m});r=p.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=sg(r);n!=null&&n.allowExpired||fte(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:i,header:s,signature:o},error:null}}const d=hte(s.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,o,Zee(`${a}.${l}`)))throw new wk("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(ye(r))return this._returnResult({data:null,error:r});throw r}}}ap.nextInstanceID={};const Wte=ap,Hte="2.103.0";let $f="";typeof Deno<"u"?$f="deno":typeof document<"u"?$f="web":typeof navigator<"u"&&navigator.product==="ReactNative"?$f="react-native":$f="node";const qte={"X-Client-Info":`supabase-js-${$f}/${Hte}`},Kte={headers:qte},Gte={schema:"public"},Yte={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Qte={};function lp(t){"@babel/helpers - typeof";return lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lp(t)}function Jte(t,e){if(lp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(lp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xte(t){var e=Jte(t,"string");return lp(e)=="symbol"?e:e+""}function Zte(t,e,n){return(e=Xte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LP(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function $t(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?LP(Object(n),!0).forEach(function(r){Zte(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const ene=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),tne=()=>Headers,nne=(t,e,n)=>{const r=ene(n),s=tne();return async(i,o)=>{var a;const l=(a=await e())!==null&&a!==void 0?a:t;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(i,$t($t({},o),{},{headers:u}))}};function rne(t){return t.endsWith("/")?t:t+"/"}function sne(t,e){var n,r;const{db:s,auth:i,realtime:o,global:a}=t,{db:l,auth:u,realtime:d,global:f}=e,h={db:$t($t({},l),s),auth:$t($t({},u),i),realtime:$t($t({},d),o),storage:{},global:$t($t($t({},f),a),{},{headers:$t($t({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?h.accessToken=t.accessToken:delete h.accessToken,h}function ine(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(rne(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var one=class extends Wte{constructor(t){super(t)}},ane=class{constructor(t,e,n){var r,s;this.supabaseUrl=t,this.supabaseKey=e;const i=ine(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:Gte,realtime:Qte,auth:$t($t({},Yte),{},{storageKey:o}),global:Kte},l=sne(n??{},a);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=nne(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient($t({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new TZ(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new Bee(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new vZ(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();
495return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:u},d,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new one({url:this.authUrl.href,headers:$t($t({},h),d),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new lee(this.realtimeUrl.href,$t($t({},t),{},{params:$t($t({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const lne=(t,e,n)=>new ane(t,e,n);function cne(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}cne()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const une="https://pfclmiclwkmsmhpiioqc.supabase.co",dne="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBmY2xtaWNsd2ttc21ocGlpb3FjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzMwMjA5NDEsImV4cCI6MjA4ODU5Njk0MX0.YWTjX0j1y-YHVrlTXYSRXw6Tmq6nsJ6EbxEu3uvMYFA",I=lne(une,dne,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function ot(){const[t,e]=v.useState(null),[n,r]=v.useState(null),[s,i]=v.useState(null),[o,a]=v.useState(!1),[l,u]=v.useState(!0),[d,f]=v.useState("none"),[h,p]=v.useState(null),[m,g]=v.useState(1),y=v.useCallback(async()=>{try{const{error:x}=await I.functions.invoke("check-subscription");if(x){console.error("check-subscription error:",x);return}if(n){const{data:w}=await I.from("team_subscriptions").select("status, current_period_end, trial_ends_at, seat_count").eq("team_id",n).single();if(w){const S=w;f(S.status||"none"),p(S.current_period_end||S.trial_ends_at||null),g(S.seat_count||1)}}}catch(x){console.error("check-subscription error:",x)}},[n]),b=v.useCallback(async x=>{const[{data:w},{data:S}]=await Promise.all([I.from("team_members").select("team_id, role").eq("user_id",x).maybeSingle(),I.from("profiles").select("onboarded").eq("id",x).maybeSingle()]),C=(w==null?void 0:w.team_id)??null;if(r(C),i((w==null?void 0:w.role)??null),a((S==null?void 0:S.onboarded)??!1),C){const{data:k}=await I.from("team_subscriptions").select("status, current_period_end, trial_ends_at, seat_count").eq("team_id",C).single();if(k){const N=k;f(N.status||"none"),p(N.current_period_end||N.trial_ends_at||null),g(N.seat_count||1)}}u(!1)},[]);return v.useEffect(()=>{const{data:{subscription:x}}=I.auth.onAuthStateChange(async(w,S)=>{const C=(S==null?void 0:S.user)??null;e(C),C?setTimeout(()=>b(C.id),0):(r(null),i(null),a(!1),f("none"),p(null),g(1),u(!1))});return I.auth.getSession().then(({data:{session:w}})=>{const S=(w==null?void 0:w.user)??null;e(S),S?(b(S.id),I.functions.invoke("check-subscription").catch(()=>{})):u(!1)}),()=>x.unsubscribe()},[b]),v.useEffect(()=>{if(!t||!n)return;const x=setInterval(y,6e4);return()=>clearInterval(x)},[t,n,y]),{user:t,teamId:n,role:s,onboarded:o,isLoading:l,subscriptionStatus:d,subscriptionEnd:h,seatCount:m,refreshSubscription:y}}const TE=ab,L3=l3,fne=lb,F3=v.forwardRef(({className:t,...e},n)=>c.jsx(Ud,{ref:n,className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));F3.displayName=Ud.displayName;const hb=v.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(fne,{children:[c.jsx(F3,{}),c.jsxs(Wd,{ref:r,className:q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
495nded-lg",t),...n,children:[e,c.jsxs(cb,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(ji,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hb.displayName=Wd.displayName;const pb=({className:t,...e})=>c.jsx("div",{className:q("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});pb.displayName="DialogHeader";const B3=({className:t,...e})=>c.jsx("div",{className:q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});B3.displayName="DialogFooter";const mb=v.forwardRef(({className:t,...e},n)=>c.jsx(Gp,{ref:n,className:q("text-lg font-semibold leading-none tracking-tight",t),...e}));mb.displayName=Gp.displayName;const hne=v.forwardRef(({className:t,...e},n)=>c.jsx(Yp,{ref:n,className:q("text-sm text-muted-foreground",t),...e}));hne.displayName=Yp.displayName;const pne=[{name:"New",color:"#6b7280",position:0},{name:"In Progress",color:"#3b82f6",position:1},{name:"Won",color:"#22c55e",position:2},{name:"Lost",color:"#ef4444",position:3}],mne=[{title:"Dashboard",url:"/dashboard",icon:gF},{title:"Humans",url:"/contacts",icon:yo}];function gne(){var N;const{state:t}=qd(),e=t==="collapsed",n=Bi(),r=Dn(),s=xt(),{user:i,teamId:o,role:a}=ot(),l=a==="owner"||a==="admin",[u,d]=v.useState(!1),[f,h]=v.useState(""),{data:p}=ue({queryKey:["profile",i==null?void 0:i.id],queryFn:async()=>{const{data:E}=await I.from("profiles").select("first_name, last_name").eq("id",i.id).single();return E},enabled:!!(i!=null&&i.id)}),{data:m}=ue({queryKey:["team",o],queryFn:async()=>{const{data:E}=await I.from("teams").select("name, image_url").eq("id",o).single();return E},enabled:!!o}),{data:g}=ue({queryKey:["boards",o],queryFn:async()=>{const{data:E,error:_}=await I.from("boards").select("id, name").order("created_at",{ascending:!0});if(_)throw _;return E},enabled:!!o}),{data:y}=ue({queryKey:["membership",i==null?void 0:i.id],queryFn:async()=>{const{data:E}=await I.from("team_members").select("last_viewed_board_id").eq("user_id",i.id).maybeSingle();return E},enabled:!!(i!=null&&i.id)}),b=Ee({mutationFn:async E=>{i!=null&&i.id&&await I.from("team_members").update({last_viewed_board_id:E}).eq("user_id",i.id)},onSuccess:()=>{s.invalidateQueries({queryKey:["membership",i==null?void 0:i.id]})}}),x=Ee({mutationFn:async E=>{const{data:_,error:T}=await I.from("boards").insert({team_id:o,name:E}).select("id").single();if(T)throw T;const{error:P}=await I.from("board_statuses").insert(pne.map(j=>({...j,board_id:_.id})));if(P)throw P;return _.id},onSuccess:E=>{s.invalidateQueries({queryKey:["boards"]}),d(!1),h(""),b.mutate(E),r(`/boards?board=${E}`)}}),w=E=>{b.mutate(E),r(`/boards?board=${E}`)},S=E=>E==="/"?n.pathname==="/":n.pathname.startsWith(E),C=E=>{if(!n.pathname.startsWith("/boards"))return!1;const T=new URLSearchParams(n.search).get("board");return T?T===E:(y==null?void 0:y.last_viewed_board_id)===E};[p==null?void 0:p.first_name,p==null?void 0:p.last_name].filter(Boolean).join(" ");const k=(m==null?void 0:m.name)||"";return c.jsxs(f3,{collapsible:"icon",children:[c.jsxs(h3,{className:"h-14 px-3 flex flex-row items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m!=null&&m.image_url?c.jsx("img",{src:m.image_url,alt:k,className:"h-7 w-7 rounded-lg object-cover shrink-0"}):c.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary flex items-center justify-center text-primary-foreground text-xs font-semibold shrink-0",children:((N=k[0])==null?void 0:N.toUpperCase())||"T"}),!e&&c.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground truncate",children:k||"KitBoard"})]}),!e&&c.jsx(NE,{className:"shrink-0"})]}),c.jsx(p3,{children:c.jsx(m3,{children:c.jsx(g3,{children:c.jsxs(y3,{children:[mne.map(E=>c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S(E.url),children:c.jsxs(Mr,{to:E.url,end:E.url==="/",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(E.icon,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:E.title})]})})},E.title)),c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S("/boards"),children:c.jsxs(Mr,{to:"/boards",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(Md,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:"Boards"})]})})}),!e&&S("/boards")&&g&&g.length>0&&c.jsxs("div",{className:"ml-5 pl-3 border-l border-border",children:[g.map(E=>
495c.jsx(Ns,{children:c.jsx(Es,{isActive:C(E.id),onClick:()=>w(E.id),className:"text-xs h-7 cursor-pointer",children:c.jsx("span",{className:"truncate",children:E.name})})},E.id)),l&&c.jsx(Ns,{children:c.jsxs(Es,{onClick:()=>d(!0),className:"text-xs h-7 text-muted-foreground hover:text-foreground cursor-pointer",children:[c.jsx(nn,{className:"h-3 w-3"}),c.jsx("span",{children:"Create new board"})]})})]}),c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S("/tasks"),children:c.jsxs(Mr,{to:"/tasks",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(Od,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:"Tasks"})]})})}),c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S("/notes"),children:c.jsxs(Mr,{to:"/notes",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(qh,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:"Notes"})]})})}),c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S("/files"),children:c.jsxs(Mr,{to:"/files",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(Q9,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:"Files"})]})})}),!e&&c.jsx("div",{className:"my-1 mx-2 border-t border-border"}),l&&c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S("/settings"),children:c.jsxs(Mr,{to:"/settings",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(qp,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:"Settings"})]})})}),c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S("/documentation"),children:c.jsxs(Mr,{to:"/documentation",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(dF,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:"Documentation"})]})})}),c.jsx(Ns,{children:c.jsx(Es,{asChild:!0,isActive:S("/feedback"),children:c.jsxs(Mr,{to:"/feedback",className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground font-medium",children:[c.jsx(nc,{className:"h-4 w-4"}),!e&&c.jsx("span",{children:"Feedback"})]})})})]})})})}),c.jsx(TE,{open:u,onOpenChange:d,children:c.jsxs(hb,{className:"sm:max-w-md",children:[c.jsx(pb,{children:c.jsx(mb,{children:"Create a new board"})}),c.jsxs("form",{onSubmit:E=>{E.preventDefault(),f.trim()&&x.mutate(f.trim())},children:[c.jsx(Je,{placeholder:"Board name",value:f,onChange:E=>h(E.target.value),autoFocus:!0}),c.jsx(B3,{className:"mt-4",children:c.jsx(K,{type:"submit",disabled:!f.trim()||x.isPending,children:x.isPending?"Creating…":"Create"})})]})]})})]})}const $3=v.createContext({slotEl:null,setSlotEl:()=>{}});function yne({children:t}){const[e,n]=v.useState(null);return c.jsx($3.Provider,{value:{slotEl:e,setSlotEl:n},children:t})}function V3(){return v.useContext($3)}function Ei({children:t}){const{slotEl:e}=V3();return e?Ii.createPortal(t,e):null}const vne=[{match:"/dashboard",icon:gF,label:"Dashboard"},{match:"/boards",icon:Md,label:"Boards"},{match:"/contacts/",icon:void 0,label:"Contact"},{match:"/contacts",icon:yo,label:"Humans"},{match:"/tasks",icon:Od,label:"Tasks"},{match:"/notes",icon:qh,label:"Notes"},{match:"/documentation",icon:dF,label:"Documentation"},{match:"/settings",icon:qp,label:"Settings"}];function xne(t){for(const e of vne)if(e.exact?t===e.match:t.startsWith(e.match))return e;return null}function bne(){const{setSlotEl:t}=V3(),e=Bi(),n=xne(e.pathname),r=n==null?void 0:n.icon,{state:s}=qd(),i=s==="collapsed";return c.jsxs("header",{className:"h-14 flex items-center px-3 gap-3 bg-background",children:[i&&c.jsx(NE,{className:"shrink-0"}),r&&c.jsx(r,{className:"h-4 w-4 text-muted-foreground shrink-0"}),c.jsx("div",{ref:t,className:"flex-1 flex items-center gap-3 relative"})]})}const wne=Sc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),z3=v.forwardRef(({className:t,variant:e,...n},r)=>c.jsx("div",{ref:r,role:"alert",className:q(wne({variant:e}),t),...n}));z3.displayName="Alert";const U3=v.forwardRef(({className:t,...e},n)=>c.jsx("h5",{ref:n,className:q("mb-1 font-medium leading-none tracking-tight",t),...e}));U3.displayName="AlertTitle";const W3=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:q("text-sm [&_p]:leading-relaxed",t),...e}));W3.displayName="AlertDescription";function Sne(){const{subscriptionStatus:t,role:e}=ot();if(t!=="past_due")return null;const n=e==="owner";return c.jsxs(z3,{variant:"destructive",className:"rounded-none border-x-0 border-t-0 shrink-0",children:[c.jsx(vF,{className:"h-4 w-4"}),c.jsx(U3,{children:"Payment past due"}),c.jsx(W3,{children:n?c.jsx("span",{children:"Your last payment failed. Please update your payment method in account settings to avoid losing access."}):c.jsx("span",{children:"Your team's payment is past due. Please contact your team owner to resolve."})})]})}function kne(){const{user:t,teamId:e,onboarded:n,isLoading:r,subscriptionStatus:s}=ot();return r?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx(vt,{className:"h-8 w-32"})}):t?!e||!n?c.jsx(Eu,{to:"/onboarding",replace:!0}):s==="canceled"||s==="expired"?c.jsx(Eu,{to:"/subscription-required",replace:!0}):c.jsx(yne,{children:c.jsx(d3,{children:c.jsxs("div",{className:"h-screen flex w-full overflow-hidden bg-background",children:[c.jsx(gne,{}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[c.jsx(bne,{}),c.jsx(Sne,{}),c.jsx("main",{className:"flex-1 overflow-hidden min-h-0 p-2 pt-0",children:c.jsx("div",{className:"h-full bg-card rounded-xl border border-border shadow-sm overflow-hidden",children:c.jsx(MB,{})})})]})]})})}):c.jsx(Eu,{to:"/login",replace:!0})}const AE=v.createContext({});function jE(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const Cne=typeof window<"u",H3=Cne?v.useLayoutEffect:v.useEffect,gb=v.createContext(null);function PE(t,e){t.indexOf(e)===-1&&t.push(e)}function rv(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Ri=(t,e,n)=>n>e?e:n<t?t:n;let yb=()=>{},td=()=>{};const Ba={},q3=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function K3(t){return typeof t=="object"&&t!==null}const G3=t=>/^0[^.\s]+$/u.test(t);function Y3(t){let e;return()=>(e===void 0&&(e=t()),e)}const cs=t=>t,Nne=(t,e)=>n=>e(t(n)),em=(...t)=>t.reduce(Nne),cp=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class RE{constructor(){this.subscriptions=[]}add(e){return PE(this.subscriptions,e),()=>rv(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Er=t=>t*1e3,is=t=>t/1e3;function Q3(t,e){return e?t*(1e3/e):0}const J3=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Ene=1e-7,_ne=12;function Tne(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=J3(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>Ene&&++a<_ne);return o}function tm(t,e,n,r){if(t===e&&n===r)return cs;const s=i=>Tne(i,0,1,t,n);return i=>i===0||i===1?i:J3(s(i),e,r)}const X3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Z3=t=>e=>1-t(1-e),e4=tm(.33,1.53,.69,.99),ME=Z3(e4),t4=X3(ME),n4=t=>t>=1?1:(t*=2)<1?.5*ME(t):.5*(2-Math.pow(2,-10*(t-1))),OE=t=>1-Math.sin(Math.acos(t)),r4=Z3(OE),s4=X3(OE),Ane=tm(.42,0,1,1),jne=tm(0,0,.58,1),i4=tm(.42,0,.58,1),Pne=t=>Array.isArray(t)&&typeof t[0]!="number",o4=t=>Array.isArray(t)&&typeof t[0]=="number",FP={linear:cs,easeIn:Ane,easeInOut:i4,easeOut:jne,circIn:OE,circInOut:s4,circOut:r4,backIn:ME,backInOut:t4,backOut:e4,anticipate:n4},Rne=t=>typeof t=="string",BP=t=>{if(o4(t)){td(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,s]=t;return tm(e,n,r,s)}else if(Rne(t))return td(FP[t]!==void 0,`Invalid easing type '${t}
495'`,"invalid-easing-type"),FP[t];return t},ig=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],$P={value:null,addProjectionMetrics:null};function Mne(t,e){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){o.has(f)&&(d.schedule(f),t()),l++,f(a)}const d={schedule:(f,h=!1,p=!1)=>{const g=p&&s?n:r;return h&&o.add(f),g.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,s){i=!0;return}s=!0;const h=n;n=r,r=h,n.forEach(u),e&&$P.value&&$P.value.frameloop[e].push(l),l=0,n.clear(),s=!1,i&&(i=!1,d.process(f))}};return d}const One=40;function a4(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=ig.reduce((w,S)=>(w[S]=Mne(i,e?S:void 0),w),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:p,postRender:m}=o,g=()=>{const w=Ba.useManualTiming,S=w?s.timestamp:performance.now();n=!1,w||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,One),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(g))},y=()=>{n=!0,r=!0,s.isProcessing||t(g)};return{schedule:ig.reduce((w,S)=>{const C=o[S];return w[S]=(k,N=!1,E=!1)=>(n||y(),C.schedule(k,N,E)),w},{}),cancel:w=>{for(let S=0;S<ig.length;S++)o[ig[S]].cancel(w)},state:s,steps:o}}const{schedule:yt,cancel:$a,state:En,steps:pw}=a4(typeof requestAnimationFrame<"u"?requestAnimationFrame:cs,!0);let Gg;function Dne(){Gg=void 0}const rr={now:()=>(Gg===void 0&&rr.set(En.isProcessing||Ba.useManualTiming?En.timestamp:performance.now()),Gg),set:t=>{Gg=t,queueMicrotask(Dne)}},l4=t=>e=>typeof e=="string"&&e.startsWith(t),c4=l4("--"),Ine=l4("var(--"),DE=t=>Ine(t)?Lne.test(t.split("/*")[0].trim()):!1,Lne=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function VP(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Gd={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},up={...Gd,transform:t=>Ri(0,1,t)},og={...Gd,default:1},lh=t=>Math.round(t*1e5)/1e5,IE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Fne(t){return t==null}const Bne=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,LE=(t,e)=>n=>!!(typeof n=="string"&&Bne.test(n)&&n.startsWith(t)||e&&!Fne(n)&&Object.prototype.hasOwnProperty.call(n,e)),u4=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(IE);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},$ne=t=>Ri(0,255,t),mw={...Gd,transform:t=>Math.round($ne(t))},Cl={test:LE("rgb","red"),parse:u4("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+mw.transform(t)+", "+mw.transform(e)+", "+mw.transform(n)+", "+lh(up.transform(r))+")"};function Vne(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Sk={test:LE("#"),parse:Vne,transform:Cl.transform},nm=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Io=nm("deg"),_i=nm("%"),ge=nm("px"),zne=nm("vh"),Une=nm("vw"),zP={..._i,parse:t=>_i.parse(t)/100,transform:t=>_i.transform(t*100)},pu={test:LE("hsl","hue"),parse:u4("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+_i.transform(lh(e))+", "+_i.transform(lh(n))+", "+lh(up.transform(r))+")"},Qt={test:t=>Cl.test(t)||Sk.test(t)||pu.test(t),parse:t=>Cl.test(t)?Cl.parse(t):pu.test(t)?pu.parse(t):Sk.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Cl.transform(t):pu.transform(t),getAnimatableNone:t=>{const e=Qt.parse(t);return e.alpha=0,Qt.transform(e)}},Wne=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Hne(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(IE))==null?void 0:e.length)||0)+(((n=t.match(Wne))==null?void 0:n.length)||0)>0}const d4="number",f4="color",qne="var",Kne="var(",UP="${}",Gne=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
vendor: 23,082 bytes, line 495
495function nd(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(Gne,l=>(Qt.test(l)?(r.color.push(i),s.push(f4),n.push(Qt.parse(l))):l.startsWith(Kne)?(r.var.push(i),s.push(qne),n.push(l)):(r.number.push(i),s.push(d4),n.push(parseFloat(l))),++i,UP)).split(UP);return{values:n,split:a,indexes:r,types:s}}function Yne(t){return nd(t).values}function h4({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===d4?s+=lh(r[i]):o===f4?s+=Qt.transform(r[i]):s+=r[i]}return s}}function Qne(t){return h4(nd(t))}const Jne=t=>typeof t=="number"?0:Qt.test(t)?Qt.getAnimatableNone(t):t,Xne=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Jne(t);function Zne(t){const e=nd(t);return h4(e)(e.values.map((r,s)=>Xne(r,e.split[s])))}const Ws={test:Hne,parse:Yne,createTransformer:Qne,getAnimatableNone:Zne};function gw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ere({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=gw(l,a,t+1/3),i=gw(l,a,t),o=gw(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function sv(t,e){return n=>n>0?e:t}const Et=(t,e,n)=>t+(e-t)*n,yw=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},tre=[Sk,Cl,pu],nre=t=>tre.find(e=>e.test(t));function WP(t){const e=nre(t);if(yb(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===pu&&(n=ere(n)),n}const HP=(t,e)=>{const n=WP(t),r=WP(e);if(!n||!r)return sv(t,e);const s={...n};return i=>(s.red=yw(n.red,r.red,i),s.green=yw(n.green,r.green,i),s.blue=yw(n.blue,r.blue,i),s.alpha=Et(n.alpha,r.alpha,i),Cl.transform(s))},kk=new Set(["none","hidden"]);function rre(t,e){return kk.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function sre(t,e){return n=>Et(t,e,n)}function FE(t){return typeof t=="number"?sre:typeof t=="string"?DE(t)?sv:Qt.test(t)?HP:are:Array.isArray(t)?p4:typeof t=="object"?Qt.test(t)?HP:ire:sv}function p4(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>FE(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function ire(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=FE(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function ore(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],a=t.values[o]??0;n[s]=a,r[i]++}return n}const are=(t,e)=>{const n=Ws.createTransformer(e),r=nd(t),s=nd(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?kk.has(t)&&!s.values.length||kk.has(e)&&!r.values.length?rre(t,e):em(p4(ore(r,s),s.values),n):(yb(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),sv(t,e))};function m4(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Et(t,e,n):FE(t)(t,e)}const lre=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>yt.update(e,n),stop:()=>$a(e),now:()=>En.isProcessing?En.timestamp:rr.now()}},g4=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},iv=2e4;function BE(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<iv;)e+=n,r=t.next(e);return e>=iv?1/0:e}function cre(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(BE(r),iv);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:is(s)}}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ck(t,e){return t*Math.sqrt(1-e*e)}const ure=12;function dre(t,e,n){let r=n;for(let s=1;s<ure;s++)r=r-t(r)/e(r);return r}const vw=.001;function fre({duration:t=Pt.duration,bounce:e=Pt.bounce,velocity:n=Pt.velocity,mass:r=Pt.mass}){let s,i;yb(t<=Er(Pt.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=Ri(Pt.minDamping,Pt.maxDamping,o),t=Ri(Pt.minDuration,Pt.maxDuration,is(t)),o<1?(s=u=>{const d=u*o,f=d*t,h=d-n,p=Ck(u,o),m=Math.exp(-f);return vw-h/p*m},i=u=>{const f=u*o*t,h=f*n+n,p=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-f),g=Ck(Math.pow(u,2),o);return(-s(u)+vw>0?-1:1)*((h-p)*m)/g}):(s=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-vw+d*f},i=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const a=5/t,l=dre(s,i,a);if(t=Er(t),isNaN(l))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const hre=["duration","bounce"],pre=["stiffness","damping","mass"];function qP(t,e){return e.some(n=>t[n]!==void 0)}function mre(t){let e={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...t};if(!qP(t,pre)&&qP(t,hre))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ri(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Pt.mass,stiffness:s,damping:i}}else{const n=fre({...t,velocity:0});e={...e,...n,mass:Pt.mass},e.isResolvedFromDuration=!0}return e}function ov(t=Pt.visualDuration,e=Pt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=mre({...n,velocity:-is(n.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(l*d)),y=o-i,b=is(Math.sqrt(l/d)),x=Math.abs(y)<5;r||(r=x?Pt.restSpeed.granular:Pt.restSpeed.default),s||(s=x?Pt.restDelta.granular:Pt.restDelta.default);let w,S,C,k,N,E;if(g<1)C=Ck(b,g),k=(m+g*b*y)/C,w=T=>{const P=Math.exp(-g*b*T);return o-P*(k*Math.sin(C*T)+y*Math.cos(C*T))},N=g*b*k+y*C,E=g*b*y-k*C,S=T=>Math.exp(-g*b*T)*(N*Math.sin(C*T)+E*Math.cos(C*T));else if(g===1){w=P=>o-Math.exp(-b*P)*(y+(m+b*y)*P);const T=m+b*y;S=P=>Math.exp(-b*P)*(b*T*P-m)}else{const T=b*Math.sqrt(g*g-1);w=B=>{const U=Math.exp(-g*b*B),D=Math.min(T*B,300);return o-U*((m+g*b*y)*Math.sinh(D)+T*y*Math.cosh(D))/T};const P=(m+g*b*y)/T,j=g*b*P-y*T,F=g*b*y-P*T;S=B=>{const U=Math.exp(-g*b*B),D=Math.min(T*B,300);return U*(j*Math.sinh(D)+F*Math.cosh(D))}}const _={calculatedDuration:p&&f||null,velocity:T=>Er(S(T)),next:T=>{if(!p&&g<1){const j=Math.exp(-g*b*T),F=Math.sin(C*T),B=Math.cos(C*T),U=o-j*(k*F+y*B),D=Er(j*(N*F+E*B));return a.done=Math.abs(D)<=r&&Math.abs(o-U)<=s,a.value=a.done?o:U,a}const P=w(T);if(p)a.done=T>=f;else{const j=Er(S(T));a.done=Math.abs(j)<=r&&Math.abs(o-P)<=s}return a.value=a.done?o:P,a},toString:()=>{const T=Math.min(BE(_),iv),P=g4(j=>_.next(T*j).value,T,30);return T+"ms "+P},toTransition:()=>{}};return _}ov.applyToOptions=t=>{const e=cre(t,100,ov);return t.ease=e.ease,t.duration=Er(e.duration),t.type="keyframes",t};const gre=5;function y4(t,e,n){const r=Math.max(e-gre,0);return Q3(n-t(r),e-r)}function Nk({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const f=t[0],h={done:!1,value:f},p=E=>a!==void 0&&E<a||l!==void 0&&E>l,m=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let g=n*e;const y=f+g,b=o===void 0?y:o(y);b!==y&&(g=b-f);const x=E=>-g*Math.exp(-E/r),w=E=>b+x(E),S=E=>{const _=x(E),T=w(E);h.done=Math.abs(_)<=u,h.value=h.done?b:T};let C,k;const N=E=>{p(h.value)&&(C=E,k=ov({keyframes:[h.value,m(h.value)],velocity:y4(w,E,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:E=>{let _=!1;return!k&&C===void 0&&(_=!0,S(E),N(E)),C!==void 0&&E>=C?k.next(E-C):(!_&&S(E),h)}}}function yre(t,e,n){const r=[],s=n||Ba.mix||m4,i=t.length-1;for(let o=0;o<i;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||cs:e;a=em(l,a)}r.push(a)}return r}function vre(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(td(i===e.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=yre(e,r,s),l=a.length,u=d=>{if(o&&d<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const h=cp(t[f],t[f+1],d);return a[f](h)};return n?d=>u(Ri(t[0],t[i-1],d)):u}function xre(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=cp(0,e,r);t.push(Et(n,1,s))}}function bre(t){const e=[0];return xre(e,t.length-1),e}function wre(t,e){return t.map(n=>n*e)}function Sre(t,e){return t.map(()=>e||i4).splice(0,t.length-1)}function ch({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=Pne(r)?r.map(BP):BP(r),i={done:!1,value:e[0]},o=wre(n&&n.length===e.length?n:bre(e),t),a=vre(o,e,{ease:Array.isArray(s)?s:Sre(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const kre=t=>t!==null;function vb(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(kre),a=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const Cre={decay:Nk,inertia:Nk,tween:ch,keyframes:ch,spring:ov};function v4(t){typeof t.type=="string"&&(t.type=Cre[t.type])}class $E{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Nre=t=>t/100;class av extends $E{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==rr.now()&&this.tick(rr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;v4(e);const{type:n=ch,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const l=n||ch;l!==ch&&typeof a[0]!="number"&&(this.mixKeyframes=em(Nre,m4(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=BE(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,S=r;if(f){const E=Math.min(this.currentTime,s)/a;let _=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&_--,_=Math.min(_,f+1),!!(_%2)&&(h==="reverse"?(T=1-T,p&&(T-=p/a)):h==="mirror"&&(S=o)),w=Ri(0,1,T)*a}let C;x?(this.delayState.value=d[0],C=this.delayState):C=S.next(w),i&&!x&&(C.value=i(C.value));let{done:k}=C;!x&&l!==null&&(k=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return N&&m!==Nk&&(C.value=vb(d,this.options,y,this.speed)),g&&g(C.value),N&&this.finish(),C}then(e,n){return this.finished.then(e,n)}get duration(){return is(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+is(e)}get time(){return is(this.currentTime)}set time(e){e=Er(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return y4(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(rr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=is(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=lre,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(rr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Ere(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Nl=t=>t*180/Math.PI,Ek=t=>{const e=Nl(Math.atan2(t[1],t[0]));return _k(e)},_re={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ek,rotateZ:Ek,skewX:t=>Nl(Math.atan(t[1])),skewY:t=>Nl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},_k=t=>(t=t%360,t<0&&(t+=360),t),KP=Ek,GP=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),YP=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Tre={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:GP,scaleY:YP,scale:t=>(GP(t)+YP(t))/2,rotateX:t=>_k(Nl(Math.atan2(t[6],t[5]))),rotateY:t=>_k(Nl(Math.atan2(-t[2],t[0]))),rotateZ:KP,rotate:KP,skewX:t=>Nl(Math.atan(t[4])),skewY:t=>Nl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Tk(t){return t.includes("scale")?1:0}function Ak(t,e){if(!t||t==="none")return Tk(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Tre,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_re,s=a}if(!s)return Tk(e);const i=r[e],o=s[1].split(",").map(jre);return typeof i=="function"?i(o):o[i]}const Are=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ak(n,e)};function jre(t){return parseFloat(t.trim())}const Yd=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qd=new Set(Yd),QP=t=>t===Gd||t===ge,Pre=new Set(["x","y","z"]),Rre=Yd.filter(t=>!Pre.has(t));function Mre(t){const e=[];return Rre.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const da={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ak(e,"x"),y:(t,{transform:e})=>Ak(e,"y")};da.translateX=da.x;da.translateY=da.y;const zl=new Set;let jk=!1,Pk=!1,Rk=!1;function x4(){if(Pk){const t=Array.from(zl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Mre(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Pk=!1,jk=!1,zl.forEach(t=>t.complete(Rk)),zl.clear()}function b4(){zl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pk=!0)})}function Ore(){Rk=!0,b4(),x4(),Rk=!1}class VE{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(zl.add(this),jk||(jk=!0,yt.read(b4),yt.resolveKeyframes(x4))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}Ere(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),zl.delete(this)}cancel(){this.state==="scheduled"&&(zl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Dre=t=>t.startsWith("--");function w4(t,e,n){Dre(e)?t.style.setProperty(e,n):t.style[e]=n}const Ire={};function S4(t,e){const n=Y3(t);return()=>Ire[e]??n()}const Lre=S4(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),k4=S4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vf=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,JP={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vf([0,.65,.55,1]),circOut:Vf([.55,0,1,.45]),backIn:Vf([.31,.01,.66,-.59]),backOut:Vf([.33,1.53,.69,.99])};function C4(t,e){if(t)return typeof t=="function"?k4()?g4(t,e):"ease-out":o4(t)?Vf(t):Array.isArray(t)?t.map(n=>C4(n,e)||JP.easeOut):JP[t]}function Fre(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const f=C4(a,s);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(d,h)}function N4(t){return typeof t=="function"&&"applyToOptions"in t}function Bre({type:t,...e}){return N4(t)&&k4()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class E4 extends $E{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,td(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Bre(e);this.animation=Fre(n,r,s,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=vb(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),w4(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return is(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+is(e)}get time(){return is(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Er(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Lre()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),cs):s(this)}}const _4={anticipate:n4,backInOut:t4,circInOut:s4};function $re(t){return t in _4}function Vre(t){typeof t.ease=="string"&&$re(t.ease)&&(t.ease=_4[t.ease])}const xw=10;class zre extends E4{constructor(e){Vre(e),v4(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new av({...o,autoplay:!1}),l=Math.max(xw,rr.now()-this.startTime),u=Ri(0,xw,l-xw),d=a.sample(l).value,{name:f}=this.options;i&&f&&w4(i,f,d),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,d,u),a.stop()}}const XP=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ws.test(t)||t==="0")&&!t.startsWith("url("));function Ure(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Wre(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=XP(s,e),a=XP(i,e);
495return yb(o===a,`You are trying to animate ${e} from "${s}" to "${i}". "${o?i:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Ure(t)||(n==="spring"||N4(n))&&r}function Mk(t){t.duration=0,t.type="keyframes"}const T4=new Set(["opacity","clipPath","filter","transform"]),Hre=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function qre(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Hre.test(t[e]))return!0;return!1}const Kre=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Gre=Y3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Yre(t){var f;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=t;if(!(((f=e==null?void 0:e.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return Gre()&&n&&(T4.has(n)||Kre.has(n)&&qre(a))&&(n!=="transform"||!d)&&!u&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const Qre=40;class Jre extends $E{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:d,...f}){var m;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=rr.now();const h={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:u,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||VE;this.keyframeResolver=new p(a,(g,y,b)=>this.onKeyframesResolved(g,y,h,!b),l,u,d),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=rr.now();let f=!0;Wre(e,i,o,a)||(f=!1,(Ba.instantAnimations||!l)&&(d==null||d(vb(e,r,n))),e[0]=e[e.length-1],Mk(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Qre?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},m=f&&!u&&Yre(p),g=(x=(b=p.motionValue)==null?void 0:b.owner)==null?void 0:x.current;let y;if(m)try{y=new zre({...p,element:g})}catch{y=new av(p)}else y=new av(p);y.finished.then(()=>{this.notifyFinished()}).catch(cs),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ore()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function A4(t,e,n,r=0,s=1){const i=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const Xre=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Zre(t){const e=Xre.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const ese=4;function j4(t,e,n=1){td(n<=ese,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=Zre(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return q3(o)?parseFloat(o):o}return DE(s)?j4(s,e,n+1):s}const tse={type:"spring",stiffness:500,damping:25,restSpeed:10},nse=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),rse={type:"keyframes",duration:.8},sse={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ise=(t,{keyframes:e})=>e.length>2?rse:Qd.has(t)?t.startsWith("scale")?nse(e[1]):tse:sse;function P4(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function zE(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?P4(n,t):n}const ose=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ase(t){for(const e in t)if(!ose.has(e))return!0;return!1}const UE=(t,e,n,r={},s,i)=>o=>{const a=zE(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Er(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};ase(a)||Object.assign(d,ise(t,d)),d.duration&&(d.duration=Er(d.duration)),d.repeatDelay&&(d.repeatDelay=Er(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Mk(d),d.delay===0&&(f=!0)),(Ba.instantAnimations||Ba.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(f=!0,Mk(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!i&&e.get()!==void 0){const h=vb(d.keyframes,a);if(h!==void 0){yt.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new av(d):new Jre(d)};function ZP(t){const e=[{},{}];
vendor: 3,269 bytes, line 495
495return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function WE(t,e,n,r){if(typeof e=="function"){const[s,i]=ZP(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=ZP(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function Ul(t,e,n){const r=t.getProps();return WE(r,e,n!==void 0?n:r.custom,t)}const R4=new Set(["width","height","top","left","right","bottom",...Yd]),eR=30,lse=t=>!isNaN(parseFloat(t));class cse{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=rr.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=rr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=lse(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new RE);const r=this.events[e].add(n);return e==="change"?()=>{r(),yt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=rr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>eR)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,eR);return Q3(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rd(t,e){return new cse(t,e)}const Ok=t=>Array.isArray(t);function use(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,rd(n))}function dse(t){return Ok(t)?t[t.length-1]||0:t}function fse(t,e){const n=Ul(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};
vendor: 4,815 bytes, line 495
495for(const o in i){const a=dse(i[o]);use(t,o,a)}}const jn=t=>!!(t&&t.getVelocity);function hse(t){return!!(jn(t)&&t.add)}function Dk(t,e){const n=t.getValue("willChange");if(hse(n))return n.add(e);if(!n&&Ba.WillChange){const r=new Ba.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function HE(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const pse="framerAppearId",M4="data-"+HE(pse);function O4(t){return t.props[M4]}function mse({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function D4(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();i=i?P4(i,l):l;const u=i==null?void 0:i.reduceMotion;r&&(i=r);const d=[],f=s&&t.animationState&&t.animationState.getState()[s];for(const h in a){const p=t.getValue(h,t.latestValues[h]??null),m=a[h];if(m===void 0||f&&mse(f,h))continue;const g={delay:n,...zE(i||{},h)},y=p.get();if(y!==void 0&&!p.isAnimating()&&!Array.isArray(m)&&m===y&&!g.velocity){yt.update(()=>p.set(m));continue}let b=!1;if(window.MotionHandoffAnimation){const S=O4(t);if(S){const C=window.MotionHandoffAnimation(S,h,yt);C!==null&&(g.startTime=C,b=!0)}}Dk(t,h);const x=u??t.shouldReduceMotion;p.start(UE(h,p,m,x&&R4.has(h)?{type:!1}:g,t,b));const w=p.animation;w&&d.push(w)}if(o){const h=()=>yt.update(()=>{o&&fse(t,o)});d.length?Promise.all(d).then(h):h()}return d}function Ik(t,e,n={}){var l;const r=Ul(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(D4(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return gse(t,e,u,d,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[u,d]=a==="beforeChildren"?[i,o]:[o,i];return u().then(()=>d())}else return Promise.all([i(),o(n.delay)])}function gse(t,e,n=0,r=0,s=0,i=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Ik(l,e,{...o,delay:n+(typeof r=="function"?0:r)+A4(t.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function yse(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Ik(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Ik(t,e,n);else{const s=typeof e=="function"?Ul(t,e,n.custom):e;r=Promise.all(D4(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const vse={test:t=>t==="auto",parse:t=>t},I4=t=>e=>e.test(t),L4=[Gd,ge,_i,Io,Une,zne,vse],tR=t=>L4.find(I4(t));function xse(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||G3(t):!0}const bse=new Set(["brightness","contrast","saturate","opacity"]);function wse(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(IE)||[];if(!r)return t;const s=n.replace(r,"");let i=bse.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const Sse=/\b([a-z-]*)\(.*?\)/gu,Lk={...Ws,getAnimatableNone:t=>{const e=t.match(Sse);return e?e.map(wse).join(" "):t}},Fk={...Ws,getAnimatableNone:t=>{const e=Ws.parse(t);return Ws.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},nR={...Gd,transform:Math.round},kse={rotate:Io,rotateX:Io,rotateY:Io,rotateZ:Io,scale:og,scaleX:og,scaleY:og,scaleZ:og,skew:Io,skewX:Io,skewY:Io,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:up,originX:zP,originY:zP,originZ:ge},qE={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,inset:ge,insetBlock:ge,insetBlockStart:ge,insetBlockEnd:ge,insetInline:ge,insetInlineStart:ge,insetInlineEnd:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,paddingBlock:ge,paddingBlockStart:ge,paddingBlockEnd:ge,paddingInline:ge,paddingInlineStart:ge,paddingInlineEnd:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,marginBlock:ge,marginBlockStart:ge,marginBlockEnd:ge,marginInline:ge,marginInlineStart:ge,marginInlineEnd:ge,fontSize:ge,backgroundPositionX:ge,backgroundPositionY:ge,...kse,zIndex:nR,fillOpacity:up,strokeOpacity:up,numOctaves:nR},Cse={...qE,color:Qt,backgroundColor:Qt,outlineColor:Qt,fill:Qt,stroke:Qt,borderColor:Qt,borderTopColor:Qt,borderRightColor:Qt,borderBottomColor:Qt,borderLeftColor:Qt,filter:Lk,WebkitFilter:Lk,mask:Fk,WebkitMask:Fk},F4=t=>Cse[t],Nse=new Set([Lk,Fk]);function B4(t,e){let n=F4(t);return Nse.has(n)||(n=Ws),n.getAnimatableNone?n.getAnimatableNone(e):void 0}
vendor: 1,723 bytes, line 495
495const Ese=new Set(["auto","none","0"]);function _se(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Ese.has(i)&&nd(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=B4(n,s)}class Tse extends VE{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let f=e[d];if(typeof f=="string"&&(f=f.trim(),DE(f))){const h=j4(f,n.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!R4.has(r)||e.length!==2)return;const[s,i]=e,o=tR(s),a=tR(i),l=VP(s),u=VP(i);if(l!==u&&da[r]){this.needsMeasurement=!0;return}if(o!==a)if(QP(o)&&QP(a))for(let d=0;d<e.length;d++){const f=e[d];typeof f=="string"&&(e[d]=parseFloat(f))}else da[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||xse(e[s]))&&r.push(s);r.length&&_se(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=da[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=da[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEac
vendor: 25,660 bytes, line 495
495h(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function KE(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const s=document.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const $4=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Yg(t){return K3(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:GE,cancel:vTe}=a4(queueMicrotask,!1),Ts={x:!1,y:!1};function V4(){return Ts.x||Ts.y}function Ase(t){return t==="x"||t==="y"?Ts[t]?null:(Ts[t]=!0,()=>{Ts[t]=!1}):Ts.x||Ts.y?null:(Ts.x=Ts.y=!0,()=>{Ts.x=Ts.y=!1})}function z4(t,e){const n=KE(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function jse(t){return!(t.pointerType==="touch"||V4())}function Pse(t,e,n={}){const[r,s,i]=z4(t,n);return r.forEach(o=>{let a=!1,l=!1,u;const d=()=>{o.removeEventListener("pointerleave",m)},f=y=>{u&&(u(y),u=void 0),d()},h=y=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(y))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=y=>{if(y.pointerType!=="touch"){if(a){l=!0;return}f(y)}},g=y=>{if(!jse(y))return;l=!1;const b=e(o,y);typeof b=="function"&&(u=b,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const U4=(t,e)=>e?t===e?!0:U4(t,e.parentElement):!1,YE=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Rse=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Mse(t){return Rse.has(t.tagName)||t.isContentEditable===!0}const Ose=new Set(["INPUT","SELECT","TEXTAREA"]);function Dse(t){return Ose.has(t.tagName)||t.isContentEditable===!0}const Qg=new WeakSet;function rR(t){return e=>{e.key==="Enter"&&t(e)}}function bw(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ise=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=rR(()=>{if(Qg.has(n))return;bw(n,"down");const s=rR(()=>{bw(n,"up")}),i=()=>bw(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function sR(t){return YE(t)&&!V4()}const iR=new WeakSet;function Lse(t,e,n={}){const[r,s,i]=z4(t,n),o=a=>{const l=a.currentTarget;if(!sR(a)||iR.has(a))return;Qg.add(l),n.stopPropagation&&iR.add(a);const u=e(l,a),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Qg.has(l)&&Qg.delete(l),sR(p)&&typeof u=="function"&&u(p,{success:m})},f=p=>{d(p,l===window||l===document||n.useGlobalTarget||U4(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Yg(a)&&(a.addEventListener("focus",u=>Ise(u,s)),!Mse(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function QE(t){return K3(t)&&"ownerSVGElement"in t}const Jg=new WeakMap;let Lo;const W4=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:QE(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Fse=W4("inline","width","offsetWidth"),Bse=W4("block","height","offsetHeight");function $se({target:t,borderBoxSize:e}){var n;(n=Jg.get(t))==null||n.forEach(r=>{r(t,{get width(){return Fse(t,e)},get height(){return Bse(t,e)}})})}function Vse(t){t.forEach($se)}function zse(){typeof ResizeObserver>"u"||(Lo=new ResizeObserver(Vse))}function Use(t,e){Lo||zse();const n=KE(t);return n.forEach(r=>{let s=Jg.get(r);s||(s=new Set,Jg.set(r,s)),s.add(e),Lo==null||Lo.observe(r)}),()=>{n.forEach(r=>{const s=Jg.get(r);s==null||s.delete(e),s!=null&&s.size||Lo==null||Lo.unobserve(r)})}}const Xg=new Set;let mu;function Wse(){mu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xg.forEach(e=>e(t))},window.addEventListener("resize",mu)}function Hse(t){return Xg.add(t),mu||Wse(),()=>{Xg.delete(t),!Xg.size&&typeof mu=="function"&&(window.removeEventListener("resize",mu),mu=void 0)}}function oR(t,e){return typeof t=="function"?Hse(t):Use(t,e)}function qse(t){return QE(t)&&t.tagName==="svg"}const Kse=[...L4,Qt,Ws],Gse=t=>Kse.find(I4(t)),aR=()=>({translate:0,scale:1,origin:0,originPoint:0}),gu=()=>({x:aR(),y:aR()}),lR=()=>({min:0,max:0}),an=()=>({x:lR(),y:lR()}),Yse=new WeakMap;function xb(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function dp(t){return typeof t=="string"||Array.isArray(t)}const JE=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],XE=["initial",...JE];function bb(t){return xb(t.animate)||XE.some(e=>dp(t[e]))}function H4(t){return!!(bb(t)||t.variants)}function Qse(t,e,n){for(const r in e){const s=e[r],i=n[r];if(jn(s))t.addValue(r,s);else if(jn(i))t.addValue(r,rd(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,rd(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Bk={current:null},q4={current:!1},Jse=typeof window<"u";function Xse(){if(q4.current=!0,!!Jse)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Bk.current=t.matches;t.addEventListener("change",e),e()}else Bk.current=!1}const cR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let lv={};function K4(t){lv=t}function Zse(){return lv}class eie{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=VE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=rr.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,yt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=bb(n),this.isVariantNode=H4(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];u[p]!==void 0&&jn(m)&&m.set(u[p])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,Yse.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(q4.current||Xse(),this.shouldReduceMotion=Bk.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),$a(this.notifyUpdate),$a(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&T4.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:d}=n.accelerate,f=new E4({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:Er(d)}),h=o(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const r=Qd.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&yt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in lv){const n=lv[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):an()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<cR.length;r++){const s=cR[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Qse(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=rd(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(q3(r)||G3(r))?r=parseFloat(r):!Gse(r)&&Ws.test(n)&&(r=B4(e,n)),this.setBaseTarget(e,jn(r)?r.get():r)),jn(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=WE(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!jn(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new RE),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){GE.render(this.render)}}class G4 extends eie{constructor(){super(...arguments),this.KeyframeResolver=Tse}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;jn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Xa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Y4({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function tie({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function nie(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ww(t){return t===void 0||t===1}function $k({scale:t,scaleX:e,scaleY:n}){return!ww(t)||!ww(e)||!ww(n)}function ml(t){return $k(t)||Q4(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Q4(t){return uR(t.x)||uR(t.y)}function uR(t){return t&&t!=="0%"}function cv(t,e,n){const r=t-n,s=e*r;return n+s}function dR(t,e,n,r,s){return s!==void 0&&(t=cv(t,s,r)),cv(t,n,r)+e}function Vk(t,e=0,n=1,r,s){t.min=dR(t.min,e,n,r,s),t.max=dR(t.max,e,n,r,s)}function J4(t,{x:e,y:n}){Vk(t.x,e.translate,e.scale,e.originPoint),Vk(t.y,n.translate,n.scale,n.originPoint)}const fR=.999999999999,hR=1.0000000000001;function rie(t,e,n,r=!1){var a;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:u}=i.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(gi(t.x,-i.scroll.offset.x),gi(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,J4(t,o)),r&&ml(i.latestValues)&&Zg(t,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}e.x<hR&&e.x>fR&&(e.x=1),e.y<hR&&e.y>fR&&(e.y=1)}function gi(t,e){t.min+=e,t.max+=e}function pR(t,e,n,r,s=.5){const i=Et(t.min,t.max,s);Vk(t,e,n,i,r)}function mR(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Zg(t,e,n){const r=n??t;pR(t.x,mR(e.x,r.x),e.scaleX,e.scale,e.originX),pR(t.y,mR(e.y,r.y),e.scaleY,e.scale,e.originY)}function X4(t,e){return Y4(nie(t.getBoundingClientRect(),e))}function sie(t,e,n){const r=X4(t,n),{scroll:s}=e;return s&&(gi(r.x,s.offset.x),gi(r.y,s.offset.y)),r}const iie={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},oie=Yd.length;function aie(t,e,n){let r="",s=!0;for(let i=0;i<oie;i++){const o=Yd[i],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=$4(a,qE[o]);if(!l){s=!1;const d=iie[o]||o;r+=`${d}(${u}) `}n&&(e[o]=u)}}return r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function ZE(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(Qd.has(l)){o=!0;continue}else if(c4(l)){s[l]=u;continue}else{const d=$4(u,qE[l]);l.startsWith("origin")?(a=!0,i[l]=d):r[l]=d}}if(e.transform||(o||n?r.transform=aie(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${l} ${u} ${d}`}}function Z4(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function gR(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(ge.test(t))t=parseFloat(t);else return t;const n=gR(t,e.target.x),r=gR(t,e.target.y);return`${n}% ${r}%`}},lie={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ws.parse(t);if(s.length>5)return r;const i=Ws.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Et(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}},zk={borderRadius:{...gf,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gf,borderTopRightRadius:gf,borderBottomLeftRadius:gf,borderBottomRightRadius:gf,boxShadow:lie};function e$(t,{layout:e,layoutId:n}){return Qd.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!zk[t]||t==="opacity")}function e_(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const a in r)(jn(r[a])||s&&jn(s[a])||e$(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function cie(t){return window.getComputedStyle(t)}class uie extends G4{constructor(){super(...arguments),this.type="html",this.renderInstance=Z4}readValueFromInstance(e,n){var r;if(Qd.has(n))return(r=this.projection)!=null&&r.isProjecting?Tk(n):Are(e,n);{const s=cie(e),i=(c4(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return X4(e,n)}build(e,n,r){ZE(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return e_(e,n,r)}}const die={offset:"stroke-dashoffset",array:"stroke-dasharray"},fie={offset:"strokeDashoffset",array:"strokeDasharray"};function hie(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?die:fie;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const pie=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function t$(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,u,d){if(ZE(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const p of pie)f[p]!==void 0&&(h[p]=f[p],delete f[p]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&hie(f,s,i,o,!1)}const n$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),r$=t=>typeof t=="string"&&t.toLowerCase()==="svg";function mie(t,e,n,r){Z4(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(n$.has(s)?s:HE(s),e.attrs[s])}function s$(t,e,n){const r=e_(t,e,n);for(const s in t)if(jn(t[s])||jn(e[s])){const i=Yd.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class gie extends G4{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=an}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Qd.has(n)){const r=F4(n);return r&&r.default||0}return n=n$.has(n)?n:HE(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return s$(e,n,r)}build(e,n,r){t$(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){mie(e,n,r,s)}mount(e){this.isSVGTag=r$(e.tagName),super.mount(e)}}const yie=XE.length;function i$(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?i$(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<yie;n++){const r=XE[n],s=t.props[r];(dp(s)||s===!1)&&(e[r]=s)}return e}function o$(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const vie=[...JE].reverse(),xie=JE.length;function bie(t){return e=>Promise.all(e.map(({animation:n,options:r})=>yse(t,n,r)))}function wie(t){let e=bie(t),n=yR(),r=!0,s=!1;const i=u=>(d,f)=>{var p;const h=Ul(t,f,u==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:g,...y}=h;d={...d,...y,...g}}return d};function o(u){e=u(t)}function a(u){const{props:d}=t,f=i$(t.parent)||{},h=[],p=new Set;let m={},g=1/0;for(let b=0;b<xie;b++){const x=vie[b],w=n[x],S=d[x]!==void 0?d[x]:f[x],C=dp(S),k=x===u?w.isActive:null;k===!1&&(g=b);let N=S===f[x]&&S!==d[x]&&C;if(N&&(r||s)&&t.manuallyAnimateOnMount&&(N=!1),w.protectedKeys={...m},!w.isActive&&k===null||!S&&!w.prevProp||xb(S)||typeof S=="boolean")continue;if(x==="exit"&&w.isActive&&k!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const E=Sie(w.prevProp,S);let _=E||x===u&&w.isActive&&!N&&C||b>g&&C,T=!1;const P=Array.isArray(S)?S:[S];let j=P.reduce(i(x),{});k===!1&&(j={});const{prevResolvedValues:F={}}=w,B={...F,...j},U=A=>{_=!0,p.has(A)&&(T=!0,p.delete(A)),w.needsAnimating[A]=!0;const O=t.getValue(A);O&&(O.liveStyle=!1)};for(const A in B){const O=j[A],W=F[A];if(m.hasOwnProperty(A))continue;let Z=!1;Ok(O)&&Ok(W)?Z=!o$(O,W):Z=O!==W,Z?O!=null?U(A):p.add(A):O!==void 0&&p.has(A)?U(A):w.protectedKeys[A]=!0}w.prevProp=S,w.prevResolvedValues=j,w.isActive&&(m={...m,...j}),(r||s)&&t.blockInitialAnimation&&(_=!1);const D=N&&E;_&&(!D||T)&&h.push(...P.map(A=>{const O={type:x};if(typeof A=="string"&&(r||s)&&!D&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,Z=Ul(W,A);if(W.enteringChildren&&Z){const{delayChildren:$}=Z.transition||{};O.delay=A4(W.enteringChildren,t,$)}}return{animation:A,options:O}}))}if(p.size){const b={};if(typeof d.initial!="boolean"){const x=Ul(t,Array.isArray(d.initial)?d.initial[0]:d.initial);x&&x.transition&&(b.transition=x.transition)}p.forEach(x=>{const w=t.getBaseTarget(x),S=t.getValue(x);S&&(S.liveStyle=!0),b[x]=w??null}),h.push({animation:b})}let y=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(y=!1),r=!1,s=!1,y?e(h):Promise.resolve()}function l(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=yR(),s=!0}}}function Sie(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!o$(e,t):!1}function cl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yR(){return{animate:cl(!0),whileInView:cl(),whileHover:cl(),whileTap:cl(),whileDrag:cl(),whileFocus:cl(),exit:cl()}}function Uk(t,e){t.min=e.min,t.max=e.max}function Cs(t,e){Uk(t.x,e.x),Uk(t.y,e.y)}function vR(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const a$=1e-4,kie=1-a$,Cie=1+a$,l$=.01,Nie=0-l$,Eie=0+l$;function sr(t){return t.max-t.min}function _ie(t,e,n){return Math.abs(t-e)<=n}function xR(t,e,n,r=.5){t.origin=r,t.originPoint=Et(e.min,e.max,t.origin),t.scale=sr(n)/sr(e),t.translate=Et(n.min,n.max,t.origin)-t.originPoint,(t.scale>=kie&&t.scale<=Cie||isNaN(t.scale))&&(t.scale=1),(t.translate>=Nie&&t.translate<=Eie||isNaN(t.translate))&&(t.translate=0)}function uh(t,e,n,r){xR(t.x,e.x,n.x,r?r.originX:void 0),xR(t.y,e.y,n.y,r?r.originY:void 0)}function bR(t,e,n,r=0){const s=r?Et(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+sr(e)}function Tie(t,e,n,r){bR(t.x,e.x,n.x,r==null?void 0:r.x),bR(t.y,e.y,n.y,r==null?void 0:r.y)}function wR(t,e,n,r=0){const s=r?Et(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+sr(e)}function uv(t,e,n,r){wR(t.x,e.x,n.x,r==null?void 0:r.x),wR(t.y,e.y,n.y,r==null?void 0:r.y)}function SR(t,e,n,r,s){return t-=e,t=cv(t,1/n,r),s!==void 0&&(t=cv(t,1/s,r)),t}function Aie(t,e=0,n=1,r=.5,s,i=t,o=t){if(_i.test(e)&&(e=parseFloat(e),e=Et(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Et(i.min,i.max,r);t===i&&(a-=e),t.min=SR(t.min,e,n,a,s),t.max=SR(t.max,e,n,a,s)}function kR(t,e,[n,r,s],i,o){Aie(t,e[n],e[r],e[s],e.scale,i,o)}const jie=["x","scaleX","originX"],Pie=["y","scaleY","originY"];function CR(t,e,n,r){kR(t.x,e,jie,n?n.x:void 0,r?r.x:void 0),kR(t.y,e,Pie,n?n.y:void 0,r?r.y:void 0)}function NR(t){return t.translate===0&&t.scale===1}function c$(t){return NR(t.x)&&NR(t.y)}function ER(t,e){return t.min===e.min&&t.max===e.max}function Rie(t,e){return ER(t.x,e.x)&&ER(t.y,e.y)}function _R(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function u$(t,e){return _R(t.x,e.x)&&_R(t.y,e.y)}function TR(t){return sr(t.x)/sr(t.y)}function AR(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function oi(t){return[t("x"),t("y")]}function Mie(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l}
495)`),r||"none"}const d$=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Oie=d$.length,jR=t=>typeof t=="string"?parseFloat(t):t,PR=t=>typeof t=="number"||ge.test(t);function Die(t,e,n,r,s,i){s?(t.opacity=Et(0,n.opacity??1,Iie(r)),t.opacityExit=Et(e.opacity??1,0,Lie(r))):i&&(t.opacity=Et(e.opacity??1,n.opacity??1,r));for(let o=0;o<Oie;o++){const a=d$[o];let l=RR(e,a),u=RR(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||PR(l)===PR(u)?(t[a]=Math.max(Et(jR(l),jR(u),r),0),(_i.test(u)||_i.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=Et(e.rotate||0,n.rotate||0,r))}function RR(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Iie=f$(0,.5,r4),Lie=f$(.5,.95,cs);function f$(t,e,n){return r=>r<t?0:r>e?1:n(cp(t,e,r))}function Fie(t,e,n){const r=jn(t)?t:rd(t);return r.start(UE("",r,e,n)),r.animation}function fp(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const Bie=(t,e)=>t.depth-e.depth;class $ie{constructor(){this.children=[],this.isDirty=!1}add(e){PE(this.children,e),this.isDirty=!0}remove(e){rv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Bie),this.isDirty=!1,this.children.forEach(e)}}function Vie(t,e){const n=rr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&($a(r),t(i-e))};return yt.setup(r,!0),()=>$a(r)}function ey(t){return jn(t)?t.get():t}class zie{constructor(){this.members=[]}add(e){PE(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(rv(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(rv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const ty={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sw=["","X","Y","Z"],Uie=1e3;let Wie=0;function kw(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function h$(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=O4(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",yt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&h$(r)}function p$({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Wie++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>
vendor: 11,049 bytes, line 495
495{this.projectionUpdateScheduled=!1,this.nodes.forEach(Kie),this.nodes.forEach(Zie),this.nodes.forEach(eoe),this.nodes.forEach(Gie)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new $ie)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new RE),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=QE(o)&&!qse(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;yt.read(()=>{f=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=Vie(h,250),ty.hasAnimatedSinceResize&&(ty.hasAnimatedSinceResize=!1,this.nodes.forEach(DR)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||ioe,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),b=!this.targetLayout||!u$(this.targetLayout,p),x=!f&&h;if(this.options.layoutRoot||this.resumeFrom||x||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...zE(m,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(d,x)}else f||DR(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),$a(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(toe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&h$(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(Qie),this.nodes.forEach(MR);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(OR);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Jie),this.nodes.forEach(Xie),this.nodes.forEach(Hie),this.nodes.forEach(qie)):this.nodes.forEach(OR),this.clearAllSnapshots();const a=rr.now();En.delta=Ri(0,1e3/60,a-En.timestamp),En.timestamp=a,En.isProcessing=!0,pw.update.process(En),pw.preRender.process(En),pw.render.process(En),En.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,GE.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Yie),this.sharedNodes.forEach(noe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!sr(this.snapshot.measuredBox.x)&&!sr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=an()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!c$(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||ml(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),ooe(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return an();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(aoe))){const{scroll:d}=this.root;d&&(gi(a.x,d.offset.x),gi(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=an();if(Cs(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Cs(a,o),gi(a.x,f.offset.x),gi(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var d,f;const u=l||an();Cs(u,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(gi(u.x,-p.scroll.offset.x),gi(u.y,-p.scroll.offset.y)),ml(p.latestValues)&&Zg(u,p.latestValues,(d=p.layout)==null?void 0:d.layoutBox)}return ml(this.latestValues)&&Zg(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(o){var l;const a=an();Cs(a,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!ml(d.latestValues))continue;let f;d.instance&&($k(d.latestValues)&&d.updateSnapshot(),f=an(),Cs(f,d.measurePageBox())),CR(a,d.latestValues,(l=d.snapshot)==null?void 0:l.layoutBox,f)}return ml(this.latestValues)&&CR(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==En.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=En.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=an(),this.targetWithTransforms=an()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Tie(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Cs(this.target,this.layout.layoutBox),J4(this.target,this.targetDelta)):Cs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||$k(this.parent.latestValues)||Q4(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=an(),this.relativeTargetOrigin=an(),uv(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),Cs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&
vendor: 5,341 bytes, line 495
495(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===En.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Cs(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;rie(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=an());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(vR(this.prevProjectionDelta.x,this.projectionDelta.x),vR(this.prevProjectionDelta.y,this.projectionDelta.y)),uh(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!AR(this.projectionDelta.x,this.prevProjectionDelta.x)||!AR(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gu(),this.projectionDelta=gu(),this.projectionDeltaWithTransform=gu()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},f=gu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=an(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,y=this.getStack(),b=!y||y.members.length<=1,x=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(soe));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const C=S/1e3;IR(f.x,o.x,C),IR(f.y,o.y,C),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uv(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),roe(this.relativeTarget,this.relativeTargetOrigin,h,C),w&&Rie(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=an()),Cs(w,this.relativeTarget)),g&&(this.animationValues=d,Die(d,u,this.latestValues,C,x,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&($a(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yt.update(()=>{ty.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=rd(0)),this.motionValue.jump(0,!1),this.currentAnimation=Fie(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Uie),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&m$(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||an();const f=sr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=sr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Cs(a,l),Zg(a,d),uh(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zie),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}
vendor: 4,517 bytes, line 495
495resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&kw("z",o,u,this.animationValues);for(let d=0;d<Sw.length;d++)kw(`rotate${Sw[d]}`,o,u,this.animationValues),kw(`skew${Sw[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=ey(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=ey(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ml(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Mie(this.projectionDeltaWithTransform,this.treeScale,d);l&&(f=l(d,f)),o.transform=f;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in zk){if(d[m]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:b}=zk[m],x=f==="none"?d[m]:g(d[m],u);if(y){const w=y.length;for(let S=0;S<w;S++)o[y[S]]=x}else b?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=u===this?ey(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(MR),this.root.sharedNodes.clear()}}}function Hie(t){t.updateLayout()}function qie(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")oi(f=>{const h=o?e.measuredBox[f]:e.layoutBox[f],p=sr(h);h.min=r[f].min,h.max=h.min+p});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";Uk(o?e.measuredBox[f]:e.layoutBox[f],r[f])}else m$(i,e.layoutBox,r)&&oi(f=>{const h=o?e.measuredBox[f]:e.layoutBox[f],p=sr(r[f]);h.max=h.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+p)});const a=gu();uh(a,r,e.layoutBox);const l=gu();o?uh(l,t.applyTransform(s,!0),e.measuredBox):uh(l,r,e.layoutBox);const u=!c$(a);let d=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=t.options.layoutAnchor||void 0,g=an();uv(g,e.layoutBox,h.layoutBox,m);const y=an();uv(y,r,p.layoutBox,m),u$(g,y)||(d=!0),f.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=g,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Kie(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Gie(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Yie(t){t.clearSnapshot()}function MR(t){t.clearMeasurements()}function Qie(t){t.isLayoutDirty=!0,t.updateLayout()}function OR(t){t.isLayoutDirty=!1}function Jie(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Xie(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function DR(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Zie(t){t.resolveTargetDelta()}function eoe(t){t.calcProjection()}
495function toe(t){t.resetSkewAndRotation()}function noe(t){t.removeLeadSnapshot()}function IR(t,e,n){t.translate=Et(e.translate,0,n),t.scale=Et(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function LR(t,e,n,r){t.min=Et(e.min,n.min,r),t.max=Et(e.max,n.max,r)}function roe(t,e,n,r){LR(t.x,e.x,n.x,r),LR(t.y,e.y,n.y,r)}function soe(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ioe={duration:.45,ease:[.4,0,.1,1]},FR=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),BR=FR("applewebkit/")&&!FR("chrome/")?Math.round:cs;function $R(t){t.min=BR(t.min),t.max=BR(t.max)}function ooe(t){$R(t.x),$R(t.y)}function m$(t,e,n){return t==="position"||t==="preserve-aspect"&&!_ie(TR(e),TR(n),.2)}function aoe(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const loe=p$({attachResizeListener:(t,e)=>fp(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Cw={current:void 0},g$=p$({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cw.current){const t=new loe({});t.mount(window),t.setOptions({layoutScroll:!0}),Cw.current=t}return Cw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),t_=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function VR(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function coe(...t){return e=>{let n=!1;const r=t.map(s=>{const i=VR(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():VR(t[s],null)}}}}function uoe(...t){return v.useCallback(coe(...t),t)}class doe extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Yg(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Yg(r)&&r.offsetWidth||0,i=Yg(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function foe({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=v.useId(),a=v.useRef(null),l=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=v.useContext(t_),d=((h=t.props)==null?void 0:h.ref)??(t==null?void 0:t.ref),f=uoe(a,d);return v.useInsertionEffect(()=>{const{width:p,height:m,top:g,left:y,right:b,bottom:x}=l.current;if(e||i===!1||!a.current||!p||!m)return;const w=n==="left"?`left: ${y}`:`right: ${b}`,S=r==="bottom"?`bottom: ${x}`:`top: ${g}`;a.current.dataset.motionPopId=o;const C=document.createElement("style");u&&(C.nonce=u);const k=s??document.head;return k.appendChild(C),C.sheet&&C.sheet.insertRule(`
496          [data-motion-pop-id="${o}"] {
497            position: absolute !important;
498            width: ${p}px !important;
499            height: ${m}px !important;
500            ${w}px !important;
501            ${S}px !important;
502          }
503        `),()=>{var N;(N=a.current)==null||N.removeAttribute("data-motion-pop-id"),k.contains(C)&&k.removeChild(C)}},[e]),c.jsx(doe,{isPresent:e,childRef:a,sizeRef:l,pop:i,children:i===!1?t:v.cloneElement(t,{ref:f})})}const hoe=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:u})=>{const d=jE(poe),f=v.useId();let h=!0,p=v.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:s,onExitComplete:m=>{d.set(m,!0);for(const g of d.values())if(!g)return;r&&r()},register:m=>(d.set(m,!1),()=>d.delete(m))}),[n,d,r]);return i&&h&&(p={...p}),v.useMemo(()=>{d.forEach((m,g)=>d.set(g,!1))},[n]),v.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=c.jsx(foe,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:u,children:t}),c.jsx(gb.Provider,{value:p,children:t})};function poe(){return new Map}function y$(t=!0){const e=v.useContext(gb);
vendor: 5,672 bytes, line 503
503if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const o=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const ag=t=>t.key||"";function zR(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const moe=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[d,f]=y$(o),h=v.useMemo(()=>zR(t),[t]),p=o&&!d?[]:h.map(ag),m=v.useRef(!0),g=v.useRef(h),y=jE(()=>new Map),b=v.useRef(new Set),[x,w]=v.useState(h),[S,C]=v.useState(h);H3(()=>{m.current=!1,g.current=h;for(let E=0;E<S.length;E++){const _=ag(S[E]);p.includes(_)?(y.delete(_),b.current.delete(_)):y.get(_)!==!0&&y.set(_,!1)}},[S,p.length,p.join("-")]);const k=[];if(h!==x){let E=[...h];for(let _=0;_<S.length;_++){const T=S[_],P=ag(T);p.includes(P)||(E.splice(_,0,T),k.push(T))}return i==="wait"&&k.length&&(E=k),C(zR(E)),w(h),null}const{forceRender:N}=v.useContext(AE);return c.jsx(c.Fragment,{children:S.map(E=>{const _=ag(E),T=o&&!d?!1:h===S||p.includes(_),P=()=>{if(b.current.has(_))return;if(y.has(_))b.current.add(_),y.set(_,!0);else return;let j=!0;y.forEach(F=>{F||(j=!1)}),j&&(N==null||N(),C(g.current),o&&(f==null||f()),r&&r())};return c.jsx(hoe,{isPresent:T,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:u,onExitComplete:T?void 0:P,anchorX:a,anchorY:l,children:E},_)})})},v$=v.createContext({strict:!1}),UR={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let WR=!1;function goe(){if(WR)return;const t={};for(const e in UR)t[e]={isEnabled:n=>UR[e].some(r=>!!n[r])};K4(t),WR=!0}function x$(){return goe(),Zse()}function yoe(t){const e=x$();for(const n in t)e[n]={...e[n],...t[n]};K4(e)}const voe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function dv(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||voe.has(t)}let b$=t=>!dv(t);function xoe(t){typeof t=="function"&&(b$=e=>e.startsWith("on")?!dv(e):t(e))}try{xoe(require("@emotion/is-prop-valid").default)}catch{}function boe(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||jn(t[s])||(b$(s)||n===!0&&dv(s)||!e&&!dv(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const wb=v.createContext({});function woe(t,e){if(bb(t)){const{initial:n,animate:r}=t;return{initial:n===!1||dp(n)?n:void 0,animate:dp(r)?r:void 0}}return t.inherit!==!1?e:{}}function Soe(t){const{initial:e,animate:n}=woe(t,v.useContext(wb));return v.useMemo(()=>({initial:e,animate:n}),[HR(e),HR(n)])}function HR(t){return Array.isArray(t)?t.join(" "):t}const n_=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function w$(t,e,n){for(const r in e)!jn(e[r])&&!e$(r,n)&&(t[r]=e[r])}function koe({transformTemplate:t},e){return v.useMemo(()=>{const n=n_();return ZE(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Coe(t,e){const n=t.style||{},r={};return w$(r,n,t),Object.assign(r,koe(t,e)),r}function Noe(t,e){const n={},r=Coe(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const S$=()=>({...n_(),attrs:{}});function Eoe(t,e,n,r){const s=v.useMemo(()=>{const i=S$();return t$(i,e,r$(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};w$(i,t.style,t),s.style={...i,...s.style}}return s}const _oe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function r_(t){return typeof t!="string"||t.includes("-")?!1:!!(_oe.indexOf(t)>-1||/[A-Z]/u.test(t))}function Toe(t,e,n,{latestValues:r},s,i=!1,o){const l=(o??r_(t)?Eoe:Noe)(e,r,s,t),u=boe(e,typeof t=="string",i),d=t!==v.Fragment?{...u,...l,ref:n}:{},{children:f}=e,h=v.useMemo(()=>jn(f)?f.get():f,[f]);return v.createElement(t,{...d,children:h})}function Aoe({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:joe(n,r,s,t),renderState:e()}}function joe(t,e,n,r){const s={},i=r(t,{});for(const h in i)s[h]=ey(i[h]);let{initial:o,animate:a}=t;const l=bb(t),u=H4(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?a:o;if(f&&typeof f!="boolean"&&!xb(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const m=WE(t,h[p]);if(m){const{transitionEnd:g,transition:y,...b}=m;for(const x in b){let w=b[x];if(Array.isArray(w)){const S=d?w.length-1:0;w=w[S]}w!==null&&(s[x]=w)}for(const x in g)s[x]=g[x]}}}return s}const k$=t=>
vendor: 22,019 bytes, line 503
503(e,n)=>{const r=v.useContext(wb),s=v.useContext(gb),i=()=>Aoe(t,e,r,s);return n?i():jE(i)},Poe=k$({scrapeMotionValuesFromProps:e_,createRenderState:n_}),Roe=k$({scrapeMotionValuesFromProps:s$,createRenderState:S$}),Moe=Symbol.for("motionComponentSymbol");function Ooe(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{var a;i&&((a=t.onMount)==null||a.call(t,i));const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i);e&&(i?e.mount(i):e.unmount())},[e])}const C$=v.createContext({});function Gc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Doe(t,e,n,r,s,i){var w,S;const{visualElement:o}=v.useContext(wb),a=v.useContext(v$),l=v.useContext(gb),u=v.useContext(t_),d=u.reducedMotion,f=u.skipAnimations,h=v.useRef(null),p=v.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=v.useContext(C$);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&Ioe(h.current,n,s,g);const y=v.useRef(!1);v.useInsertionEffect(()=>{m&&y.current&&m.update(n,l)});const b=n[M4],x=v.useRef(!!b&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,b))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,b)));return H3(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,b)}),x.current=!1),m.enteringChildren=void 0)}),m}function Ioe(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:N$(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Gc(a),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:u,layoutAnchor:d})}function N$(t){if(t)return t.options.allowProjection!==!1?t.projection:N$(t.parent)}function Nw(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&yoe(r);const i=n?n==="svg":r_(t),o=i?Roe:Poe;function a(u,d){let f;const h={...v.useContext(t_),...u,layoutId:Loe(u)},{isStatic:p}=h,m=Soe(u),g=o(u,p);if(!p&&typeof window<"u"){Foe();const y=Boe(h);f=y.MeasureLayout,m.visualElement=Doe(t,g,h,s,y.ProjectionNode,i)}return c.jsxs(wb.Provider,{value:m,children:[f&&m.visualElement?c.jsx(f,{visualElement:m.visualElement,...h}):null,Toe(t,u,Ooe(g,m.visualElement,d),g,p,e,i)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=v.forwardRef(a);return l[Moe]=t,l}function Loe({layoutId:t}){const e=v.useContext(AE).id;return e&&t!==void 0?e+"-"+t:t}function Foe(t,e){v.useContext(v$).strict}function Boe(t){const e=x$(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function $oe(t,e){if(typeof Proxy>"u")return Nw;const n=new Map,r=(i,o)=>Nw(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Nw(o,void 0,t,e)),n.get(o))})}const Voe=(t,e)=>e.isSVG??r_(t)?new gie(e):new uie(e,{allowProjection:t!==v.Fragment});class zoe extends Xa{constructor(e){super(e),e.animationState||(e.animationState=wie(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();xb(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Uoe=0;class Woe extends Xa{constructor(){super(...arguments),this.id=Uoe++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"){const l=Ul(this.node,o,a);if(l){const{transition:u,transitionEnd:d,...f}=l;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Hoe={animation:{Feature:zoe},exit:{Feature:Woe}};function rm(t){return{point:{x:t.pageX,y:t.pageY}}}const qoe=t=>e=>YE(e)&&t(e,rm(e));function dh(t,e,n,r){return fp(t,e,qoe(n),r)}const E$=({current:t})=>t?t.ownerDocument.defaultView:null,qR=(t,e)=>Math.abs(t-e);function Koe(t,e){const n=qR(t.x,e.x),r=qR(t.y,e.y);return Math.sqrt(n**2+r**2)}const KR=new Set(["auto","scroll"]);class _${constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=lg(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Ew(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Koe(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:y}=p,{timestamp:b}=En;this.history.push({...y,timestamp:b});const{onStart:x,onMove:w}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=lg(m,this.transformPagePoint),yt.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ew(p.type==="pointercancel"?this.lastMoveEventInfo:lg(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,x),y&&y(p,x)},!YE(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=rm(e),u=lg(l,this.transformPagePoint),{point:d}=u,{timestamp:f}=En;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,Ew(u,this.history)),this.removeListeners=em(dh(this.contextWindow,"pointermove",this.handlePointerMove),dh(this.contextWindow,"pointerup",this.handlePointerUp),dh(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(KR.has(r.overflowX)||KR.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),yt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),$a(this.updatePoint)}}function lg(t,e){return e?{point:e(t.point)}:t}function GR(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ew({point:t},e){return{point:t,delta:GR(t,T$(e)),offset:GR(t,Goe(e)),velocity:Yoe(e,.1)}}function Goe(t){return t[0]}function T$(t){return t[t.length-1]}function Yoe(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=T$(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Er(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Er(e)*2&&(r=t[1]);const i=is(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Qoe(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Et(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Et(n,t,r.max):Math.min(t,n)),t}function YR(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Joe(t,{top:e,left:n,bottom:r,right:s}){return{x:YR(t.x,n,s),y:YR(t.y,e,r)}}function QR(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Xoe(t,e){return{x:QR(t.x,e.x),y:QR(t.y,e.y)}}function Zoe(t,e){let n=.5;const r=sr(t),s=sr(e);return s>r?n=cp(e.min,e.max-r,t.min):r>s&&(n=cp(t.min,t.max-s,e.min)),Ri(0,1,n)}function eae(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Wk=.35;function tae(t=Wk){return t===!1?t=0:t===!0&&(t=Wk),{x:JR(t,"left","right"),y:JR(t,"top","bottom")}}function JR(t,e,n){return{min:XR(t,e),max:XR(t,n)}}function XR(t,e){return typeof t=="number"?t:t[e]||0}const nae=new WeakMap;class rae{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=an(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(rm(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ase(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oi(b=>{let x=this.getAxisMotionValue(b).get()||0;if(_i.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const S=w.layout.layoutBox[b];S&&(x=sr(S)*(parseFloat(x)/100))}}this.originPoint[b]=x}),g&&yt.update(()=>g(f,h),!1,!0),Dk(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=h;if(m&&this.currentDirection===null){this.currentDirection=iae(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,b),this.updateAxis("y",h.point,b),this.visualElement.render(),y&&yt.update(()=>y(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new _$(e,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:E$(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&yt.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!cg(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Qoe(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&Gc(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Joe(r.layoutBox,e):this.constraints=!1,this.elastic=tae(n),s!==this.constraints&&!Gc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&oi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=eae(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Gc(e))return!1;const r=e.current;td(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=sie(r,s.root,this.visualElement.getTransformPagePoint());let o=Xoe(s.layout.layoutBox,i);if(n){const a=n(tie(o));this.hasMutatedConstraints=!!a,a&&(o=Y4(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=oi(d=>{if(!cg(d,n,this.currentDirection))return;let f=l&&l[d]||{};(o===!0||o===d)&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?e[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Dk(this.visualElement,e),r.start(UE(e,r,0,n,this.visualElement,!1))}stopAnimation(){oi(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){oi(n=>{const{drag:r}=this.getProps();if(!cg(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(e[n]-Et(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Gc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};oi(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=Zoe({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),oi(o=>{if(!cg(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Et(l,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;nae.set(this.visualElement,this);const e=this.visualElement.current,n=dh(e,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,p=h!==e&&Dse(h);d&&f&&!p&&this.start(u)});let r;const s=()=>{const{dragConstraints:u}=this.getProps();Gc(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=sae(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),yt.read(s);const a=fp(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(oi(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Wk,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function ZR(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function sae(t,e,n){const r=oR(t,ZR(n)),s=oR(e,ZR(n));return()=>{r(),s()}}function cg(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function iae(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class oae extends Xa{constructor(e){super(e),this.removeGroupControls=cs,this.removeListeners=cs,this.controls=new rae(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cs}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const _w=t=>(e,n)=>{t&&yt.update(()=>t(e,n),!1,!0)};class aae extends Xa{constructor(){super(...arguments),this.removePointerDownListener=cs}onPointerDown(e){this.session=new _$(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:E$(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:_w(e),onStart:_w(n),onMove:_w(r),onEnd:(i,o)=>{delete this.session,s&&yt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=dh(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Tw=!1;class lae extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Tw&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ty.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Tw=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||yt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),GE.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Tw=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function A$(t){const[e,n]=y$(),r=v.useContext(AE);return c.jsx(lae,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(C$),isPresent:e,safeToRemove:n})}const cae={pan:{Feature:aae},drag:{Feature:oae,ProjectionNode:g$,MeasureLayout:A$}};function eM(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&yt.postRender(()=>i(e,rm(e)))}class uae extends Xa{mount(){const{current:e}=this.node;e&&(this.unmount=Pse(e,(n,r)=>(eM(this.node,r,"Start"),s=>eM(this.node,s,"End"))))}unmount(){}}class dae extends Xa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=em(fp(this.node.current,"focus",()=>this.onFocus()),fp(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tM(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&yt.postRender(()=>i(e,rm(e)))}class fae extends Xa{mount(){const{current:e}=this.node;if(!e)return;
503const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Lse(e,(s,i)=>(tM(this.node,i,"Start"),(o,{success:a})=>tM(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Hk=new WeakMap,Aw=new WeakMap,hae=t=>{const e=Hk.get(t.target);e&&e(t)},pae=t=>{t.forEach(hae)};function mae({root:t,...e}){const n=t||document;Aw.has(n)||Aw.set(n,{});const r=Aw.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(pae,{root:t,...e})),r[s]}function gae(t,e,n){const r=mae(e);return Hk.set(t,n),r.observe(t),()=>{Hk.delete(t),r.unobserve(t)}}const yae={some:0,all:1};class vae extends Xa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:yae[s]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=d?f:h;p&&p(u)};this.stopObserver=gae(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(xae(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function xae({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const bae={inView:{Feature:vae},tap:{Feature:fae},focus:{Feature:dae},hover:{Feature:uae}},wae={layout:{ProjectionNode:g$,MeasureLayout:A$}},Sae={...Hoe,...bae,...cae,...wae},Ye=$oe(Sae,Voe),kae={some:0,all:1};function Cae(t,e,{root:n,margin:r,amount:s="some"}={}){const i=KE(t),o=new WeakMap,a=u=>{u.forEach(d=>{const f=o.get(d.target);if(d.isIntersecting!==!!f)if(d.isIntersecting){const h=e(d.target,d);typeof h=="function"?o.set(d.target,h):l.unobserve(d.target)}else typeof f=="function"&&(f(d),o.delete(d.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:r,threshold:typeof s=="number"?s:kae[s]});return i.forEach(u=>l.observe(u)),()=>l.disconnect()}function j$(t,{root:e,margin:n,amount:r,once:s=!1,initial:i=!1}={}){const[o,a]=v.useState(i);return v.useEffect(()=>{if(!t.current||s&&o)return;const l=()=>(a(!0),s?void 0:()=>a(!1)),u={root:e&&e.current||void 0,margin:n,amount:r};return Cae(t.current,l,u)},[e,t,n,s,r]),o}const Bs=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:q("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Bs.displayName="Card";const Nae=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:q("flex flex-col space-y-1.5 p-6",t),...e}));Nae.displayName="CardHeader";const Eae=v.forwardRef(({className:t,...e},n)=>c.jsx("h3",{ref:n,className:q("text-2xl font-semibold leading-none tracking-tight",t),...e}));Eae.displayName="CardTitle";const _ae=v.forwardRef(({className:t,...e},n)=>c.jsx("p",{ref:n,className:q("text-sm text-muted-foreground",t),...e}));_ae.displayName="CardDescription";const fh=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:q("p-6 pt-0",t),...e}));fh.displayName="CardContent";const Tae=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:q("flex items-center p-6 pt-0",t),...e}));Tae.displayName="CardFooter";var Sb="Collapsible",[Aae,P$]=dr(Sb),[jae,s_]=Aae(Sb),R$=v.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=t,[l,u]=gs({prop:r,defaultProp:s??!1,onChange:o,caller:Sb});return c.jsx(jae,{scope:n,disabled:i,contentId:yn(),open:l,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:c.jsx(he.div,{"data-state":o_(l),"data-disabled":i?"":void 0,...a,ref:e})})});R$.displayName=Sb;var M$="CollapsibleTrigger",O$=v.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=s_(M$,n);return c.jsx(he.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":o_(s.open
vendor: 4,263 bytes, line 503
503),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:fe(t.onClick,s.onOpenToggle)})});O$.displayName=M$;var i_="CollapsibleContent",D$=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=s_(i_,t.__scopeCollapsible);return c.jsx(fr,{present:n||s.open,children:({present:i})=>c.jsx(Pae,{...r,ref:e,present:i})})});D$.displayName=i_;var Pae=v.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,o=s_(i_,n),[a,l]=v.useState(r),u=v.useRef(null),d=We(e,u),f=v.useRef(0),h=f.current,p=v.useRef(0),m=p.current,g=o.open||a,y=v.useRef(g),b=v.useRef(void 0);return v.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),Wt(()=>{const x=u.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,p.current=w.width,y.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),l(r)}},[o.open,r]),c.jsx(he.div,{"data-state":o_(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...i,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...t.style},children:g&&s})});function o_(t){return t?"open":"closed"}var Rae=R$,Mae=O$,Oae=D$,Dae=v.createContext(void 0);function sm(t){const e=v.useContext(Dae);return t||e||"ltr"}var Xs="Accordion",Iae=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[a_,Lae,Fae]=zx(Xs),[kb,bTe]=dr(Xs,[Fae,P$]),l_=P$(),I$=z.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return c.jsx(a_.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?c.jsx(zae,{...i,ref:e}):c.jsx(Vae,{...s,ref:e})})});I$.displayName=Xs;var[L$,Bae]=kb(Xs),[F$,$ae]=kb(Xs,{collapsible:!1}),Vae=z.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=t,[a,l]=gs({prop:n,defaultProp:r??"",onChange:s,caller:Xs});return c.jsx(L$,{scope:t.__scopeAccordion,value:z.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:z.useCallback(()=>i&&l(""),[i,l]),children:c.jsx(F$,{scope:t.__scopeAccordion,collapsible:i,children:c.jsx(B$,{...o,ref:e})})})}),zae=z.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o,a]=gs({prop:n,defaultProp:r??[],onChange:s,caller:Xs}),l=z.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=z.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return c.jsx(L$,{scope:t.__scopeAccordion,value:o,onItemOpen:l,onItemClose:u,children:c.jsx(F$,{scope:t.__scopeAccordion,collapsible:!0,children:c.jsx(B$,{...i,ref:e})})})}),[Uae,Cb]=kb(Xs),B$=z.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=t,a=z.useRef(null),l=We(a,e),u=Lae(n),f=sm(s)==="ltr",h=fe(t.onKeyDown,p=>{var E;if(!Iae.includes(p.key))return;const m=p.target,g=u().filter(_=>{var T;return!((T=_.ref.current)!=null&&T.disabled)}),y=g.findIndex(_=>_.ref.current===m),b=g.length;if(y===-1)return;p.preventDefault();let x=y;const w=0,S=b-1,C=()=>{x=y+1,x>S&&(x=w)},k=()=>{x=y-1,x<w&&(x=S)};switch(p.key){case"Home":x=w;break;case"End":x=S;break;case"ArrowRight":i==="horizontal"&&(f?C():k());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(f?k():C());break;case"ArrowUp":i==="vertical"&&k();break}const N=x%b;(E=g[N].ref.current)==null||E.focus()});return c.jsx(Uae,{scope:n,disabled:r,direction:s,orientation:i,children:c.jsx(a_.Slot,{scope:n,children:c.jsx(he.div,{...o,"data-orientation":i,ref:l,onKeyDown:r?void 0:h})})})}),fv="AccordionItem",[Wae,c_]=kb(fv),$$=z.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...s}=t,i=Cb(fv,n),o=Bae(fv,n),a=l_(n),l=yn(),u=r&&o.value.includes(r)||!1,d=i.disabled||t.disabled;return c.jsx(Wae,{scope:n,open:u,disabled:d,triggerId:l,children:c.jsx(Rae,{"data-orientation":i.orientation,"data-state":q$(u),...a,...s,ref:e,disabled:d,open:u,onOpenChange:f=>{f?o.onItemOpen(r):o.onItemClose(r)}})})});$$.displayName=fv;var V$="AccordionHeader",z$=z.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=Cb(Xs,n),i=c_(V$,n);return c.jsx(he.h3,{"data-orientation":s.orientation,"data-state":q$(i.open
503),"data-disabled":i.disabled?"":void 0,...r,ref:e})});z$.displayName=V$;var qk="AccordionTrigger",U$=z.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=Cb(Xs,n),i=c_(qk,n),o=$ae(qk,n),a=l_(n);return c.jsx(a_.ItemSlot,{scope:n,children:c.jsx(Mae,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:e})})});U$.displayName=qk;var W$="AccordionContent",H$=z.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=Cb(Xs,n),i=c_(W$,n),o=l_(n);return c.jsx(Oae,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});H$.displayName=W$;function q$(t){return t?"open":"closed"}var Hae=I$,qae=$$,Kae=z$,K$=U$,G$=H$;const Y$=Hae,u_=v.forwardRef(({className:t,...e},n)=>c.jsx(qae,{ref:n,className:q("border-b",t),...e}));u_.displayName="AccordionItem";const d_=v.forwardRef(({className:t,children:e,...n},r)=>c.jsx(Kae,{className:"flex",children:c.jsxs(K$,{ref:r,className:q("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,c.jsx(Hx,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));d_.displayName=K$.displayName;const f_=v.forwardRef(({className:t,children:e,...n},r)=>c.jsx(G$,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:c.jsx("div",{className:q("pb-4 pt-0",t),children:e})}));f_.displayName=G$.displayName;function on({children:t,className:e="",delay:n=0}){const r=v.useRef(null),s=j$(r,{once:!0,margin:"-60px"});return c.jsx(Ye.div,{ref:r,initial:{opacity:0,y:24},animate:s?{opacity:1,y:0}:{},transition:{duration:.5,ease:"easeOut",delay:n},className:e,children:t})}const Gae=[{quote:"KitBoard is great if your Creator business has a sales team. With your sequences and automation setup, your sales team knows exactly the right time to reach out.",name:"Jason Resnick",title:"nurturekit.co"},{quote:"KitBoard works seamlessly with Kit and opens up so many possibilities for automated and personal follow up with my best leads. I love being able to easily tag and nurture my subscribers, add notes to their profile, and see all my personal email conversations in one place. There's really no need for me to use another CRM or duct tape a bunch of other tools together.",name:"Robby Miles",title:"Creator"},{quote:"KitBoard's seamless integration with Kit has simplified my sales process and eliminated the need for multiple tools. It's been a game-changer!",name:"Darrell Vesterfelt",title:"Co-founder, School of Traditional Skills"},{quote:"High-touch, premium experiences deserve a sales process that reflects the underlying value. KitBoard gives me a simple but effective way to manage the sales process for my coaching business on top of my favorite tool I already use: Kit.",name:"Barrett Brooks",title:"Executive Coach"}],Yae=[{title:"Connect Your Kit Account",body:"Install KitBoard from the Kit App Store with one click. No API keys to hunt down, no Zapier required. KitBoard connects to your Kit account through a secure OAuth integration and stays in sync automatically."},{title:"Import Your Subscribers",body:"Browse your Kit subscribers right inside KitBoard. Filter by tag, select who you want to bring in, and import them as contacts. KitBoard matches by email so you never create duplicates, and every imported contact stays linked to their Kit subscriber profile."},{title:"Build Your Pipeline",body:"Create boards that map to your sales process. Drag contacts through stages — from prospect to interested to booked to closed. When you move a contact, KitBoard updates their tags in Kit automatically. No manual syncing. No broken workflows."},{title:"Manage the Relationship",body:"Add notes after calls, set follow-up reminders, track deal values, and view your full email history with each contact through KitBoard's Gmail integration. Everything about a relationship in one place."},{title:"Close and Trigger",body:"When you close a deal, a simple drag-and-drop can trigger a welcome sequence, add a tag, or kick off any automation you've already built in Kit. Your CRM and your email platform finally work as one system."}],Qae=[{title:"Native Kit Integration",body:"Connect your Kit account in one click from the Kit App Store. Your subscriber data, tags, custom fields, and engagement history flow into KitBoard automatically. No API keys, no Zapier, no middleware."},{title:"Visual Pipeline Boards",body:"Build custom boards for every product, service, or sales process. Each column maps to a Kit tag, so when you drag a contact to a new stage, their tags update in Kit instantly. Create unlimited boards to track coaching clients, course launches, sponsorship deals, and more."},{title:"Contact Profiles with Kit Data",body:"See everything about a contact in one view — their Kit subscriber status, tags, custom fields, deal value, notes, reminders, and full email history. No tab switching. No guessing where a conversation left off."},{title:"Gmail Integration",body:"View every email you've sent or received from a contact directly inside KitBoard. Your sales conversations and your subscriber data, side by side."},{title:"Custom Fields & Aggregation",body:"Track deal sizes, websites, notes, and any data you need with custom fields. Specify field types like text, dollars, or numbers, and aggregate custom field data across each stage of your pipeline to see totals at a glance."},{title:"Team Workspaces",body:"Invite your sales team, VA, or business partner into your workspace. Everyone works from the same contacts, same boards, and same activity feed — all scoped to your team so nothing leaks between accounts."},{title:"Kit Automation Compatible",body:"KitBoard works with your existing Kit automations. Tag changes triggered by KitBoard flow into your Kit sequences, rules, and visual automations. Your email marketing and your sales process stay perfectly in sync."}],Jae=[{title:"Coaching",body:"Find your ideal clients from within your audience, nurture them through a high-touch sales process, and manage them as long-term clients. KitBoard gives coaches a clear pipeline from subscriber to signed engagement."},{title:"High-Value Course & Membership Sales",body:"Some products need more than a checkout page. For premium courses and memberships that require a conversation before the sale, KitBoard gives you a structured pipeline integrated directly with your Kit automations."},{title:"Productized Services",body:"Copywriters, designers, marketers, and consultants — build the perfect pipeline from your audience to a productized service business. Track every inquiry, proposal, and project without leaving your Kit ecosystem."},{title:"Sponsorships & Partnerships",body:"Manage inbound sponsorship inquiries, brand partnerships, and affiliate deals in a dedicated pipeline. Track deal values, conversations, and status without spreadsheets."},{title:"Hiring From Your Audience",body:"The best people you can hire for your creator business are often in your audience. Use KitBoard to filter from thousands of subscribers down to the perfect candidate with a structured hiring pipeline."}],Xae=["Managing Kit subscriber data in a CRM meant complex, expensive automations","Hours spent configuring tools that weren't designed for creators","Subscriber data in Kit, sales notes in a CRM, emails in Gmail — three tabs, zero connection","Paying $50-300/month for CRM features you'll never touch","Broken Zapier workflows at the worst possible moment"],Zae=["One-click connection to your Kit account from the Kit App Store","Subscriber data, sales pipeline, and email history in one place","Tag changes in KitBoard automatically sync back to Kit","AI handles note-taking, follow-up suggestions, and message drafting","$25/month (billed annually) for unlimited team members"],ele=["
503Unlimited boards","Unlimited subscribers","Unlimited notes, reminders, and activity tracking","Native Kit App Store integration","Gmail integration for full email conversation history","Compatible with Kit automations and sequences","Team workspaces with multi-user access","Custom fields with aggregation across pipeline stages","AI features included as they roll out","Premium chat support"],tle=[{q:"Does KitBoard work with the free plan for Kit?",a:"Yes. KitBoard works with all Kit plans."},{q:"How does KitBoard connect to Kit?",a:"KitBoard is available on the Kit App Store. Install it with one click and authorize the connection through Kit's secure OAuth flow. No API keys to copy and paste — just connect and go."},{q:"How do KitBoard boards work with Kit data?",a:"Each board represents a set of tags from your Kit account. For example, a board tracking your coaching sales pipeline might use the tags Prospect, Interested, and Closed. When you drag a contact from one column to another, KitBoard automatically removes the old tag and adds the new one in Kit. You can use existing Kit tags or create new ones directly from KitBoard."},{q:"Do I have to manually update Kit when I change something in KitBoard?",a:"No. Everything syncs automatically. Move a subscriber between columns, update a custom field, add a tag — it all flows back to Kit in real time."},{q:"Can I view email conversations with a subscriber in KitBoard?",a:"Yes. With KitBoard's Gmail integration, you can see every email you've sent or received from a contact directly inside their profile. No more digging through your inbox."},{q:"Can I import specific subscribers from Kit?",a:"Yes. When you import subscribers, you can browse your full list or filter by Kit tag. Select exactly who you want to bring into KitBoard — no need to import everyone."},{q:"Is KitBoard multi-tenant? Can my team use it?",a:"Yes. Invite team members into your workspace. Everyone shares the same contacts, boards, and activity — all scoped to your team."},{q:"What AI features are available?",a:"AI features are actively in development and will roll out to all Pro plan users as they go live. This includes brain dump processing, smart follow-up suggestions, AI-drafted messages, contact prioritization, and writing style matching."}],nle={backgroundImage:"radial-gradient(circle, hsl(var(--foreground) / 0.25) 1.2px, transparent 1.2px)",backgroundSize:"32px 32px"};function rle(){return c.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[c.jsx("nav",{className:"sticky top-0 z-50 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsxs("div",{className:"mx-auto flex h-14 max-w-5xl items-center justify-between px-6",children:[c.jsx($e,{to:"/",className:"flex items-center gap-2",children:c.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"KitBoard"})}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(K,{variant:"ghost",size:"sm",asChild:!0,children:c.jsx($e,{to:"/login",children:"Log in"})}),c.jsx(K,{size:"sm",asChild:!0,children:c.jsxs($e,{to:"/signup",children:["Try it Free ",c.jsx(Ly,{className:"ml-1 h-3.5 w-3.5"})]})})]})]})}),c.jsxs("section",{className:"relative flex min-h-[calc(100vh-3.5rem)] flex-col items-center justify-center overflow-hidden px-6 text-center",style:nle,children:[c.jsx("div",{className:"pointer-events-none absolute -left-40 -top-40 h-[500px] w-[500px] rounded-full opacity-[0.07]",style:{background:"radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"}}),c.jsx("div",{className:"pointer-events-none absolute -bottom-32 -right-32 h-[400px] w-[400px] rounded-full opacity-[0.05]",style:{background:"radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"}}),c.jsx("div",{className:"pointer-events-none absolute left-1/2 top-1/3 h-[600px] w-[600px] -translate-x-1/2 -translate-y-1/2 rounded-full opacity-[0.03]",style:{background:"radial-gradient(circle, hsl(var(--primary)) 0%, transparent 60%)"}}),c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse 50% 45% at 50% 50%, transparent 0%, hsl(var(--background) / 0.6) 50%, hsl(var(--background)) 85%)"}}),c.jsxs("div",{className:"relative z-10 mx-auto max-w-4xl",children:[c.jsx(Ye.p,{initial:{opacity:0,y:12}
503,animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"mb-5 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"The AI-Powered CRM for Coaches + Creators"}),c.jsxs(Ye.h1,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},className:"text-4xl font-semibold tracking-tight sm:text-5xl lg:text-6xl",children:["Your audience is your pipeline.",c.jsx("br",{}),"KitBoard helps you close."]}),c.jsx(Ye.p,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.35},className:"mx-auto mt-6 max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg",children:"KitBoard is tailor-made for creators with engaged audiences on Kit looking for tools to help them more effectively track and close high touch sales within their audience."}),c.jsxs(Ye.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,delay:.5},className:"mt-10 flex items-center justify-center gap-3",children:[c.jsx(K,{size:"lg",asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})}),c.jsx(K,{size:"lg",variant:"outline",asChild:!0,children:c.jsx("a",{href:"#how-it-works",children:"See How It Works"})})]})]})]}),c.jsx("section",{className:"border-y bg-secondary/40 py-6 text-center",children:c.jsx(on,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Loved by coaches, consultants, and creators who sell through relationships."})})}),c.jsx("section",{className:"mx-auto max-w-5xl px-6 py-24",children:c.jsx("div",{className:"grid gap-6 sm:grid-cols-2",children:Gae.map((t,e)=>c.jsx(on,{delay:e*.1,children:c.jsx(Bs,{className:"border bg-card h-full",children:c.jsxs(fh,{className:"p-6",children:[c.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:['"',t.quote,'"']}),c.jsxs("p",{className:"mt-4 text-sm font-medium",children:[t.name,c.jsxs("span",{className:"ml-1 font-normal text-muted-foreground",children:["— ",t.title]})]})]})})},t.name))})}),c.jsx(_n,{}),c.jsxs("section",{className:"mx-auto max-w-3xl px-6 py-24",children:[c.jsx(on,{children:c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"You don't need a CRM built for enterprise sales teams. You need one built for you."})}),c.jsx(on,{delay:.1,children:c.jsxs("div",{className:"mt-8 space-y-4 text-sm leading-relaxed text-muted-foreground sm:text-base",children:[c.jsx("p",{children:"You've built an engaged audience on Kit. Subscribers are clicking your emails, replying to your newsletters, and raising their hands for your offers. But when it comes time to actually manage those conversations and close the sale, where does that happen?"}),c.jsx("p",{children:"HubSpot wants you to spend a week configuring pipelines you'll never use. Salesforce requires a certification just to figure out the settings page. Pipedrive was designed for B2B sales teams cold-calling strangers — not creators nurturing warm leads from their own audience."}),c.jsx("p",{children:"And none of them integrate well with Kit. You're left duct-taping Zapier automations together, copy-pasting subscriber data between tabs, and hoping nothing breaks."}),c.jsx("p",{className:"font-medium text-foreground",children:"There's a better way."}),c.jsx("p",{children:"KitBoard is a CRM that was designed from day one for creators who sell on Kit. Not adapted. Not bolted on. Built for this."})]})})]}),c.jsx(_n,{}),c.jsxs("section",{id:"how-it-works",className:"relative mx-auto max-w-3xl px-6 py-24",children:[c.jsx(on,{children:c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"From subscriber to client — in one connected workflow."})}),c.jsx("ol",{className:"mt-12 space-y-10",children:Yae.map((t,e)=>c.jsx(on,{delay:e*.08,children:c.jsxs("li",{className:"flex gap-5",children:[c.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-xs font-medium",children:e+1}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium sm:text-base",children:t.title}),c.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:t.body})]})]})},e))}),c.jsx(on,{delay:.4,className:"mt-12",children:c.jsx(K,{asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})})})]}),c.jsx(_n,{}),c.jsxs("section",{className:"mx-auto max-w-5xl px-6 py-24",children:[c.jsx(on,{children:c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Everything you need. Nothing you don't."})}),c.jsx("div",{className:"mt-12 grid gap-10 sm:grid-cols-2",children:Qae.map((t,e)=>c.jsx(on,{delay:e*.06,children:c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium sm:text-base",children:t.title}),c.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:t.body})]})},t.title))})]}),c.jsx(_n,{}),c.jsxs("section",{className:"mx-auto max-w-5xl px-6 py-24",children:[c.jsx(on,{children:c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Turn your audience into your customers."})}),c.jsx("div",{className:"mt-12 grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:Jae.map((t,e)=>c.jsx(on,{delay:e*.08,children:c.jsx(Bs,{className:"border bg-card h-full",children:c.jsxs(fh,{className:"p-6",children:[c.jsx("p",{className:"text-sm font-medium sm:text-base",children:t.title}),c.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:t.body})]})})},t.title))})]}),c.jsx(_n,{}),c.jsxs("section",{className:"mx-auto max-w-4xl px-6 py-24",children:[c.jsx(on,{children:c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Before KitBoard vs. After KitBoard"})}),c.jsxs("div",{className:"mt-12 grid gap-10 sm:grid-cols-2",children:[c.jsx(on,{delay:.1,children:c.jsxs("div",{children:[c.jsx("p",{className:"mb-4 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Before"}),c.jsx("ul",{className:"space-y-3",children:Xae.map((t,e)=>c.jsxs("li",{className:"flex gap-2 text-sm text-muted-foreground",children:[c.jsx(ji,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground
503/50"}),t]},e))})]})}),c.jsx(on,{delay:.2,children:c.jsxs("div",{children:[c.jsx("p",{className:"mb-4 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"After"}),c.jsx("ul",{className:"space-y-3",children:Zae.map((t,e)=>c.jsxs("li",{className:"flex gap-2 text-sm",children:[c.jsx(xi,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground"}),t]},e))})]})})]})]}),c.jsx(_n,{}),c.jsxs("section",{className:"mx-auto max-w-xl px-6 py-24 text-center",children:[c.jsx(on,{children:c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Simple pricing. No gotchas."})}),c.jsx(on,{delay:.15,children:c.jsx(Bs,{className:"mt-10 border bg-card",children:c.jsxs(fh,{className:"p-8",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Pro"}),c.jsxs("p",{className:"mt-2 text-3xl font-semibold",children:["$25",c.jsx("span",{className:"text-base font-normal text-muted-foreground",children:"/month"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Billed annually · Unlimited team members · 14-day free trial"}),c.jsx(_n,{className:"my-6"}),c.jsx("ul",{className:"space-y-2 text-left text-sm",children:ele.map(t=>c.jsxs("li",{className:"flex gap-2",children:[c.jsx(xi,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground"}),t]},t))}),c.jsx(K,{className:"mt-8 w-full",asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})})]})})})]}),c.jsx(_n,{}),c.jsxs("section",{className:"mx-auto max-w-3xl px-6 py-24",children:[c.jsx(on,{children:c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Questions? Answers."})}),c.jsx(on,{delay:.1,children:c.jsx(Y$,{type:"single",collapsible:!0,className:"mt-8",children:tle.map((t,e)=>c.jsxs(u_,{value:`faq-${e}`,children:[c.jsx(d_,{className:"text-sm text-left",children:t.q}),c.jsx(f_,{className:"text-sm text-muted-foreground",children:t.a})]},e))})})]}),c.jsx(_n,{}),c.jsx("section",{className:"mx-auto max-w-3xl px-6 py-24 text-center",children:c.jsxs(on,{children:[c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Your audience is already warm. KitBoard helps you close."}),c.jsx("p",{className:"mx-auto mt-4 max-w-xl text-sm leading-relaxed text-muted-foreground sm:text-base",children:"Stop duct-taping enterprise CRMs to your creator business. Connect your Kit account, import your subscribers, and start closing in minutes."}),c.jsx("div",{className:"mt-10",children:c.jsx(K,{size:"lg",asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})})})]})}),c.jsx(_n,{}),c.jsx("footer",{className:"mx-auto max-w-5xl px-6 py-10",children:c.jsxs("div",{className:"flex flex-col items-center justify-between gap-4 text-xs text-muted-foreground sm:flex-row",children:[c.jsx("p",{children:"© 2026 KitBoard.co. All rights reserved."}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx("a",{href:"#",className:"hover:text-foreground",children:"Privacy Policy"}),c.jsx("a",{href:"#",className:"hover:text-foreground",children:"Terms of Service"})]}),c.jsx("p",{children:"Powered by Restack Labs"})]})})]})}var sle="authorization_response",ile="/~oauth/initiate",ole=["https://oauth.lovable.app","https://lovable.dev"],ale="lovable://oauth-callback",lle="http://127.0.0.1/iframe-oauth/callback",cle=500,ule=12e4;function dle(t){let e;const n=new Promise(i=>{e=i}),r=i=>{if(!t.some(l=>i.origin===l))return;const a=i.data;!a||typeof a!="object"||a.type===sle&&e(a.response)},s=()=>{window.removeEventListener("message",r)};return window.addEventListener("message",r),{cleanup:s,messagePromise:n}}function fle(t){const e=window.screenX!==0||window.screenY!==0||!t,n=e?window.outerWidth*.5:window.screen.width*.5,r=e?window.outerHeight*.5:window.screen.height*.5,s=e?window.screenX+(window.outerWidth-n)/2:(window.screen.width-n)/2,i=e?window.screenY+(window.outerHeight-r)/2:(window.screen.height-r)/2;return{width:n,height:r,left:s,top:i}}function nM(t,e){return t.state!==e?{error:new Error("State is invalid")}:t.error?t.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(t.error_description??"Sign in failed")}:!t.access_token||!t.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:t.access_token,refresh_token:t.refresh_token},error:null}}function hle(){const t=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(t)||/Macintosh/i.test(t)&&navigator.maxTouchPoints>1)}function ple(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(t=>t.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function mle(t={}){const e=t.oauthBrokerUrl??ile,n=t.supportedOAuthOrigins??ole;async function r(s,i={}){let o=!1;try{o=window.self!==window.top}catch{o=!0}const a=navigator.userAgent,l=/LovableApp\//.test(a),u=!l&&/lovable/i.test(a),d=ple();let f=i.redirect_uri??window.location.origin;l&&o?f=ale:u&&o&&(f=lle);const h=new URLSearchParams({...i.extraParams,provider:s,redirect_uri:f,state:d});if(!o)return window.location.href=`${e}?${h.toString()}`,{error:null,redirected:!0};!l&&!u&&h.set("response_mode","web_message");const p=`${e}?${h.toString()}`,m=u?[...n,window.location.origin]:n,{messagePromise:g,cleanup:y}=dle(m);let b;if(hle())b=window.open(p,"_blank");else{const{width:S,height:C,left:k,top:N}=fle(o);b=window.open(p,"oauth",`width=${S},height=${C},left=${k},top=${N}`)}if(!b&&(l||u)){let S;const C=new Promise((k,N)=>{S=setTimeout(()=>{N(new Error("OAuth timed out waiting for response"))},ule)});try{const k=await Promise.race([g,C]);return nM(k,d)}catch(k){return{error:k instanceof Error?k:new Error(String(k))}}finally{S&&clearTimeout(S),y()}}if(!b)return y(),{error:new Error("Popup was blocked")};let x;const w=new Promise((S,C)=>{x=setInterval(()=>{b.closed&&(clearInterval(x),C(new Error("Sign in was cancelled")))},cle)});try{const S=await Promise.race([g,w]);return nM(S,d)}catch(S){return{error:S instanceof Error?S:new Error(String(S))}}finally{clearInterval(x),y(),b==null||b.close()}}return{signInWithOAuth:r}}var gle={name:"@lovable.dev/cloud-auth-js",version:"1.1.1",description:"Lovable Cloud Auth JS",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist"],scripts:{build:"tsup src/index.ts --format cjs,esm --dts --outDir dist",dev:"tsup src/index.ts --format cjs,esm --dts --watch",test:"vitest run",typecheck:"tsgo --noEmit",prepublishOnly:"npm run clean && npm run build",clean:"rimraf dist"},keywords:["lovable","oauth","authentication"],license:"MIT",devDependencies:{"@types/node":"^22",jsdom:"^26",rimraf:"^5.0.0",tsup:"^7.2.0",typescript:"^5",vitest:"^4.1.0"}};typeof window<"u"&&(window.__lovable_cloud_auth_js_version=gle.ver
503sion);function yle(t={}){return mle(t)}const vle=yle(),h_={auth:{signInWithOAuth:async(t,e)=>{const n=await vle.signInWithOAuth(t,{redirect_uri:e==null?void 0:e.redirect_uri,extraParams:{...e==null?void 0:e.extraParams}});if(n.redirected||n.error)return n;try{await I.auth.setSession(n.tokens)}catch(r){return{error:r instanceof Error?r:new Error(String(r))}}return n}}},xle={initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function ble(){const[t,e]=v.useState(!1),[n,r]=v.useState(!1),s=Dn(),[i]=kc();v.useEffect(()=>{const a=i.get("error");a&&Fr.error(decodeURIComponent(a))},[i]);const o=async a=>{const l=a==="google"?e:r;l(!0);try{const u=await h_.auth.signInWithOAuth(a,{redirect_uri:window.location.origin});if(u.error){Fr.error(u.error.message||`${a} sign-in failed`);return}if(u.redirected)return;const{data:{user:d}}=await I.auth.getUser();if(d){const{data:f}=await I.from("profiles").select("onboarded").eq("id",d.id).maybeSingle();s(f!=null&&f.onboarded?"/dashboard":"/onboarding")}}catch(u){Fr.error(u.message||`${a} sign-in failed`)}finally{l(!1)}};return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(Ye.div,{...xle,className:"w-full max-w-sm space-y-6 px-4",children:[c.jsxs("div",{className:"space-y-1 text-center",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"KitBoard"}),c.jsx("p",{className:"text-muted-foreground",children:"Sign in to your account"})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs(K,{type:"button",variant:"outline",className:"w-full",onClick:()=>o("google"),disabled:t,children:[c.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[c.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),c.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),c.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),c.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),t?"Signing in…":"Continue with Google"]}),c.jsxs(K,{type:"button",variant:"outline",className:"w-full",onClick:()=>o("apple"),disabled:n,children:[c.jsx("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),n?"Signing in…":"Continue with Apple"]})]}),c.jsxs("p",{className:"text-center text-muted-foreground",children:["Don't have an account?"," ",c.jsx($e,{to:"/signup",className:"text-foreground underline underline-offset-4 hover:text-foreground/80",children:"Sign up"})]})]})})}var wle="Label",Q$=v.forwardRef((t,e)=>c.jsx(he.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Q$.displayName=wle;var J$=Q$;const Sle=Sc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pt=v.forwardRef(({className:t,...e},n)=>c.jsx(J$,{ref:n,className:q(Sle(),t),...e}));pt.displayName=J$.displayName;const kle={initial:{opacity:0}
503,animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function Cle(){const[t,e]=v.useState(""),[n,r]=v.useState(!1),[s,i]=v.useState(!1),{toast:o}=ut(),a=async l=>{l.preventDefault(),r(!0);const{error:u}=await I.auth.resetPasswordForEmail(t,{redirectTo:`${window.location.origin}/reset-password`});r(!1),u?o({title:"Error",description:u.message,variant:"destructive"}):i(!0)};return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(Ye.div,{...kle,className:"w-full max-w-sm space-y-6 px-4",children:[c.jsxs("div",{className:"space-y-1 text-center",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"Reset your password"}),c.jsx("p",{className:"text-muted-foreground",children:s?"Check your email for a reset link.":"Enter your email and we'll send you a reset link."})]}),s?c.jsxs("div",{className:"rounded-lg border border-border bg-card p-4 text-center text-sm text-muted-foreground",children:["We sent a password reset link to ",c.jsx("strong",{className:"text-foreground",children:t}),". Check your inbox and spam folder."]}):c.jsxs("form",{onSubmit:a,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"email",children:"Email"}),c.jsx(Je,{id:"email",type:"email",value:t,onChange:l=>e(l.target.value),required:!0,placeholder:"[email protected]"})]}),c.jsx(K,{type:"submit",className:"w-full",disabled:n,children:n?"Sending…":"Send reset link"})]}),c.jsx("p",{className:"text-center",children:c.jsxs($e,{to:"/login",className:"text-sm text-muted-foreground hover:text-foreground inline-flex items-center gap-1",children:[c.jsx(Iy,{className:"h-3 w-3"}),"Back to sign in"]})})]})})}const Nle={initial:{opacity:0}
503,animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function Ele(){const[t,e]=v.useState(""),[n,r]=v.useState(""),[s,i]=v.useState(!1),[o,a]=v.useState(!1),l=Dn(),{toast:u}=ut();v.useEffect(()=>{const{data:{subscription:f}}=I.auth.onAuthStateChange(h=>{h==="PASSWORD_RECOVERY"&&a(!0)});return()=>f.unsubscribe()},[]);const d=async f=>{if(f.preventDefault(),t!==n){u({title:"Error",description:"Passwords do not match.",variant:"destructive"});return}if(t.length<6){u({title:"Error",description:"Password must be at least 6 characters.",variant:"destructive"});return}i(!0);const{error:h}=await I.auth.updateUser({password:t});i(!1),h?u({title:"Error",description:h.message,variant:"destructive"}):(u({title:"Password updated",description:"You can now sign in with your new password."}),l("/login"))};return o?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(Ye.div,{...Nle,className:"w-full max-w-sm space-y-6 px-4",children:[c.jsxs("div",{className:"space-y-1 text-center",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"Set new password"}),c.jsx("p",{className:"text-muted-foreground",children:"Enter your new password below."})]}),c.jsxs("form",{onSubmit:d,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"password",children:"New password"}),c.jsx(Je,{id:"password",type:"password",value:t,onChange:f=>e(f.target.value),required:!0,placeholder:"••••••••"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"confirmPassword",children:"Confirm password"}),c.jsx(Je,{id:"confirmPassword",type:"password",value:n,onChange:f=>r(f.target.value),required:!0,placeholder:"••••••••"})]}),c.jsx(K,{type:"submit",className:"w-full",disabled:s,children:s?"Updating…":"Update password"})]})]})}):c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}const hv="kit_install_return",_le=60*60*1e3;function Tle(t,e){try{const n={redirect_to:t,state:e??null,savedAt:Date.now()};localStorage.setItem(hv,JSON.stringify(n))}catch{}}function p_(){try{const t=localStorage.getItem(hv);if(!t)return null;const e=JSON.parse(t);return e!=null&&e.redirect_to?Date.now()-e.savedAt>_le?(localStorage.removeItem(hv),null):e:null}catch{return null}}function rM(){try{localStorage.removeItem(hv)}catch{}}function hp(){return p_()!==null}function sM(){const t=p_();if(!t)return!1;try{const e=new URL(t.redirect_to);return e.searchParams.set("success","true"),t.state&&e.searchParams.set("state",t.state),rM(),window.location.href=e.toString(),!0}catch{return rM(),!1}}const Ale={initial:{opacity:0}
503,animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function jle(){const[t,e]=v.useState(!1),[n,r]=v.useState(!1),s=Dn(),i=async o=>{const a=o==="google"?e:r;a(!0);try{const l=await h_.auth.signInWithOAuth(o,{redirect_uri:window.location.origin});if(l.error){Fr.error(l.error.message||`${o} sign-in failed`);return}if(l.redirected)return;const{data:{user:u}}=await I.auth.getUser();if(u){const{data:d}=await I.from("profiles").select("onboarded").eq("id",u.id).maybeSingle();hp()?s("/kit/install"):s(d!=null&&d.onboarded?"/dashboard":"/onboarding")}}catch(l){Fr.error(l.message||`${o} sign-in failed`)}finally{a(!1)}};return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(Ye.div,{...Ale,className:"w-full max-w-sm space-y-6 px-4",children:[c.jsxs("div",{className:"space-y-1 text-center",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"KitBoard"}),c.jsx("p",{className:"text-muted-foreground",children:"Create your account"})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs(K,{type:"button",variant:"outline",className:"w-full",onClick:()=>i("google"),disabled:t,children:[c.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[c.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),c.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),c.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),c.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),t?"Signing up…":"Continue with Google"]}),c.jsxs(K,{type:"button",variant:"outline",className:"w-full",onClick:()=>i("apple"),disabled:n,children:[c.jsx("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),n?"Signing up…":"Continue with Apple"]})]}),c.jsxs("p",{className:"text-center text-muted-foreground",children:["Already have an account?"," ",c.jsx($e,{to:"/login",className:"text-foreground underline underline-offset-4 hover:text-foreground/80",children:"Sign in"})]})]})})}const Ple=t=>!t||!t.startsWith("/")?"/onboarding":t;function Rle(){const t=Dn(),[e]=kc();return v.useEffect(()=>{let n=!0,r;const s=new URLSearchParams(window.location.hash.replace(/^#/,"")),i=d=>e.get(d)??s.get(d),o=Ple(i("next")),{data:{subscription:a}}=I.auth.onAuthStateChange((d,f)=>{n&&f!=null&&f.user&&(d==="SIGNED_IN"||d==="INITIAL_SESSION"||d==="TOKEN_REFRESHED")&&setTimeout(()=>{n&&l(f.user.id)},0)}),l=async d=>{const{data:f}=await I.from("profiles").select("onboarded").eq("id",d).maybeSingle();if(!n)return;const h=hp()?"/kit/install":f!=null&&f.onboarded?"/dashboard":o;t(h,{replace:!0})};return(async()=>{var d;try{const f=i("error_description")??i("error");
503if(f)throw new Error(f);const h=i("token_hash")??i("token"),p=i("type");if(h&&p){const{data:y,error:b}=await I.auth.verifyOtp({token_hash:h,type:p});if(b)throw b;if((d=y.session)!=null&&d.user){await l(y.session.user.id);return}}const m=i("code");if(m){const{error:y}=await I.auth.exchangeCodeForSession(m);y&&console.warn("Code exchange failed, waiting for session:",y.message)}const{data:{session:g}}=await I.auth.getSession();if(g!=null&&g.user){await l(g.user.id);return}r=window.setTimeout(async()=>{const{data:{session:y}}=await I.auth.getSession();y!=null&&y.user?await l(y.user.id):n&&t("/login",{replace:!0})},2500)}catch(f){if(n){const h=f instanceof Error?f.message:"Email link is invalid or has expired";t(`/login?error=${encodeURIComponent(h)}`,{replace:!0})}}})(),()=>{n=!1,r&&window.clearTimeout(r),a.unsubscribe()}},[t,e]),c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}const Mle=[{id:"online-course",name:"Online Course / Digital Product",description:"Sell courses, templates, ebooks, and digital downloads",icon:"GraduationCap",statuses:[{name:"Lead",color:"#6b7280"},{name:"Interested",color:"#3b82f6"},{name:"Pitched",color:"#8b5cf6"},{name:"Negotiating",color:"#f59e0b"},{name:"Won",color:"#22c55e"},{name:"Lost",color:"#ef4444"}]},{id:"coaching",name:"Coaching / Consulting",description:"Manage discovery calls, proposals, and client relationships",icon:"Users",statuses:[{name:"Discovery Call",color:"#3b82f6"},{name:"Proposal Sent",color:"#8b5cf6"},{name:"Follow-up",color:"#f59e0b"},{name:"Closed Won",color:"#22c55e"},{name:"Closed Lost",color:"#ef4444"}]},{id:"sponsorship",name:"Sponsorship / Brand Deals",description:"Track brand partnerships, outreach, and campaign delivery",icon:"Megaphone",statuses:[{name:"Prospect",color:"#6b7280"},{name:"Outreach",color:"#3b82f6"},{name:"Negotiating",color:"#f59e0b"},{name:"Contract Sent",color:"#8b5cf6"},{name:"Active",color:"#22c55e"},{name:"Completed",color:"#14b8a6"}]},{id:"freelance",name:"Freelance / Agency",description:"Manage client inquiries, scoping, and invoicing",icon:"Briefcase",statuses:[{name:"Inquiry",color:"#6b7280"},{name:"Scoping",color:"#3b82f6"},{name:"Proposal",color:"#8b5cf6"},{name:"In Progress",color:"#f59e0b"},{name:"Invoiced",color:"#14b8a6"},{name:"Paid",color:"#22c55e"}]},{id:"blank",name:"Start from scratch",description:"A simple board with basic statuses you can customize",icon:"Plus",statuses:[{name:"New",color:"#6b7280"},{name:"In Progress",color:"#3b82f6"},{name:"Won",color:"#22c55e"},{name:"Lost",color:"#ef4444"}]}],Ole=[{id:"online-course",label:"Online Course / Digital Product",description:"Track deal values, products, and launch dates",fields:[{name:"Deal Value",field_type:"dollar"},{name:"Product Name",field_type:"text"},{name:"Launch Date",field_type:"date"},{name:"Referral Source",field_type:"text"}]},{id:"coaching",label:"Coaching / Consulting",description:"Track session rates, programs, and goals",fields:[{name:"Session Rate",field_type:"dollar"},{name:"Program Length",field_type:"text"},{name:"Next Session",field_type:"date"},{name:"Goals",field_type:"text"}]},{id:"sponsorship",label:"Sponsorship / Brand Deals",description:"Track deal values, brands, and campaigns",fields:[{name:"Deal Value",field_type:"dollar"},{name:"Brand Name",field_type:"text"},{name:"Campaign Start",field_type:"date"},{name:"Deliverables",field_type:"text"}]},{id:"freelance",label:"Freelance / Agency",description:"Track budgets, deadlines, and scope",fields:[{name:"Project Budget",field_type:"dollar"},{name:"Deadline",field_type:"date"},{name:"Scope",field_type:"text"},{name:"Retainer",field_type:"dollar"}]}],Dle={GraduationCap:W9,Users:yo,Megaphone:K9,Briefcase:A9,Plus:nn},iM=["Team","Board","Payment"],jw={initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20}};function Ile(){const t=Dn(),[e]=kc(),{user:n,teamId:r,onboarded:s,isLoading:i}=ot(),{toast:o}=ut(),a=e.get("step"),l=()=>a==="payment"?2:0,[u,d]=v.useState(l),[f,h]=v.useState(""),[p,m]=v.useState(r),[g,y]=v.useState(null),[b,x]=v.useState(!1);if(v.useEffect(()=>{r&&m(r)},[r]),v.useEffect(()=>{!i&&s&&t("/dashboard",{replace:!0})},[i,s,t]),v.useEffect(()=>{!i&&r&&u===0&&d(1)},[i,r,u]),i)return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground"})});if(!n)return t("/login"),null;const w=async()=>{x(!0);try{const{data:k,error:N}=await I.rpc("create_team",{_name:f.trim()});if(N)throw N;if(!k)throw new Error("Failed to create team");const E=k;m(E),await I.functions.invoke("create-stripe-customer",{body:{team_id:E,team_name:f.trim()}}),d(1)}catch(k){o({title:"Error",description:k.message,variant:"destructive"})}finally{x(!1)}},S=k=>{y(k),d(2)}
503,C=async()=>{x(!0);try{if(g&&p){const{data:E}=await I.from("boards").select("id").eq("team_id",p).limit(1);if(!E||E.length===0){const T=g.name==="Start from scratch"?"My Board":g.name,{data:P,error:j}=await I.from("boards").insert({name:T,team_id:p}).select("id").single();if(j)throw j;const F=g.statuses.map((U,D)=>({board_id:P.id,name:U.name,color:U.color,position:D})),{error:B}=await I.from("board_statuses").insert(F);if(B)throw B}const _=Ole.find(T=>T.id===g.id);if(_){const{data:T}=await I.from("custom_field_definitions").select("id").eq("team_id",p).limit(1);if(!T||T.length===0){const P=_.fields.map(j=>({name:j.name,field_type:j.field_type,team_id:p}));await I.from("custom_field_definitions").insert(P)}}}const{data:k,error:N}=await I.functions.invoke("create-checkout");if(N)throw N;if(k!=null&&k.error)throw new Error(k.error);if(!(k!=null&&k.url))throw new Error("No checkout URL returned");window.location.href=k.url}catch(k){o({title:"Error",description:k.message,variant:"destructive"}),x(!1)}};return c.jsxs("div",{className:"relative flex min-h-screen items-center justify-center bg-background px-4",children:[c.jsxs(K,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 text-muted-foreground",onClick:async()=>{await I.auth.signOut(),t("/login")},children:[c.jsx(yF,{className:"h-4 w-4 mr-2"}),"Sign out"]}),c.jsxs("div",{className:"w-full max-w-lg space-y-8",children:[c.jsx("div",{className:"flex items-center justify-center gap-2",children:iM.map((k,N)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:`h-8 w-8 rounded-full flex items-center justify-center text-xs font-medium transition-colors ${N<=u?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:N<u?c.jsx(xi,{className:"h-4 w-4"}):N+1}),N<iM.length-1&&c.jsx("div",{className:`h-px w-6 ${N<u?"bg-primary":"bg-border"}`})]},k))}),c.jsxs(moe,{mode:"wait",children:[u===0&&c.jsxs(Ye.div,{...jw,transition:{duration:.2},className:"space-y-6",children:[c.jsxs("div",{className:"text-center space-y-1",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"Create your team"}),c.jsx("p",{className:"text-muted-foreground",children:"Give your team a name to get started."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"teamName",children:"Team name"}),c.jsx(Je,{id:"teamName",value:f,onChange:k=>h(k.target.value),placeholder:"Acme Inc.",onKeyDown:k=>k.key==="Enter"&&f.trim()&&w()})]}),c.jsxs(K,{onClick:w,className:"w-full",disabled:b||!f.trim(),children:[b?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-2"}):null,"Continue",c.jsx(Ly,{className:"h-4 w-4 ml-2"})]})]},"team"),u===1&&c.jsxs(Ye.div,{...jw,transition:{duration:.2},className:"space-y-6",children:[c.jsxs("div",{className:"text-center space-y-1",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"Choose a board template"}),c.jsx("p",{className:"text-muted-foreground",children:"Pick a template that fits your business, or start from scratch."})]}),c.jsx("div",{className:"grid gap-3",children:Mle.map(k=>{const N=Dle[k.icon]||nn,E=(g==null?void 0:g.id)===k.id;return c.jsxs("button",{onClick:()=>S(k),disabled:b,className:`flex items-start gap-3 p-4 rounded-lg border transition-colors text-left ${E?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50 hover:bg-accent/50"}`,children:[c.jsx("div",{className:"h-9 w-9 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:c.jsx(N,{className:"h-5 w-5 text-primary"})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-foreground",children:k.name}),c.jsx("p",{className:"text-xs text-muted-foreground",children:k.description})]})]},k.id)})})]},"board"),u===2&&c.jsxs(Ye.div,{...jw,transition:{duration:.2},className:"space-y-6",children:[c.jsxs("div",{className:"text-center space-y-1",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"Start your free trial"}),c.jsx("p",{className:"text-muted-foreground",children:"You'll be taken to Stripe to enter your payment details."})]}),c.jsxs("div",{className:"border border-border rounded-lg p-6 bg-card space-y-4",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"text-4xl font-bold text-foreground",children:"$25"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"per month per seat · 14-day free trial"})]}),c.jsx("div",{className:"border-t border-border pt-3 text-center",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"14-day free trial included. Cancel anytime."})})]}),c.jsxs(K,{onClick:C,className:"w-full",disabled:b,size:"lg",children:[b?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-2"}):c.jsx(QN,{className:"h-4 w-4 mr-2"}),"Continue to payment"]}),c.jsx("div",{className:"flex",children:c.jsxs(K,{variant:"outline",onClick:()=>d(1),className:"flex-none",disabled:b,children:[c.jsx(Iy,{className:"h-4 w-4 mr-1"}),"Back"]})})]},"payment")]})]})]})}function Lle(){const{role:t,isLoading:e,subscriptionStatus:n}=ot(),r=Dn(),{toast:s}=ut(),[i,o]=v.useState(!1);if(v.useEffect(()=>{!e&&(n==="active"||n==="trialing")&&r("/dashboard",{replace:!0})},[e,n,r]),e)return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground"})});const a=t==="owner",l=async()=>{o(!0);try{const{data:u,error:d}=await I.functions.invoke("create-checkout");if(d)throw d;if(u!=null&&u.error)throw new Error(u.error);if(!(u!=null&&u.url))throw new Error("No checkout URL returned");window.location.href=u.url}catch(u){s({title:"Error",description:u.message,variant:"destructive"}),o(!1)}};return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:c.jsxs(Ye.div,{initial:{opacity:0,y:12}
503,animate:{opacity:1,y:0},className:"w-full max-w-md space-y-6",children:[c.jsxs("div",{className:"text-center space-y-2",children:[c.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-destructive/10 flex items-center justify-center",children:c.jsx(vF,{className:"h-6 w-6 text-destructive"})}),c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:a?"Your subscription has ended":"Your team's subscription has ended"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:a?"Access is paused. Reactivate your subscription to continue using KitBoard.":"Your team admin needs to reactivate the subscription before you can access KitBoard. Please reach out to your team admin for help."})]}),a&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"border border-border rounded-lg p-6 bg-card space-y-4",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"text-4xl font-bold text-foreground",children:"$25"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"per month per seat · 14-day free trial"})]}),c.jsx("div",{className:"border-t border-border pt-3 text-center",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"14-day free trial included. Cancel anytime."})})]}),c.jsxs(K,{onClick:l,className:"w-full",disabled:i,size:"lg",children:[i?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-2"}):c.jsx(QN,{className:"h-4 w-4 mr-2"}),"Resubscribe on Stripe"]})]})]})})}function Fle(){const{user:t,teamId:e,refreshSubscription:n}=ot(),[r,s]=v.useState("polling"),i=v.useRef(!1);return v.useEffect(()=>{if(!t||!e||i.current)return;i.current=!0;let o=0;const a=20,l=async()=>{try{await I.from("profiles").upsert({id:t.id,onboarded:!0},{onConflict:"id"}),console.log("[CheckoutSuccess] Marked onboarded=true")}catch(d){console.error("[CheckoutSuccess] Failed to mark onboarded:",d)}window.location.href=hp()?"/kit/install":"/dashboard"},u=async()=>{o++,console.log(`[CheckoutSuccess] Poll attempt ${o}/${a}`);try{await n();const{data:d,error:f}=await I.from("team_subscriptions").select("status").eq("team_id",e).single();console.log("[CheckoutSuccess] Subscription query:",{sub:d,error:f});const h=d;if((h==null?void 0:h.status)==="trialing"||(h==null?void 0:h.status)==="active"){console.log("[CheckoutSuccess] Subscription confirmed:",h.status),s("success"),setTimeout(l,1500);return}}catch(d){console.error("[CheckoutSuccess] Poll error:",d)}o<a?setTimeout(u,2e3):(console.log("[CheckoutSuccess] Max attempts reached, redirecting anyway"),await l())};u()},[t,e]),c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx("div",{className:"text-center space-y-4",children:r==="polling"?c.jsxs(c.Fragment,{children:[c.jsx(gt,{className:"h-8 w-8 animate-spin text-primary mx-auto"}),c.jsx("p",{className:"text-muted-foreground",children:"Confirming your subscription…"})]}):c.jsxs(c.Fragment,{children:[c.jsx(fF,{className:"h-8 w-8 text-primary mx-auto"}),c.jsx("p",{className:"text-foreground font-medium",children:"You're all set! Redirecting…"})]})})})}function Me(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Ar(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Zn(t,e){const n=Me(t);return isNaN(e)?Ar(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Ys(t,e){const n=Me(t);if(isNaN(e))return Ar(t,NaN);if(!e)return n;const r=n.getDate(),s=Ar(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const m_=6048e5,Ble=864e5,X$=6e4,Z$=36e5,ug=43200,oM=1440;let $le={};function Jd(){return $le}function Mi(t,e){var a,l,u,d;const n=Jd(),r=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=Me(t),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function ac(t){return Mi(t,{weekStartsOn:1}
503)}function e5(t){const e=Me(t),n=e.getFullYear(),r=Ar(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=ac(r),i=Ar(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=ac(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function sd(t){const e=Me(t);return e.setHours(0,0,0,0),e}function id(t){const e=Me(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function wi(t,e){const n=sd(t),r=sd(e),s=+n-id(n),i=+r-id(r);return Math.round((s-i)/Ble)}function Vle(t){const e=e5(t),n=Ar(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),ac(n)}function Kk(t,e){const n=e*7;return Zn(t,n)}function zle(t,e){return Ys(t,e*12)}function Ule(t){let e;return t.forEach(function(n){const r=Me(n);(e===void 0||e<r||isNaN(Number(r)))&&(e=r)}),e||new Date(NaN)}function Wle(t){let e;return t.forEach(n=>{const r=Me(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function ny(t,e){const n=Me(t),r=Me(e),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}function Hle(t){return Ar(t,Date.now())}function Sr(t,e){const n=sd(t),r=sd(e);return+n==+r}function g_(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function qle(t){if(!g_(t)&&typeof t!="number")return!1;const e=Me(t);return!isNaN(Number(e))}function od(t,e){const n=Me(t),r=Me(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function Kle(t,e,n){const r=Mi(t,n),s=Mi(e,n),i=+r-id(r),o=+s-id(s);return Math.round((i-o)/m_)}function Gle(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Yle(t,e){return+Me(t)-+Me(e)}function Qle(t){const e=Me(t);return e.setHours(23,59,59,999),e}function Nb(t){const e=Me(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Jle(t){const e=Me(t);return+Qle(e)==+Nb(e)}function Xle(t,e){const n=Me(t),r=Me(e),s=ny(n,r),i=Math.abs(od(n,r));let o;if(i<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*i);let a=ny(n,r)===-s;Jle(Me(t))&&i===1&&ny(t,r)===1&&(a=!1),o=s*(i-Number(a))}return o===0?0:o}function Zle(t,e,n){const r=Yle(t,e)/1e3;return Gle(n==null?void 0:n.roundingMethod)(r)}function _r(t){const e=Me(t);return e.setDate(1),e.setHours(0,0,0,0),e}function t5(t){const e=Me(t),n=Ar(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function y_(t,e){var a,l,u,d;const n=Jd(),r=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=Me(t),i=s.getDay(),o=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function n5(t){return y_(t,{weekStartsOn:1})}const ece={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tce=(t,e,n)=>{let r;const s=ece[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Pw(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const nce={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rce={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},sce={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ice={date:Pw({formats:nce,defaultWidth:"full"}
vendor: 3,794 bytes, line 503
503),time:Pw({formats:rce,defaultWidth:"full"}),dateTime:Pw({formats:sce,defaultWidth:"full"})},oce={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ace=(t,e,n,r)=>oce[t];function yf(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const lce={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cce={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},uce={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dce={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},fce={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},hce={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},pce=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},mce={ordinalNumber:pce,era:yf({values:lce,defaultWidth:"wide"}),quarter:yf({values:cce,defaultWidth:"wide",argumentCallback:t=>t-1}),month:yf({values:uce,defaultWidth:"wide"}),day:yf({values:dce,defaultWidth:"wide"}),dayPeriod:yf({values:fce,defaultWidth:"wide",formattingValues:hce,defaultFormattingWidth:"wide"})};function vf(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const o=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?yce(a,f=>f.test(o)):gce(a,f=>f.test(o));let u;u=t.valueCallback?t.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=e.slice(o.length);return{value:u,rest:d}}}function gce(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function yce(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function vce(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const xce=/^(\d+)(th|st|nd|rd)?/i,bce=/\d+/i,wce={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sce={any:[/^b/i,/^(a|c)/i]}
vendor: 8,423 bytes, line 503
503,kce={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Cce={any:[/1/i,/2/i,/3/i,/4/i]},Nce={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ece={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},_ce={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Tce={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ace={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jce={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Pce={ordinalNumber:vce({matchPattern:xce,parsePattern:bce,valueCallback:t=>parseInt(t,10)}),era:vf({matchPatterns:wce,defaultMatchWidth:"wide",parsePatterns:Sce,defaultParseWidth:"any"}),quarter:vf({matchPatterns:kce,defaultMatchWidth:"wide",parsePatterns:Cce,defaultParseWidth:"any",valueCallback:t=>t+1}),month:vf({matchPatterns:Nce,defaultMatchWidth:"wide",parsePatterns:Ece,defaultParseWidth:"any"}),day:vf({matchPatterns:_ce,defaultMatchWidth:"wide",parsePatterns:Tce,defaultParseWidth:"any"}),dayPeriod:vf({matchPatterns:Ace,defaultMatchWidth:"any",parsePatterns:jce,defaultParseWidth:"any"})},v_={code:"en-US",formatDistance:tce,formatLong:ice,formatRelative:ace,localize:mce,match:Pce,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Rce(t){const e=Me(t);return wi(e,t5(e))+1}function r5(t){const e=Me(t),n=+ac(e)-+Vle(e);return Math.round(n/m_)+1}function s5(t,e){var d,f,h,p;const n=Me(t),r=n.getFullYear(),s=Jd(),i=(e==null?void 0:e.firstWeekContainsDate)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(h=s.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=Ar(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=Mi(o,e),l=Ar(t,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=Mi(l,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Mce(t,e){var a,l,u,d;const n=Jd(),r=(e==null?void 0:e.firstWeekContainsDate)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=s5(t,e),i=Ar(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Mi(i,e)}function i5(t,e){const n=Me(t),r=+Mi(n,e)-+Mce(n,e);return Math.round(r/m_)+1}function lt(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Ro={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return lt(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):lt(n+1,2)},d(t,e){return lt(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return lt(t.getHours()%12||12,e.length)},H(t,e){return lt(t.getHours(),e.length)},m(t,e){return lt(t.getMinutes(),e.length)},s(t,e){return lt(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return lt(s,e.length)}},$c={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},aM={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Ro.y(t,e)},Y:function(t,e,n,r){const s=s5(t,r),i=s>0?s:1-s;if(e==="YY"){const o=i%100;return lt(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):lt(i,e.length)},R:function(t,e){const n=e5(t);return lt(n,e.length)},u:function(t,e){const n=t.getFullYear();return lt(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return lt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return lt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Ro.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return lt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=i5(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):lt(s,e.length)},I:function(t,e,n){const r=r5(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):lt(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Ro.d(t,e)},D:function(t,e,n){const r=Rce(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):lt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return lt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return lt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return lt(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=$c.noon:r===0?s=$c.midnight:s=r/12>
vendor: 4,583 bytes, line 503
503=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=$c.evening:r>=12?s=$c.afternoon:r>=4?s=$c.morning:s=$c.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ro.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Ro.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):lt(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):lt(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ro.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Ro.s(t,e)},S:function(t,e){return Ro.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return cM(r);case"XXXX":case"XX":return gl(r);case"XXXXX":case"XXX":default:return gl(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return cM(r);case"xxxx":case"xx":return gl(r);case"xxxxx":case"xxx":default:return gl(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+lM(r,":");case"OOOO":default:return"GMT"+gl(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+lM(r,":");case"zzzz":default:return"GMT"+gl(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return lt(r,e.length)},T:function(t,e,n){const r=t.getTime();return lt(r,e.length)}};function lM(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+lt(i,2)}function cM(t,e){return t%60===0?(t>0?"-":"+")+lt(Math.abs(t)/60,2):gl(t,e)}function gl(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=lt(Math.trunc(r/60),2),i=lt(r%60,2);return n+s+e+i}const uM=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},o5=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Oce=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return uM(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",uM(r,e)).replace("{{time}}",o5(s,e))},Dce={p:o5,P:Oce},Ice=/^D+$/,Lce=/^Y+$/,Fce=["D","DD","YY","YYYY"];function Bce(t){return Ice.test(t)}function $ce(t){return Lce.test(t)}function Vce(t,e,n){const r=zce(t,e,n);if(console.warn(r),Fce.includes(t))throw new RangeError(r)}function zce(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Uce=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wce=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hce=/^'([^]*?)'?$/,qce=/''/g,Kce=/[a-zA-Z]/;function Ze(t,e,n){var d,f,h,p,m,g,y,b;const r=Jd(),s=(n==null?void 0:n.locale)??r.locale??v_,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((g=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((b=(y=r.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,a=Me(t);if(!qle(a))throw new RangeError("Invalid time value");let l=e.match(Wce).map(x=>{const w=x[0];if(w==="p"||w==="P"){const S=Dce[w];return S(x,s.formatLong)}return x}).join("").match(Uce).map(x=>
503{if(x==="''")return{isToken:!1,value:"'"};const w=x[0];if(w==="'")return{isToken:!1,value:Gce(x)};if(aM[w])return{isToken:!0,value:x};if(w.match(Kce))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:x}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return l.map(x=>{if(!x.isToken)return x.value;const w=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&$ce(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Bce(w))&&Vce(w,e,String(t));const S=aM[w[0]];return S(a,w,s.localize,u)}).join("")}function Gce(t){const e=t.match(Hce);return e?e[1].replace(qce,"'"):t}function Yce(t,e,n){const r=Jd(),s=(n==null?void 0:n.locale)??r.locale??v_,i=2520,o=ny(t,e);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o});let l,u;o>0?(l=Me(e),u=Me(t)):(l=Me(t),u=Me(e));const d=Zle(u,l),f=(id(u)-id(l))/1e3,h=Math.round((d-f)/60);let p;if(h<2)return n!=null&&n.includeSeconds?d<5?s.formatDistance("lessThanXSeconds",5,a):d<10?s.formatDistance("lessThanXSeconds",10,a):d<20?s.formatDistance("lessThanXSeconds",20,a):d<40?s.formatDistance("halfAMinute",0,a):d<60?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",1,a):h===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",h,a);if(h<45)return s.formatDistance("xMinutes",h,a);if(h<90)return s.formatDistance("aboutXHours",1,a);if(h<oM){const m=Math.round(h/60);return s.formatDistance("aboutXHours",m,a)}else{if(h<i)return s.formatDistance("xDays",1,a);if(h<ug){const m=Math.round(h/oM);return s.formatDistance("xDays",m,a)}else if(h<ug*2)return p=Math.round(h/ug),s.formatDistance("aboutXMonths",p,a)}if(p=Xle(u,l),p<12){const m=Math.round(h/ug);return s.formatDistance("xMonths",m,a)}else{const m=p%12,g=Math.trunc(p/12);return m<3?s.formatDistance("aboutXYears",g,a):m<9?s.formatDistance("overXYears",g,a):s.formatDistance("almostXYears",g+1,a)}}function ad(t,e){return Yce(t,Hle(t),e)}function Qce(t){const e=Me(t),n=e.getFullYear(),r=e.getMonth(),s=Ar(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Jce(t){return Math.trunc(+Me(t)/1e3)}function Xce(t){const e=Me(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function Zce(t,e){return Kle(Xce(t),_r(t),e)+1}function pv(t,e){const n=Me(t),r=Me(e);return n.getTime()>r.getTime()}function a5(t,e){const n=Me(t),r=Me(e);return+n<+r}function x_(t,e){const n=Me(t),r=Me(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function eue(t,e){const n=Me(t),r=Me(e);return n.getFullYear()===r.getFullYear()}function ry(t,e){return Zn(t,-e)}function Gk(t,e){const r=sue(t);let s;if(r.date){const l=iue(r.date,2);s=oue(l.restDateString,l.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const i=s.getTime();let o=0,a;if(r.time&&(o=aue(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(a=lue(r.timezone),isNaN(a))return new Date(NaN)}else{const l=new Date(i+o),u=new Date(0);return u.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),u.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),u}return new Date(i+o+a)}const dg={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tue=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,nue=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,rue=/^([+-])(\d{2})(?::?(\d{2}))?$/;function sue(t){const e={},n=t.split(dg.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],dg.timeZoneDelimiter.test(e.date)&&(e.date=t.split(dg.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const s=dg.timezone.exec(r);s?(e.time=r.replace(s[1],""),e.timezone=s[1]):e.time=r}return e}function iue(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const s=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?s:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oue(t,e){if(e===null)return new Date(NaN);const n=t.match(tue);if(!n)return new Date(NaN);const r=!!n[4],s=xf(n[1]),i=xf(n[2])-1,o=xf(n[3]),a=xf(n[4]),l=xf(n[5])-1;if(r)return hue(e,a,l)?cue(e,a,l):new Date(NaN);{const u=new Date(0);return!due(e,i,o)||!fue(e,s)?new Date(NaN):(u.setUTCFullYear(e,i,Math.max(s,o)),u)}}function xf(t){return t?parseInt(t):1}function aue(t){const e=t.match(nue);if(!e)return NaN;const n=Rw(e[1]),r=Rw(e[2]),s=Rw(e[3]);return pue(n,r,s)?n*Z$+r*X$+s*1e3:NaN}function Rw(t){return t&&parseFloat(t.replace(",","."))||0}function lue(t){if(t==="Z")return 0;const e=t.match(rue);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return mue(r,s)?n*(r*Z$+s*X$):NaN}function cue(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const s=r.getUTCDay()||7,i=(e-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+i),r}const uue=[31,null,31,30,31,30,31,31,30,31,30,31];function l5(t){return t%400===0||t%4===0&&t%100!==0}function due(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(uue[e]||(l5(t)?29:28))}function fue(t,e){return e>=1&&e<=(l5(t)?366:365)}function hue(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function pue(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function mue(t,e){return e>=0&&e<=59}function Mw(t,e){const n=Me(t),r=n.getFullYear(),s=n.getDate(),i=Ar(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const o=Qce(i);return n.setMonth(e,Math.min(s,o)),n}function dM(t,e){const n=Me(t);return isNaN(+n)?Ar(t,NaN):(n.setFullYear(e),n)}function Yk(t,[e,n]){return Math.min(n,Math.max(e,t))}function gue(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}var b_="ScrollArea",[c5,wTe]=dr(b_),[yue,ys]=c5(b_),u5=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=t,[a,l]=v.useState(null),[u,d]=v.useState(null),[f,h]=v.useState(null),[p,m]=v.useState(null),[g,y]=v.useState(null),[b,x]=v.useState(0),[w,S]=v.useState(0),[C,k]=v.useState(!1),[N,E]=v.useState(!1),_=We(e,P=>l(P)),T=sm(s);return c.jsx(yue,{scope:n,type:r,dir:T,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:N,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeight
vendor: 9,210 bytes, line 503
503Change:S,children:c.jsx(he.div,{dir:T,...o,ref:_,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});u5.displayName=b_;var d5="ScrollAreaViewport",f5=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,o=ys(d5,n),a=v.useRef(null),l=We(e,a,o.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),c.jsx(he.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style},children:c.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});f5.displayName=d5;var $i="ScrollAreaScrollbar",w_=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=ys($i,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=t.orientation==="horizontal";return v.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?c.jsx(vue,{...r,ref:e,forceMount:n}):s.type==="scroll"?c.jsx(xue,{...r,ref:e,forceMount:n}):s.type==="auto"?c.jsx(h5,{...r,ref:e,forceMount:n}):s.type==="always"?c.jsx(S_,{...r,ref:e}):null});w_.displayName=$i;var vue=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=ys($i,t.__scopeScrollArea),[i,o]=v.useState(!1);return v.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),o(!0)},d=()=>{l=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),c.jsx(fr,{present:n||i,children:c.jsx(h5,{"data-state":i?"visible":"hidden",...r,ref:e})})}),xue=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=ys($i,t.__scopeScrollArea),i=t.orientation==="horizontal",o=_b(()=>l("SCROLL_END"),100),[a,l]=gue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,l]),v.useEffect(()=>{const u=s.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(l("SCROLL"),o()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[s.viewport,i,l,o]),c.jsx(fr,{present:n||a!=="hidden",children:c.jsx(S_,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:fe(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:fe(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),h5=v.forwardRef((t,e)=>{const n=ys($i,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,o]=v.useState(!1),a=t.orientation==="horizontal",l=_b(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;o(a?u:d)}},10);return ld(n.viewport,l),ld(n.content,l),c.jsx(fr,{present:r||i,children:c.jsx(S_,{"data-state":i?"visible":"hidden",...s,ref:e})})}),S_=v.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,s=ys($i,t.__scopeScrollArea),i=v.useRef(null),o=v.useRef(0),[a,l]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=v5(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,p){return Nue(h,o.current,a,p)}return n==="horizontal"?c.jsx(bue,{...d,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const h=s.viewport.scrollLeft,p=fM(h,a,s.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=f(h,s.dir))}}):n==="vertical"?c.jsx(wue,{...d,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const h=s.viewport.scrollTop,p=fM(h,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=f(h))}}):null}),bue=v.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=ys($i,t.__scopeScrollArea),[o,a]=v.useState(),l=v.useRef(null),u=We(e,l,i.onScrollbarXChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(m5,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Eb(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const h=i.viewport.scrollLeft+d.deltaX;t.onWheelScroll(h),b5(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:gv(o.paddingLeft),paddingEnd:gv(o.paddingRight)}})}})}),wue=v.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=ys($i,t.__scopeScrollArea),[o,a]=v.useState(),l=v.useRef(null),u=We(e,l,i.onScrollbarYChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(m5,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Eb(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const h=i.viewport.scrollTop+d.deltaY;t.onWheelScroll(h),b5(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:gv(o.paddingTop),paddingEnd:gv(o.paddingBottom)}})}})}),[Sue,p5]=c5($i),m5=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=t,p=ys($i,n),[m,g]=v.useState(null),y=We(e,_=>g(_)),b=v.useRef(null),x=v.useRef(""),w=p.viewport,S=r.content-r.viewport,C=en(d),k=en(l),N=_b(f,10);function E(_){if(b.current){const T=_.clientX-b.current.left,P=_.clientY-b.current.top;u({x:T,y:P})}}return v.useEffect(()=>{const _=T=>{const P=T.target;(m==null?void 0:m.contains(P))&&C(T,S)};return document.addEventListener("wheel",_,{passive:!1}),()=>document.removeEventListener("wheel",_,{passive:!1})},[w,m,S,C]),v.useEffect(k,[r,k]),ld(m,N),ld(p.content,N),c.jsx(Sue,{scope:n,scrollbar:m,hasThumb:s,onThumbChange:en(i),onThumbPointerUp:en(o),onThumbPositionChange:k,onThumbPointerDown:en(a),children:c.jsx(he.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:fe(t.onPointerDown,_=>{_.button===0&&(_.target.setPointerCapture(_.pointerId),b.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(_))}),onPointerMove:fe(t.onPointerMove,E),onPointerUp:fe(t.onPointerUp,_=>{const T=_.target;T.hasPointerCapture(_.pointerId)&&T.releasePointerCapture(_.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),mv="ScrollAreaThumb",g5=v.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=p5(mv,t.__scopeScrollArea);return c.jsx(fr,{present:n||s.hasThumb,children:c.jsx(kue,{ref:e,...r})})}),kue=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=ys(mv,n),o=p5(mv,n),{onThumbPositionChange:a}=o,l=We(e,f=>o.onThumbChange(f)),u=v.useRef(void 0),d=_b(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const f=i.viewport;if(f){const h=()=>{if(d(),!u.current){const p=Eue(f,a);u.current=p,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[i.viewport,d,a]),c.jsx(he.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:fe(t.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),m=f.clientX-p.left,g=f.clientY-p.top;o.onThumbPointerDown({x:m,y:g})}),onPointerUp:fe(t.onPointerUp,o.onThumbPointerUp)})});g5.displayName=mv;var k_="ScrollAreaCorner",y5=v.forwardRef((t,e)=>{const n=ys(k_,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(Cue,{...t,ref:e}):null});y5.displayName=k_;var Cue=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=ys(k_,n),[i,o]=v.useState(0),[a,l]=v.useState(0),u=!!(i&&a);return ld(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;
vendor: 2,517 bytes, line 503
503s.onCornerHeightChange(d),l(d)}),ld(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?c.jsx(he.div,{...r,ref:e,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function gv(t){return t?parseInt(t,10):0}function v5(t,e){const n=t/e;return isNaN(n)?0:n}function Eb(t){const e=v5(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Nue(t,e,n,r="ltr"){const s=Eb(n),i=s/2,o=e||i,a=s-o,l=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return x5([l,u],f)(t)}function fM(t,e,n="ltr"){const r=Eb(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,o=e.content-e.viewport,a=i-r,l=n==="ltr"?[0,o]:[o*-1,0],u=Yk(t,l);return x5([0,o],[0,a])(u)}function x5(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function b5(t,e){return t>0&&t<e}var Eue=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function s(){const i={left:t.scrollLeft,top:t.scrollTop},o=n.left!==i.left,a=n.top!==i.top;(o||a)&&e(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function _b(t,e){const n=en(t),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function ld(t,e){const n=en(e);Wt(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var w5=u5,_ue=f5,Tue=y5;const S5=v.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(w5,{ref:r,className:q("relative overflow-hidden",t),...n,children:[c.jsx(_ue,{className:"h-full w-full rounded-[inherit]",children:e}),c.jsx(k5,{}),c.jsx(Tue,{})]}));S5.displayName=w5.displayName;const k5=v.forwardRef(({className:t,orientation:e="vertical",...n},r)=>c.jsx(w_,{ref:r,orientation:e,className:q("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:c.jsx(g5,{className:"relative flex-1 rounded-full bg-border"})}));k5.displayName=w_.displayName;const Aue={initial:{opacity:0}
503,animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function jue(t){return t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Pue(){const{teamId:t}=ot(),e=Dn(),{data:n,isLoading:r}=ue({queryKey:["dashboard-contacts",t],queryFn:async()=>{const{data:k,error:N}=await I.from("contacts").select("id, first_name, last_name, created_at").order("created_at",{ascending:!1});if(N)throw N;return k},enabled:!!t}),{data:s,isLoading:i}=ue({queryKey:["dashboard-tasks",t],queryFn:async()=>{const{data:k,error:N}=await I.from("tasks").select("id, title, due_at, status, contact_id, contacts(first_name, last_name)").neq("status","done").not("due_at","is",null).gte("due_at",new Date().toISOString()).order("due_at",{ascending:!0}).limit(50);if(N)throw N;return k??[]},enabled:!!t}),{data:o,isLoading:a}=ue({queryKey:["dashboard-boards",t],queryFn:async()=>{const{data:k,error:N}=await I.from("boards").select("id, name, board_statuses(id, name, color, position), board_contacts(id, status_id)").order("created_at",{ascending:!1});if(N)throw N;return k},enabled:!!t}),{data:l,isLoading:u}=ue({queryKey:["dashboard-activity",t],queryFn:async()=>{const{data:k,error:N}=await I.from("contact_activity_log").select("id, action, metadata, created_at, contact_id, contacts(id, first_name, last_name)").order("created_at",{ascending:!1}).limit(50);if(N)throw N;return k},enabled:!!t}),d=(n==null?void 0:n.length)??0,f=(n==null?void 0:n.filter(k=>pv(new Date(k.created_at),ry(new Date,7))).length)??0,h=r||i||a,[p,m]=v.useState(!1),[g,y]=v.useState(!1),[b,x]=v.useState(!1),w=p?o:o==null?void 0:o.slice(0,5),S=g?s:s==null?void 0:s.slice(0,5),C=b?l:l==null?void 0:l.slice(0,5);return c.jsxs(c.Fragment,{children:[c.jsx(Ei,{children:c.jsx("h1",{className:"text-sm font-semibold text-foreground",children:"Dashboard"})}),c.jsx(S5,{className:"h-full",children:c.jsxs(Ye.div,{...Aue,className:"p-6 space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.jsx(Ow,{label:"Total Contacts",value:h?null:d,icon:c.jsx(yo,{className:"h-4 w-4"}),onClick:()=>e("/contacts")}),c.jsx(Ow,{label:"Added This Week",value:h?null:f,icon:c.jsx(yo,{className:"h-4 w-4"}),onClick:()=>e("/contacts")}),c.jsx(Ow,{label:"Upcoming Tasks",value:h?null:(s==null?void 0:s.length)??0,icon:c.jsx(Od,{className:"h-4 w-4"}),onClick:()=>e("/tasks")})]}),c.jsxs("section",{className:"space-y-3",children:[c.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Boards"}),a?c.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((k,N)=>c.jsx(vt,{className:"h-24 w-full"},N))}):w&&w.length>0?c.jsxs("div",{className:"space-y-2",children:[w.map(k=>{const N=(k.board_statuses??[]).sort((T,P)=>T.position-P.position),E=k.board_contacts??[],_=E.length;return c.jsxs(Bs,{className:"p-4 cursor-pointer hover:bg-secondary/50 transition-colors",onClick:()=>e(`/boards/${k.id}`),children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:k.name}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:[_," contacts"]})]}),N.length>0&&_>0&&c.jsx("div",{className:"flex h-2 rounded-full overflow-hidden bg-muted",children:N.map(T=>{const P=E.filter(j=>j.status_id===T.id).length;return P===0?null:c.jsx("div",{className:"h-full",style:{width:`${P/_*100}%`,backgroundColor:T.color},title:`${T.name}: ${P}`},T.id)})}),N.length>0&&c.jsx("div",{className:"flex flex-wrap gap-3 mt-2",children:N.map(T=>{const P=E.filter(j=>j.status_id===T.id).length;return c.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[c.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:T.color}}),T.name," (",P,")"]},T.id)})})]},k.id)}),o&&o.length>5&&c.jsx(K,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>m(k=>!k),children:p?"Show less":`Show ${o.length-5} more`})]}):c.jsxs(Bs,{className:"p-6 text-center",children:[c.jsx(Md,{className:"h-8 w-8 text-muted-foreground mx-auto mb-2"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"No boards yet"})]})]}),c.jsxs("section",{className:"space-y-3",children:[c.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Upcoming Tasks"}),i?c.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((k,N)=>c.jsx(vt,{className:"h-10 w-full"},N))}):S&&S.length>0?c.jsxs("div",{className:"space-y-2",children:[S.map(k=>{const N=k.contacts,E=N?`${N.first_name} ${N.last_name??""}`.trim():"";return c.jsxs("div",{className:"flex items-center justify-between p-3 border border-border rounded-md hover:bg-secondary/50 cursor-pointer transition-colors",onClick:()=>k.contact_id?e(`/contacts/${k.contact_id}`):e("/tasks"),children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:k.title}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:E})]}),c.jsx("span",{className:"text-xs text-muted-foreground flex-shrink-0 ml-2",children:k.due_at?Ze(new Date(k.due_at),"MMM d"):""})]},k.id)}),s&&s.length>5&&c.jsx(K,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>y(k=>!k),children:g?"Show less":`Show ${s.length-5} more`})]}):c.jsx(Bs,{className:"p-4 text-center",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"No upcoming tasks"})})]}),c.jsxs("section",{className:"space-y-3",children:[c.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Recent Activity"}),u?c.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((k,N)=>c.jsx(vt,{className:"h-10 w-full"},N))}):C&&C.length>0?c.jsxs("div",{className:"space-y-2",children:[C.map(k=>{const N=k.contacts,E=N?`${N.first_name} ${N.last_name??""}`.trim():"";return c.jsxs("div",{className:"flex items-start gap-3 p-3 border border-border rounded-md hover:bg-secondary/50 cursor-pointer transition-colors",onClick:()=>N&&e(`/contacts/${N.id}`),children:[c.jsx(DS,{className:"h-4 w-4 text-muted-foreground mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("p",{className:"text-sm text-foreground",children:[c.jsx("span",{className:"font-medium",children:jue(k.action)}),E&&c.jsxs("span",{className:"text-muted-foreground",children:[" — ",E]})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:Ze(ne
503w Date(k.created_at),"MMM d, h:mm a")})]})]},k.id)}),l&&l.length>5&&c.jsx(K,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>x(k=>!k),children:b?"Show less":`Show ${l.length-5} more`})]}):c.jsxs(Bs,{className:"p-4 text-center",children:[c.jsx(DS,{className:"h-8 w-8 text-muted-foreground mx-auto mb-2"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity yet"})]})]})]})})]})}function Ow({label:t,value:e,icon:n,onClick:r}){return c.jsxs(Bs,{className:`p-4 ${r?"cursor-pointer hover:bg-secondary/50 transition-colors":""}`,onClick:r,children:[c.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[n,c.jsx("span",{className:"text-xs",children:t})]}),e===null?c.jsx(vt,{className:"h-7 w-16"}):c.jsx("p",{className:"text-2xl font-semibold text-foreground",children:e})]})}const Rue="/assets/app-board-screenshot-CYRNFQs2.png";function Fn({children:t,className:e="",delay:n=0}){const r=v.useRef(null),s=j$(r,{once:!0,margin:"-60px"});return c.jsx(Ye.div,{ref:r,initial:{opacity:0,y:24},animate:s?{opacity:1,y:0}:{},transition:{duration:.5,ease:"easeOut",delay:n},className:e,children:t})}const Dw=[{icon:Md,title:"Powerful CRM",body:"Rich contact profiles, custom fields, visual pipelines, and deal tracking — all designed for creators who sell through relationships."},{icon:yo,title:"Team Collaboration",body:"Shared workspaces, real-time activity feeds, and role-based access so your whole team works from one source of truth."},{icon:qx,title:"Email Integrations",body:"Native Kit connection with one-click install, Gmail conversation history, and automated tag syncing across your pipeline."}],bf=[{quote:"KitBoard is great if your Creator business has a sales team. With your sequences and automation setup, your sales team knows exactly the right time to reach out.",name:"Jason Resnick",title:"nurturekit.co"},{quote:"KitBoard works seamlessly with Kit and opens up so many possibilities for automated and personal follow up with my best leads. I love being able to easily tag and nurture my subscribers, add notes to their profile, and see all my personal email conversations in one place.",name:"Robby Miles",title:"Creator"},{quote:"KitBoard's seamless integration with Kit has simplified my sales process and eliminated the need for multiple tools. It's been a game-changer!",name:"Darrell Vesterfelt",title:"Co-founder, School of Traditional Skills"},{quote:"High-touch, premium experiences deserve a sales process that reflects the underlying value. KitBoard gives me a simple but effective way to manage the sales process for my coaching business on top of my favorite tool I already use: Kit.",name:"Barrett Brooks",title:"Executive Coach"}],Mue=[{title:"Connect Your Kit Account",body:"Install KitBoard from the Kit App Store with one click. No API keys to hunt down, no Zapier required. KitBoard connects to your Kit account through a secure OAuth integration and stays in sync automatically."},{title:"Import Your Subscribers",body:"Browse your Kit subscribers right inside KitBoard. Filter by tag, select who you want to bring in, and import them as contacts. KitBoard matches by email so you never create duplicates."},{title:"Build Your Pipeline",body:"Create boards that map to your sales process. Drag contacts through stages — from prospect to interested to booked to closed. When you move a contact, KitBoard updates their tags in Kit automatically."},{title:"Manage the Relationship",body:"Add notes after calls, set follow-up reminders, track deal values, and view your full email history with each contact through KitBoard's Gmail integration."},{title:"Close and Trigger",body:"When you close a deal, a simple drag-and-drop can trigger a welcome sequence, add a tag, or kick off any automation you've already built in Kit."}],Oue=["Managing Kit subscriber data in a CRM meant complex, expensive automations","Hours spent configuring tools that weren't designed for creators","Subscriber data in Kit, sales notes in a CRM, emails in Gmail — three tabs, zero connection","Paying $50-300/month for CRM features you'll never touch","Broken Zapier workflows at the worst possible moment"],Due=["One-click connection to your Kit account from the Kit App Store","Subscriber data, sales pipeline, and email history in one place","Tag changes in KitBoard automatically sync back to Kit","AI handles note-taking, follow-up suggestions, and message drafting","$25/month per seat — scales with your team"],Iue=["Unlimited boards","Unlimited subscribers","Unlimited notes, reminders, and activity tracking","Native Kit App Store integration","Gmail integration for full email conversation history","Compatible with Kit automations and sequences","Team workspaces with multi-user access","Custom fields with aggregation across pipeline stages","AI features included as they roll out","Premium chat support"],Lue=[{q:"Does KitBoard work with the free plan for Kit?",a:"Yes. KitBoard works with all Kit plans."},{q:"How does KitBoard connect to Kit?",a:"KitBoard is available on the Kit App Store. Install it with one click and authorize the connection through Kit's secure OAuth flow. No API keys to copy and paste — just connect and go."},{q:"How do KitBoard boards work with Kit data?",a:"Each board represents a set of tags from your Kit account. When you drag a contact from one column to another, KitBoard automatically removes the old tag and adds the new one in Kit."},{q:"Can I view email conversations with a subscriber in KitBoard?",a:"Yes. With KitBoard's Gmail integration, you can see every email you've sent or received from a contact directly inside their profile."},{q:"Can I import specific subscribers from Kit?",a:"Yes. When you import subscribers, you can browse your full list or filter by Kit tag. Select exactly who you want to bring into KitBoard."},{q:"Is KitBoard multi-tenant? Can my team use it?",a:"Yes. Invite team members into your workspace. Everyone shares the same contacts, boards, and activity — all scoped to your team."},{q:"What AI features are available?",a:"AI features are actively in development and will roll out to all Pro plan users as they go live. This includes smart follow-up suggestions, AI-drafted messages, contact prioritization, and note summarization."}],Iw={backgroundImage:"radial-gradient(circle, hsl(var(--foreground) / 0.25) 1.2px, transparent 1.2px)",backgroundSize:"32px 32px"};function Fue(){const t=Dn(),[e,n]=v.useState(()=>
503{const r=new URLSearchParams(window.location.search),s=window.location.hash;return!!(r.get("code")||r.get("token_hash")||s.includes("access_token")||s.includes("refresh_token")||s.includes("type=signup")||s.includes("error="))});return v.useEffect(()=>{let r=!0,s;const i=new URLSearchParams(window.location.search),o=window.location.hash,a=!!(i.get("code")||i.get("token_hash")||o.includes("access_token")||o.includes("refresh_token")||o.includes("type=signup")||o.includes("error="));if(o.includes("error=")){const p=new URLSearchParams(o.replace("#","")).get("error_description")||"Email link is invalid or has expired";t(`/login?error=${encodeURIComponent(p)}`,{replace:!0});return}const l=async h=>{if(hp()){if(!r)return;t("/kit/install",{replace:!0});return}const{data:p}=await I.from("profiles").select("onboarded").eq("id",h).maybeSingle();r&&t(p!=null&&p.onboarded?"/dashboard":"/onboarding",{replace:!0})},u=a||hp(),{data:{subscription:d}}=I.auth.onAuthStateChange((h,p)=>{if(r){if(u&&(p!=null&&p.user)&&(h==="SIGNED_IN"||h==="INITIAL_SESSION"||h==="TOKEN_REFRESHED")){setTimeout(()=>{r&&l(p.user.id)},0);return}!a&&h==="INITIAL_SESSION"&&n(!1)}});return(async()=>{const h=i.get("code");h&&await I.auth.exchangeCodeForSession(h).catch(()=>null);const{data:{session:p}}=await I.auth.getSession();if(r){if(u&&(p!=null&&p.user)){await l(p.user.id);return}if(!a){n(!1);return}s=window.setTimeout(async()=>{const{data:{session:m}}=await I.auth.getSession();r&&(m!=null&&m.user?await l(m.user.id):n(!1))},1500)}})(),()=>{r=!1,s&&window.clearTimeout(s),d.unsubscribe()}},[t]),e?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):c.jsxs("div",{className:"min-h-screen overflow-x-hidden bg-background text-foreground",children:[c.jsx("nav",{className:"sticky top-0 z-50 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsxs("div",{className:"mx-auto flex h-14 max-w-5xl items-center justify-between px-6",children:[c.jsx($e,{to:"/",className:"flex items-center gap-2",children:c.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"KitBoard"})}),c.jsxs("div",{className:"hidden items-center gap-5 sm:flex",children:[c.jsx("a",{href:"#features",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Features"}),c.jsx("a",{href:"#how-it-works",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"How It Works"}),c.jsx("a",{href:"#pricing",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Pricing"}),c.jsx($e,{to:"/support",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Docs"}),c.jsxs("a",{href:"https://app.kitboard.co",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-1",children:["Legacy App ",c.jsx(IS,{className:"h-3 w-3"})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(K,{variant:"ghost",size:"sm",asChild:!0,children:c.jsx($e,{to:"/login",children:"Log in"})}),c.jsx(K,{size:"sm",asChild:!0,children:c.jsxs($e,{to:"/signup",children:["Try it Free ",c.jsx(Ly,{className:"ml-1 h-3.5 w-3.5"})]})})]})]})}),c.jsxs("section",{className:"relative flex flex-col items-center overflow-hidden px-6 pt-20 pb-0 text-center sm:pt-28",style:Iw,children:[c.jsx("div",{className:"pointer-events-none absolute -left-40 -top-40 h-[500px] w-[500px] rounded-full opacity-[0.07]",style:{background:"radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"}}),c.jsx("div",{className:"pointer-events-none absolute -bottom-32 -right-32 h-[400px] w-[400px] rounded-full opacity-[0.05]",style:{background:"radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"}}),c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse 50% 45% at 50% 35%, transparent 0%, hsl(var(--background) / 0.6) 50%, hsl(var(--background)) 85%)"}}),c.jsxs("div",{className:"relative z-10 mx-auto max-w-4xl",children:[c.jsx(Ye.p,{initial:{opacity:0,y:12}
503,animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"mb-5 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"The Creator-First CRM"}),c.jsxs(Ye.h1,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},className:"text-balance text-3xl font-semibold tracking-tight sm:text-5xl lg:text-6xl",children:["Your audience is your pipeline.",c.jsx("br",{className:"hidden sm:inline"}),c.jsx("span",{className:"sm:hidden",children:" "}),"KitBoard helps you close."]}),c.jsx(Ye.p,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.35},className:"mx-auto mt-6 max-w-2xl text-pretty text-base leading-relaxed text-muted-foreground sm:text-lg",children:"A powerful CRM with team collaboration, email integrations, and AI workflows — built for creators and coaches who sell through relationships on Kit."}),c.jsxs(Ye.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,delay:.5},className:"mt-10 flex flex-col items-stretch justify-center gap-3 sm:flex-row sm:items-center",children:[c.jsx(K,{size:"lg",asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})}),c.jsx(K,{size:"lg",variant:"outline",asChild:!0,children:c.jsx("a",{href:"#how-it-works",children:"See How It Works"})})]})]}),c.jsx(Ye.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{duration:.7,delay:.65},className:"relative z-10 mx-auto mt-16 w-full max-w-6xl px-2 sm:px-6",children:c.jsxs("div",{className:"relative max-h-[42vh] overflow-hidden rounded-t-xl",children:[c.jsx("div",{className:"pointer-events-none absolute -inset-x-8 -bottom-8 top-12 rounded-3xl bg-primary/10 blur-3xl"}),c.jsxs("div",{className:"relative overflow-hidden rounded-t-xl border border-b-0 border-border bg-card shadow-2xl ring-1 ring-black/5",children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border bg-secondary/60 px-4 py-2.5",children:[c.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-[#ff5f57]"}),c.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-[#febc2e]"}),c.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-[#28c840]"})]}),c.jsx("img",{src:Rue,alt:"KitBoard app showing a kanban-style board with subscribers organized across New, In Progress, Won, and Lost columns",className:"block w-full"})]})]})})]}),c.jsxs("section",{className:"relative overflow-hidden border-b bg-secondary/30 px-6 pt-16 pb-20",children:[c.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-border to-transparent"}),c.jsx("div",{className:"mx-auto max-w-6xl",children:c.jsx(Fn,{children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"mb-3 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"A look inside"}),c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Your pipeline, organized like a board."}),c.jsx("p",{className:"mx-auto mt-3 max-w-xl text-sm text-muted-foreground sm:text-base",children:"Drag subscribers through stages, track deal value, and keep your whole team in sync."})]})})})]}),c.jsx("section",{className:"border-y border-border bg-card",children:c.jsxs("div",{className:"mx-auto flex max-w-6xl flex-wrap items-center justify-between gap-x-10 gap-y-4 px-6 py-5",children:[c.jsx("p",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"Trusted by creators on Kit"}),c.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-2",children:["nurturekit.co","Robby Miles","Traditional Skills","Barrett Brooks"].map(r=>c.jsx("span",{className:"text-sm font-medium tracking-tight text-muted-foreground/70",children:r},r))})]})}),c.jsx("section",{id:"features",className:"relative px-6 py-24",children:c.jsxs("div",{className:"mx-auto max-w-6xl",children:[c.jsxs(Fn,{children:[c.jsx("p",{className:"mb-3 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"— Features"}),c.jsx("h2",{className:"max-w-2xl text-2xl font-semibold tracking-tight sm:text-3xl",children:"Everything you need to close from your audience."}),c.jsx("p",{className:"mt-3 max-w-xl text-sm text-muted-foreground sm:text-base",children:"Four pillars that make KitBoard the only CRM creators need."})]}),c.jsxs("div",{className:"mt-12 grid gap-4 sm:grid-cols-3",children:[c.jsx(Fn,{className:"sm:col-span-2 sm:row-span-2",children:c.jsxs("div",{className:"group h-full rounded-xl border border-border bg-card shadow-sm transition-all hover:border-primary/40 hover:shadow-md",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border px-6 py-3",children:[c.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"01 / Feature"}),c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"})]}),c.jsxs("div",{className:"p-6",children:[c.jsx("div",{className:"mb-4 flex h-8 w-8 items-center justify-center rounded-md border border-border bg-secondary/60 transition-colors group-hover:bg-primary/10",children:c.jsx(Md,{className:"h-4 w-4 text-foreground"})}),c.jsx("p",{className:"text-base font-medium",children:Dw[0].title}),c.jsx("p",{className:"mt-2 max-w-md text-sm leading-relaxed text-muted-foreground",children:Dw[0].body}),c.jsx("div",{className:"mt-6 grid grid-cols-3 gap-3 rounded-lg border border-border bg-secondary/30 p-3",children:["New","In Progress","Won"].map(r=>c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("p",{className:"text-[9px] font-mono uppercase tracking-widest text-muted-foreground",children:r}),[0,1].map(s=>c.jsxs("div",{className:"rounded-md border border-border bg-card px-2.5 py-2",children:[c.jsx("div",{className:"h-1.5 w-2/3 rounded bg-foreground
503/20"}),c.jsx("div",{className:"mt-1.5 h-1 w-1/2 rounded bg-foreground/10"})]},s))]},r))})]})]})}),Dw.slice(1).map((r,s)=>c.jsx(Fn,{delay:(s+1)*.08,children:c.jsxs("div",{className:"group h-full rounded-xl border border-border bg-card shadow-sm transition-all hover:border-primary/40 hover:shadow-md",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-3",children:[c.jsxs("span",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:["0",s+2," / Feature"]}),c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary/40"})]}),c.jsxs("div",{className:"p-5",children:[c.jsx("div",{className:"mb-3 flex h-8 w-8 items-center justify-center rounded-md border border-border bg-secondary/60 transition-colors group-hover:bg-primary/10",children:c.jsx(r.icon,{className:"h-4 w-4 text-foreground"})}),c.jsx("p",{className:"text-sm font-medium",children:r.title}),c.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:r.body})]})]})},r.title))]})]})}),c.jsxs("section",{className:"relative overflow-hidden bg-secondary/30 px-6 py-24",children:[c.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-40",style:Iw}),c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse 60% 60% at 50% 50%, transparent 0%, hsl(var(--secondary) / 0.7) 75%)"}}),c.jsxs("div",{className:"relative mx-auto max-w-6xl",children:[c.jsx(Fn,{children:c.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[c.jsx(X9,{className:"mx-auto h-8 w-8 text-primary/40"}),c.jsxs("p",{className:"mt-6 text-xl font-medium leading-relaxed tracking-tight text-foreground sm:text-2xl",children:['"',bf[0].quote,'"']}),c.jsxs("div",{className:"mt-8 flex items-center justify-center gap-3",children:[c.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border border-border bg-card text-xs font-medium",children:bf[0].name.split(" ").map(r=>r[0]).join("")}),c.jsxs("div",{className:"text-left",children:[c.jsx("p",{className:"text-sm font-medium",children:bf[0].name}),c.jsx("p",{className:"text-xs text-muted-foreground",children:bf[0].title})]})]})]})}),c.jsx("div",{className:"mt-16 grid gap-4 sm:grid-cols-3",children:bf.slice(1).map((r,s)=>c.jsx(Fn,{delay:s*.08,children:c.jsxs("div",{className:"h-full rounded-xl border border-border bg-card p-5 shadow-sm",children:[c.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground line-clamp-5",children:['"',r.quote,'"']}),c.jsxs("p",{className:"mt-4 text-xs font-medium text-foreground",children:[r.name,c.jsxs("span",{className:"font-normal text-muted-foreground",children:[" · ",r.title]})]})]})},r.name))})]})]}),c.jsx("section",{id:"how-it-works",className:"relative px-6 py-24",children:c.jsxs("div",{className:"mx-auto max-w-6xl",children:[c.jsxs(Fn,{children:[c.jsx("p",{className:"mb-3 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"— How it works"}),c.jsx("h2",{className:"max-w-2xl text-2xl font-semibold tracking-tight sm:text-3xl",children:"From subscriber to client — in one connected workflow."})]}),c.jsxs("div",{className:"relative mt-12 grid gap-4 md:grid-cols-5",children:[c.jsx("div",{className:"pointer-events-none absolute inset-x-6 top-[26px] hidden h-px bg-gradient-to-r from-transparent via-border to-transparent md:block"}),Mue.map((r,s)=>c.jsx(Fn,{delay:s*.08,children:c.jsxs("div",{className:"relative h-full rounded-xl border border-border bg-card shadow-sm transition-all hover:border-primary/40 hover:shadow-md",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-card px-4 py-2.5",children:[c.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"Step"}),c.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-primary text-[10px] font-medium text-primary-foreground",children:s+1})]}),c.jsxs("div",{className:"p-4",children:[c.jsx("p",{className:"text-sm font-medium",children:r.title}),c.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:r.body})]})]})},s))]}),c.jsx(Fn,{delay:.4,className:"mt-12",children:c.jsx(K,{asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})})})]})}),c.jsx("section",{className:"relative bg-secondary/30 px-6 py-24",children:c.jsxs("div",{className:"mx-auto max-w-5xl",children:[c.jsxs(Fn,{children:[c.jsx("p",{className:"mb-3 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"— The shift"}),c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Before KitBoard vs. After KitBoard"})]}),c.jsx(Fn,{delay:.1,children:c.jsxs("div",{className:"mt-10 grid overflow-hidden rounded-xl border border-border bg-card shadow-sm sm:grid-cols-2",children:[c.jsxs("div",{className:"border-b border-border p-8 sm:border-b-0 sm:border-r",children:[c.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[c.jsx("p",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"Before"}),c.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground
503/70",children:"Friction"})]}),c.jsx("ul",{className:"space-y-3",children:Oue.map((r,s)=>c.jsxs("li",{className:"flex gap-2.5 text-sm text-muted-foreground/80",children:[c.jsx(ji,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground/40"}),c.jsx("span",{children:r})]},s))})]}),c.jsxs("div",{className:"bg-secondary/20 p-8",children:[c.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[c.jsx("p",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-primary",children:"After"}),c.jsx("span",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground/70",children:"Flow"})]}),c.jsx("ul",{className:"space-y-3",children:Due.map((r,s)=>c.jsxs("li",{className:"flex gap-2.5 text-sm text-foreground",children:[c.jsx(xi,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"}),c.jsx("span",{children:r})]},s))})]})]})})]})}),c.jsx("section",{id:"pricing",className:"relative px-6 py-24",children:c.jsxs("div",{className:"mx-auto max-w-5xl",children:[c.jsxs(Fn,{children:[c.jsx("p",{className:"mb-3 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"— Pricing"}),c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Simple pricing. No gotchas."})]}),c.jsx(Fn,{delay:.1,children:c.jsxs("div",{className:"mt-10 overflow-hidden rounded-xl border border-border bg-card shadow-sm",children:[c.jsx("div",{className:"h-1 bg-primary"}),c.jsxs("div",{className:"grid sm:grid-cols-5",children:[c.jsxs("div",{className:"border-b border-border p-8 sm:col-span-2 sm:border-b-0 sm:border-r",children:[c.jsx("p",{className:"text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"Pro Plan"}),c.jsxs("p",{className:"mt-4 text-4xl font-semibold tracking-tight",children:["$25",c.jsx("span",{className:"text-base font-normal text-muted-foreground",children:"/mo · seat"})]}),c.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"14-day free trial · Cancel anytime"}),c.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground/70",children:"Billed annually"}),c.jsx(K,{className:"mt-6 w-full",asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})}),c.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-x-4 gap-y-2 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx(xi,{className:"h-3 w-3 text-primary"})," No card"]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx(xi,{className:"h-3 w-3 text-primary"})," 14-day trial"]})]})]}),c.jsxs("div",{className:"p-8 sm:col-span-3",children:[c.jsx("p",{className:"mb-4 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"Everything included"}),c.jsx("ul",{className:"grid gap-y-2.5 sm:grid-cols-2 sm:gap-x-6",children:Iue.map(r=>c.jsxs("li",{className:"flex gap-2 text-sm",children:[c.jsx(xi,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"}),c.jsx("span",{children:r})]},r))})]})]})]})})]})}),c.jsx("section",{className:"relative bg-secondary/30 px-6 py-24",children:c.jsx("div",{className:"mx-auto max-w-5xl",children:c.jsxs("div",{className:"grid gap-10 md:grid-cols-3",children:[c.jsx(Fn,{children:c.jsxs("div",{className:"md:sticky md:top-24",children:[c.jsx("p",{className:"mb-3 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"— FAQ"}),c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Questions? Answers."}),c.jsxs("p",{className:"mt-3 text-sm text-muted-foreground",children:["Can't find what you need? Read the full"," ",c.jsx($e,{to:"/support",className:"text-foreground underline underline-offset-4 hover:text-primary",children:"documentation"}),"."]})]})}),c.jsx(Fn,{delay:.1,className:"md:col-span-2",children:c.jsx("div",{className:"rounded-xl border border-border bg-card shadow-sm",children:c.jsx(Y$,{type:"single",collapsible:!0,className:"px-6",children:Lue.map((r,s)=>c.jsxs(u_,{value:`faq-${s}`,className:"border-border last:border-b-0",children:[c.jsx(d_,{className:"text-left text-sm",children:r.q}),c.jsx(f_,{className:"text-sm text-muted-foreground",children:r.a})]},s))})})})]})})}),c.jsxs("section",{className:"relative overflow-hidden px-6 py-24",children:[c.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-50",style:Iw}),c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse 60% 60% at 50% 50%, transparent 0%, hsl(var(--background) / 0.85) 70%)"}}),c.jsx("div",{className:"relative mx-auto max-w-3xl",children:c.jsx(Fn,{children:c.jsxs("div",{className:"rounded-2xl border border-border bg-card p-10 text-center shadow-sm sm:p-14",children:[c.jsx("p",{className:"mb-3 text-[10px] font-mono uppercase tracking-[0.2em] text-muted-foreground",children:"— Get started"}),c.jsx("h2",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:"Your audience is already warm. KitBoard helps you close."}),c.jsx("p",{className:"mx-auto mt-4 max-w-xl text-sm leading-relaxed text-muted-foreground sm:text-base",children:"Stop duct-taping enterprise CRMs to your creator business. Connect your Kit account, import your subscribers, and start closing in minutes."}),c.jsxs("div",{className:"mt-8 flex flex-col items-center justify-center gap-3 sm:flex-row",children:[c.jsx(K,{size:"lg",asChild:!0,children:c.jsx($e,{to:"/signup",children:"Get Started for Free"})}),c.jsx(K,{size:"lg",variant:"ghost",asChild:!0,children:c.jsxs($e,{to:"/support",children:["Read the docs ",c.jsx(Ly,{className:"ml-1 h-3.5 w-3.5"})]})})]})]})})})]}),c.jsx("footer",{className:"border-t border-border bg-background",children:c.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-12",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-8 sm:grid-cols-4",children:[c.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[c.jsx($e,{to:"/",className:"text-sm font-semibold tracking-tight",children:"KitBoard"}),c.jsx("p",{className:"mt-3 text-xs text-muted-foreground leading-relaxed",children:"The simple CRM built for Kit.com creators."})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs font-semibold text-foreground mb-3",children:"Product"}),c.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[c.jsx("li",{children:c.jsx("a",{href:"#features",className:"hover:text-foreground transition-colors",children:"Features"})}),c.jsx("li",{children:c.jsx("a",{href:"#how-it-works",className:"hover:text-foreground transition-colors",children:"How It Works"})}),c.jsx("li",{children:c.jsx("a",{href:"#pricing",className:"hover:text-foreground transition-colors",children:"Pricing"})}),c.jsx("li",{children:c.jsx($e,{to:"/signup",className:"hover:text-foreground transition-colors",children:"Try it Free"})})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs font-semibold text-foreground mb-3",children:"Resources"}),c.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[c.jsx("li",{children:c.jsx($e,{to:"/support",className:"hover:text-foreground transition-colors",children:"Documentation"})}),c.jsx("li",{children:c.jsx($e,{to:"/support",className:"hover:text-foreground transition-colors",children:"Support"})}),c.jsx("li",{children:c.jsxs("a",{href:"https://app.kitboard.co",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors inline-flex items-center gap-1",children:["Legacy App ",c.jsx(IS,{className:"h-3 w-3"})]})})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-xs font-semibold text-foreground mb-3",children:"Legal"}),c.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[c.jsx("li",{children:c.jsx($e,{to:"/privacy",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})}),c.jsx("li",{children:c.jsx($e,{to:"/privacy",className:"hover:text-foreground transition-colors",children:"Terms of Service"})})]})]})]}),c.jsxs("div",{className:"mt-10 pt-6 border-t border-border flex flex-col items-center justify-between gap-3 text-xs text-muted-foreground sm:flex-row",children:[c.jsxs("p",{children:["© ",new Date().getFullYear()," KitBoard.co. All rights reserved."]}),c.jsx("p",{children:"Powered by Restack Labs"})]})]})})]})}const Tb=v.forwardRef(({className:t,...e},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:q("w-full caption-bottom text-sm",t),...e})}));Tb.displayName="Table";const Ab=v.forwardRef(({className:t,...e},n)=>c.jsx("thead",{ref:n,className:q("[&_tr]:border-b",t),...e}));Ab.displayName="TableHeader";const jb=v.forwardRef(({className:t,...e},n)=>c.jsx("tbody",{ref:n,className:q("[&_tr:last-child]:border-0",t),...e}));jb.displayName="TableBody";const Bue=v.forwardRef(({className:t,...e},n)=>c.jsx("tfoot",{ref:n,className:q("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));Bue.displayName="TableFooter";const lc=v.forwardRef(({className:t,...e},n)=>c.jsx("tr",{ref:n,className:q("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));lc.displayName="TableRow";const pn=v.forwardRef(({className:t,...e},n)=>c.jsx("th",{ref:n,className:q("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));pn.displayName="TableHead";const mn=v.forwardRef(({className:t,...e},n)=>c.jsx("td",{ref:n,className:q("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));mn.displayName="TableCell";const $ue=v.forwardRef(({className:t,...e},n)=>c.jsx("caption",{ref:n,className:q("mt-4 text-sm text-muted-foreground",t),...e}));$ue.displayName="TableCaption";var im=t=>t.type==="checkbox",El=t=>t instanceof Date,er=t=>t==null;const C5=t=>typeof t=="object";var qt=t=>!er(t)&&!Array.isArray(t)&&C5(t)&&!El(t),Vue=t=>qt(t)&&t.target?im(t.target)?t.target.checked:t.target.value:t,zue=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,Uue=(t,e)=>t.has(zue(e)),Wue=t=>{const e=t.constructor&&t.constructor.prototype;return qt(e)&&e.hasOwnProperty("isPrototypeOf")},C_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fn(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(!(C_&&(t instanceof Blob||r))&&(n||qt(t)))if(e=n?[]:{},!n&&!Wue(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=fn(t[s]));else return t;return e}var Pb=t=>/^\w*$/.test(t),Jt=t=>t===void 0,N_=t=>Array.isArray(t)?t.filter(Boolean):[],E_=t=>N_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),me=(t,e,n)=>{if(!e||!qt(t))return n;const r=(Pb(e)?[e]:E_(e)).reduce((s,i)=>er(s)?s:s[i],t);return Jt(r)||r===t?Jt(t[e])?n:t[e]:r},di=t=>typeof t=="boolean",ht=(t,e,n)=>{let r=-1;const s=Pb(e)?[e]:E_(e),i=s.length,o=i-1;for(;++r<i;){const a=s[r];let l=n;if(r!==o){const u=t[a];l=qt(u)||Array.isArray(u)?u:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;t[a]=l,t=t[a]}};const hM={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Is={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},qi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Hue=z.createContext(null);Hue.displayName="HookFormContext";var que=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const o=i;return e._proxyFormState[o]!==Is.all&&(e._proxyFormState[o]=!r||Is.all),t[o]}});return s};const Kue=typeof window<"u"?z.useLayoutEffect:z.useEffect;var Si=t=>typeof t=="string",Gue=(t,e,n,r,s)=>Si(t)?(r&&e.watch.add(t),me(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),me(n,i))):(r&&(e.watchAll=!0),n),Qk=t=>er(t)||!C5(t);function Yo(t,e,n=new WeakSet){if(Qk(t)||Qk(e))return t===e;if(El(t)&&El(e))return t.getTime()===e.getTime();const r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;if(n.has(t)||n.has(e))return!0;n.add(t),n.add(e);for(const i of r){const o=t[i];if(!s.includes(i))return!1;if(i!=="ref"){const a=e[i];if(El(o)&&El(a)||qt(o)&&qt(a)||Array.isArray(o)&&Array.isArray(a)?!Yo(o,a,n):o!==a)return!1}}return!0}var N5=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},hh=t=>Array.isArray(t)?t:[t],pM=()=>{let t=[];return{get observers(){return t},next:s=>{for(const i of t)i.next&&i.next(s)},subscribe:s=>(t.push(s),{unsubscribe:()=>{t=t.filter(i=>i!==s)}}),unsubscribe:()=>{t=[]}}},yr=t=>qt(t)&&!Object.keys(t).length,__=t=>t.type==="file",Ls=t=>typeof t=="function",yv=t=>
vendor: 6,229 bytes, line 503
503{if(!C_)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},E5=t=>t.type==="select-multiple",T_=t=>t.type==="radio",Yue=t=>T_(t)||im(t),Lw=t=>yv(t)&&t.isConnected;function Que(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Jt(t)?r++:t[e[r++]];return t}function Jue(t){for(const e in t)if(t.hasOwnProperty(e)&&!Jt(t[e]))return!1;return!0}function Gt(t,e){const n=Array.isArray(e)?e:Pb(e)?[e]:E_(e),r=n.length===1?t:Que(t,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(qt(r)&&yr(r)||Array.isArray(r)&&Jue(r))&&Gt(t,n.slice(0,-1)),t}var _5=t=>{for(const e in t)if(Ls(t[e]))return!0;return!1};function vv(t,e={}){const n=Array.isArray(t);if(qt(t)||n)for(const r in t)Array.isArray(t[r])||qt(t[r])&&!_5(t[r])?(e[r]=Array.isArray(t[r])?[]:{},vv(t[r],e[r])):er(t[r])||(e[r]=!0);return e}function T5(t,e,n){const r=Array.isArray(t);if(qt(t)||r)for(const s in t)Array.isArray(t[s])||qt(t[s])&&!_5(t[s])?Jt(e)||Qk(n[s])?n[s]=Array.isArray(t[s])?vv(t[s],[]):{...vv(t[s])}:T5(t[s],er(e)?{}:e[s],n[s]):n[s]=!Yo(t[s],e[s]);return n}var wf=(t,e)=>T5(t,e,vv(e));const mM={value:!1,isValid:!1},gM={value:!0,isValid:!0};var A5=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Jt(t[0].attributes.value)?Jt(t[0].value)||t[0].value===""?gM:{value:t[0].value,isValid:!0}:gM:mM}return mM},j5=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Jt(t)?t:e?t===""?NaN:t&&+t:n&&Si(t)?new Date(t):r?r(t):t;const yM={isValid:!1,value:null};var P5=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,yM):yM;function vM(t){const e=t.ref;return __(e)?e.files:T_(e)?P5(t.refs).value:E5(e)?[...e.selectedOptions].map(({value:n})=>n):im(e)?A5(t.refs).value:j5(Jt(e.value)?t.ref.value:e.value,t)}var Xue=(t,e,n,r)=>{const s={};for(const i of t){const o=me(e,i);o&&ht(s,i,o._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},xv=t=>t instanceof RegExp,Sf=t=>Jt(t)?t:xv(t)?t.source:qt(t)?xv(t.value)?t.value.source:t.value:t,xM=t=>({isOnSubmit:!t||t===Is.onSubmit,isOnBlur:t===Is.onBlur,isOnChange:t===Is.onChange,isOnAll:t===Is.all,isOnTouch:t===Is.onTouched});const bM="AsyncFunction";var Zue=t=>!!t&&!!t.validate&&!!(Ls(t.validate)&&t.validate.constructor.name===bM||qt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===bM)),ede=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),wM=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const ph=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=me(t,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],s)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(ph(a,e))break}else if(qt(a)&&ph(a,e))break}}};function SM(t,e,n){const r=me(t,n);if(r||Pb(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=me(e,i),a=me(t,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:n}}var tde=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return yr(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(o=>e[o]===(!r||Is.all))},nde=(t,e,n)=>!t||!e||t===e||hh(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),rde=(t,e,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(e||t):(n?r.isOnBlur:s.isOnBlur)?!t:(n?r.isOnChange:s.isOnChange)?t:!0,sde=(t,e)=>!N_(me(t,e)).length&&Gt(t,e),ide=(t,e,n)=>{const r=hh(me(t,n));return ht(r,"root",e[n]),ht(t,n,r),t},sy=t=>Si(t);function kM(t,e,n="validate"){if(sy(t)||Array.isArray(t)&&t.every(sy)||di(t)&&!t)return{type:n,message:sy(t)?t:"",ref:e}}var Vc=t=>qt(t)&&!xv(t)?t:{value:t,message:""},CM=async(t,e,n,r,s,i)=>{const{ref:o,refs:a,required:l,maxLength:u,minLength:d,min:f,max:h,pattern:p,validate:m,name:g,valueAsNumber:y,mount:b}=t._f,x=me(n,g);if(!b||e.has(g))return{};const w=a?a[0]:o,S=j=>{s&&w.reportValidity&&(w.setCustomValidity(di(j)?"":j||""),w.reportValidity())},C={},k=T_(o),N=im(o),E=k||N,_=(y||__(o))&&Jt(o.value)&&Jt(x)||yv(o)&&o.value===""||x===""||Array.isArray(x)&&!x.length,T=N5.bind(null,g,r,C),P=(j,F,B,U=qi.maxLength,D=qi.minLength)=>{const L=j?F:B;C[g]={type:j?U:D,message:L,ref:o,...T(j?U:D,L)}};if(i?!Array.isArray(x)||!x.length:l&&(!E&&(_||er(x))||di(x)&&!x||N&&!A5(a).isValid||k&&!P5(a).isValid)){const{value:j,message:F}=sy(l)?{value:!!l,message:l}:Vc(l);if(j&&(C[g]={type:qi.required,message:F,ref:w,...T(qi.required,F)},!r))return S(F),C}if(!_&&(!er(f)||!er(h))){let j,F;const B=Vc(h),U=Vc(f);if(!er(x)&&!isNaN(x)){const D=o.valueAsNumber||x&&+x;er(B.value)||(j=D>B.value),er(U.value)||(F=D<U.value)}else{const D=o.valueAsDate||new Date(x),L=W=>new Date(new Date().toDateString()+" "+W),A=o.type=="time",O=o.type=="week";Si(B.value)&&x&&(j=A?L(x)>L(B.value):O?x>B.value:D>new Date(B.value)),Si(U.value)&&x&&(F=A?L(x)<L(U.value):O?x<U.value:D<new Date(U.value))}if((j||F)&&(P(!!j,B.message,U.message,qi.max,qi.min),!r))return S(C[g].message),C}if((u||d)&&!_&&(Si(x)||i&&Array.isArray(x))){const j=Vc(u),F=Vc(d),B=!er(j.value)&&x.length>+j.value,U=!er(F.value)&&x.length<+F.value;if((B||U)&&(P(B,j.message,F.message),!r))return S(C[g].message),C}if(p&&!_&&Si(x)){const{value:j,message:F}=Vc(p);if(xv(j)&&!x.match(j)&&(C[g]={type:qi.pattern,message:F,ref:o,...T(qi.pattern,F)},!r))return S(F),C}if(m){if(Ls(m)){const j=await m(x,n),F=kM(j,w);if(F&&(C[g]={...F,...T(qi.validate,F.message)},!r))return S(F.message),C}else if(qt(m)){let j={};for(const F in m){if(!yr(j)&&!r)break;const B=kM(await m[F](x,n),w,F);B&&(j={...B,...T(F,B.message)},S(B.message),r&&(C[g]=j))}if(!yr(j)&&(C[g]={ref:w,...j},!r))return C}}return S(!0),C};const ode={mode:Is.onSubmit,reValidateMode:Is.onChange,shouldFocusError:!0};function ade(t={}){let e={...ode,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ls(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1}
vendor: 6,671 bytes, line 503
503,r={},s=qt(e.defaultValues)||qt(e.values)?fn(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:fn(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...d};const h={array:pM(),state:pM()},p=e.criteriaMode===Is.all,m=M=>V=>{clearTimeout(u),u=setTimeout(M,V)},g=async M=>{if(!e.disabled&&(d.isValid||f.isValid||M)){const V=e.resolver?yr((await N()).errors):await _(r,!0);V!==n.isValid&&h.state.next({isValid:V})}},y=(M,V)=>{!e.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((M||Array.from(a.mount)).forEach(H=>{H&&(V?ht(n.validatingFields,H,V):Gt(n.validatingFields,H))}),h.state.next({validatingFields:n.validatingFields,isValidating:!yr(n.validatingFields)}))},b=(M,V=[],H,oe,ie=!0,re=!0)=>{if(oe&&H&&!e.disabled){if(o.action=!0,re&&Array.isArray(me(r,M))){const de=H(me(r,M),oe.argA,oe.argB);ie&&ht(r,M,de)}if(re&&Array.isArray(me(n.errors,M))){const de=H(me(n.errors,M),oe.argA,oe.argB);ie&&ht(n.errors,M,de),sde(n.errors,M)}if((d.touchedFields||f.touchedFields)&&re&&Array.isArray(me(n.touchedFields,M))){const de=H(me(n.touchedFields,M),oe.argA,oe.argB);ie&&ht(n.touchedFields,M,de)}(d.dirtyFields||f.dirtyFields)&&(n.dirtyFields=wf(s,i)),h.state.next({name:M,isDirty:P(M,V),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ht(i,M,V)},x=(M,V)=>{ht(n.errors,M,V),h.state.next({errors:n.errors})},w=M=>{n.errors=M,h.state.next({errors:n.errors,isValid:!1})},S=(M,V,H,oe)=>{const ie=me(r,M);if(ie){const re=me(i,M,Jt(H)?me(s,M):H);Jt(re)||oe&&oe.defaultChecked||V?ht(i,M,V?re:vM(ie._f)):B(M,re),o.mount&&g()}},C=(M,V,H,oe,ie)=>{let re=!1,de=!1;const Ge={name:M};if(!e.disabled){if(!H||oe){(d.isDirty||f.isDirty)&&(de=n.isDirty,n.isDirty=Ge.isDirty=P(),re=de!==Ge.isDirty);const dt=Yo(me(s,M),V);de=!!me(n.dirtyFields,M),dt?Gt(n.dirtyFields,M):ht(n.dirtyFields,M,!0),Ge.dirtyFields=n.dirtyFields,re=re||(d.dirtyFields||f.dirtyFields)&&de!==!dt}if(H){const dt=me(n.touchedFields,M);dt||(ht(n.touchedFields,M,H),Ge.touchedFields=n.touchedFields,re=re||(d.touchedFields||f.touchedFields)&&dt!==H)}re&&ie&&h.state.next(Ge)}return re?Ge:{}},k=(M,V,H,oe)=>{const ie=me(n.errors,M),re=(d.isValid||f.isValid)&&di(V)&&n.isValid!==V;if(e.delayError&&H?(l=m(()=>x(M,H)),l(e.delayError)):(clearTimeout(u),l=null,H?ht(n.errors,M,H):Gt(n.errors,M)),(H?!Yo(ie,H):ie)||!yr(oe)||re){const de={...oe,...re&&di(V)?{isValid:V}:{},errors:n.errors,name:M};n={...n,...de},h.state.next(de)}},N=async M=>{y(M,!0);const V=await e.resolver(i,e.context,Xue(M||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return y(M),V},E=async M=>{const{errors:V}=await N(M);if(M)for(const H of M){const oe=me(V,H);oe?ht(n.errors,H,oe):Gt(n.errors,H)}else n.errors=V;return V},_=async(M,V,H={valid:!0})=>{for(const oe in M){const ie=M[oe];if(ie){const{_f:re,...de}=ie;if(re){const Ge=a.array.has(re.name),dt=ie._f&&Zue(ie._f);dt&&d.validatingFields&&y([oe],!0);const hr=await CM(ie,a.disabled,i,p,e.shouldUseNativeValidation&&!V,Ge);if(dt&&d.validatingFields&&y([oe]),hr[re.name]&&(H.valid=!1,V))break;!V&&(me(hr,re.name)?Ge?ide(n.errors,hr,re.name):ht(n.errors,re.name,hr[re.name]):Gt(n.errors,re.name))}!yr(de)&&await _(de,V,H)}}return H.valid},T=()=>{for(const M of a.unMount){const V=me(r,M);V&&(V._f.refs?V._f.refs.every(H=>!Lw(H)):!Lw(V._f.ref))&&G(M)}a.unMount=new Set},P=(M,V)=>!e.disabled&&(M&&V&&ht(i,M,V),!Yo(W(),s)),j=(M,V,H)=>Gue(M,a,{...o.mount?i:Jt(V)?s:Si(M)?{[M]:V}:V},H,V),F=M=>N_(me(o.mount?i:s,M,e.shouldUnregister?me(s,M,[]):[])),B=(M,V,H={})=>{const oe=me(r,M);let ie=V;if(oe){const re=oe._f;re&&(!re.disabled&&ht(i,M,j5(V,re)),ie=yv(re.ref)&&er(V)?"":V,E5(re.ref)?[...re.ref.options].forEach(de=>de.selected=ie.includes(de.value)):re.refs?im(re.ref)?re.refs.forEach(de=>{(!de.defaultChecked||!de.disabled)&&(Array.isArray(ie)?de.checked=!!ie.find(Ge=>Ge===de.value):de.checked=ie===de.value||!!ie)}):re.refs.forEach(de=>de.checked=de.value===ie):__(re.ref)?re.ref.value="":(re.ref.value=ie,re.ref.type||h.state.next({name:M,values:fn(i)})))}(H.shouldDirty||H.shouldTouch)&&C(M,ie,H.shouldTouch,H.shouldDirty,!0),H.shouldValidate&&O(M)},U=(M,V,H)=>{for(const oe in V){if(!V.hasOwnProperty(oe))return;const ie=V[oe],re=M+"."+oe,de=me(r,re);(a.array.has(M)||qt(ie)||de&&!de._f)&&!El(ie)?U(re,ie,H):B(re,ie,H)}},D=(M,V,H={})=>{const oe=me(r,M),ie=a.array.has(M),re=fn(V);ht(i,M,re),ie?(h.array.next({name:M,values:fn(i)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&H.shouldDirty&&h.state.next({name:M,dirtyFields:wf(s,i),isDirty:P(M,re)})):oe&&!oe._f&&!er(re)?U(M,re,H):B(M,re,H),wM(M,a)&&h.state.next({...n,name:M}),h.state.next({name:o.mount?M:void 0,values:fn(i)})},L=async M=>{o.mount=!0;const V=M.target;let H=V.name,oe=!0;const ie=me(r,H),re=dt=>{oe=Number.isNaN(dt)||El(dt)&&isNaN(dt.getTime())||Yo(dt,me(i,H,dt))},de=xM(e.mode),Ge=xM(e.reValidateMode);if(ie){let dt,hr;const Ui=V.type?vM(ie._f):Vue(M),ti=M.type===hM.BLUR||M.type===hM.FOCUS_OUT,wm=!ede(ie._f)&&!e.resolver&&!me(n.errors,H)&&!ie._f.deps||rde(ti,me(n.touchedFields,H),n.isSubmitted,Ge,de),il=wM(H,a,ti);ht(i,H,Ui),ti?(ie._f.onBlur&&ie._f.onBlur(M),l&&l(0)):ie._f.onChange&&ie._f.onChange(M);const ni=C(H,Ui,ti),Sm=!yr(ni)||il;if(!ti&&h.state.next({name:H,type:M.type,values:fn(i)}),wm)return(d.isValid||f.isValid)&&(e.mode==="onBlur"?ti&&g():ti||g()),Sm&&h.state.next({name:H,...il?{}:ni});if(!ti&&il&&h.state.next({...n}),e.resolver){const{errors:Wi}=await N([H]);if(re(Ui),oe){const x0=SM(n.errors,r,H),km=SM(Wi,r,x0.name||H);dt=km.error,H=km.name,hr=yr(Wi)}}else y([H],!0),dt=(await CM(ie,a.disabled,i,p,e.shouldUseNativeValidation))[H],y([H]),re(Ui),oe&&(dt?hr=!1:(d.isValid||f.isValid)&&(hr=await _(r,!0)));oe&&(ie._f.deps&&O(ie._f.deps),k(H,hr,dt,ni))}},A=(M,V)=>{if(me(n.errors,V)&&M.focus)return M.focus(),1},O=async(M,V={})=>{let H,oe;const ie=hh(M);if(e.resolver){const re=await E(Jt(M)?M:ie);H=yr(re),oe=M?!ie.some(de=>me(re,de)):H}else M?(oe=(await Promise.all(ie.map(async re=>{const de=me(r,re);return await _(de&&de._f?{[re]:de}:de)}))).every(Boolean),!(!oe&&!n.isValid)&&g()):oe=H=await _(r);return h.state.next({...!Si(M)||(d.isValid||f.isValid)&&H!==n.isValid?{}:{name:M},...e.resolver||!M?{isValid:H}:{},errors:n.errors}),V.shouldFocus&&!oe&&ph(r,A,M?ie:a.mount),oe},W=M=>{const V={...o.mount?i:s};return Jt(M)?V:Si(M)?me(V,M):M.map(H=>me(V,H))},Z=(M,V)=>({invalid:!!me((V||n).errors,M),isDirty:!!me((V||n).dirtyFields,M),error:me((V||n).errors,M),isValidating:!!me(n.validatingFields,M),isTouched:!!me((V||n).touchedFields,M)}),$=M=>
vendor: 4,682 bytes, line 503
503{M&&hh(M).forEach(V=>Gt(n.errors,V)),h.state.next({errors:M?n.errors:{}})},Y=(M,V,H)=>{const oe=(me(r,M,{_f:{}})._f||{}).ref,ie=me(n.errors,M)||{},{ref:re,message:de,type:Ge,...dt}=ie;ht(n.errors,M,{...dt,...V,ref:oe}),h.state.next({name:M,errors:n.errors,isValid:!1}),H&&H.shouldFocus&&oe&&oe.focus&&oe.focus()},ee=(M,V)=>Ls(M)?h.state.subscribe({next:H=>"values"in H&&M(j(void 0,V),H)}):j(M,V,!0),ne=M=>h.state.subscribe({next:V=>{nde(M.name,V.name,M.exact)&&tde(V,M.formState||d,Vi,M.reRenderRoot)&&M.callback({values:{...i},...n,...V,defaultValues:s})}}).unsubscribe,be=M=>(o.mount=!0,f={...f,...M.formState},ne({...M,formState:f})),G=(M,V={})=>{for(const H of M?hh(M):a.mount)a.mount.delete(H),a.array.delete(H),V.keepValue||(Gt(r,H),Gt(i,H)),!V.keepError&&Gt(n.errors,H),!V.keepDirty&&Gt(n.dirtyFields,H),!V.keepTouched&&Gt(n.touchedFields,H),!V.keepIsValidating&&Gt(n.validatingFields,H),!e.shouldUnregister&&!V.keepDefaultValue&&Gt(s,H);h.state.next({values:fn(i)}),h.state.next({...n,...V.keepDirty?{isDirty:P()}:{}}),!V.keepIsValid&&g()},Ae=({disabled:M,name:V})=>{(di(M)&&o.mount||M||a.disabled.has(V))&&(M?a.disabled.add(V):a.disabled.delete(V))},Re=(M,V={})=>{let H=me(r,M);const oe=di(V.disabled)||di(e.disabled);return ht(r,M,{...H||{},_f:{...H&&H._f?H._f:{ref:{name:M}},name:M,mount:!0,...V}}),a.mount.add(M),H?Ae({disabled:di(V.disabled)?V.disabled:e.disabled,name:M}):S(M,!0,V.value),{...oe?{disabled:V.disabled||e.disabled}:{},...e.progressive?{required:!!V.required,min:Sf(V.min),max:Sf(V.max),minLength:Sf(V.minLength),maxLength:Sf(V.maxLength),pattern:Sf(V.pattern)}:{},name:M,onChange:L,onBlur:L,ref:ie=>{if(ie){Re(M,V),H=me(r,M);const re=Jt(ie.value)&&ie.querySelectorAll&&ie.querySelectorAll("input,select,textarea")[0]||ie,de=Yue(re),Ge=H._f.refs||[];if(de?Ge.find(dt=>dt===re):re===H._f.ref)return;ht(r,M,{_f:{...H._f,...de?{refs:[...Ge.filter(Lw),re,...Array.isArray(me(s,M))?[{}]:[]],ref:{type:re.type,name:M}}:{ref:re}}}),S(M,!1,void 0,re)}else H=me(r,M,{}),H._f&&(H._f.mount=!1),(e.shouldUnregister||V.shouldUnregister)&&!(Uue(a.array,M)&&o.action)&&a.unMount.add(M)}}},De=()=>e.shouldFocusError&&ph(r,A,a.mount),qe=M=>{di(M)&&(h.state.next({disabled:M}),ph(r,(V,H)=>{const oe=me(r,H);oe&&(V.disabled=oe._f.disabled||M,Array.isArray(oe._f.refs)&&oe._f.refs.forEach(ie=>{ie.disabled=oe._f.disabled||M}))},0,!1))},je=(M,V)=>async H=>{let oe;H&&(H.preventDefault&&H.preventDefault(),H.persist&&H.persist());let ie=fn(i);if(h.state.next({isSubmitting:!0}),e.resolver){const{errors:re,values:de}=await N();n.errors=re,ie=fn(de)}else await _(r);if(a.disabled.size)for(const re of a.disabled)Gt(ie,re);if(Gt(n.errors,"root"),yr(n.errors)){h.state.next({errors:{}});try{await M(ie,H)}catch(re){oe=re}}else V&&await V({...n.errors},H),De(),setTimeout(De);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:yr(n.errors)&&!oe,submitCount:n.submitCount+1,errors:n.errors}),oe)throw oe},Tt=(M,V={})=>{me(r,M)&&(Jt(V.defaultValue)?D(M,fn(me(s,M))):(D(M,V.defaultValue),ht(s,M,fn(V.defaultValue))),V.keepTouched||Gt(n.touchedFields,M),V.keepDirty||(Gt(n.dirtyFields,M),n.isDirty=V.defaultValue?P(M,fn(me(s,M))):P()),V.keepError||(Gt(n.errors,M),d.isValid&&g()),h.state.next({...n}))},qn=(M,V={})=>{const H=M?fn(M):s,oe=fn(H),ie=yr(M),re=ie?s:oe;if(V.keepDefaultValues||(s=H),!V.keepValues){if(V.keepDirtyValues){const de=new Set([...a.mount,...Object.keys(wf(s,i))]);for(const Ge of Array.from(de))me(n.dirtyFields,Ge)?ht(re,Ge,me(i,Ge)):D(Ge,me(re,Ge))}else{if(C_&&Jt(M))for(const de of a.mount){const Ge=me(r,de);if(Ge&&Ge._f){const dt=Array.isArray(Ge._f.refs)?Ge._f.refs[0]:Ge._f.ref;if(yv(dt)){const hr=dt.closest("form");if(hr){hr.reset();break}}}}if(V.keepFieldsRef)for(const de of a.mount)D(de,me(re,de));else r={}}i=e.shouldUnregister?V.keepDefaultValues?fn(s):{}:fn(re),h.array.next({values:{...re}}),h.state.next({values:{...re}})}a={mount:V.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!V.keepIsValid||!!V.keepDirtyValues,o.watch=!!e.shouldUnregister,h.state.next({submitCount:V.keepSubmitCount?n.submitCount:0,isDirty:ie?!1:V.keepDirty?n.isDirty:!!(V.keepDefaultValues&&!Yo(M,s)),isSubmitted:V.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ie?{}:V.keepDirtyValues?V.keepDefaultValues&&i?wf(s,i):n.dirtyFields:V.keepDefaultValues&&M?wf(s,M):V.keepDirty?n.dirtyFields:{},touchedFields:V.keepTouched?n.touchedFields:{},errors:V.keepErrors?n.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Zs=(M,V)=>qn(Ls(M)?M(i):M,V),ei=(M,V={})=>{const H=me(r,M),oe=H&&H._f;if(oe){const ie=oe.refs?oe.refs[0]:oe.ref;
503ie.focus&&(ie.focus(),V.shouldSelect&&Ls(ie.select)&&ie.select())}},Vi=M=>{n={...n,...M}},zi={control:{register:Re,unregister:G,getFieldState:Z,handleSubmit:je,setError:Y,_subscribe:ne,_runSchema:N,_focusError:De,_getWatch:j,_getDirty:P,_setValid:g,_setFieldArray:b,_setDisabledField:Ae,_setErrors:w,_getFieldArray:F,_reset:qn,_resetDefaultValues:()=>Ls(e.defaultValues)&&e.defaultValues().then(M=>{Zs(M,e.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:T,_disableForm:qe,_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(M){o=M},get _defaultValues(){return s},get _names(){return a},set _names(M){a=M},get _formState(){return n},get _options(){return e},set _options(M){e={...e,...M}}},subscribe:be,trigger:O,register:Re,handleSubmit:je,watch:ee,setValue:D,getValues:W,reset:Zs,resetField:Tt,clearErrors:$,unregister:G,setError:Y,setFocus:ei,getFieldState:Z};return{...zi,formControl:zi}}function R5(t={}){const e=z.useRef(void 0),n=z.useRef(void 0),[r,s]=z.useState({isDirty:!1,isValidating:!1,isLoading:Ls(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:Ls(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:r},t.defaultValues&&!Ls(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:o,...a}=ade(t);e.current={...a,formState:r}}const i=e.current.control;return i._options=t,Kue(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,o},[i]),z.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),z.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),z.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),z.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),z.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),z.useEffect(()=>{t.values&&!Yo(t.values,n.current)?(i._reset(t.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=t.values,s(o=>({...o}))):i._resetDefaultValues()},[i,t.values]),z.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),e.current.formState=que(r,i),e.current}const NM=(t,e,n)=>{if(t&&"reportValidity"in t){const r=me(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},M5=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?NM(r.ref,n,t):r.refs&&r.refs.forEach(s=>NM(s,n,t))}},lde=(t,e)=>{e.shouldUseNativeValidation&&M5(t,e);const n={};for(const r in t){const s=me(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(cde(e.names||Object.keys(t),r)){const o=Object.assign({},me(n,r));ht(o,"root",i),ht(n,r,o)}else ht(n,r,i)}return n},cde=(t,e)=>t.some(n=>n.startsWith(e+"."));var ude=function(t,e){for(var n={};t.length;){var r=t[0],s=r.code,i=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[o]={message:a.message,type:a.code}}else n[o]={message:i,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return t.push(f)})}),e){var l=n[o].types,u=l&&l[r.code];n[o]=N5(o,e,n,s,u?[].concat(u,r.message):r.message)}t.shift()}return n},O5=function(t,e,n){return n===void 0&&(n={}),function(r,s,i){try{return Promise.resolve(function(o,a){try{var l=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(u){return i.shouldUseNativeValidation&&M5({},i),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:lde(ude(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},rt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>
vendor: 1,174 bytes, line 503
503typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(rt||(rt={}));var EM;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(EM||(EM={}));const xe=rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vo=t=>{switch(typeof t){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return Number.isNaN(t)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(t)?xe.array:t===null?xe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?xe.promise:typeof Map<"u"&&t instanceof Map?xe.map:typeof Set<"u"&&t instanceof Set?xe.set:typeof Date<"u"&&t instanceof Date?xe.date:xe.object;default:return xe.unknown}},te=rt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
503d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class bo extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return s(this),r}static assert(e){if(!(e instanceof bo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}bo.create=t=>new bo(t);const Jk=(t,e)=>{let n;switch(t.code){case te.invalid_type:t.received===xe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,rt.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${rt.joinValues(t.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${rt.joinValues(t.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${rt.joinValues(t.options)}, received '${t.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:rt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case te.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case te.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case te.custom:n="Invalid input";break;
vendor: 7,542 bytes, line 503
503case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case te.not_finite:n="Number must be finite";break;default:n=e.defaultError,rt.assertNever(t)}return{message:n}};let dde=Jk;function fde(){return dde}const hde=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};function le(t,e){const n=fde(),r=hde({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Jk?void 0:Jk].filter(s=>!!s)});t.common.issues.push(r)}class Hr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Ie;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Hr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return Ie;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const Ie=Object.freeze({status:"aborted"}),zf=t=>({status:"dirty",value:t}),vs=t=>({status:"valid",value:t}),_M=t=>t.status==="aborted",TM=t=>t.status==="dirty",cd=t=>t.status==="valid",bv=t=>typeof Promise<"u"&&t instanceof Promise;var we;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(we||(we={}));class Va{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}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}}const AM=(t,e)=>{if(cd(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new bo(t.common.issues);return this._error=n,this._error}}};function He(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{const{message:l}=t;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:s}}class nt{get description(){return this._def.description}_getType(e){return Vo(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Vo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Hr,ctx:{common:e.parent.common,data:e.data,parsedType:Vo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(bv(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vo(e)},s=this._parseSync({data:e,path:r.path,parent:r});return AM(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vo(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return cd(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>cd(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vo(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(bv(s)?s:Promise.resolve(s));return AM(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),a=()=>i.addIssue({code:te.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new dd({schema:this,typeName:Le.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:n=>this["~validate"](n)}}optional(){return Ea.create(this,this._def)}nullable(){return fd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ti.create(this)}promise(){return Cv.create(this,this._def)}or(e){return Sv.create([this,e],this._def)}and(e){return kv.create(this,e,this._def)}transform(e){return new dd({...He(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new eC({...He(this._def),innerType:this,defaultValue:n,typeName:Le.ZodDefault})}brand(){return new Ide({typeName:Le.ZodBranded,type:this,...He(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new tC({...He(this._def),innerType:this,catchValue:n,typeName:Le.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return A_.create(this,e)}readonly(){return nC.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pde=/^c[^\s-]{8,}
vendor: 4,644 bytes, line 503
503$/i,mde=/^[0-9a-z]+$/,gde=/^[0-9A-HJKMNP-TV-Z]{26}$/i,yde=/^[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,vde=/^[a-z0-9_-]{21}$/i,xde=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,bde=/^[-+]?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)?)??$/,wde=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Sde="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fw;const kde=/^(?:(?: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])$/,Cde=/^(?:(?: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])$/,Nde=/^(([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]))$/,Ede=/^(([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])$/,_de=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Tde=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,D5="((\\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])))",Ade=new RegExp(`^${D5}$`);function I5(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function jde(t){return new RegExp(`^${I5(t)}$`)}function Pde(t){let e=`${D5}T${I5(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Rde(t,e){return!!((e==="v4"||!e)&&kde.test(t)||(e==="v6"||!e)&&Nde.test(t))}function Mde(t,e){if(!xde.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Ode(t,e){return!!((e==="v4"||!e)&&Cde.test(t)||(e==="v6"||!e)&&Ede.test(t))}class fa extends nt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==xe.string){const i=this._getOrReturnCtx(e);return le(i,{code:te.invalid_type,expected:xe.string,received:i.parsedType}),Ie}const r=new Hr;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),le(s,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),le(s,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?le(s,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&le(s,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")wde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"email",code:te.invali
vendor: 18,193 bytes, line 503
503d_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Fw||(Fw=new RegExp(Sde,"u")),Fw.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"emoji",code:te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")yde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"uuid",code:te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")vde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"nanoid",code:te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")pde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"cuid",code:te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")mde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"cuid2",code:te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")gde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"ulid",code:te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),le(s,{validation:"url",code:te.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"regex",code:te.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),le(s,{code:te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),le(s,{code:te.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),le(s,{code:te.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Pde(i).test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{code:te.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Ade.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{code:te.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?jde(i).test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{code:te.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?bde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"duration",code:te.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Rde(e.data,i.version)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"ip",code:te.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Mde(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"jwt",code:te.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Ode(e.data,i.version)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"cidr",code:te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?_de.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"base64",code:te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Tde.test(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{validation:"base64url",code:te.invalid_string,message:i.message}),r.dirty()):rt.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:te.invalid_string,...we.errToObj(r)})}_addCheck(e){return new fa({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...we.errToObj(e)})}url(e){return this._addCheck({kind:"url",...we.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...we.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...we.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...we.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...we.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...we.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...we.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...we.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...we.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...we.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...we.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...we.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...we.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...we.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...we.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...we.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...we.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...we.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...we.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...we.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...we.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...we.errToObj(n)})}nonempty(e){return this.min(1,we.errToObj(e))}trim(){return new fa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}fa.create=t=>new fa({checks:[],typeName:Le.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...He(t)});function Dde(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class pp extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==xe.number){const i=this._getOrReturnCtx(e);return le(i,{code:te.invalid_type,expected:xe.number,received:i.parsedType}),Ie}let r;const s=new Hr;for(const i of this._def.checks)i.kind==="int"?rt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),le(r,{code:te.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),le(r,{code:te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),le(r,{code:te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Dde(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),le(r,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),le(r,{code:te.not_finite,message:i.message}),s.dirty()):rt.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,we.toString(n))}gt(e,n){return this.setLimit("min",e,!1,we.toString(n))}lte(e,n){return this.setLimit("max",e,!0,we.toString(n))}lt(e,n){return this.setLimit("max",e,!1,we.toString(n))}setLimit(e,n,r,s){return new pp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:we.toString(s)}]})}_addCheck(e){return new pp({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:we.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:we.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:we.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:we.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:we.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:we.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:we.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:we.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:we.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&rt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}pp.create=t=>new pp({checks:[],typeName:Le.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...He(t)});class mp extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==xe.bigint)return this._getInvalidInput(e);let r;const s=new Hr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),le(r,{code:te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),le(r,{code:te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),le(r,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):rt.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return le(n,{code:te.invalid_type,expected:xe.bigint,received:n.parsedType}),Ie}gte(e,n){return this.setLimit("min",e,!0,we.toString(n))}gt(e,n){return this.setLimit("min",e,!1,we.toString(n))}lte(e,n){return this.setLimit("max",e,!0,we.toString(n))}lt(e,n){return this.setLimit("max",e,!1,we.toString(n))}setLimit(e,n,r,s){return new mp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:we.toString(s)}]})}_addCheck(e){return new mp({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:we.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:we.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:we.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:we.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:we.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}mp.create=t=>new mp({checks:[],typeName:Le.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...He(t)});class jM extends nt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==xe.boolean){const r=this._getOrReturnCtx(e);return le(r,{code:te.invalid_type,expected:xe.boolean,received:r.parsedType}),Ie}return vs(e.data)}}jM.create=t=>new jM({typeName:Le.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...He(t)});class wv extends nt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==xe.date){const i=this._getOrReturnCtx(e);return le(i,{code:te.invalid_type,expected:xe.date,received:i.parsedType}),Ie}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return le(i,{code:te.invalid_date}),Ie}const r=new Hr;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),le(s,{code:te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),le(s,{code:te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):rt.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new wv({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:we.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:we.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}wv.create=t=>new wv({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Le.ZodDate,...He(t)});class PM extends nt{_parse(e){if(this._getType(e)!==xe.symbol){const r=this._getOrReturnCtx(e);return le(r,{code:te.invalid_type,expected:xe.symbol,received:r.parsedType}),Ie}return vs(e.data)}}PM.create=t=>new PM({typeName:Le.ZodSymbol,...He(t)});class RM extends nt{_parse(e){if(this._getType(e)!==xe.undefined){const r=this._getOrReturnCtx(e);return le(r,{code:te.invalid_type,expected:xe.undefined,received:r.parsedType}),Ie}return vs(e.data)}}RM.create=t=>new RM({typeName:Le.ZodUndefined,...He(t)});class MM extends nt{_parse(e){if(this._getType(e)!==xe.null){const r=this._getOrReturnCtx(e);return le(r,{code:te.invalid_type,expected:xe.null,received:r.parsedType}),Ie}return vs(e.data)}}MM.create=t=>new MM({typeName:Le.ZodNull,...He(t)});class OM extends nt{constructor(){super(...arguments),this._any=!0}_parse(e){return vs(e.data)}}OM.create=t=>new OM({typeName:Le.ZodAny,...He(t)});class DM extends nt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return vs(e.data)}}DM.create=t=>new DM({typeName:Le.ZodUnknown,...He(t)});class za extends nt{_parse(e){const n=this._getOrReturnCtx(e);return le(n,{code:te.invalid_type,expected:xe.never,received:n.parsedType}),Ie}}za.create=t=>new za({typeName:Le.ZodNever,...He(t)});class IM extends nt{_parse(e){if(this._getType(e)!==xe.undefined){const r=this._getOrReturnCtx(e);return le(r,{code:te.invalid_type,expected:xe.void,received:r.parsedType}),Ie}return vs(e.data)}}IM.create=t=>new IM({typeName:Le.ZodVoid,...He(t)});class Ti extends nt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==xe.array)return le(n,{code:te.invalid_type,expected:xe.array,received:n.parsedType}),Ie;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(o||a)&&(le(n,{code:o?te.too_big:te.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(le(n,{code:te.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(le(n,{code:te.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>s.type._parseAsync(new Va(n,o,n.path,a)))).then(o=>Hr.mergeArray(r,o));const i=[...n.data].map((o,a)=>s.type._parseSync(new Va(n,o,n.path,a)));return Hr.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Ti({...this._def,minLength:{value:e,message:we.toString(n)}})}max(e,n){return new Ti({...this._def,maxLength:{value:e,message:we.toString(n)}})}length(e,n){return new Ti({...this._def,exactLength:{value:e,message:we.toString(n)}})}nonempty(e){return this.min(1,e)}}Ti.create=(t,e)=>new Ti({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...He(e)});function Yc(t){if(t instanceof Vt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Ea.create(Yc(r))}return new Vt({...t._def,shape:()=>e})}else return t instanceof Ti?new Ti({...t._def,type:Yc(t.element)}):t instanceof Ea?Ea.create(Yc(t.unwrap())):t instanceof fd?fd.create(Yc(t.unwrap())):t instanceof cc?cc.
vendor: 4,336 bytes, line 503
503create(t.items.map(e=>Yc(e))):t}class Vt extends nt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=rt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==xe.object){const u=this._getOrReturnCtx(e);return le(u,{code:te.invalid_type,expected:xe.object,received:u.parsedType}),Ie}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof za&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const d=i[u],f=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Va(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof za){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(le(s,{code:te.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Va(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Hr.mergeObjectSync(r,u)):Hr.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return we.errToObj,new Vt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:we.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Vt({...this._def,unknownKeys:"strip"})}passthrough(){return new Vt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Vt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Vt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Le.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Vt({...this._def,catchall:e})}pick(e){const n={};for(const r of rt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Vt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of rt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Vt({...this._def,shape:()=>n})}deepPartial(){return Yc(this)}partial(e){const n={};for(const r of rt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new Vt({...this._def,shape:()=>n})}required(e){const n={};for(const r of rt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ea;)i=i._def.innerType;n[r]=i}return new Vt({...this._def,shape:()=>n})}keyof(){return L5(rt.objectKeys(this.shape))}}Vt.create=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strip",catchall:za.create(),typeName:Le.ZodObject,...He(e)});Vt.strictCreate=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strict",catchall:za.create(),typeName:Le.ZodObject,...He(e)});Vt.lazycreate=(t,e)=>new Vt({shape:t,unknownKeys:"strip",catchall:za.create(),typeName:Le.ZodObject,...He(e)});class Sv extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new bo(a.ctx.common.issues));return le(n,{code:te.invalid_union,unionErrors:o}),Ie}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;
vendor: 4,961 bytes, line 503
503const a=o.map(l=>new bo(l));return le(n,{code:te.invalid_union,unionErrors:a}),Ie}}get options(){return this._def.options}}Sv.create=(t,e)=>new Sv({options:t,typeName:Le.ZodUnion,...He(e)});function Xk(t,e){const n=Vo(t),r=Vo(e);if(t===e)return{valid:!0,data:t};if(n===xe.object&&r===xe.object){const s=rt.objectKeys(e),i=rt.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(const a of i){const l=Xk(t[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===xe.array&&r===xe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],a=e[i],l=Xk(o,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===xe.date&&r===xe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class kv extends nt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(_M(i)||_M(o))return Ie;const a=Xk(i.value,o.value);return a.valid?((TM(i)||TM(o))&&n.dirty(),{status:n.value,value:a.data}):(le(r,{code:te.invalid_intersection_types}),Ie)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}kv.create=(t,e,n)=>new kv({left:t,right:e,typeName:Le.ZodIntersection,...He(n)});class cc extends nt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==xe.array)return le(r,{code:te.invalid_type,expected:xe.array,received:r.parsedType}),Ie;if(r.data.length<this._def.items.length)return le(r,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ie;!this._def.rest&&r.data.length>this._def.items.length&&(le(r,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Va(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Hr.mergeArray(n,o)):Hr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new cc({...this._def,rest:e})}}cc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cc({items:t,typeName:Le.ZodTuple,rest:null,...He(e)})};class LM extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==xe.map)return le(r,{code:te.invalid_type,expected:xe.map,received:r.parsedType}),Ie;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:s._parse(new Va(r,a,r.path,[u,"key"])),value:i._parse(new Va(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Ie;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Ie;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}LM.create=(t,e,n)=>new LM({valueType:e,keyType:t,typeName:Le.ZodMap,...He(n)});class gp extends nt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==xe.set)return le(r,{code:te.invalid_type,expected:xe.set,received:r.parsedType}),Ie;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(le(r,{code:te.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(le(r,{code:te.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return Ie;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>i._parse(new Va(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,n){return new gp({...this._def,minSize:{value:e,message:we.toString(n)}})}max(e,n){return new gp({...this._def,maxSize:{value:e,message:we.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}gp.create=(t,e)=>new gp({valueType:t,minSize:null,maxSize:null,typeName:Le.ZodSet,...He(e)});class FM extends nt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}FM.create=(t,e)=>new FM({getter:t,typeName:Le.ZodLazy,...He(e)});class Zk extends nt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);
vendor: 5,468 bytes, line 503
503return le(n,{received:n.data,code:te.invalid_literal,expected:this._def.value}),Ie}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zk.create=(t,e)=>new Zk({value:t,typeName:Le.ZodLiteral,...He(e)});function L5(t,e){return new ud({values:t,typeName:Le.ZodEnum,...He(e)})}class ud extends nt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return le(n,{expected:rt.joinValues(r),received:n.parsedType,code:te.invalid_type}),Ie}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return le(n,{received:n.data,code:te.invalid_enum_value,options:r}),Ie}return vs(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ud.create(e,{...this._def,...n})}exclude(e,n=this._def){return ud.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}ud.create=L5;class BM extends nt{_parse(e){const n=rt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==xe.string&&r.parsedType!==xe.number){const s=rt.objectValues(n);return le(r,{expected:rt.joinValues(s),received:r.parsedType,code:te.invalid_type}),Ie}if(this._cache||(this._cache=new Set(rt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=rt.objectValues(n);return le(r,{received:r.data,code:te.invalid_enum_value,options:s}),Ie}return vs(e.data)}get enum(){return this._def.values}}BM.create=(t,e)=>new BM({values:t,typeName:Le.ZodNativeEnum,...He(e)});class Cv extends nt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==xe.promise&&n.common.async===!1)return le(n,{code:te.invalid_type,expected:xe.promise,received:n.parsedType}),Ie;const r=n.parsedType===xe.promise?n.data:Promise.resolve(n.data);return vs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cv.create=(t,e)=>new Cv({type:t,typeName:Le.ZodPromise,...He(e)});class dd extends nt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{le(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return Ie;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Ie:l.status==="dirty"||n.value==="dirty"?zf(l.value):l});{if(n.value==="aborted")return Ie;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Ie:a.status==="dirty"||n.value==="dirty"?zf(a.value):a}}if(s.type==="refinement"){const o=a=>{const l=s.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ie:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ie:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!cd(o))return Ie;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>cd(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:n.value,value:a})):Ie);rt.assertNever(s)}}dd.create=(t,e,n)=>new dd({schema:t,typeName:Le.ZodEffects,effect:e,...He(n)});dd.createWithPreprocess=(t,e,n)=>new dd({schema:e,effect:{type:"preprocess",transform:t},typeName:Le.ZodEffects,...He(n)});class Ea extends nt{_parse(e){return this._getType(e)===xe.undefined?vs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ea.create=(t,e)=>new Ea({innerType:t,typeName:Le.ZodOptional,...He(e)});class fd extends nt{_parse(e){return this._getType(e)===xe.null?vs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fd.create=(t,e)=>new fd({innerType:t,typeName:Le.ZodNullable,...He(e)});class eC extends nt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eC.create=(t,e)=>new eC({innerType:t,typeName:Le.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...He(e)});class tC extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return bv(s)?s.then(i=>
503({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new bo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new bo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}tC.create=(t,e)=>new tC({innerType:t,typeName:Le.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...He(e)});class $M extends nt{_parse(e){if(this._getType(e)!==xe.nan){const r=this._getOrReturnCtx(e);return le(r,{code:te.invalid_type,expected:xe.nan,received:r.parsedType}),Ie}return{status:"valid",value:e.data}}}$M.create=t=>new $M({typeName:Le.ZodNaN,...He(t)});class Ide extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class A_ extends nt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ie:i.status==="dirty"?(n.dirty(),zf(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ie:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new A_({in:e,out:n,typeName:Le.ZodPipeline})}}class nC extends nt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(cd(s)&&(s.value=Object.freeze(s.value)),s);return bv(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}nC.create=(t,e)=>new nC({innerType:t,typeName:Le.ZodReadonly,...He(e)});Vt.lazycreate;var Le;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Le||(Le={}));const kf=fa.create;za.create;Ti.create;const Lde=Vt.create;Vt.strictCreate;Sv.create;kv.create;cc.create;const Bw=Zk.create;ud.create;Cv.create;Ea.create;fd.create;const F5=Lde({first_name:kf().trim().min(1,"First name is required").max(100),last_name:kf().trim().max(100).optional().or(Bw("")),email:kf().trim().email("Invalid email address").max(255),phone:kf().trim().max(50).optional().or(Bw("")),company:kf().trim().max(100).optional().or(Bw(""))});function rC({onSubmit:t,isLoading:e,defaultValues:n,submitLabel:r="Save"}){const{register:s,handleSubmit:i,formState:{errors:o}}=R5({resolver:O5(F5),defaultValues:{first_name:"",last_name:"",email:"",phone:"",company:"",...n}});return c.jsxs("form",{onSubmit:i(t),className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"first_name",children:"First Name *"}),c.jsx(Je,{id:"first_name",...s("first_name")}),o.first_name&&c.jsx("p",{className:"text-xs text-destructive",children:o.first_name.message})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"last_name",children:"Last Name"}),c.jsx(Je,{id:"last_name",...s("last_name")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"email",children:"Email *"}),c.jsx(Je,{id:"email",type:"email",...s("email")}),o.email&&c.jsx("p",{className:"text-xs text-destructive",children:o.email.message})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"phone",children:"Phone"}),c.jsx(Je,{id:"phone",...s("phone")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"company",children:"Company"}),c.jsx(Je,{id:"company",...s("company")})]}),c.jsx(K,{type:"submit",className:"w-full",disabled:e,children:e?"Saving…":r})]})}function B5(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Rb="Checkbox",[Fde,STe]=dr(Rb),[Bde,j_]=Fde(Rb);function $de(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:s,disabled:i,form:o,name:a,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,p]=gs({prop:n,defaultProp:s??!1,onChange:l,caller:Rb}),[m,g]=v.useState(null),[y,b]=v.useState(null),x=v.useRef(!1),w=m?!!o||!!m.closest("form"):!0,S={checked:h,disabled:i,setChecked:p,control:m,setControl:g,name:a,form:o,value:d,hasConsumerStoppedPropagationRef:x,required:u,defaultChecked:_a(s)?!1:s,isFormControl:w,bubbleInput:y,setBubbleInput:b};return c.jsx(Bde,{scope:e,...S,children:Vde(f)?f(S):r})}var $5="CheckboxTrigger",V5=v.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},s)=>{const{control:i,value:o,disabled:a,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:m}=j_($5,t),g=We(s,d),y=v.useRef(l);return v.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const x=()=>f(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[i,f]),c.jsx(he.button,{type:"button",role:"checkbox","aria-checked":_a(l)?"mixed":l,"aria-required":u,"data-state":q5(l),"data-disabled":a?"":void 0,disabled:a,value:o,...r,ref:g,onKeyDown:fe(e,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:fe(n,b=>{f(x=>_a(x)?!0:!x),m&&p&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})})});V5.displayName=$5;var P_=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:l,onCheckedChange:u,form:d,...f}=t;return c.jsx($de,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:a,required:o,onCheckedChange:u,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:h})=>c.jsxs(c.Fragment,{children:[c.jsx(V5,{...f,ref:e,__scopeCheckbox:n}),h&&c.jsx(H5,{__scopeCheckbox:n})]})})});P_.displayName=Rb;var z5="CheckboxIndicator",U5=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=j_(z5,n);return c.jsx(fr,{present:r||_a(i.checked)||i.checked===!0,children:c.jsx(he.span,{"data-state":q5(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});U5.displayName=z5;var W5="CheckboxBubbleInput",H5=v.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:a,disabled:l,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p}=j_(W5,t),m=We(n,p),g=B5(i),y=VF(r);v.useEffect(()=>{const x=h;if(!x)return;const w=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(w,"checked").set,k=!s.current;if(g!==i&&C){const N=new Event("click",{bubbles:k});x.indeterminate=_a(i),C.call(x,_a(i)?!1:i),x.dispatchEvent(N)}},[h,g,i,s]);const b=v.useRef(_a(i)?!1:i);return c.jsx(he.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:a,disabled:l,name:u,value:d,form:f,...e,tabIndex:-1,ref:m,style:{...e.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});H5.displayName=W5;function Vde(t){return typeof t=="function"}function _a(t){return t==="indeterminate"}function q5(t){return _a(t)?"indeterminate":t?"checked":"unchecked"}const hd=v.forwardRef(({className:t,...e},n)=>c.jsx(P_,{ref:n,className:q("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(U5,{className:q("flex items-center justify-center text-current"),children:c.jsx(xi,{className:"h-4 w-4"})})}));hd.displayName=P_.displayName;var zde=[" ","Enter","ArrowUp","ArrowDown"],Ude=[" ","Enter"],uc="Select",[Mb,Ob,Wde]=zx(uc),[Xd,kTe]=dr(uc,[Wde,Fd]),Db=Fd(),[Hde,Za]=Xd(uc),[qde,Kde]=Xd(uc),K5=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:m}=t,g=Db(e),[y,b]=v.useState(null),[x,w]=v.useState(null),[S,C]=v.useState(!1),k=sm(u),[N,E]=gs({prop:r,defaultProp:s??!1,onChange:i,caller:uc}),[_,T]=gs({prop:o,defaultProp:a,onChange:l,caller:uc}),P=v.useRef(null),j=y?m||!!y.closest("form"):!0,[F,B]=v.useState(new Set),U=Array.from(F).map(D=>D.props.value).join(";");return c.jsx(uE,{...g,children:c.jsxs(Hde,{required:p,scope:e,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:yn(),value:_,onValueChange:T,open:N,onOpenChange:E,dir:k,triggerPointerDownPosRef:P,disabled:h,children:[c.jsx(Mb.Provider,{scope:e,children:c.jsx(qde,{scope:t.__scopeSelect,onNativeOptionAdd:v.useCallback(D=>{B(L=>new Set(L).add(D))},[]),onNativeOptionRemove:v.useCallback(D=>{B(L=>{const A=new Set(L);return A.delete(D),A})},[]),children:n})}),j?c.jsxs(yV,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:_,onCh
vendor: 17,051 bytes, line 503
503ange:D=>T(D.target.value),disabled:h,form:m,children:[_===void 0?c.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};K5.displayName=uc;var G5="SelectTrigger",Y5=v.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=Db(n),o=Za(G5,n),a=o.disabled||r,l=We(e,o.onTriggerChange),u=Ob(n),d=v.useRef("touch"),[f,h,p]=xV(g=>{const y=u().filter(w=>!w.disabled),b=y.find(w=>w.value===o.value),x=bV(y,g,b);x!==void 0&&o.onValueChange(x.value)}),m=g=>{a||(o.onOpenChange(!0),p()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return c.jsx(Qx,{asChild:!0,...i,children:c.jsx(he.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":vV(o.value)?"":void 0,...s,ref:l,onClick:fe(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&m(g)}),onPointerDown:fe(s.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:fe(s.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(y&&g.key===" ")&&zde.includes(g.key)&&(m(),g.preventDefault())})})})});Y5.displayName=G5;var Q5="SelectValue",J5=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=t,l=Za(Q5,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=We(e,l.onValueNodeChange);return Wt(()=>{u(d)},[u,d]),c.jsx(he.span,{...a,ref:f,style:{pointerEvents:"none"},children:vV(l.value)?c.jsx(c.Fragment,{children:o}):i})});J5.displayName=Q5;var Gde="SelectIcon",X5=v.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return c.jsx(he.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});X5.displayName=Gde;var Yde="SelectPortal",Z5=t=>c.jsx(Wp,{asChild:!0,...t});Z5.displayName=Yde;var dc="SelectContent",eV=v.forwardRef((t,e)=>{const n=Za(dc,t.__scopeSelect),[r,s]=v.useState();if(Wt(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ii.createPortal(c.jsx(tV,{scope:t.__scopeSelect,children:c.jsx(Mb.Slot,{scope:t.__scopeSelect,children:c.jsx("div",{children:t.children})})}),i):null}return c.jsx(nV,{...t,ref:e})});eV.displayName=dc;var As=10,[tV,el]=Xd(dc),Qde="SelectContentImpl",Jde=tc("SelectContent.RemoveScroll"),nV=v.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y,...b}=t,x=Za(dc,n),[w,S]=v.useState(null),[C,k]=v.useState(null),N=We(e,G=>S(G)),[E,_]=v.useState(null),[T,P]=v.useState(null),j=Ob(n),[F,B]=v.useState(!1),U=v.useRef(!1);v.useEffect(()=>{if(w)return wE(w)},[w]),bE();const D=v.useCallback(G=>{const[Ae,...Re]=j().map(je=>je.ref.current),[De]=Re.slice(-1),qe=document.activeElement;for(const je of G)if(je===qe||(je==null||je.scrollIntoView({block:"nearest"}),je===Ae&&C&&(C.scrollTop=0),je===De&&C&&(C.scrollTop=C.scrollHeight),je==null||je.focus(),document.activeElement!==qe))return},[j,C]),L=v.useCallback(()=>D([E,w]),[D,E,w]);v.useEffect(()=>{F&&L()},[F,L]);const{onOpenChange:A,triggerPointerDownPosRef:O}=x;v.useEffect(()=>{if(w){let G={x:0,y:0};const Ae=De=>{var qe,je;G={x:Math.abs(Math.round(De.pageX)-(((qe=O.current)==null?void 0:qe.x)??0)),y:Math.abs(Math.round(De.pageY)-(((je=O.current)==null?void 0:je.y)??0))}},Re=De=>{G.x<=10&&G.y<=10?De.preventDefault():w.contains(De.target)||A(!1),document.removeEventListener("pointermove",Ae),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",Ae),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ae),document.removeEventListener("pointerup",Re,{capture:!0})}}},[w,A,O]),v.useEffect(()=>{const G=()=>A(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[A]);const[W,Z]=xV(G=>{const Ae=j().filter(qe=>!qe.disabled),Re=Ae.find(qe=>qe.ref.current===document.activeElement),De=bV(Ae,G,Re);De&&setTimeout(()=>De.ref.current.focus())}),$=v.useCallback((G,Ae,Re)=>{const De=!U.current&&!Re;(x.value!==void 0&&x.value===Ae||De)&&(_(G),De&&(U.current=!0))},[x.value]),Y=v.useCallback(()=>w==null?void 0:w.focus(),[w]),ee=v.useCallback((G,Ae,Re)=>{const De=!U.current&&!Re;(x.value!==void 0&&x.value===Ae||De)&&P(G)},[x.value]),ne=r==="popper"?sC:rV,be=ne===sC?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y}:{};return c.jsx(tV,{scope:n,content:w,viewport:C,onViewportChange:k,itemRefCallback:$,selectedItem:E,onItemLeave:Y,itemTextRefCallback:ee,focusSelectedItem:L,selectedItemText:T,position:r,isPositioned:F,searchRef:W,children:c.jsx(ib,{as:Jde,allowPinchZoom:!0,children:c.jsx(rb,{asChild:!0,trapped:x.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:fe(s,G=>{var Ae;(Ae=x.trigger)==null||Ae.focus({preventScroll:!0}),G.preventDefault()}),children:c.jsx(Rd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:c.jsx(ne,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:G=>G.preventDefault(),...b,...be,onPlaced:()=>B(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:fe(b.onKeyDown,G=>{const Ae=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!Ae&&G.key.length===1&&Z(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let De=j().filter(qe=>!qe.disabled).map(qe=>qe.ref.current);if(["ArrowUp","End"].includes(G.key)&&(De=De.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const qe=G.target,je=De.indexOf(qe);De=De.slice(je+1)}setTimeout(()=>D(De)),G.preventDefault()}})})})})})})});nV.displayName=Qde;var Xde="SelectItemAlignedPosition",rV=v.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Za(dc,n),o=el(dc,n),[a,l]=v.useState(null),[u,d]=v.useState(null),f=We(e,N=>d(N)),h=Ob(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,w=v.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&g&&y&&b){const N=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),_=i.valueNode.getBoundingClientRect(),T=b.getBoundingClientRect();if(i.dir!=="rtl"){const qe=T.left-E.left,je=_.left-qe,Tt=N.left-je,qn=N.width+Tt,Zs=Math.max(qn,E.width),ei=window.innerWidth-As,Vi=Yk(je,[As,Math.max(As,ei-Zs)]);a.style.minWidth=qn+"px",a.style.left=Vi+"px"}else{const qe=E.right-T.right,je=window.innerWidth-_.right-qe,Tt=window.innerWidth-N.right-je,qn=N.width+Tt,Zs=Math.max(qn,E.width),ei=window.innerWidth-As,Vi=Yk(je,[As,Math.max(As,ei-Zs)]);a.style.minWidth=qn+"px",a.style.right=Vi+"px"}const P=h(),j=window.innerHeight-As*2,F=g.scrollHeight,B=window.getComputedStyle(u),U=parseInt(B.borderTopWidth,10),D=parseInt(B.paddingTop,10),L=parseInt(B.borderBottomWidth,10),A=parseInt(B.paddingBottom,10),O=U+D+F+A+L,W=Math.min(y.offsetHeight*5,O),Z=window.getComputedStyle(g),$=parseInt(Z.paddingTop,10),Y=parseInt(Z.paddingBottom,10),ee=N.top+N.height/2-As,ne=j-ee,be=y.offsetHeight/2,G=y.offsetTop+be,Ae=U+D+G,Re=O-Ae;if(Ae<=ee){const qe=P.length>0&&y===P[P.length-1].ref.current;a.style.bottom="0px";const je=u.clientHeight-g.offsetTop-g.offsetHeight,Tt=Math.max(ne,be+(qe?Y:0)+je+L),qn=Ae+Tt;a.style.height=qn+"px"}else{const qe=P.length>0&&y===P[0].ref.current;a.style.top="0px";const Tt=Math.max(ee,U+g.offsetTop+(qe?$:0)+be)+Re;a.style.height=Tt+"px",g.scrollTop=Ae-ee+g.offsetTop}a.style.margin=`${As}px 0`,a.style.minHeight=W+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,u,g,y,b,i.dir,r]);Wt(()=>w(),[w]);const[S,C]=v.useState();Wt(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const k=v.useCallback(N=>{N&&m.current===!0&&(w(),x==null||x(),m.current=!1)},[w,x]);return c.jsx(efe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(he.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});rV.displayName=Xde;var Zde="SelectPopperPosition",sC=v.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=As,...i}=t,o=Db(n);return c.jsx(dE,{...o,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sC.displayName=Zde;var[efe,R_]=Xd(dc,{}),iC="SelectViewport",sV=v.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=el(iC,n),o=R_(iC,n),a=We(e,i.onViewportChange),l=v.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(Mb.Slot,{scope:n,children:c.jsx(he.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:fe(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const p=Math.abs(l.current-d.scrollTop);if(p>0){const m=window.innerHeight-As*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),b=Math.max(g,y);if(b<m){const x=b+p,w=Math.min(m,x),S=x-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});sV.displayName=iC;var iV="SelectGroup",[tfe,nfe]=Xd(iV),rfe=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=yn();return c.jsx(tfe,{scope:n,id:s,children:c.jsx(he.div,{role:"group","aria-labelledby":s,...r,ref:e})})});rfe.displayName=iV;var oV="SelectLabel",aV=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=nfe(oV,n);return c.jsx(he.div,{id:s.id,...r,ref:e})});aV.displayName=oV;var Nv="SelectItem",[sfe,lV]=Xd(Nv),cV=v.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=t,a=Za(Nv,n),l=el(Nv,n),u=a.value===r,[d,f]=v.useState(i??""),[h,p]=v.useState(!1),m=We(e,x=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,x,r,s)}),g=yn(),y=v.useRef("touch"),b=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(sfe,{scope:n,value:r,disabled:s,textId:g,isSelected:u,onItemTextChange:v.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:c.jsx(Mb.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:c.jsx(he.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:m,onFocus:fe(o.onFocus,()=>p(!0)),onBlur:fe(o.onBlur,()=>p(!1)),onClick:fe(o.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:fe(o.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:fe(o.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:fe(o.onPointerMove,x=>{var w;y.current=x.pointerType,s?(w=l.onItemLeave)==null||w.call(l):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:fe(o.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(Ude.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});cV.displayName=Nv;var Uf="SelectItemText",uV=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,o=Za(Uf,n),a=el(Uf,n),l=lV(Uf,n),u=Kde(Uf,n),[d,f]=v.useState(null),h=We(e,b=>f(b),l.onItemTextChange,b=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,b,l.value,l.disabled)}),p=d==null?void 0:d.textContent,m=v.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return Wt(()=>(g(m),()=>y(m)),[g,y,m]),c.jsxs(c.Fragment,{children:[c.jsx(he.span,{id:l.textId,...i,ref:h}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ii.createPortal(i.children,o.valueNode):null]})});uV.displayName=Uf;var dV="SelectItemIndicator",fV=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return lV(dV,n).isSelected?c.jsx(he.span,{"aria-hidden":!0,...r,ref:e}):null});fV.displayName=dV;var oC="SelectScrollUpButton",hV=v.forwardRef((t,e)=>{const n=el(oC,t.__scopeSelect),r=R_(oC,t.__scopeSelect),[s,i]=v.useState(!1),o=We(e,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?c.jsx(mV,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});hV.displayName=oC;var aC="SelectScrollDownButton",pV=v.forwardRef((t,e)=>{const n=el(aC,t.__scopeSelect),r=R_(aC,t.__scopeSelect),[s,i]=v.useState(!1),o=We(e,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;i(d)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?c.jsx(mV,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});pV.displayName=aC;var mV=v.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=el("SelectScrollButton",n),o=v.useRef(null),a=Ob(n),l=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>l(),[l]),Wt(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),c.jsx(he.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:fe(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:fe(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:fe(s.onPointerLeave,()=>{l()})})}),ife="SelectSeparator",gV=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return c.jsx(he.div,{"aria-hidden":!0,...r,ref:e})});gV.displayName=ife;var lC="SelectArrow",ofe=v.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=Db(n),i=Za(lC,n),o=el(lC,n);return i.open&&o.position==="popper"?c.jsx(fE,{...s,...r,ref:e}):null});ofe.displayName=lC;var afe="SelectBubbleInput",yV=v.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const s=v.useRef(null),i=We(r,s),o=B5(e);return v.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&d){const f=new Event("change",{bubbles:!0});d.call(a,e),a.dispatchEvent(f)}},[o,e]),c.jsx(he.select,{...n,style:{...zL,...n.style},ref:i,defaultValue:e})});yV.displayName=afe;function vV(t){return t===""||t===void 0}function xV(t){const e=en(t),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(o=>{const a=n.current+o;e(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function bV(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=lfe(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function lfe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var cfe=K5,wV=Y5,ufe=J5,dfe=X5,ffe=Z5,SV=eV,hfe=sV,kV=aV,CV=cV,pfe=uV,mfe=fV,NV=hV,EV=pV,_V=gV;const Zd=cfe,om=ufe,Cc=v.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(wV,{ref:r,className:q("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
503ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,c.jsx(dfe,{asChild:!0,children:c.jsx(Hx,{className:"h-4 w-4 opacity-50"})})]}));Cc.displayName=wV.displayName;const TV=v.forwardRef(({className:t,...e},n)=>c.jsx(NV,{ref:n,className:q("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(O9,{className:"h-4 w-4"})}));TV.displayName=NV.displayName;const AV=v.forwardRef(({className:t,...e},n)=>c.jsx(EV,{ref:n,className:q("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(Hx,{className:"h-4 w-4"})}));AV.displayName=EV.displayName;const Nc=v.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>c.jsx(ffe,{children:c.jsxs(SV,{ref:s,className:q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[c.jsx(TV,{}),c.jsx(hfe,{className:q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),c.jsx(AV,{})]})}));Nc.displayName=SV.displayName;const gfe=v.forwardRef(({className:t,...e},n)=>c.jsx(kV,{ref:n,className:q("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));gfe.displayName=kV.displayName;const zn=v.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(CV,{ref:r,className:q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(mfe,{children:c.jsx(xi,{className:"h-4 w-4"})})}),c.jsx(pfe,{children:e})]}));zn.displayName=CV.displayName;const yfe=v.forwardRef(({className:t,...e},n)=>c.jsx(_V,{ref:n,className:q("-mx-1 my-1 h-px bg-muted",t),...e}));yfe.displayName=_V.displayName;const vfe=Sc("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ai({className:t,variant:e,...n}){return c.jsx("div",{className:q(vfe({variant:e}),t),...n})}function jV({onImported:t,boardId:e,statusId:n}){var U,D,L;const{teamId:r}=ot(),{toast:s}=ut(),i=xt(),[o,a]=v.useState("all"),[l,u]=v.useState(new Set),[d,f]=v.useState(null),[h,p]=v.useState([]),[m,g]=v.useState(!0),[y,b]=v.useState(!1),[x,w]=v.useState(null),{data:S,isLoading:C}=ue({queryKey:["kit-connection",r],queryFn:async()=>{const{data:A,error:O}=await I.from("kit_connections").select("id").eq("team_id",r).maybeSingle();if(O)throw O;return A},enabled:!!r}),{data:k}=ue({queryKey:["kit-tags"],queryFn:async()=>{const{data:A,error:O}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:"/v4/tags"}});if(O)throw O;return(A==null?void 0:A.tags)||[]},enabled:!!S}),{isLoading:N,isError:E,error:_}=ue({queryKey:["kit-subscribers",o],queryFn:async()=>{var Y,ee;const A=o==="all"?"/v4/subscribers":`/v4/tags/${o}/subscribers`,O={per_page:"50"},{data:W,error:Z}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:A,params:O}});if(Z)throw Z;if(W!=null&&W.error)throw new Error(W.error);const $=(W==null?void 0:W.subscribers)||[];return p($),f(((Y=W==null?void 0:W.pagination)==null?void 0:Y.end_cursor)||null),g(((ee=W==null?void 0:W.pagination)==null?void 0:ee.has_next_page)||!1),u(new Set),w(null),$},enabled:!!S,retry:!1}),T=v.useCallback(async()=>{var A,O;if(!(!d||y)){b(!0);try{const W=o==="all"?"/v4/subscribers":`/v4/tags/${o}/subscribers`,{data:Z,error:$}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:W,params:{per_page:"50",after:d}}});if($)throw $;const Y=(Z==null?void 0:Z.subscribers)||[];p(ee=>[...ee,...Y]),f(((A=Z==null?void 0:Z.pagination)==null?void 0:A.end_cursor)||null),g(((O=Z==null?void 0:Z.pagination)==null?void 0:O.has_next_page)||!1)}catch{s({title:"Failed to load more subscribers",variant:"destructive"})}finally{b(!1)}}},[d,y,o,s]),P=A=>{u(O=>{const W=new Set(O);return W.has(A)?W.delete(A):W.add(A),W})},j=()=>{l.size===h.length?u(new Set):u(new Set(h.map(A=>A.id)))},F=Ee({mutationFn:async()=>{const A=h.filter(Z=>l.has(Z.id)),{data:O,error:W}=await I.functions.invoke("kit-import",{body:{subscribers:A,board_
503id:e,status_id:n}});if(W)throw W;if(O!=null&&O.error)throw new Error(O.error);return O},onSuccess:A=>{w(A),u(new Set),i.invalidateQueries({queryKey:["contacts"]}),s({title:"Import complete",description:`${A.created} created, ${A.updated} updated`}),t==null||t()},onError:A=>{s({title:"Import failed",description:A.message,variant:"destructive"})}}),B=Ee({mutationFn:async()=>{const{data:A,error:O}=await I.functions.invoke("kit-oauth-start",{body:{return_url:window.location.origin}});if(O)throw O;if(A!=null&&A.error)throw new Error(A.error);return A.url},onSuccess:A=>{window.location.href=A},onError:A=>{s({title:"Failed to start Kit connection",description:A.message,variant:"destructive"})}});return C?c.jsxs("div",{className:"space-y-3 py-4",children:[c.jsx(vt,{className:"h-8 w-full"}),c.jsx(vt,{className:"h-8 w-full"})]}):!S||E?((U=_==null?void 0:_.message)!=null&&U.toLowerCase().includes("reconnect")||(D=_==null?void 0:_.message)!=null&&D.toLowerCase().includes("token")||((L=_==null?void 0:_.message)==null||L.toLowerCase().includes("unauthorized")),c.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center space-y-4",children:[c.jsx("div",{className:"h-12 w-12 rounded-lg flex items-center justify-center text-white font-bold",style:{backgroundColor:"#FB6970"},children:"Kit"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-foreground",children:E?"Your Kit.com connection needs to be re-established":"Connect your Kit.com account to import subscribers"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:E?"The connection may have expired or been revoked.":"Or go to Settings → Integrations to manage connections"})]}),c.jsxs(K,{onClick:()=>B.mutate(),disabled:B.isPending,size:"sm",children:[B.isPending?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-1"}):c.jsx(Kh,{className:"h-4 w-4 mr-1"}),E?"Reconnect Kit.com":"Connect Kit.com"]})]})):x?c.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center space-y-3",children:[c.jsx(By,{className:"h-10 w-10 text-green-500"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Import Complete"}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[x.created," new contacts created",c.jsx("br",{}),x.updated," existing contacts updated"]})]}),c.jsx(K,{variant:"outline",size:"sm",onClick:()=>w(null),children:"Import More"})]}):c.jsxs("div",{className:"space-y-4 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Zd,{value:o,onValueChange:a,children:[c.jsx(Cc,{className:"w-full h-8 text-sm",children:c.jsx(om,{placeholder:"Filter by tag"})}),c.jsxs(Nc,{children:[c.jsx(zn,{value:"all",children:"All subscribers"}),k==null?void 0:k.map(A=>c.jsx(zn,{value:String(A.id),children:A.name},A.id))]})]}),l.size>0&&c.jsxs(K,{size:"sm",onClick:()=>F.mutate(),disabled:F.isPending,children:[F.isPending?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-1"}):c.jsx(pF,{className:"h-4 w-4 mr-1"}),"Import ",l.size," selected"]})]}),N?c.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((A,O)=>c.jsx(vt,{className:"h-10 w-full"},O))}):h.length===0?c.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No subscribers found."}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3 px-1 text-xs text-muted-foreground border-b border-border pb-2",children:[c.jsx(hd,{checked:l.size===h.length&&h.length>0,onCheckedChange:j}),c.jsx("span",{className:"flex-1",children:"Name / Email"}),c.jsx("span",{className:"w-16 text-center",children:"Status"})]}),c.jsx("div",{className:"space-y-0.5",children:h.map(A=>c.jsxs("label",{className:"flex items-center gap-3 px-1 py-2 rounded hover:bg-muted/50 cursor-pointer",children:[c.jsx(hd,{checked:l.has(A.id),onCheckedChange:()=>P(A.id)}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:A.first_name||A.email_address.split("@")[0]}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.email_address})]}),c.jsx(Ai,{variant:A.state==="active"?"default":"secondary",className:"text-xs capitalize",children:A.state})]},A.id))}),m&&c.jsxs(K,{variant:"ghost",size:"sm",onClick:T,disabled:y,className:"w-full",children:[y?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-1"}
503):null,"Load more"]})]})]})}const Ib="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wgARCADIAMgDASIAAhEBAxEB/8QAHAABAAMBAQEBAQAAAAAAAAAAAAUHCAYEAwEC/8QAGwEBAAMAAwEAAAAAAAAAAAAAAAQFBgIDBwH/2gAMAwEAAhADEAAAAehHpnloAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8s6w+b0+ov6zZpOzqyua5j9+i/3Lume3r+kHUPNVtnp37Z0tWdA7Vl1AsNR/tP3Bd0ITIYAAAGc4eYh/OPTJG0ar+0yFFvRMw53Paaoa/NHmc8RN6cZXWXEaM5Ptbqjzb4rtrWg0Pk6Lk5Ph2W90vI9ds8QEqIAABnOHmIfzj0w9lp98eoOgiPNHk6Lmc66I2uHz5AT8Bjdr6r/AKA0Bd0WdRndLYlwUbb+xxUm4zs7WpDu6AAAM5w8xD+cemSOk82aT0uYqur7upGrtV+UHcHPrr6An4CttPVpHN2mtBncv/O16por78EWZJ6RznozV5ENDmwAAOd+PUI0rm+kO3q8cH1Djy5eWknz7z/n6hx+810p2daJlnLjxP17FGleb0kuIH3iAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//EACcQAAEDBAEEAgIDAAAAAAAAAAQCAwUAAQY1EBIWMDQRFCBwExUx/9oACAEBAAEFAv2Z1WrqtXVb8nHUMo7gj+pl9shH+V1WrqtXza/jmNrUbsalssSOoiYNKve91UL609JrkDqi5JyMKy1H8sPxhfu+KY2tRuxyyWuMzyL60qIoKQoUZZZBAiCQzBHASKjZR6Kd7xOqAkXZMHwTG1oFdmjZQz757DCyXO35Cu35CmE3QxLPRJV/6uE6ox2Gj7uupYbkDIaTbMjhWrChPnL7fkKxgR4KO8Extfwj5wuOVFyrUqPU9uKF9qb1PGF+74pja0G3Z4szDWFoIHWK9URIqjDUqspM9uKF9qa1PGLHtAnrkxEJXlItyfBMbWo3Y1mglrX4xon7MPPbihfaJZ+wOtF2l8xmy8ExtajdjWXp6ojjC1/IU9uKF9qslx9by72+L8RDS3ZLwPY9HkO9sxtN47HsuUUI0az2zG12zG0FHDxyX4AAl7tmNpGNxyFcFxQh1KxABVNYpHt3YGaFR+zP/8QAMBEAAQMCAggFAwUAAAAAAAAAAgABAwQRBRITFCAhMTIzcRAiQVBRkaHhFWFjgfD/2gAIAQMBAT8B92DBswsWk+35VbR6m7NmvdQYVNM2YvKyraHU2F817qDBxIGKUt6nw7QzhHm3F6r9E/k+35VXT6tK8d77UPTHspqfTVIGXAWRSxhuImZYxIEjBke/FU9fmjbSA9+yxGpOaQcou1uCpqzStaUXZ+zqaOkI7y2v+6qmBpiaPhsw9MeynrIqYmGT1RAEw2JrssQo9Vk8vK6p+iHZlinXh/3x4YrGb1N2ZSQyRW0jWvsw9MeyxvnBYUbnTNf0WLhmp7/Dqn6IdmWNPY43ZU1SFTGxj4Y11A2WqZ23Mb/V0chyc5XQTSxtYCdv7RTym2Ujd27pqmdmsxv9Ucpyc5XQmQPcXstdqbWzund33v7v/8QALxEAAQQBAQYDBwUAAAAAAAAAAgABAxEEBRITFCEzcSAxMhBBUFGRoeEVImOB8P/aAAgBAgEBPwH4sesbJOOx9/wsPL4tneqpT6pDE+yPN1h5vFuTbNUp9XcTcYh5KHUN7CUlcxX6z/H9/wALFn4mLeVXil6hd1FkbnHMR83QxSHzEbWkRmDntNSyMGpH3ZtXdafjBDGVkz35rIxGje4yZ27sojyhGorpYzk8Iufn4ZeoXdQ4kuQLlH7kJHCVi9OsDL4qP93qZT9U+7rTOjN/vn7NMkBsendRzRy3sPdeGXqF3Wjeg1qgMOS9e9aSezkV82U/VPu60drGRnWTjnjHsl7NH6ZeHhoH5uDfRBGEfoakcMcj2Ys6GCIHsRZv6T40L83BvogjCP0NSIRNqJrXB493sMmZm5N8X//EADkQAAIBAQQFCQYFBQAAAAAAAAECAwAEEBESITFyc7ETIjAyNEFRkdEUIEJxosEjYXCh8DVSU4GS/9oACAEBAAY/Av1M11rFa/eLyMEUd7HCsPakrPE6yL4qcbtYrWOkte9bjdZd6vG4xWQCRhrkOqvxLTJ8gcBWk41FsipNP4SHKi/e5ZUPN+NfEVmGpXDfzzvn3f36O171uN1l3q8aFliOEkg5x8F9yLYFTRMPixH5i5IYxiznCns
5037dVly08MowZf3uZ4cpLDDnCurD/yfWjLKFDZyvN6G171uN1ndjgqyKSf91NN3M2j5d1BIxmY91dlauytUYOsKKMNrkXlE81r+oth/PyrCzzKZG0Zm1mmkc5UUYk1lmnQkamGsUzWe3xygfCwINFYIzIwGJwrsr0UmQxvyhOB6G171uPujJIXj/wAb6RXKR6GHWQ6xdatu6HbFWvdm+fd/fo7XvW43QRt1WcKfOj7PI0b+D6RTRSrlddBFySjqanHiKBGkGrVt3Q7Yq17s3tyzZEdcuY9xrE2qHDbFRQwhpi7hc2oDobXvW43WXerxugtIGk8xvt974cdaczyq1bd0O2KliPxqVpkYYMpwI9yyb1ePQ2vetxusu9Xjdj4ODfOvhJj+1Wrbuh2xcbXZlzMevGOIrA677NkUthIpOHz6FpHs+LscScx9a7N9betK62fBlOIOdvW4xTLnQ92Ndm+tvWuzfW3rTLZ4+TDa9JNNLJBmdtJOY12b629aDCz6RpHPb1vxmgVj/dqPnWjlV+TVpR5NpqyxRrGvgow/U3//xAApEAABAgQFBAIDAQAAAAAAAAABABEQIVHwMUFhcYEgMNHxkaFwscHh/9oACAEBAAE/IfyYQGYDle+QLk+egkDEtDGQ80DlEeKbFvlkPEnLAiRiLL3y98hhCDt27ZVCw0wl2+wPat4oyJAP+eEkcchVJVnohcTf5BhLkYGMzgZOcs53dpMRX2jt2yqFhpUxaQsaHPRbaImoMRahkYMKEDyq4V0oU/x3AZEaQEM9c4M71ggEmMhYMAPPZtlUNGFiAA6I7uRxy+iye6cB+170eV70eUIdgBGrIDORnDg24RmAGmT/ACgfnIx0naSBTcHkEJZ4ONsshgaJBB0EmP0mhijIF7weUU+NCMOzbKultAYk+GnCpYmMfGvRVxqrTSN9o7dsqg7xJyhAIsZdI7/QjfD3ECHGZry+URMBOCMxGrjVA9nKLHDGwHAQ6Z2Ws0zedhPFnnj2bZVCw0wbFOGrnEISTvH+n00auNUDBBzkMn6UGZEdFjp7NsqhYaYBJbiP7E2T/YDxGrjWGK6GMNmCIYBASIMQGXZV2AByey4OptuTtBo3OZ8MRhA/jwJeGG0dNHAAcJw8lPK3Jbngw0Y9nBMyIpsu+lNGH2PnCfW8/wDGWlPl+TX/2gAMAwEAAgADAAAAEPfffffffffffffffffffffffffffffffffffffffffffffffffffffZmP8AC1Y5/wB9999Wn85yp1Ee9999W32UV78289999W89/V+X8U9999O8sePf/d8999999999999999999999999999999999999999999999999999999//EACYRAQABAQcDBQEAAAAAAAAAAAERACExQVFhgbFxkaEQIMHR8FD/2gAIAQMBAT8Q/rDZiQd1I3sS3Rdu0dQTO/t9xWeCwiIjVzpyAiYIs7zNIja4IXaJOp1qNDAkC2IvOr7vDcUJCWO82fe1OyjVDmjsYNxHLKrImBc0dSDGoVHEEVstDYinHEuYHoxZvSAeuJ5qBy2xF0ae3w3FJemaLN6i4bc6n3UFqDTM24r8DIrzPn0LUohEDbZQqXAm/tf39vhuK8J5oSxE+fmizYPez5r8DIpL4E8lMjbiYj+uz9GITg8+0YDD8X0+LIzV5qEUyEHhp/kgpOy0KDDV902LQulXmpllmMPilJO80ipK/wBf/8QAJhEBAAEBBgcBAQEAAAAAAAAAAREAITFRYYGxIEGRocHR8BBQcf/aAAgBAgEBPxD+slsYU0U57wL58FI5Cwu6+prDgc5mZyKCAhiWbekRRH2aUm/MdGp0Iy+TZM3aHF3zemVQoaRb61omUMhdqVnkF4mONWkMm8CZMvKpBnkMgW2d2ad6th/pNulHdHGNqmts2zfOfD3zeiEHBNulS0Bo/ZVIZBzwdd6+xi12Xj8GQiLMudIg+ZHu7h75vXcG1InIHx4pMCh0t8V9jForsMbNKSs5OJ9f+FFzNuFQprk9UOgywA2qWUxQdyptzEA9ik1NcnqpcOWAG1RjDBJoCDpFAgQf1//EACgQAQABAgUDBAMBAQAAAAAAAAERACEQMUFRYXGRoTCBsfAgcPFAwf/aAAgBAQABPxD9mJhYzEV/EUoA65APwFkBusYX6NHdUmKnxpxIvYh5pWeQSRtI58UZIDdYr+Ir+IqZtucp9NziYYWCWxTjmb0+oTPzMUzRTI8P4Utd81L5pT9q2o8/22oqHBM7IaYScIg5uxN4lHRpSvZjKQL3GPjfWrhh4rD8SEhssToO/wCH0m2jgKwWUS6j3E0wb6awmJzXASrsNTN6QlsgORB6lKHhJ9wtUXHCEOLa0WQLyYXDfTBZhLK3u9O4VRIhRwrbA0kWMnpYOw95qOLlFjGygx9euIp7ACUt3V9y6BeGTimXGZxQ+ulPBMTTyBIALFgDenkqykiVaCmDCnuw4ZOKhi8U4mwk69lWwcLLgTdNUw5CuBMKsxsuo9vWuALkSiG0r9cOZqaKsale+6vGqNEQry3wYfcbfwc8b6tcPtGqhnEOlloCyFMZssHUl6UvgujOiOokI6iYL2IapNkbmTkKBap6RCRPavLfBh9xtpzhLJ2TiovtKLyGgwk6MVY2cjLPQJPtTNmKAGpCUTMBDGfq3DAZEgGg70Q9jbGBH2rooPfXy3wYfcbaTIGZ0H/6ppGaEVCPRP8ADluGFISncMYhytmToK+W+DD7jbgp80LfDK1UzF3MlWkgogQiZiYm8FFlqBkASr6JGr+O0rABLsVx6RV77gQqFDCGeBN1EkqkZQ581x6XHpHbHNACBlk9qPNpp5EwIZaFcekL+dAgMjDBua4t0shCT3Rd6fwDoEO40faFwidr1bowCLuwXeX9m//Z";function Ua({className:t="",size:e="default"}){const n=e==="sm"?"h-4 w-4":"h-5 w-5";return c.jsx("img",{src:Ib,alt:"Kit",className:`${n} rounded ${t}`})}var $w="rovingFocusGroup.onEntryFocus",xfe={bubbles:!1,cancelable:!0},am="RovingFocusGroup",[cC,PV,bfe]=zx(am),[wfe,RV]=dr(am,[bfe]),[Sfe,kfe]=wfe(am),MV=v.forwardRef((t,e)=>c.jsx(cC.Provider,{scope:t.__scopeRovingFocusGroup,children:c.jsx(cC.Slot,{scope:t.__scopeRovingFocusGroup,children:c.jsx(Cfe,{...t,ref:e})})}));MV.displayName=am;var Cfe=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,h=v.useRef(null),p=We(e,h),m=sm(i),[g,y]=gs({prop:o,defaultProp:a??null,onChange:l,caller:am}),[b,x]=v.useState(!1),w=en(u),S=PV(n),C=v.useRef(!1),[k,N]=v.useState(0);return v.useEffect(()=>{const E=h.current;if(E)return E.addEventListener($w,w),()=>E.removeEventListener($w,w)},[w]),c.jsx(Sfe,{scope:n,orientation:r,dir:m,loop:s,currentTabStopId:g,onItemFocus:v.useCallback(E=>y(E),[y]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>N(E=>E+1),[]),onFocusableItemRemove:v.useCallback(()=>N(E=>E-1),[]),children:c.jsx(he.div,{tabIndex:b||k===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...t.style},onMouseDown:fe(t.onMouseDown,()=>{C.current=!0}),onFocus:fe(t.onFocus,E=>{const _=!C.current;if(E.target===E.currentTarget&&_&&!b){const T=new CustomEvent($w,xfe);
vendor: 4,215 bytes, line 503
503if(E.currentTarget.dispatchEvent(T),!T.defaultPrevented){const P=S().filter(D=>D.focusable),j=P.find(D=>D.active),F=P.find(D=>D.id===g),U=[j,F,...P].filter(Boolean).map(D=>D.ref.current);IV(U,d)}}C.current=!1}),onBlur:fe(t.onBlur,()=>x(!1))})})}),OV="RovingFocusGroupItem",DV=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...a}=t,l=yn(),u=i||l,d=kfe(OV,n),f=d.currentTabStopId===u,h=PV(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:g}=d;return v.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),c.jsx(cC.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:c.jsx(he.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:e,onMouseDown:fe(t.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:fe(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:fe(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=_fe(y,d.orientation,d.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const S=w.indexOf(y.currentTarget);w=d.loop?Tfe(w,S+1):w.slice(S+1)}setTimeout(()=>IV(w))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:g!=null}):o})})});DV.displayName=OV;var Nfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Efe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function _fe(t,e,n){const r=Efe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Nfe[r]}function IV(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Tfe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Afe=MV,jfe=DV,Lb="Tabs",[Pfe,CTe]=dr(Lb,[RV]),LV=RV(),[Rfe,M_]=Pfe(Lb),FV=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:l="automatic",...u}=t,d=sm(a),[f,h]=gs({prop:r,onChange:s,defaultProp:i??"",caller:Lb});return c.jsx(Rfe,{scope:n,baseId:yn(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:l,children:c.jsx(he.div,{dir:d,"data-orientation":o,...u,ref:e})})});FV.displayName=Lb;var BV="TabsList",$V=v.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=M_(BV,n),o=LV(n);return c.jsx(Afe,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:c.jsx(he.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});$V.displayName=BV;var VV="TabsTrigger",zV=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,o=M_(VV,n),a=LV(n),l=HV(o.baseId,r),u=qV(o.baseId,r),d=r===o.value;return c.jsx(jfe,{asChild:!0,...a,focusable:!s,active:d,children:c.jsx(he.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...i,ref:e,onMouseDown:fe(t.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:fe(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:fe(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!s&&f&&o.onValueChange(r)})})})});zV.displayName=VV;var UV="TabsContent",WV=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=t,a=M_(UV,n),l=HV(a.baseId,r),u=qV(a.baseId,r),d=r===a.value,f=v.useRef(d);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),c.jsx(fr,{present:s||d,children:({present:h})=>c.jsx(he.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:h&&i})})});WV.displayName=UV;function HV(t,e){return`${t}-trigger-${e}`}function qV(t,e){return`${t}-content-${e}`}var Mfe=FV,KV=$V,GV=zV,YV=WV;const Fb=Mfe,lm=v.forwardRef(({className:t,...e},n)=>
503c.jsx(KV,{ref:n,className:q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));lm.displayName=KV.displayName;const tr=v.forwardRef(({className:t,...e},n)=>c.jsx(GV,{ref:n,className:q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...e}));tr.displayName=GV.displayName;const nr=v.forwardRef(({className:t,...e},n)=>c.jsx(YV,{ref:n,className:q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));nr.displayName=YV.displayName;async function Wa(t,e,n,r){await I.from("contact_activity_log").insert({contact_id:t,user_id:e,action:n,metadata:r??{}})}const Ofe={initial:{opacity:0}
503,animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}},Vw=50;function Dfe(){var C;const{teamId:t}=ot(),{toast:e}=ut(),n=xt(),r=Dn(),[s,i]=v.useState(""),[o,a]=v.useState(!1),l=v.useRef(null),u=v.useRef(null),{data:d}=ue({queryKey:["kit-connection",t],queryFn:async()=>{const{data:k,error:N}=await I.from("kit_connections").select("id").eq("team_id",t).maybeSingle();if(N)throw N;return k},enabled:!!t}),f=!!d,{data:h,fetchNextPage:p,hasNextPage:m,isFetchingNextPage:g,isLoading:y}=kB({queryKey:["contacts",t,s],queryFn:async({pageParam:k=0})=>{const N=k*Vw,E=N+Vw-1;let _=I.from("contacts").select("*",{count:"exact"}).order("created_at",{ascending:!1});s&&(_=_.or(`first_name.ilike.%${s}%,last_name.ilike.%${s}%,email.ilike.%${s}%`));const{data:T,error:P,count:j}=await _.range(N,E);if(P)throw P;return{data:T??[],total:j??0,page:k}},initialPageParam:0,getNextPageParam:k=>(k.page+1)*Vw<k.total?k.page+1:void 0,enabled:!!t}),b=(h==null?void 0:h.pages.flatMap(k=>k.data))??[],x=((C=h==null?void 0:h.pages[0])==null?void 0:C.total)??0;v.useEffect(()=>{const k=l.current,N=u.current;if(!k||!N)return;const E=new IntersectionObserver(_=>{_[0].isIntersecting&&m&&!g&&p()},{root:N,rootMargin:"200px"});return E.observe(k),()=>E.disconnect()},[m,g,p]);const{user:w}=ot(),S=Ee({mutationFn:async k=>{const{data:N,error:E}=await I.from("contacts").insert({team_id:t,first_name:k.first_name,last_name:k.last_name||null,email:k.email,phone:k.phone||null,company:k.company||null}).select("id").single();if(E)throw E;return N},onSuccess:k=>{k&&w&&Wa(k.id,w.id,"contact_created"),n.invalidateQueries({queryKey:["contacts"]}),a(!1),e({title:"Contact created"})},onError:k=>{const N=k.message.includes("duplicate key")?"A contact with this email already exists.":k.message;e({title:"Error",description:N,variant:"destructive"})}});return c.jsxs(c.Fragment,{children:[c.jsxs(Ei,{children:[c.jsx("h1",{className:"text-sm font-semibold text-foreground",children:"Contacts"}),c.jsx("div",{className:"flex-1 flex justify-center",children:c.jsxs("div",{className:"relative w-full max-w-xs",children:[c.jsx(Gh,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Je,{placeholder:"Search contacts…",value:s,onChange:k=>i(k.target.value),className:"pl-9 h-8"})]})}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[x>0&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:[x," contacts"]}),c.jsxs(K,{variant:"outline",onClick:()=>a(!0),size:"sm",children:[c.jsx(nn,{className:"h-4 w-4 mr-1"}),"Add Contact"]})]})]}),c.jsxs(Ye.div,{...Ofe,className:"h-full flex flex-col overflow-hidden",children:[y?c.jsx("div",{className:"p-6 space-y-2",children:Array.from({length:5}).map((k,N)=>c.jsx(vt,{className:"h-12 w-full"},N))}):b.length>0?c.jsx("div",{ref:u,className:"flex-1 overflow-y-auto min-h-0",children:c.jsxs("div",{className:"p-6 pt-4",children:[c.jsx("div",{className:"border border-border rounded-md",children:c.jsxs(Tb,{children:[c.jsx(Ab,{children:c.jsxs(lc,{children:[c.jsx(pn,{children:"Name"}),c.jsx(pn,{children:"Email"}),c.jsx(pn,{className:"hidden md:table-cell",children:"Phone"}),c.jsx(pn,{className:"hidden md:table-cell",children:"Company"}),c.jsx(pn,{className:"hidden md:table-cell",children:"Added"})]})}),c.jsx(jb,{children:b.map(k=>c.jsxs(lc,{className:"cursor-pointer hover:bg-secondary",onClick:()=>r(`/contacts/${k.id}`),children:[c.jsx(mn,{className:"font-medium",children:c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[k.first_name," ",k.last_name??"",k.kit_subscriber_id&&c.jsx(Ua,{size:"sm"})]})}),c.jsx(mn,{className:"text-muted-foreground",children:k.email}),c.jsx(mn,{className:"hidden md:table-cell text-muted-foreground",children:k.phone??"—"}),c.jsx(mn,{className:"hidden md:table-cell text-muted-foreground",children:k.company??"—"}),c.jsx(mn,{className:"hidden md:table-cell text-muted-foreground",children:k.created_at&&!isNaN(new Date(k.created_at).getTime())?Ze(new Date(k.created_at),"MMM d, yyyy"):"—"})]},k.id))})]})}),c.jsx("div",{ref:l,className:"h-1"}),g&&c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(gt,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})}):c.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[c.jsx(yo,{className:"h-10 w-10 text-muted-foreground mb-3"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:s?"No contacts match your search.":"No contacts yet."}),!s&&c.jsx(K,{onClick:()=>a(!0),size:"sm",children:"Add your first contact"})]}),c.jsx(Qp,{open:o,onOpenChange:a,children:c.jsxs(Hd,{children:[c.jsx(Jp,{children:c.jsx(Xp,{children:"Add Contact"})}),f?c.jsxs(Fb,{defaultValue:"manual",className:"mt-4",children:[c.jsxs(lm,{className:"w-full",children:[c.jsx(tr,{value:"manual",className:"flex-1",children:"Manual"}),c.jsxs(tr,{value:"kit",className:"flex-1 gap-1.5",children:["Import from ",c.jsx(Ua,{})]})]}),c.jsx(nr,{value:"manual",children:c.jsx(rC,{onSubmit:k=>S.mutate(k),isLoading:S.isPending})}),c.jsx(nr,{value:"kit",children:c.jsx(jV,{onImported:()=>a(!1)})})]}):c.jsx("div",{className:"mt-6",children:c.jsx(rC,{onSubmit:k=>S.mutate(k),isLoading:S.isPending})})]})})]})]})}var QV={exports:{}},JV={};/**
504 * @license React
505 * use-sync-external-store-shim.production.js
506 *
507 * Copyright (c) Meta Platforms, Inc. and affiliates.
508 *
509 * This source code is licensed under the MIT license found in the
510 * LICENSE file in the root directory of this source tree.
511 */var pd=v;function Ife(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Lfe=typeof Object.is=="function"?Object.is:Ife,Ffe=pd.useState,Bfe=pd.useEffect,$fe=pd.useLayoutEffect,Vfe=pd.useDebugValue;function zfe(t,e){var n=e(),r=Ffe({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return $fe(function(){s.value=n,s.getSnapshot=e,zw(s)&&i({inst:s})},[t,n,e]),Bfe(function(){return zw(s)&&i({inst:s}),t(function(){zw(s)&&i({inst:s})})},[t]),Vfe(n),n}function zw(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Lfe(t,n)}catch{return!0}}function Ufe(t,e){return e()}var Wfe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ufe:zfe;
511JV.useSyncExternalStore=pd.useSyncExternalStore!==void 0?pd.useSyncExternalStore:Wfe;QV.exports=JV;var Bb=QV.exports;function Hfe(){return Bb.useSyncExternalStore(qfe,()=>!0,()=>!1)}function qfe(){return()=>{}}var O_="Avatar",[Kfe,NTe]=dr(O_),[Gfe,XV]=Kfe(O_),ZV=v.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=v.useState("idle");return c.jsx(Gfe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:c.jsx(he.span,{...r,ref:e})})});ZV.displayName=O_;var ez="AvatarImage",tz=v.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,o=XV(ez,n),a=Yfe(r,i),l=en(u=>{s(u),o.onImageLoadingStatusChange(u)});return Wt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?c.jsx(he.img,{...i,ref:e,src:r}):null});tz.displayName=ez;var nz="AvatarFallback",rz=v.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=XV(nz,n),[o,a]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&i.imageLoadingStatus!=="loaded"?c.jsx(he.span,{...s,ref:e}):null});rz.displayName=nz;function VM(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Yfe(t,{referrerPolicy:e,crossOrigin:n}){const r=Hfe(),s=v.useRef(null),i=r?(s.current||(s.current=new window.Image),s.current):null,[o,a]=v.useState(()=>VM(i,t));return Wt(()=>{a(VM(i,t))},[i,t]),Wt(()=>{const l=f=>()=>{a(f)};if(!i)return;const u=l("loaded"),d=l("error");return i.addEventListener("load",u),i.addEventListener("error",d),e&&(i.referrerPolicy=e),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,n,e]),o}var sz=ZV,iz=tz,oz=rz;const D_=v.forwardRef(({className:t,...e},n)=>c.jsx(sz,{ref:n,className:q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));D_.displayName=sz.displayName;const az=v.forwardRef(({className:t,...e},n)=>c.jsx(iz,{ref:n,className:q("aspect-square h-full w-full",t),...e}));az.displayName=iz.displayName;const I_=v.forwardRef(({className:t,...e},n)=>c.jsx(oz,{ref:n,className:q("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));I_.displayName=oz.displayName;var lz="AlertDialog",[Qfe,ETe]=dr(lz,[qB]),Co=qB(),cz=t=>{const{__scopeAlertDialog:e,...n}=t,r=Co(e);return c.jsx(ab,{...r,...n,modal:!0})};cz.displayName=lz;var Jfe="AlertDialogTrigger",uz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Co(n);return c.jsx(l3,{...s,...r,ref:e})});uz.displayName=Jfe;var Xfe="AlertDialogPortal",dz=t=>{const{__scopeAlertDialog:e,...n}=t,r=Co(e);return c.jsx(lb,{...r,...n})};dz.displayName=Xfe;var Zfe="AlertDialogOverlay",fz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Co(n);return c.jsx(Ud,{...s,...r,ref:e})});fz.displayName=Zfe;var Au="AlertDialogContent",[ehe,the]=Qfe(Au),nhe=LL("AlertDialogContent"),hz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Co(n),o=v.useRef(null),a=We(e,o),l=v.useRef(null);return c.jsx(UX,{contentName:Au,titleName:pz,docsSlug:"alert-dialog",children:c.jsx(ehe,{scope:n,cancelRef:l,children:c.jsxs(Wd,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:fe(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(nhe,{children:r}),c.jsx(she,{contentRef:o})]})})})});hz.displayName=Au;var pz="AlertDialogTitle",mz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Co(n);return c.jsx(Gp,{...s,...r,ref:e})});mz.displayName=pz;var gz="AlertDialogDescription",yz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Co(n);return c.jsx(Yp,{...s,...r,ref:e})});yz.displayName=gz;var rhe="AlertDialogAction",vz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Co(n);return c.jsx(cb,{...s,...r,ref:e})});vz.displayName=rhe;var xz="AlertDialogCancel",bz=v.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=the(xz,n),i=Co(n),o=We(e,s);return c.jsx(cb,{...i,...r,ref:o})});bz.displayName=xz;var she=({contentRef:t})=>{const e=`\`${Au}\` requires a description for the component to be accessible for screen reader users.
512
513You can add a description to the \`${Au}\` by passing a \`${gz}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
514
515Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Au}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
516
517For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},ihe=cz,ohe=uz,ahe=dz,wz=fz,Sz=hz,kz=vz,Cz=bz,Nz=mz,Ez=yz;const L_=ihe,F_=ohe,lhe=ahe,_z=v.forwardRef(({className:t,...e},n)=>c.jsx(wz,{className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));_z.displayName=wz.displayName;const $b=v.forwardRef(({className:t,...e},n)=>c.jsxs(lhe,{children:[c.jsx(_z,{}),c.jsx(Sz,{ref:n,className:q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));$b.displayName=Sz.displayName;const Vb=({className:t,...e})=>c.jsx("div",{className:q("flex flex-col space-y-2 text-center sm:text-left",t),...e});Vb.displayName="AlertDialogHeader";const zb=({className:t,...e})=>c.jsx("div",{className:q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});zb.displayName="AlertDialogFooter";const Ub=v.forwardRef(({className:t,...e},n)=>c.jsx(Nz,{ref:n,className:q("text-lg font-semibold",t),...e}));Ub.displayName=Nz.displayName;const Wb=v.forwardRef(({className:t,...e},n)=>c.jsx(Ez,{ref:n,className:q("text-sm text-muted-foreground",t),...e}));Wb.displayName=Ez.displayName;const Hb=v.forwardRef(({className:t,...e},n)=>c.jsx(kz,{ref:n,className:q(tp(),t),...e}));Hb.displayName=kz.displayName;const qb=v.forwardRef(({className:t,...e},n)=>c.jsx(Cz,{ref:n,className:q(tp({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));qb.displayName=Cz.displayName;function che({content:t,onClick:e}){const n=(()=>{const r=document.createElement("div");return r.innerHTML=t,r.textContent||r.innerText||""})();return c.jsx("div",{className:"mt-1 cursor-pointer",onClick:e,children:c.jsx("p",{className:"text-sm text-foreground line-clamp-3",children:n||c.jsx("span",{className:"italic text-muted-foreground/50",children:"Empty note"})})})}function uhe(t,e){switch(t){case"contact_created":return"Contact was created";case"field_updated":return`${dhe(e.field)} changed from "${e.old||"—"}" to "${e.new||"—"}"`;case"custom_field_updated":return`${e.field_name} changed from "${e.old||"—"}" to "${e.new||"—"}"`;case"note_created":return`Note added: "${e.note_preview}"`;case"task_created":return`Task added: "${e.title}"`;case"reminder_created":return`Task added: "${e.title}"`;case"status_changed":return e.old_status?`Status on ${e.board_name} changed from "${e.old_status}" to "${e.new_status}"`:`Added to board "${e.board_name}" with status "${e.new_status}"`;default:return t}}function dhe(t){return t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function fhe(t){switch(t){case"contact_created":return c.jsx(ZN,{className:"h-3 w-3 text-green-500"});case"field_updated":case"custom_field_updated":return c.jsx(z9,{className:"h-3 w-3 text-blue-500"});case"status_changed":return c.jsx(JN,{className:"h-3 w-3 text-purple-500"});case"note_created":return c.jsx(nc,{className:"h-3 w-3 text-primary"});case"task_created":case"reminder_created":return c.jsx(Od,{className:"h-3 w-3 text-amber-500"});default:return c.jsx(DS,{className:"h-3 w-3 text-muted-foreground"})}}function hhe({contactId:t,userId:e,teamId:n,onOpenNote:r}){const{toast:s}=ut(),i=xt(),{data:o=[]}=ue({queryKey:["notes",t],queryFn:async()=>{const{data:b,error:x}=await I.from("notes").select("*").eq("contact_id",t).order("created_at",{ascending:!1});if(x)throw x;return b}}),{data:a=[]}=ue({queryKey:["tasks",t],queryFn:async()=>{const{data:b,error:x}=await I.from("tasks").select("*").eq("contact_id",t).order("created_at",{ascending:!1});if(x)throw x;return b??[]}}),{data:l=[]}=ue({queryKey:["activity_log",t],queryFn:async()=>{const{data:b,error:x}=await I.from("contact_activity_log").select("*").eq("contact_id",t).order("created_at",{ascending:!1});if(x)throw x;return b??[]}}),u=v.useMemo(()=>{const b=new Set;return o.forEach(x=>b.add(x.author_id)),a.forEach(x=>b.add(x.created_by)),l.forEach(x=>
517{x.user_id&&b.add(x.user_id)}),Array.from(b)},[o,a,l]),{data:d={}}=ue({queryKey:["user_names",u],queryFn:async()=>{if(u.length===0)return{};const{data:b,error:x}=await I.rpc("get_user_emails",{_user_ids:u});if(x)throw x;const w={};return(b??[]).forEach(S=>{w[S.user_id]=S.email}),w},enabled:u.length>0}),f=v.useMemo(()=>l.filter(b=>b.action!=="note_created"&&b.action!=="reminder_created"&&b.action!=="task_created"),[l]),h=v.useMemo(()=>[...o.map(x=>({type:"note",id:x.id,created_at:x.created_at,content:x.content,author_id:x.author_id})),...a.map(x=>({type:"task",id:x.id,created_at:x.created_at,title:x.title,due_at:x.due_at,status:x.status,created_by:x.created_by})),...f.map(x=>({type:"activity",id:x.id,created_at:x.created_at,action:x.action,metadata:x.metadata??{},user_id:x.user_id}))].sort((x,w)=>new Date(w.created_at).getTime()-new Date(x.created_at).getTime()),[o,a,f]),p=()=>{i.invalidateQueries({queryKey:["notes",t]}),i.invalidateQueries({queryKey:["tasks",t]}),i.invalidateQueries({queryKey:["activity_log",t]})},m=Ee({mutationFn:async b=>{const{error:x}=await I.from("notes").delete().eq("id",b);if(x)throw x},onSuccess:()=>{p(),s({title:"Note deleted"})}}),g=Ee({mutationFn:async({id:b,done:x})=>{const{error:w}=await I.from("tasks").update({status:x?"done":"todo"}).eq("id",b);if(w)throw w},onSuccess:()=>p()}),y=Ee({mutationFn:async b=>{const{error:x}=await I.from("tasks").delete().eq("id",b);if(x)throw x},onSuccess:()=>{p(),s({title:"Task deleted"})}});return c.jsx("div",{className:"space-y-4",children:h.length===0?c.jsxs("div",{className:"border border-border rounded-md p-8 flex flex-col items-center justify-center text-muted-foreground",children:[c.jsx(nc,{className:"h-8 w-8 mb-2 opacity-40"}),c.jsx("p",{className:"text-sm",children:"No activity yet. Add a note or task to get started."})]}):c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute left-[11px] top-3 bottom-3 w-px bg-border"}),c.jsx("div",{className:"space-y-0",children:h.map(b=>c.jsxs("div",{className:"relative flex gap-3 group py-3",children:[c.jsx("div",{className:"relative z-10 flex-shrink-0 w-[23px] h-[23px] rounded-full border border-border bg-muted/50 flex items-center justify-center",children:b.type==="note"?c.jsx(nc,{className:"h-3 w-3 text-primary"}):b.type==="task"?c.jsx(Od,{className:"h-3 w-3 text-amber-500"}):fhe(b.action)}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx("span",{className:"font-medium text-foreground",children:b.type==="note"?"Note":b.type==="task"?"Task":"Activity"}),(()=>{const x=b.type==="activity"?b.user_id:b.type==="note"?b.author_id:b.created_by,w=x?d[x]:null;return w?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"by"}),c.jsx("span",{className:"font-medium text-foreground",children:w})]}):null})(),c.jsx("span",{children:"·"}),c.jsx("span",{children:Ze(new Date(b.created_at),"MMM d, yyyy 'at' h:mm a")})]}),b.type!=="activity"&&c.jsx(K,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",onClick:()=>b.type==="note"?m.mutate(b.id):y.mutate(b.id),children:c.jsx(qs,{className:"h-3 w-3"})})]}),b.type==="note"?c.jsx(che,{content:b.content,onClick:()=>r==null?void 0:r(b.id)}):b.type==="task"?c.jsxs("div",{className:"mt-1 flex items-start gap-2",children:[c.jsx(hd,{checked:b.status==="done",onCheckedChange:x=>g.mutate({id:b.id,done:!!x}),className:"mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:q("text-sm",b.status==="done"&&"line-through text-muted-foreground"),children:b.title}),b.due_at&&c.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Due ",Ze(new Date(b.due_at),"MMM d, yyyy")]})]})]}):c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:uhe(b.action,b.metadata)})]})]},b.id))})]})})}var Kb="Popover",[Tz,_Te]=dr(Kb,[Fd]),cm=Fd(),[phe,tl]=Tz(Kb),Az=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,a=cm(e),l=v.useRef(null),[u,d]=v.useState(!1),[f,h]=gs({prop:r,defaultProp:s??!1,onChange:i,caller:Kb});return c.jsx(uE,{...a,children:c.jsx(phe,{scope:e,contentId:yn(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:v.useCallback(()=>d(!0),[]),onCustomAnchorRemove:v.useCallback(()=>d(!1),[]),modal:o,children:n})})};Az.displayName=Kb;var jz="PopoverAnchor",mhe=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=tl(jz,n),i=cm(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=s;return v.useEffect(()=>(o(),()=>a()),[o,a]),c.jsx(Qx,{...i,...r,ref:e})});mhe.displayName=jz;var Pz="PopoverTrigger",Rz=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=tl(Pz,n),i=cm(n),o=We(e,s.triggerRef),a=c.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Lz(s.open),...r,ref:o,onClick:fe(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:c.jsx(Qx,{asChild:!0,...i,children:a})});Rz.displayName=Pz;var B_="PopoverPortal",[ghe,yhe]=Tz(B_,{forceMount:void 0}),Mz=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=tl(B_,e);return c.jsx(ghe,{scope:e,forceMount:n,children:c.jsx(fr,{present:n||i.open,children:c.jsx(Wp,{asChild:!0,container:s,children:r})})})};Mz.displayName=B_;var md="PopoverContent",Oz=v.forwardRef((t,e)=>{const n=yhe(md,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=tl(md,t.__scopePopover);return c.jsx(fr,{present:r||i.open,children:i.modal?c.jsx(xhe,{...s,ref:e}):c.jsx(bhe,{...s,ref:e})})});Oz.displayName=md;var vhe=tc("PopoverContent.RemoveScroll"),xhe=v.forwardRef((t,e)=>{const n=tl(md,t.__scopePopover),r=v.useRef(null),s=We(e,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return wE(o)},[]),c.jsx(ib,{as:vhe,allowPinchZoom:!0,children:c.jsx(Dz,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:fe(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:fe(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),bhe=v.forwardRef((t,e)=>{const n=tl(md,t.__scopePopover),r=v.useRef(!1),s=v.useRef(!1);return c.jsx(Dz,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Dz=v.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=t,h=tl(md,n),p=cm(n);return bE(),c.jsx(rb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:c.jsx(Rd,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:c.jsx(dE,{"data-state":Lz(h.open),role:"dialog",id:h.contentId,...p,...f,ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Iz="PopoverClose",whe=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=tl(Iz,n);return c.jsx(he.button,{type:"button",...r,ref:e,onClick:fe(t.onClick,()=>s.onOpenChange(!1))})});whe.displayName=Iz;var She="PopoverArrow",khe=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=cm(n);return c.jsx(fE,{...s,...r,ref:e})});khe.displayName=She;function Lz(t){return t?"open":"closed"}var Che=Az,Nhe=Rz,Ehe=Mz,Fz=Oz;const gd=Che,yd=Nhe,fc=v.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>c.jsx(Ehe,{children:c.jsx(Fz,{ref:s,align:e,sideOffset:n,className:q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
517de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));fc.displayName=Fz.displayName;function _he({contactId:t}){const{toast:e}=ut(),{user:n}=ot(),r=xt(),[s,i]=v.useState(!1),[o,a]=v.useState(null),{data:l,isLoading:u}=ue({queryKey:["contact_board_statuses",t],queryFn:async()=>{const{data:m,error:g}=await I.from("board_contacts").select("id, board_id, status_id, boards(name), board_statuses(name, color)").eq("contact_id",t);if(g)throw g;return m},enabled:!!t}),{data:d}=ue({queryKey:["all_boards"],queryFn:async()=>{const{data:m,error:g}=await I.from("boards").select("id, name");if(g)throw g;return m}}),{data:f}=ue({queryKey:["all_board_statuses"],queryFn:async()=>{const{data:m,error:g}=await I.from("board_statuses").select("id, board_id, name, color, position").order("position",{ascending:!0});if(g)throw g;return m}}),h=Ee({mutationFn:async({entryId:m,statusId:g,meta:y})=>{const{error:b}=await I.from("board_contacts").update({status_id:g}).eq("id",m);if(b)throw b;return y},onSuccess:m=>{n&&m&&Wa(t,n.id,"status_changed",m),r.invalidateQueries({queryKey:["contact_board_statuses",t]}),r.invalidateQueries({queryKey:["activity_log",t]}),e({title:"Status updated"})},onError:m=>e({title:"Error",description:m.message,variant:"destructive"})});Ee({mutationFn:async({boardId:m,statusId:g,meta:y})=>{const{error:b}=await I.from("board_contacts").insert({contact_id:t,board_id:m,status_id:g});if(b)throw b;return y},onSuccess:m=>{n&&m&&Wa(t,n.id,"status_changed",m),r.invalidateQueries({queryKey:["contact_board_statuses",t]}),r.invalidateQueries({queryKey:["activity_log",t]}),i(!1),e({title:"Added to board"})},onError:m=>e({title:"Error",description:m.message,variant:"destructive"})});const p=new Set((l==null?void 0:l.map(m=>m.board_id))??[]);return d==null||d.filter(m=>!p.has(m.id)),u?c.jsx(vt,{className:"h-8 w-full"}):c.jsxs("div",{className:"space-y-2",children:[l&&l.length>0&&l.map(m=>{var S;const g=((S=m.boards)==null?void 0:S.name)??"Unknown",y=m.board_statuses,b=(y==null?void 0:y.name)??"Unknown",x=(y==null?void 0:y.color)??"#6b7280",w=(f==null?void 0:f.filter(C=>C.board_id===m.board_id))??[];return c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[c.jsx(JN,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),c.jsx("span",{className:"text-sm text-foreground truncate",children:g})]}),c.jsxs(gd,{open:o===m.id,onOpenChange:C=>a(C?m.id:null),children:[c.jsx(yd,{asChild:!0,children:c.jsxs("button",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium text-white flex-shrink-0 hover:opacity-80 transition-opacity cursor-pointer",style:{backgroundColor:x},children:[b,c.jsx(Hx,{className:"h-3 w-3"})]})}),c.jsx(fc,{className:"w-40 p-1",align:"end",children:w.map(C=>c.jsxs("button",{onClick:()=>{h.mutate({entryId:m.id,statusId:C.id,meta:{board_name:g,old_status:b,new_status:C.name}}),a(null)},className:q("w-full flex items-center gap-2 px-2 py-1.5 rounded text-sm hover:bg-muted transition-colors text-left",C.id===m.status_id&&"bg-muted"),children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:C.color}}),C.name]},C.id))})]})]},m.id)}),(!l||l.length===0)&&c.jsx("p",{className:"text-xs text-muted-foreground py-1",children:"Not on any boards."})]})}function The({contactId:t}){const{toast:e}=ut(),{user:n}=ot(),r=xt(),[s,i]=v.useState(!1),{data:o}=ue({queryKey:["contact_board_ids",t],queryFn:async()=>{const{data:h,error:p}=await I.from("board_contacts").select("board_id").eq("contact_id",t);if(p)throw p;return h},enabled:!!t}),{data:a}=ue({queryKey:["all_boards"],queryFn:async()=>{const{data:h,error:p}=await I.from("boards").select("id, name");if(p)throw p;return h}}),{data:l}=ue({queryKey:["all_board_statuses"],queryFn:async()=>{const{data:h,error:p}=await I.from("board_statuses").select("id, board_id, name, color, position").order("position",{ascending:!0});if(p)throw p;return h}}),u=Ee({mutationFn:async({boardId:h,statusId:p,meta:m})=>{const{error:g}=await I.from("board_contacts").insert({contact_id:t,board_id:h,status_id:p});if(g)throw g;return m},onSuccess:h=>{n&&h&&Wa(t,n.id,"status_changed",h),r.invalidateQueries({queryKey:["contact_board_statuses",t]}),r.invalidateQueries({queryKey:["contact_board_ids",t]}
517),r.invalidateQueries({queryKey:["activity_log",t]}),i(!1),e({title:"Added to board"})},onError:h=>e({title:"Error",description:h.message,variant:"destructive"})}),d=new Set((o==null?void 0:o.map(h=>h.board_id))??[]),f=(a==null?void 0:a.filter(h=>!d.has(h.id)))??[];return f.length===0?null:c.jsxs(gd,{open:s,onOpenChange:i,children:[c.jsx(yd,{asChild:!0,children:c.jsx(K,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:c.jsx(nn,{className:"h-3.5 w-3.5"})})}),c.jsx(fc,{className:"w-48 p-1",align:"end",children:f.map(h=>{const p=l==null?void 0:l.find(m=>m.board_id===h.id);return c.jsxs("button",{disabled:!p,onClick:()=>p&&u.mutate({boardId:h.id,statusId:p.id,meta:{board_name:h.name,old_status:"",new_status:p.name}}),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded text-sm hover:bg-muted transition-colors text-left disabled:opacity-50",children:[c.jsx(JN,{className:"h-3 w-3 text-muted-foreground"}),h.name]},h.id)})})]})}function Bz(t){const e=parseFloat(t);return isNaN(e)?t:`$${e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2})}`}function $z(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return t}}function Ahe(t){const e=parseFloat(t);return isNaN(e)?t:e.toLocaleString("en-US")}function jhe(t,e){return e?t==="dollar"?Bz(e):t==="date"?$z(e):t==="number"?Ahe(e):e:""}function Phe({contactId:t}){const{teamId:e,user:n}=ot(),{toast:r}=ut(),s=xt(),[i,o]=v.useState(null),[a,l]=v.useState(""),{data:u,isLoading:d}=ue({queryKey:["custom_field_definitions",e],queryFn:async()=>{const{data:x,error:w}=await I.from("custom_field_definitions").select("*").eq("team_id",e).order("created_at",{ascending:!0});if(w)throw w;return x},enabled:!!e}),{data:f,isLoading:h}=ue({queryKey:["custom_field_values",t],queryFn:async()=>{const{data:x,error:w}=await I.from("custom_field_values").select("*").eq("contact_id",t);if(w)throw w;return x},enabled:!!t}),p=Ee({mutationFn:async({fieldDefId:x,value:w})=>{var N;const S=f==null?void 0:f.find(E=>E.field_definition_id===x),C=(S==null?void 0:S.value)??"";if(S){const{error:E}=await I.from("custom_field_values").update({value:w||null}).eq("id",S.id);if(E)throw E}else{const{error:E}=await I.from("custom_field_values").insert({contact_id:t,field_definition_id:x,value:w||null});if(E)throw E}return{field_name:((N=u==null?void 0:u.find(E=>E.id===x))==null?void 0:N.name)??"Unknown",old:C||"",new:w||""}},onSuccess:x=>{n&&x&&x.old!==x.new&&Wa(t,n.id,"custom_field_updated",x),s.invalidateQueries({queryKey:["custom_field_values",t]}),s.invalidateQueries({queryKey:["activity_log",t]}),o(null)},onError:x=>{r({title:"Error",description:x.message,variant:"destructive"})}});if(d||h)return c.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((x,w)=>c.jsx(vt,{className:"h-8 w-full"},w))});if(!u||u.length===0)return c.jsx("p",{className:"text-xs text-muted-foreground py-2",children:"No custom fields defined. An admin can add them in Settings → Custom Fields."});const m=x=>{var w;return((w=f==null?void 0:f.find(S=>S.field_definition_id===x))==null?void 0:w.value)??""},g=(x,w)=>w?x==="dollar"?Bz(w):x==="date"?$z(w):w:"—",y=x=>{o(x),l(m(x))},b=x=>{p.mutate({fieldDefId:x,value:a.trim()})};return c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Custom Fields"}),c.jsx("div",{className:"grid grid-cols-1 gap-3",children:u.map(x=>{const w=i===x.id,S=m(x.id);return c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("span",{className:"text-xs text-muted-foreground shrink-0 pt-0.5",children:x.name}),w?c.jsx(Je,{value:a,onChange:C=>l(C.target.value),type:x.field_type==="number"||x.field_type==="dollar"?"number":x.field_type==="date"?"date":"text",className:"h-7 text-sm w-32",autoFocus:!0,onKeyDown:C=>{C.key==="Enter"&&b(x.id),C.key==="Escape"&&o(null)},onBlur:()=>b(x.id)}):c.jsx("p",{className:"text-sm font-medium cursor-pointer hover:bg-secondary rounded px-1 py-0.5 transition-colors text-right truncate",onClick:()=>y(x.id),title:"Click to edit",children:g(x.field_type,S)})]},x.id)})})]})}
vendor: 10,896 bytes, line 517
517var zM=1,Rhe=.9,Mhe=.8,Ohe=.17,Uw=.1,Ww=.999,Dhe=.9999,Ihe=.99,Lhe=/[\\\/_+.#"@\[\(\{&]/,Fhe=/[\\\/_+.#"@\[\(\{&]/g,Bhe=/[\s-]/,Vz=/[\s-]/g;function uC(t,e,n,r,s,i,o){if(i===e.length)return s===t.length?zM:Ihe;var a=`${s},${i}`;if(o[a]!==void 0)return o[a];for(var l=r.charAt(i),u=n.indexOf(l,s),d=0,f,h,p,m;u>=0;)f=uC(t,e,n,r,u+1,i+1,o),f>d&&(u===s?f*=zM:Lhe.test(t.charAt(u-1))?(f*=Mhe,p=t.slice(s,u-1).match(Fhe),p&&s>0&&(f*=Math.pow(Ww,p.length))):Bhe.test(t.charAt(u-1))?(f*=Rhe,m=t.slice(s,u-1).match(Vz),m&&s>0&&(f*=Math.pow(Ww,m.length))):(f*=Ohe,s>0&&(f*=Math.pow(Ww,u-s))),t.charAt(u)!==e.charAt(i)&&(f*=Dhe)),(f<Uw&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(h=uC(t,e,n,r,u+1,i+2,o),h*Uw>f&&(f=h*Uw)),f>d&&(d=f),u=n.indexOf(l,u+1);return o[a]=d,d}function UM(t){return t.toLowerCase().replace(Vz," ")}function $he(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,uC(t,e,UM(t),UM(e),0,0,{})}var Cf='[cmdk-group=""]',Hw='[cmdk-group-items=""]',Vhe='[cmdk-group-heading=""]',zz='[cmdk-item=""]',WM=`${zz}:not([aria-disabled="true"])`,dC="cmdk-item-select",Qc="data-value",zhe=(t,e,n)=>$he(t,e,n),Uz=v.createContext(void 0),um=()=>v.useContext(Uz),Wz=v.createContext(void 0),$_=()=>v.useContext(Wz),Hz=v.createContext(void 0),qz=v.forwardRef((t,e)=>{let n=Jc(()=>{var $,Y;return{search:"",value:(Y=($=t.value)!=null?$:t.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Jc(()=>new Set),s=Jc(()=>new Map),i=Jc(()=>new Map),o=Jc(()=>new Set),a=Kz(t),{label:l,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:y=!0,...b}=t,x=yn(),w=yn(),S=yn(),C=v.useRef(null),k=Zhe();hc(()=>{if(d!==void 0){let $=d.trim();n.current.value=$,N.emit()}},[d]),hc(()=>{k(6,F)},[]);let N=v.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,Y,ee)=>{var ne,be,G,Ae;if(!Object.is(n.current[$],Y)){if(n.current[$]=Y,$==="search")j(),T(),k(1,P);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Re=document.getElementById(S);Re?Re.focus():(ne=document.getElementById(x))==null||ne.focus()}if(k(7,()=>{var Re;n.current.selectedItemId=(Re=B())==null?void 0:Re.id,N.emit()}),ee||k(5,F),((be=a.current)==null?void 0:be.value)!==void 0){let Re=Y??"";(Ae=(G=a.current).onValueChange)==null||Ae.call(G,Re);return}}N.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),E=v.useMemo(()=>({value:($,Y,ee)=>{var ne;Y!==((ne=i.current.get($))==null?void 0:ne.value)&&(i.current.set($,{value:Y,keywords:ee}),n.current.filtered.items.set($,_(Y,ee)),k(2,()=>{T(),N.emit()}))},item:($,Y)=>(r.current.add($),Y&&(s.current.has(Y)?s.current.get(Y).add($):s.current.set(Y,new Set([$]))),k(3,()=>{j(),T(),n.current.value||P(),N.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let ee=B();k(4,()=>{j(),(ee==null?void 0:ee.getAttribute("id"))===$&&P(),N.emit()})}),group:$=>(s.current.has($)||s.current.set($,new Set),()=>{i.current.delete($),s.current.delete($)}),filter:()=>a.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:x,inputId:S,labelId:w,listInnerRef:C}),[]);function _($,Y){var ee,ne;let be=(ne=(ee=a.current)==null?void 0:ee.filter)!=null?ne:zhe;return $?be($,n.current.search,Y):0}function T(){if(!n.current.search||a.current.shouldFilter===!1)return;let $=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(ne=>{let be=s.current.get(ne),G=0;be.forEach(Ae=>{let Re=$.get(Ae);G=Math.max(Re,G)}),Y.push([ne,G])});let ee=C.current;U().sort((ne,be)=>{var G,Ae;let Re=ne.getAttribute("id"),De=be.getAttribute("id");return((G=$.get(De))!=null?G:0)-((Ae=$.get(Re))!=null?Ae:0)}).forEach(ne=>{let be=ne.closest(Hw);be?be.appendChild(ne.parentElement===be?ne:ne.closest(`${Hw} > *`)):ee.appendChild(ne.parentElement===ee?ne:ne.closest(`${Hw} > *`))}),Y.sort((ne,be)=>be[1]-ne[1]).forEach(ne=>{var be;let G=(be=C.current)==null?void 0:be.querySelector(`${Cf}[${Qc}="${encodeURIComponent(ne[0])}"]`);G==null||G.parentElement.appendChild(G)})}function P(){let $=U().find(ee=>ee.getAttribute("aria-disabled")!=="true"),Y=$==null?void 0:$.getAttribute(Qc);N.setState("value",Y||void 0)}function j(){var $,Y,ee,ne;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let be=0;for(let G of r.current){let Ae=(Y=($=i.current.get(G))==null?void 0:$.value)!=null?Y:"",Re=(ne=(ee=i.current.get(G))==null?void 0:ee.keywords)!=null?ne:[],De=_(Ae,Re);n.current.filtered.items.set(G,De),De>0&&be++}for(let[G,Ae]of s.current)for(let Re of Ae)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=be}function F(){var $,Y,ee;let ne=B();ne&&((($=ne.parentElement)==null?void 0:$.firstChild)===ne&&((ee=(Y=ne.closest(Cf))==null?void 0:Y.querySelector(Vhe))==null||ee.scrollIntoView({block:"nearest"})),ne.scrollIntoView({block:"nearest"}))}function B(){var $;return($=C.current)==null?void 0:$.querySelector(`${zz}[aria-selected="true"]`)}function U(){var $;return Array.from((($=C.current)==null?void 0:$.querySelectorAll(WM))||[])}function D($){let Y=U()[$];Y&&N.setState("value",Y.getAttribute(Qc))}function L($){var Y;let ee=B(),ne=U(),be=ne.findIndex(Ae=>Ae===ee),G=ne[be+$];(Y=a.current)!=null&&Y.loop&&(G=be+$<0?ne[ne.length-1]:be+$===ne.length?ne[0]:ne[be+$]),G&&N.setState("value",G.getAttribute(Qc))}function A($){let Y=B(),ee=Y==null?void 0:Y.closest(Cf),ne;for(;ee&&!ne;)ee=$>0?Jhe(ee,Cf):Xhe(ee,Cf),ne=ee==null?void 0:ee.querySelector(WM);ne?N.setState("value",ne.getAttribute(Qc)):L($)}let O=()=>D(U().length-1),W=$=>{$.preventDefault(),$.metaKey?O():$.altKey?A(1):L(1)},Z=$=>{$.preventDefault(),$.metaKey?D(0):$.altKey?A(-1):L(-1)};return v.createElement(he.div,{ref:e,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:$=>{var Y;(Y=b.onKeyDown)==null||Y.call(b,$);let ee=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||ee))switch($.key){case"n":case"j":{y&&$.ctrlKey&&W($);break}case"ArrowDown":{W($);break}case"p":case"k":{y&&$.ctrlKey&&Z($);break}case"ArrowUp":{Z($);break}case"Home":{$.preventDefault(),D(0);break}case"End":{$.preventDefault(),O();break}case"Enter":{$.preventDefault();let ne=B();if(ne){let be=new Event(dC);ne.dispatchEvent(be)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:tpe},l),Gb(t,$=>v.createElement(Wz.Provider,{value:N},v.createElement(Uz.Provider,{value:E},$))))}),Uhe=v.forwardRef((t,e)=>{var n,r;let s=yn(),i=v.useRef(null),o=v.useContext(Hz),a=um(),l=Kz(t),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;hc(()=>{if(!u)return a.item(s,o==null?void 0:o.id)},[u]);let d=Gz(s,i,[t.value,t.children,i],t.keywords),f=$_(),h=Ha(k=>k.value&&k.value===d.current),p=Ha(k=>u||a.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);v.useEffect(()=>{let k=i.current;if(!(!k||t.disabled))return k.addEventListener(dC,m),()=>k.removeEventListener(dC,m)},[p,t.onSelect,t.disabled]);function m(){var k,N;g(),(N=(k=l.current).onSelect)==null||N.call(k,d.current)}function g(){f.setState("value",d.current,!0)}if(!p)return null;let{disabled:y,value:b,onSelect:x,forceMount:w,keywords:S,...C}=t;return v.createElement(he.div,{ref:ec(i,e),...C,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||a.getDisablePointerSelection()?void 0:g,onClick:y?void 0:m},t.children)}),Whe=v.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,o=yn(),a=v.useRef(null),l=v.useRef(null),u=yn(),d=um(),f=Ha(p=>s||d.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);hc(()=>d.group(o),[]),Gz(o,a,[t.value,t.heading,l]);let h=v.useMemo(()=>({id:o,forceMount:s}),[s]);return v.createElement(he.div,{ref:ec(a,e),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&v.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Gb(t,p=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},v.createElement(Hz.Provider,{value:h},p))))}),Hhe=v.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=v.useRef(null),i=Ha(o=>!o.search);return!n&&!i?null:v.createElement(he.div,{ref:ec(s,e),...r,"cmdk-separator":"",role:"separator"})}),qhe=v.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=$_(),o=Ha(u=>u.search),a=Ha(u=>u.selectedItemId),l=um();return v.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),v.createElement(he.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:s?t.value:o,onChange:u=>{s||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),Khe=v.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=v.useRef(null),o=v.useRef(null),a=Ha(u=>u.selectedItemId),l=um();return v.useEffect(()=>{if(o.current&&i.current){let u=o.current,d=i.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let p=u.offsetHeight;d.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),v.createElement(he.div,{ref:ec(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},Gb(t,u=>v.createElement("div",{ref:ec(o,l.listInnerRef),"cmdk-list-sizer":""},u)))}),Ghe=v.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...a}=t;return v.createElement(ab,{open:n,onOpenChange:r},v.createElement(lb,{container:o},v.createElement(Ud,{"cmdk-overlay":"",className:s}),v.createElement(Wd,{"aria-label":t.label,"cmdk-dialog":"",className:i},v.createElement(qz,{ref:e,...a}))))}),Yhe=v.forwardRef((t,e)=>Ha(n=>n.filtered.count===0)?v.createElement(he.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),Qhe=v.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return v.createElement(he.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Gb(t,o=>v.createElement("div",{"aria-hidden":!0},o)))}),jr=Object.assign(qz,{List:Khe,Item:Uhe,Input:qhe,Group:Whe,Separator:Hhe,Dialog:Ghe,Empty:Yhe,Loading:Qhe});function Jhe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function Xhe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Kz(t){let e=v.useRef(t);return hc(()=>{e.current=t}),e}var hc=typeof window>"u"?v.useEffect:v.useLayoutEffect;
517function Jc(t){let e=v.useRef();return e.current===void 0&&(e.current=t()),e}function Ha(t){let e=$_(),n=()=>t(e.snapshot());return v.useSyncExternalStore(e.subscribe,n,n)}function Gz(t,e,n,r=[]){let s=v.useRef(),i=um();return hc(()=>{var o;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():s.current}})(),l=r.map(u=>u.trim());i.value(t,a,l),(o=e.current)==null||o.setAttribute(Qc,a),s.current=a}),s}var Zhe=()=>{let[t,e]=v.useState(),n=Jc(()=>new Map);return hc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function epe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Gb({asChild:t,children:e},n){return t&&v.isValidElement(e)?v.cloneElement(epe(e),{ref:e.ref},n(e.props.children)):n(e)}var tpe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const V_=v.forwardRef(({className:t,...e},n)=>c.jsx(jr,{ref:n,className:q("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));V_.displayName=jr.displayName;const z_=v.forwardRef(({className:t,...e},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(Gh,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(jr.Input,{ref:n,className:q("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));z_.displayName=jr.Input.displayName;const U_=v.forwardRef(({className:t,...e},n)=>c.jsx(jr.List,{ref:n,className:q("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));U_.displayName=jr.List.displayName;const W_=v.forwardRef((t,e)=>c.jsx(jr.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));W_.displayName=jr.Empty.displayName;const Yz=v.forwardRef(({className:t,...e},n)=>c.jsx(jr.Group,{ref:n,className:q("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Yz.displayName=jr.Group.displayName;const npe=v.forwardRef(({className:t,...e},n)=>c.jsx(jr.Separator,{ref:n,className:q("-mx-1 h-px bg-border",t),...e}));npe.displayName=jr.Separator.displayName;const H_=v.forwardRef(({className:t,...e},n)=>c.jsx(jr.Item,{ref:n,className:q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...e}));H_.displayName=jr.Item.displayName;function rpe({label:t,value:e,fieldKey:n,subscriberId:r}){const[s,i]=v.useState(!1),[o,a]=v.useState(e||""),l=xt(),u=Ee({mutationFn:async f=>{const{data:h,error:p}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:`/v4/subscribers/${r}`,method:"PUT",payload:{fields:{[n]:f}}}});if(p)throw p;return h},onSuccess:()=>{l.invalidateQueries({queryKey:["kit-subscriber",r]}),Fr.success("Field updated in Kit"),i(!1)},onError:()=>{Fr.error("Failed to update field in Kit")}}),d=()=>{o!==(e||"")?u.mutate(o):i(!1)};return s?c.jsxs("div",{className:"flex justify-between items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground text-xs shrink-0",children:t}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Je,{className:"h-7 text-xs w-32",value:o,onChange:f=>a(f.target.value),onKeyDown:f=>{f.key==="Enter"&&d(),f.key==="Escape"&&(i(!1),a(e||""))},autoFocus:!0,disabled:u.isPending}),c.jsx(K,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:d,disabled:u.isPending,children:c.jsx(xi,{className:"h-3 w-3"})})]})]}):c.jsxs("div",{className:"flex justify-between items-center group",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:t}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-xs text-foreground",children:e||"—"}),c.jsx("button",{onClick:()=>{a(e||""),i(!0)},className:"opacity-0 group-hover:opacity-100 transition-opacity",children:c.jsx(XN,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]})]})}function spe({kitSubscriberId:t}){const{teamId:e,role:n}=ot(),r=xt(),[s,i]=v.useState(!1),{data:o,isLoading:a}=ue({queryKey:["kit-connection",e],queryFn:async()=>{const{data:w,error:S}=await I.from("kit_connections").select("id").eq("team_id",e).maybeSingle();if(S)throw S;return w},enabled:!!e}),{data:l,isLoading:u}=ue({queryKey:["kit-subscriber",t],queryFn:async()=>{const{data:w,error:S}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:`/v4/subscribers/${t}`}});if(S)throw S;return(w==null?void 0:w.subscriber)||w},enabled:!!o,staleTime:5*60*1e3}),{data:d}=ue({queryKey:["kit-subscriber-tags",t],queryFn:async()=>{const{data:w,error:S}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:`/v4/subscribers/${t}/tags`}});if(S)throw S;return(w==null?void 0:w.tags)||[]},enabled:!!o,staleTime:5*60*1e3}),{data:f}=ue({queryKey:["kit-custom-fields"],queryFn:async()=>{const{data:w,error:S}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:"/v4/custom_fields"}});if(S)throw S;return(w==null?void 0:w.custom_fields)||[]},enabled:!!o,staleTime:10*60*1e3}),{data:h}
517=ue({queryKey:["kit-all-tags"],queryFn:async()=>{const{data:w,error:S}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:"/v4/tags"}});if(S)throw S;return(w==null?void 0:w.tags)||[]},enabled:!!o&&s,staleTime:5*60*1e3}),p=Ee({mutationFn:async w=>{const{data:S,error:C}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:`/v4/tags/${w}/subscribers`,method:"POST",payload:{id:t}}});if(C)throw C;return S},onSuccess:()=>{r.invalidateQueries({queryKey:["kit-subscriber-tags",t]}),Fr.success("Tag added"),i(!1)},onError:()=>Fr.error("Failed to add tag")}),m=Ee({mutationFn:async w=>{const{data:S,error:C}=await I.functions.invoke("kit-api-proxy",{body:{endpoint:`/v4/tags/${w}/subscribers/${t}`,method:"DELETE"}});if(C)throw C;return S},onSuccess:()=>{r.invalidateQueries({queryKey:["kit-subscriber-tags",t]}),Fr.success("Tag removed")},onError:()=>Fr.error("Failed to remove tag")});if(a)return c.jsx("div",{className:"border-t border-border pt-4",children:c.jsx(vt,{className:"h-4 w-24"})});if(!o)return c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx("div",{className:"flex items-center gap-2 mb-3",children:c.jsx(Ua,{})}),c.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["This contact is linked to Kit subscriber #",t,", but the Kit integration is not connected."]}),n==="admin"||n==="owner"?c.jsxs($e,{to:"/settings/integrations",className:"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",children:[c.jsx(qp,{className:"h-3 w-3"}),"Connect in Settings"]}):c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Ask a team admin to connect the Kit integration in Settings → Integrations."})]});const g=(l==null?void 0:l.fields)||{},y=f?f.map(w=>({key:w.key,label:w.label,value:g[w.key]??""})):Object.entries(g).map(([w,S])=>({key:w,label:w,value:String(S??"")})),b=new Set((d||[]).map(w=>w.id)),x=(h||[]).filter(w=>!b.has(w.id));return c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx("div",{className:"flex items-center gap-2 mb-3",children:c.jsx(Ua,{})}),u?c.jsxs("div",{className:"space-y-2",children:[c.jsx(vt,{className:"h-4 w-24"}),c.jsx(vt,{className:"h-4 w-32"})]}):l?c.jsxs("div",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"Status"}),c.jsx(Ai,{variant:l.state==="active"?"default":"secondary",className:"text-xs capitalize",children:l.state})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"Subscriber ID"}),c.jsx("span",{className:"font-medium text-foreground text-xs",children:t})]}),y.length>0&&c.jsxs("div",{className:"space-y-1.5 pt-1",children:[c.jsx("span",{className:"text-muted-foreground text-xs font-medium uppercase tracking-wider",children:"Custom Fields"}),y.map(w=>c.jsx(rpe,{label:w.label,value:w.value,fieldKey:w.key,subscriberId:t},w.key))]}),c.jsxs("div",{className:"pt-1",children:[c.jsx("span",{className:"text-muted-foreground text-xs font-medium uppercase tracking-wider",children:"Tags"}),c.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[(d||[]).map(w=>c.jsxs(Ai,{variant:"outline",className:"text-xs gap-1 pr-1",children:[w.name,c.jsx("button",{onClick:()=>m.mutate(w.id),disabled:m.isPending,className:"hover:text-destructive transition-colors",children:c.jsx(ji,{className:"h-3 w-3"})})]},w.id)),c.jsxs(gd,{open:s,onOpenChange:i,children:[c.jsx(yd,{asChild:!0,children:c.jsxs(K,{variant:"outline",size:"sm",className:"h-6 text-xs gap-1 px-2",children:[c.jsx(nn,{className:"h-3 w-3"})," Tag"]})}),c.jsx(fc,{className:"w-52 p-0",align:"start",children:c.jsxs(V_,{children:[c.jsx(z_,{placeholder:"Search tags...",className:"h-8 text-xs"}),c.jsxs(U_,{children:[c.jsx(W_,{className:"text-xs p-2",children:"No tags found"}),c.jsx(Yz,{children:x.map(w=>c.jsx(H_,{onSelect:()=>p.mutate(w.id),className:"text-xs",children:w.name},w.id))})]})]})})]})]})]})]}):c.jsx("p",{className:"text-xs text-muted-foreground",children:"Unable to load Kit data."})]})}function ipe({contactId:t,kitSubscriberId:e}){const{teamId:n,role:r}=ot(),{data:s,isLoading:i}=ue({queryKey:["kit-connection",n],queryFn:async()=>{const{data:a,error:l}=await I.from("kit_connections").select("id, token_expires_at").eq("team_id",n).maybeSingle();if(l)throw l;return a},enabled:!!n});if(i)return null;const o=s!=null&&s.token_expires_at?new Date(s.token_expires_at)<new Date:!1;if(!s||o){const a=r==="admin"||r==="owner";return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center max-w-sm mx-auto 
517space-y-3",children:[c.jsx(Ua,{}),c.jsx("p",{className:"text-sm text-muted-foreground",children:s?"Your Kit connection has expired and needs to be refreshed.":"The Kit integration is not connected."}),a?c.jsxs($e,{to:"/settings/integrations",className:"inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",children:[c.jsx(qp,{className:"h-4 w-4"}),"Update Kit connection in Settings"]}):c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Contact your team admin to refresh the Kit integration."})]})}return e?c.jsx(spe,{kitSubscriberId:e}):c.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"This contact is not linked to a Kit subscriber."})})}function Nn(t){this.content=t}Nn.prototype={constructor:Nn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),i=r.content.slice();return s==-1?i.push(n||t,e):(i[s+1]=e,n&&(i[s]=n)),new Nn(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Nn(n)},addToStart:function(t,e){return new Nn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Nn(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),i=r.find(t);return s.splice(i==-1?s.length:i,0,e,n),new Nn(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Nn.from(t),t.size?new Nn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Nn.from(t),t.size?new Nn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Nn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Nn.from=function(t){if(t instanceof Nn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Nn(e)};function Qz(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)n++;return n}if(s.content.size||i.content.size){let o=Qz(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function Jz(t,e,n,r){for(let s=t.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let o=t.child(--s),a=e.child(--i),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,d=Math.min(o.text.length,a.text.length);for(;u<d&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=Jz(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Q{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,i){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,s+a,i||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,s+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new Q(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let i=0,o=0;o<n;i++){let a=this.content[i],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),s+=a.nodeSize),o=l}return new Q(r,s)}cutByIndex(e,n){return e==n?Q.empty:e==0&&n==this.content.length?this:new Q(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new Q(s,i)}addToStart(e){return new Q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Q(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Qz(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Jz(this,e,n,r)}findIndex(e){if(e==0)return fg(0,e);if(e==this.size)return fg(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?fg(n+1,i):fg(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Q.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Q(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Q.empty;let n,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(n||(n=e.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Q(n||e,r)}static from(e){if(!e)return Q.empty;if(e instanceof Q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Q.empty=new Q([],0);const qw={index:0,offset:0};function fg(t,e){return qw.index=t,qw.offset=e,qw}function Ev(t,e){if(t===e)return!0;
vendor: 4,106 bytes, line 517
517if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ev(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ev(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let mt=class fC{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ev(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return fC.none;if(e instanceof fC)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};mt.none=[];class _v extends Error{}class ce{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Zz(this.content,e+this.openStart,n);return r&&new ce(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ce(Xz(this.content,e+this.openStart,n+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,n){if(!n)return ce.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ce(Q.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new ce(e,r,s)}}ce.empty=new ce(Q.empty,0,0);function Xz(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(s==e||i.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Xz(i.content,e-s-1,n-s-1)))}function Zz(t,e,n,r){let{index:s,offset:i}=t.findIndex(e),o=t.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Zz(o.content,e-i-1,n,o);return a&&t.replaceChild(s,o.copy(a))}function ope(t,e,n){if(n.openStart>t.depth)throw new _v("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new _v("Inconsistent open depths");return eU(t,e,n,0)}function eU(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let o=eU(t,e,n,r+1);return i.copy(i.content.replaceChild(s,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return Hl(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=ape(n,t);return Hl(i,nU(t,o,a,e,r))}else return Hl(i,Tv(t,e,r))}function tU(t,e){if(!e.type.compatibleContent(t.type))throw new _v("Cannot join "+e.type.name+" onto "+t.type.name)}
vendor: 10,911 bytes, line 517
517function hC(t,e,n){let r=t.node(n);return tU(r,e.node(n)),r}function Wl(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function mh(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Wl(t.nodeAfter,r),i++));for(let a=i;a<o;a++)Wl(s.child(a),r);e&&e.depth==n&&e.textOffset&&Wl(e.nodeBefore,r)}function Hl(t,e){return t.type.checkContent(e),t.copy(e)}function nU(t,e,n,r,s){let i=t.depth>s&&hC(t,e,s+1),o=r.depth>s&&hC(n,r,s+1),a=[];return mh(null,t,s,a),i&&o&&e.index(s)==n.index(s)?(tU(i,o),Wl(Hl(i,nU(t,e,n,r,s+1)),a)):(i&&Wl(Hl(i,Tv(t,e,s+1)),a),mh(e,n,s,a),o&&Wl(Hl(o,Tv(n,r,s+1)),a)),mh(r,null,s,a),new Q(a)}function Tv(t,e,n){let r=[];if(mh(null,t,n,r),t.depth>n){let s=hC(t,e,n+1);Wl(Hl(s,Tv(t,e,n+1)),r)}return mh(e,null,n,r),new Q(r)}function ape(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(Q.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class yp{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return mt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let a=r;r=s,s=a}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){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)&&(!n||n(this.node(r))))return new Av(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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(i),u=i-l;if(r.push(o,a,s+l),!u||(o=o.child(a),o.isText))break;i=u-1,s+=l+1}return new yp(n,r,i)}static resolveCached(e,n){let r=HM.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==n)return o}else HM.set(e,r=new lpe);let s=r.elts[r.i]=yp.resolve(e,n);return r.i=(r.i+1)%cpe,s}}class lpe{constructor(){this.elts=[],this.i=0}}const cpe=12,HM=new WeakMap;class Av{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const upe=Object.create(null);let Ta=class pC{constructor(e,n,r,s=mt.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||Q.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,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ev(this.attrs,n||e.defaultAttrs||upe)&&mt.sameSet(this.marks,r||mt.none)}copy(e=null){return e==this.content?this:new pC(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new pC(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ce.empty;let s=this.resolve(e),i=this.resolve(n),o=r?0:s.sharedDepth(n),a=s.start(o),u=s.node(o).content.cut(s.pos-a,i.pos-a);return new ce(u,s.depth-o,i.depth-o)}replace(e,n,r){return ope(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return yp.resolveCached(this,e)}resolveNoCache(e){return yp.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),rU(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Q.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=mt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!mt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=Q.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Ta.prototype.text=void 0;class jv extends Ta{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):rU(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new jv(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new jv(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function rU(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class pc{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new dpe(e,n);if(r.next==null)return pc.empty;let s=sU(r);r.next&&r.err("Unexpected trailing text");let i=vpe(ype(s));return xpe(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function i(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return Q.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:f}=o.next[u];
vendor: 4,097 bytes, lines 517-518
517if(!(d.isText||d.hasRequiredAttrs())&&s.indexOf(f)==-1){s.push(f);let h=i(f,a.concat(d));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let a=s;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:a,next:l}=i.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:s}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
518`)}}pc.empty=new pc(!0);class dpe{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function sU(t){let e=[];do e.push(fpe(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function fpe(t){let e=[];do e.push(hpe(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function hpe(t){let e=gpe(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=ppe(t,e);else break;return e}function qM(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function ppe(t,e){let n=qM(t),r=n;return t.eat(",")&&(t.next!="}"?r=qM(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function mpe(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function gpe(t){if(t.eat("(")){let e=sU(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=mpe(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function ype(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function s(o,a){o.forEach(l=>l.to=a)}function i(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(i(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=i(o.exprs[l],a);if(l==o.exprs.length-1)return u;s(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),s(i(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return s(i(o.expr,a),l),s(i(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(i(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let d=n();s(i(o.expr,l),d),l=d}if(o.max==-1)s(i(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=n();r(l,d),s(i(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function iU(t,e){return e-t}function KM(t,e){let n=[];return r(e),n.sort(iU);function r(s){let i=t[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let o=0;o<i.length;o++){let{term:a,to:l}=i[o];!a&&n.indexOf(l)==-1&&r(l)}}}function vpe(t){let e=Object.create(null);return n(KM(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>
vendor: 13,250 bytes, lines 518-520
518{if(!a)return;let u;for(let d=0;d<s.length;d++)s[d][0]==a&&(u=s[d][1]);KM(t,l).forEach(d=>{u||s.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let i=e[r.join(",")]=new pc(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let a=s[o][1].sort(iU);i.next.push({type:s[o][0],next:e[a.join(",")]||n(a)})}return i}}function xpe(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],i=!s.validEnd,o=[];for(let a=0;a<s.next.length;a++){let{type:l,next:u}=s.next[a];o.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function oU(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function aU(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let i=t[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function lU(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in t){let i=t[s];i.validate&&i.validate(e[s])}}function cU(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new wpe(t,r,e[r]);return n}let GM=class uU{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=cU(e,r.attrs),this.defaultAttrs=oU(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==pc.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:aU(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ta(this,this.computeAttrs(e),Q.from(n),mt.setFrom(r))}createChecked(e=null,n,r){return n=Q.from(n),this.checkContent(n),new Ta(this,this.computeAttrs(e),n,mt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Q.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(Q.empty,!0);return i?new Ta(this,e,n.append(i),mt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){lU(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:mt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new uU(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function bpe(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class wpe{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?bpe(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Yb{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=cU(e,s.attrs),this.excluded=null;let i=oU(this.attrs);this.instance=i?new mt(this,i):null}create(e=null){return!e&&this.instance?this.instance:new mt(this,aU(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Yb(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){lU(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class dU{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Nn.from(e.nodes),n.marks=Nn.from(e.marks||{}),this.nodes=GM.compile(this.spec.nodes,this),this.marks=Yb.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=pc.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?YM(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:YM(this,o.split(" "))}this.nodeFromJSON=s=>Ta.fromJSON(this,s),this.markFromJSON=s=>mt.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof GM){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new jv(r,r.defaultAttrs,e,mt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function YM(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],i=t.marks[s],o=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Spe(t){return t.tag!=null}function kpe(t){return t.style!=null}let gh=class mC{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(Spe(s))this.tags.push(s);else if(kpe(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new JM(this,n,!1);return r.addAll(e,mt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new JM(this,n,!0);return r.addAll(e,mt.none,n.from,n.to),ce.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Epe(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<i)break}n.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=XM(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=XM(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new mC(e,mC.schemaRules(e)))}};const fU={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},Cpe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hU={ol:!0,ul:!0},vp=1,gC=2,yh=4;function QM(t,e,n){return e!=null?(e?vp:0)|(e==="full"?gC:0):t&&t.whitespace=="pre"?vp|gC:n&~yh}class hg{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=mt.none,this.match=i||(o&yh?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Q.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&vp)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=Q.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Q.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!fU.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class JM{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=QM(null,n.preserveWhitespace,0)|(r?yh:0);s?i=new hg(s.type,s.attrs,mt.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new hg(null,null,mt.none,!0,null,o):i=new hg(e.schema.topNodeType,null,mt.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&gC?"full":this.localPreserveWS||(s.options&vp)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
519`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));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 a=s.content[s.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;hU.hasOwnProperty(o)&&this.parser.normalizeLists&&Npe(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Cpe.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,d=this.needsBlock;if(fU.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),u&&this.sync(i),this.needsBlock=d}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=s}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
520`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(i,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,s){let i,o;
vendor: 4,119 bytes, line 520
520if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=s==null?null:e.childNodes[s];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!s||s.length>u.length+a)&&(s=u,i=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)n=this.enterInner(s[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=mt.none;for(let a of s.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):ZM(a.type,e.type))&&(o=a.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,s){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,s)),i}enterInner(e,n,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=QM(e,i,o.options);o.options&yh&&o.content.length==0&&(a|=yh);let l=mt.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):ZM(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new hg(e,n,l,s,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=vp)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&s?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];
vendor: 10,595 bytes, line 520
520if(r.isTextblock&&r.defaultAttrs)return r}}}function Npe(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&hU.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Epe(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function XM(t){let e={};for(let n in t)e[n]=t[n];return e}function ZM(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:d}=a.edge(l);if(u==e||i.indexOf(d)<0&&o(d))return!0}};if(o(s.contentMatch))return!0}}class Ec{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Kw(n).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let a=0,l=0;for(;a<i.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(i[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)s=i.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,n);d&&(i.push([u,s]),s.appendChild(d.dom),s=d.contentDOM||d.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:s}=iy(Kw(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&iy(Kw(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return iy(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ec(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=eO(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return eO(e.marks)}}function eO(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Kw(t){return t.document||window.document}const tO=new WeakMap;function _pe(t){let e=tO.get(t);return e===void 0&&tO.set(t,e=Tpe(t)),e}function Tpe(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function iy(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=_pe(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let a,l=n?t.createElementNS(n,s):t.createElement(s),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let f in u)if(u[f]!=null){let h=f.indexOf(" ");h>0?l.setAttributeNS(f.slice(0,h),f.slice(h+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=d;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:m}=iy(t,h,n,r);if(l.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const pU=65535,mU=Math.pow(2,16);function Ape(t,e){return t+e*mU}function nO(t){return t&pU}function jpe(t){return(t-(t&pU))/mU}const gU=1,yU=2,oy=4,vU=8;class yC{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&vU)>0}get deletedBefore(){return(this.delInfo&(gU|oy))>0}get deletedAfter(){return(this.delInfo&(yU|oy))>0}get deletedAcross(){return(this.delInfo&oy)>0}}class Ir{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ir.empty)return Ir.empty}recover(e){let n=0,r=nO(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+jpe(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?s:0);if(l>e)break;let u=this.ranges[a+i],d=this.ranges[a+o],f=l+u;if(e<=f){let h=u?e==l?-1:e==f?1:n:n,p=l+s+(h<0?0:d);if(r)return p;let m=e==(n<0?l:f)?null:Ape(a/3,e-l),g=e==l?yU:e==f?gU:oy;return(n<0?e!=l:e!=f)&&(g|=vU),new yC(p,g,m)}s+=d-u}return r?e+s:new yC(e+s,0,null)}touches(e,n){let r=0,s=nO(n),i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+i],d=l+u;if(e<=d&&a==s*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],a=o-(this.inverted?i:0),l=o+(this.inverted?0:i),u=this.ranges[s+n],d=this.ranges[s+r];e(a,a+u,l,l+d),i+=d-u}}invert(){return new Ir(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ir.empty:new Ir(e<0?[0,-e,0]:[0,0,e])}}Ir.empty=new Ir([]);class xp{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new xp(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new xp;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return r?e:new yC(e,s,null)}}const Gw=Object.create(null);class Hn{getMap(){return Ir.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Gw[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Gw)throw new RangeError("Duplicate use of step JSON ID "+e);return Gw[e]=n,n.prototype.jsonID=e,n}}class tn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new tn(e,null)}static fail(e){return new tn(null,e)}static fromReplace(e,n,r,s){try{return tn.ok(e.replace(n,r,s))}catch(i){if(i instanceof _v)return tn.fail(i.message);throw i}}}function q_(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(q_(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return Q.fromArray(r)}class ha extends Hn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new ce(q_(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return tn.fromReplace(e,this.from,this.to,i)}invert(){return new $s(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ha(n.pos,r.pos,this.mark)}merge(e){return e instanceof ha&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ha(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ha(n.from,n.to,e.markFromJSON(n.mark))}}Hn.jsonID("addMark",ha);class $s extends Hn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ce(q_(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return tn.fromReplace(e,this.from,this.to,r)}invert(){return new ha(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new $s(n.pos,r.pos,this.mark)}merge(e){return e instanceof $s&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new $s(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new $s(n.from,n.to,e.markFromJSON(n.mark))}}Hn.jsonID("removeMark",$s);class pa extends Hn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return tn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return tn.fromReplace(e,this.pos,this.pos+1,new ce(Q.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new pa(this.pos,n.marks[s]);return new pa(this.pos,this.mark)}}return new mc(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new pa(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new pa(n.pos,e.markFromJSON(n.mark))}}Hn.jsonID("addNodeMark",pa);class mc extends Hn{constructor(e,n){super(),this.pos=e,this.mark=n}
vendor: 4,718 bytes, line 520
520apply(e){let n=e.nodeAt(this.pos);if(!n)return tn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return tn.fromReplace(e,this.pos,this.pos+1,new ce(Q.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new pa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new mc(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new mc(n.pos,e.markFromJSON(n.mark))}}Hn.jsonID("removeNodeMark",mc);class Xt extends Hn{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&vC(e,this.from,this.to)?tn.fail("Structure replace would overwrite content"):tn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ir([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Xt.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Xt(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Xt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ce.empty:new ce(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ce.empty:new ce(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xt(n.from,n.to,ce.fromJSON(e,n.slice),!!n.structure)}}Xt.MAP_BIAS=1;Hn.jsonID("replace",Xt);class vn extends Hn{constructor(e,n,r,s,i,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=a}apply(e){if(this.structure&&(vC(e,this.from,this.gapFrom)||vC(e,this.gapTo,this.to)))return tn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return tn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?tn.fromReplace(e,this.from,this.to,r):tn.fail("Content does not fit in gap")}getMap(){return new Ir([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new vn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||i>r.pos?null:new vn(n.pos,r.pos,s,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new vn(n.from,n.to,n.gapFrom,n.gapTo,ce.fromJSON(e,n.slice),n.insert,!!n.structure)}}Hn.jsonID("replaceAround",vn);function vC(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function Ppe(t,e,n,r){let s=[],i=[],o,a;t.doc.nodesBetween(e,n,(l,u,d)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let h=Math.max(u,e),p=Math.min(u+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(o&&o.to==h&&o.mark.eq(f[g])?o.to=p:s.push(o=new $s(h,p,f[g])));a&&a.to==h?a.to=p:i.push(a=new ha(h,p,r))}}
vendor: 15,002 bytes, lines 520-521
520),s.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function Rpe(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;i++;let l=null;if(r instanceof Yb){let u=o.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;d<l.length;d++){let f=l[d],h;for(let p=0;p<s.length;p++){let m=s[p];m.step==i-1&&f.eq(s[p].style)&&(h=m)}h?(h.to=u,h.step=i):s.push({style:f,from:Math.max(a,e),to:u,step:i})}}}),s.forEach(o=>t.step(new $s(o.from,o.to,o.style)))}function K_(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<i.childCount;l++){let u=i.child(l),d=a+u.nodeSize,f=r.matchType(u.type);if(!f)o.push(new Xt(a,d,ce.empty));else{r=f;for(let h=0;h<u.marks.length;h++)n.allowsMarkType(u.marks[h].type)||t.step(new $s(a,d,u.marks[h]));if(s&&u.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(u.text);)m||(m=new ce(Q.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new Xt(a+h.index,a+h.index+h[0].length,m))}}a=d}if(!r.validEnd){let l=r.fillBefore(Q.empty,!0);t.replace(a,a,new ce(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function Mpe(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ef(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+s,l=t.$to.indexAfter(r)-i;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!Mpe(o,a,l))break;a&&(s=1),l<o.childCount&&(i=1)}return null}function Ope(t,e,n){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),a=s.after(i+1),l=o,u=a,d=Q.empty,f=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,d=Q.from(r.node(m).copy(d)),f++):l--;let h=Q.empty,p=0;for(let m=i,g=!1;m>n;m--)g||s.after(m+1)<s.end(m)?(g=!0,h=Q.from(s.node(m).copy(h)),p++):u++;t.step(new vn(l,u,o,a,new ce(d.append(h),f,p),d.size-f,!0))}function G_(t,e,n=null,r=t){let s=Dpe(t,e),i=s&&Ipe(r,e);return i?s.map(rO).concat({type:e,attrs:n}).concat(i.map(rO)):null}function rO(t){return{type:t,attrs:null}}function Dpe(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return n.canReplaceWith(r,s,o)?i:null}function Ipe(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<s;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function Lpe(t,e,n){let r=Q.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Q.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new vn(s,i,s,i,new ce(r,0,0),n.length,!0))}function Fpe(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,l)&&Bpe(t.doc,t.mapping.slice(i).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?u=!1:!p&&m&&(u=!0)}u===!1&&bU(t,o,a,i),K_(t,t.mapping.slice(i).map(a,1),r,void 0,u===null);let d=t.mapping.slice(i),f=d.map(a,1),h=d.map(a+o.nodeSize,1);return t.step(new vn(f,h,f+1,h-1,new ce(Q.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&xU(t,o,a,i),!1}})}function xU(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(s.text);){let l=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function bU(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(`
521`))}})}function Bpe(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function $pe(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new vn(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ce(Q.from(o),0,0),1,!0))}function ju(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let u=s.depth-1,d=n-2;u>i;u--,d--){let f=s.node(u),h=s.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let a=s.indexAfter(i),l=r&&r[0];return s.node(i).canReplaceWith(a,a,l?l.type:s.node(i+1).type)}function Vpe(t,e,n=1,r){let s=t.doc.resolve(e),i=Q.empty,o=Q.empty;for(let a=s.depth,l=s.depth-n,u=n-1;a>l;a--,u--){i=Q.from(s.node(a).copy(i));let d=r&&r[u];o=Q.from(d?d.type.create(d.attrs,o):s.node(a).copy(o))}t.step(new Xt(e,e,new ce(i.append(o),n,n),!0))}function nl(t,e){let n=t.resolve(e),r=n.index();return wU(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zpe(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s<e.childCount;s++){let i=e.child(s),o=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function wU(t,e){return!!(t&&e&&!t.isLeaf&&zpe(t,e))}function Qb(t,e,n=-1){let r=t.resolve(e);for(let s=r.depth;;s--){let i,o,a=r.index(s);if(s==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(s+1),a++,o=r.node(s).maybeChild(a)):(i=r.node(s).maybeChild(a-1),o=r.node(s+1)),i&&!i.isTextblock&&wU(i,o)&&r.node(s).canReplace(a,a+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function Upe(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let d=o.whitespace=="pre",f=!!o.contentMatch.matchType(s);d&&!f?r=!1:!d&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);bU(t,d.node(),d.before(),a)}o.inlineContent&&K_(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Xt(u,l.map(e+n,-1),ce.empty,!0)),r===!0){let d=t.doc.resolve(u);xU(t,d.node(),d.before(),t.steps.length)}return t}function Wpe(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i<r.node(s).childCount)return null}return null}function SU(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(i==1)d=u.canReplace(l,l,s);else{let f=u.contentMatchAt(l).findWrapping(s.firstChild.type);d=f&&u.canReplaceWith(l,l,f[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function Jb(t,e,n=e,r=ce.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return kU(s,i,r)?new Xt(e,n,r):new Hpe(s,i,r).fit()}function kU(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Hpe{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Q.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=Q.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,a=s.depth;for(;o&&a&&i.childCount==1;)i=i.firstChild.content,o--,a--;let l=new ce(i,o,a);return e>-1?new vn(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Xt(r.pos,s.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=Yw(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],d,f=null;if(n==1&&(o?u.matchType(o.type)||(f=u.fillBefore(Q.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:f};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:d};if(i&&u.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=Yw(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new ce(e,n+1,Math.max(r,s.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=Yw(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new ce(Wf(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ce(Wf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,u=0,d=[],{match:f,type:h}=this.frontier[n];if(s){for(let g=0;g<s.childCount;g++)d.push(s.child(g));f=f.matchFragment(s)}let p=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let g=a.child(u),y=f.matchType(g.type);if(!y)break;u++,(u>1||l==0||g.content.size)&&(f=y,d.push(CU(g.mark(h.allowedMarks(g.marks)),u==1?l:0,u==a.childCount?p:-1)))}let m=u==a.childCount;m||(p=-1),this.placed=Hf(this.placed,n,Q.from(d)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=m?e==0?ce.empty:new ce(Wf(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new ce(Wf(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Qw(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=Qw(e,n,s,r,i);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],d=Qw(e,a,u,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Hf(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Hf(this.placed,this.depth,Q.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Q.empty,!0);n.childCount&&(this.placed=Hf(this.placed,this.frontier.length,n))}}function Wf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Wf(t.firstChild.content,e-1,n)))}function Hf(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Hf(t.lastChild.content,e-1,n)))}function Yw(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function CU(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,CU(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Q.empty,!0)))),t.copy(r)}function Qw(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,o);return a&&!qpe(n,i.content,o)?a:null}function qpe(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Kpe(t){return t.spec.defining||t.spec.definingForContent}function Gpe(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(kU(s,i,r))return t.step(new Xt(e,n,r));let o=EU(s,i);o[o.length-1]==0&&o.pop();let a=-(s.depth+1);o.unshift(a);for(let h=s.depth,p=s.pos-1;h>0;h--,p--){let m=s.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(h)>-1?a=h:s.before(h)==p&&o.splice(1,0,-h)}let l=o.indexOf(a),u=[],d=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(u.push(m),p==r.openStart)break;h=m.content}for(let h=d-1;h>=0;h--){let p=u[h],m=Kpe(p.type);if(m&&!p.sameMarkup(s.node(Math.abs(a)-1)))d=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+d+1)%(r.openStart+1),m=u[p];if(m)for(let g=0;g<o.length;g++){let y=o[(g+l)%o.length],b=!0;y<0&&(b=!1,y=-y);let x=s.node(y-1),w=s.index(y-1);if(x.canReplaceWith(w,w,m.type,m.marks))return t.replace(s.before(y),b?i.after(y):n,new ce(NU(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=o.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=o[h];p<0||(e=s.before(p),n=i.after(p))}}function NU(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(NU(i.content,e+1,n,r,i)))}if(e>r){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(Q.empty,!0))}return t}function Ype(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=Wpe(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new ce(Q.from(r),0,0))}function Qpe(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;
vendor: 4,152 bytes, line 521
521l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=s.depth;l>o;l--)s.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=s.depth;l>0&&n==s.start(l);l--)n=s.before(l);r=t.doc.resolve(e),s=t.doc.resolve(n)}}let i=EU(r,s);for(let o=0;o<i.length;o++){let a=i[o],l=o==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),s.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),s.indexAfter(a-1))))return t.delete(r.before(a),s.after(a))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function EU(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(i<t.pos-(t.depth-s)||e.end(s)>e.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class Pu extends Hn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return tn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return tn.fromReplace(e,this.pos,this.pos+1,new ce(Q.from(s),0,n.isLeaf?0:1))}getMap(){return Ir.empty}invert(e){return new Pu(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Pu(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Pu(n.pos,n.attr,n.value)}}Hn.jsonID("attr",Pu);class bp extends Hn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return tn.ok(r)}getMap(){return Ir.empty}invert(e){return new bp(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new bp(n.attr,n.value)}}Hn.jsonID("docAttr",bp);let vd=class extends Error{};vd=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};vd.prototype=Object.create(Error.prototype);vd.prototype.constructor=vd;vd.prototype.name="TransformError";class _U{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new xp}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new vd(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(e=s.map(e,1),n=s.map(n,-1)),s.forEach((i,o,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ce.empty){let s=Jb(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new ce(Q.from(r),0,0))}delete(e,n){return this.replace(e,n,ce.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Gpe(this,e,n,r),this}replaceRangeWith(e,n,r){return Ype(this,e,n,r),this}deleteRange(e,n){return Qpe(this,e,n),this}lift(e,n){return Ope(this,e,n),this}join(e,n=1){return Upe(this,e,n),this}wrap(e,n){return Lpe(this,e,n),this}setBlockType(e,n=e,r,s=null){return Fpe(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return $pe(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new Pu(e,n,r)),this}setDocAttribute(e,n){return this.step(new bp(e,n)),this}addNodeMark(e,n){return this.step(new pa(e,n)),this}
vendor: 5,113 bytes, line 521
521removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof mt)n.isInSet(r.marks)&&this.step(new mc(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new mc(e,i)),s=i.removeFromSet(s);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return Vpe(this,e,n,r),this}addMark(e,n,r){return Ppe(this,e,n,r),this}removeMark(e,n,r){return Rpe(this,e,n,r),this}clearIncompatible(e,n,r){return K_(this,e,n,r),this}}const Jw=Object.create(null);class Ue{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Jpe(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ce.empty){let r=n.content.lastChild,s=null;for(let a=0;a<n.openEnd;a++)s=r,r=r.lastChild;let i=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],d=e.mapping.slice(i);e.replaceRange(d.map(l.pos),d.map(u.pos),a?ce.empty:n),a==0&&oO(e,i,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:o,$to:a}=s[i],l=e.mapping.slice(r),u=l.map(o.pos),d=l.map(a.pos);i?e.deleteRange(u,d):(e.replaceRangeWith(u,d,n),oO(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new Oe(e):Xc(e.node(0),e.parent,e.pos,e.index(),n,r);if(s)return s;for(let i=e.depth-1;i>=0;i--){let o=n<0?Xc(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Xc(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new us(e.node(0))}static atStart(e){return Xc(e,e,0,0,1)||new us(e)}static atEnd(e){return Xc(e,e,e.content.size,e.childCount,-1)||new us(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Jw[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Jw)throw new RangeError("Duplicate use of selection JSON ID "+e);return Jw[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Oe.between(this.$anchor,this.$head).getBookmark()}}Ue.prototype.visible=!0;class Jpe{constructor(e,n){this.$from=e,this.$to=n}}let sO=!1;function iO(t){!sO&&!t.parent.inlineContent&&(sO=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Oe extends Ue{constructor(e,n=e){iO(e),iO(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ue.near(r);let s=e.resolve(n.map(this.anchor));return new Oe(s.parent.inlineContent?s:r,r)}replace(e,n=ce.empty){if(super.replace(e,n),n==ce.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Oe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Oe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=Ue.findFrom(n,r,!0)||Ue.findFrom(n,-r,!0);if(i)n=i.$head;else return Ue.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(Ue.findFrom(e,-r,!0)||Ue.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new Oe(e,n)}}Ue.jsonID("text",Oe);class Xb{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Xb(e.map(this.anchor),e.map(this.head))}resolve(e){return Oe.between(e.resolve(this.anchor),e.resolve(this.head))}}class _e extends Ue{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),i=e.resolve(s);return r?Ue.near(i):new _e(i)}content(){return new ce(Q.from(this.node),0,0)}eq(e){return e instanceof _e&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Y_(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new _e(e.resolve(n.anchor))}static create(e,n){return new _e(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}_e.prototype.visible=!1;Ue.jsonID("node",_e);class Y_{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Xb(r,r):new Y_(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&_e.isSelectable(r)?new _e(n):Ue.near(n)}}class us extends Ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}
vendor: 4,248 bytes, line 521
521replace(e,n=ce.empty){if(n==ce.empty){e.delete(0,e.doc.content.size);let r=Ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new us(e)}map(e){return new us(e)}eq(e){return e instanceof us}getBookmark(){return Xpe}}Ue.jsonID("all",us);const Xpe={map(){return this},resolve(t){return new us(t)}};function Xc(t,e,n,r,s,i=!1){if(e.inlineContent)return Oe.create(t,n);for(let o=r-(s>0?0:1);s>0?o<e.childCount:o>=0;o+=s){let a=e.child(o);if(a.isAtom){if(!i&&_e.isSelectable(a))return _e.create(t,n-(s<0?a.nodeSize:0))}else{let l=Xc(t,a,n+s,s<0?a.childCount:0,s,i);if(l)return l}n+=a.nodeSize*s}return null}function oO(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof Xt||s instanceof vn))return;let i=t.mapping.maps[r],o;i.forEach((a,l,u,d)=>{o==null&&(o=d)}),t.setSelection(Ue.near(t.doc.resolve(o),n))}const aO=1,pg=2,lO=4;class Zpe extends _U{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|aO)&~pg,this.storedMarks=null,this}get selectionSet(){return(this.updated&aO)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=pg,this}ensureMarks(e){return mt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&pg)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~pg,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||mt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(Ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=lO,this}get scrolledIntoView(){return(this.updated&lO)>0}}function cO(t,e){return!e||!t?t:t.bind(e)}class qf{constructor(e,n,r){this.name=e,this.init=cO(n.init,r),this.apply=cO(n.apply,r)}}const eme=[new qf("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new qf("selection",{init(t,e){return t.selection||Ue.atStart(e.doc)},apply(t){return t.selection}}),new qf("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new qf("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Xw{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eme.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new qf(r.key,r.spec.state,r))})}}class yu{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
vendor: 14,135 bytes, lines 521-522
521apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),s=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=s?s[o].n:0,u=s?s[o].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!s){s=[];for(let f=0;f<this.config.plugins.length;f++)s.push(f<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),i=!0}s&&(s[o]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new yu(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let i=r[s];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new Zpe(this)}static create(e){let n=new Xw(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new yu(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(e,r);return r}reconfigure(e){let n=new Xw(this.schema,e.plugins),r=n.fields,s=new yu(n);for(let i=0;i<r.length;i++){let o=r[i].name;s[o]=this.hasOwnProperty(o)?this[o]:r[i].init(e,s)}return s}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new Xw(e.schema,e.plugins),i=new yu(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Ta.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=Ue.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[o.name]=u.fromJSON.call(l,e,n[a],i);return}}i[o.name]=o.init(e,i)}}),i}}function TU(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=TU(s,e,{})),n[r]=s}return n}class Lt{constructor(e){this.spec=e,this.props={},e.props&&TU(e.props,this,this.props),this.key=e.key?e.key.key:AU("plugin")}getState(e){return e[this.key]}}const Zw=Object.create(null);function AU(t){return t in Zw?t+"$"+ ++Zw[t]:(Zw[t]=0,t+"$")}class dn{constructor(e="key"){this.key=AU(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const tme=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function jU(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const nme=(t,e,n)=>{let r=jU(t,n);if(!r)return!1;let s=Q_(r);if(!s){let o=r.blockRange(),a=o&&ef(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let i=s.nodeBefore;if(OU(t,s,e,-1))return!0;if(r.parent.content.size==0&&(xd(i,"end")||_e.isSelectable(i)))for(let o=r.depth;;o--){let a=Jb(t.doc,r.before(o),r.after(o),ce.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(xd(i,"end")?Ue.findFrom(l.doc.resolve(l.mapping.map(s.pos,-1)),-1):_e.create(l.doc,s.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},rme=(t,e,n)=>{let r=jU(t,n);if(!r)return!1;let s=Q_(r);return s?PU(t,s,e):!1},sme=(t,e,n)=>{let r=RU(t,n);if(!r)return!1;let s=J_(r);return s?PU(t,s,e):!1};function PU(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let d=s.lastChild;if(!d)return!1;s=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=Jb(t.doc,i,l,ce.empty);if(!u||u.from!=i||u instanceof Xt&&u.slice.size>=l-i)return!1;if(n){let d=t.tr.step(u);d.setSelection(Oe.create(d.doc,i)),n(d.scrollIntoView())}return!0}function xd(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const ime=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Q_(r)}let o=i&&i.nodeBefore;return!o||!_e.isSelectable(o)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function Q_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function RU(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const ome=(t,e,n)=>{let r=RU(t,n);if(!r)return!1;let s=J_(r);if(!s)return!1;let i=s.nodeAfter;if(OU(t,s,e,1))return!0;if(r.parent.content.size==0&&(xd(i,"start")||_e.isSelectable(i))){let o=Jb(t.doc,r.before(),r.after(),ce.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(xd(i,"start")?Ue.findFrom(a.doc.resolve(a.mapping.map(s.pos)),1):_e.create(a.doc,a.mapping.map(s.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),!0):!1},ame=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=J_(r)}let o=i&&i.nodeAfter;return!o||!_e.isSelectable(o)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,i.pos)).scrollIntoView()),!0)};function J_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const lme=(t,e)=>{let n=t.selection,r=n instanceof _e,s;if(r){if(n.node.isTextblock||!nl(t.doc,n.from))return!1;s=n.from}else if(s=Qb(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(_e.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},cme=(t,e)=>{let n=t.selection,r;if(n instanceof _e){if(n.node.isTextblock||!nl(t.doc,n.to))return!1;r=n.to}else if(r=Qb(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},ume=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&ef(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},dme=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
522`).scrollIntoView()),!0)};function MU(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const fme=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=MU(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(Ue.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},hme=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof us||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=MU(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,a=t.tr.insert(o,i.createAndFill());a.setSelection(Oe.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},pme=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(ju(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&ef(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)},mme=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(_e.create(t.doc,s))),!0)};function gme(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||nl(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function OU(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,a,l=s.type.spec.isolating||i.type.spec.isolating;if(!l&&gme(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let p=e.pos+i.nodeSize,m=Q.empty;for(let b=o.length-1;b>=0;b--)m=Q.from(o[b].create(null,m));m=Q.from(s.copy(m));let g=t.tr.step(new vn(e.pos-1,p,e.pos,p,new ce(m,1,0),o.length,!0)),y=g.doc.resolve(p+2*o.length);y.nodeAfter&&y.nodeAfter.type==s.type&&nl(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&l?null:Ue.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),h=f&&ef(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(u&&xd(i,"start",!0)&&xd(s,"end")){let p=s,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=i,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=Q.empty;for(let w=m.length-1;w>=0;w--)b=Q.from(m[w].copy(b));let x=t.tr.step(new vn(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new ce(b,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function DU(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(Oe.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const yme=DU(-1),vme=DU(1);function xme(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),a=o&&G_(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function uO(t,e=null){return function(n,r){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(o,a,(l,u)=>{if(s)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)s=!0;else{let d=n.doc.resolve(u),f=d.index();s=d.parent.canReplaceWith(f,f+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function bme(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i);if(!o)return!1;let a=r?n.tr:null;return wme(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function wme(t,e,n,r=null){let s=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);i=new Av(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Av(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let a=G_(i,n,r,e);return a?(t&&Sme(t,e,a,s,n),!0):!1}function Sme(t,e,n,r,s){let i=Q.empty;for(let d=n.length-1;d>=0;d--)i=Q.from(n[d].type.create(n[d].attrs,i));t.step(new vn(e.start-(r?2:0),e.end,e.start,e.end,new ce(i,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==s&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),u=e.parent;for(let d=e.startIndex,f=e.endIndex,h=!0;d<f;d++,h=!1)!h&&ju(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(d).nodeSize;return t}function kme(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,o=>o.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?Cme(e,n,t,i):Nme(e,n,i):!0:!1}}function Cme(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new vn(i-1,o,i,o,new ce(Q.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Av(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const a=ef(r);if(a==null)return!1;s.lift(r,a);let l=s.doc.resolve(s.mapping.map(i,-1)-1);return nl(s.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&s.join(l.pos),e(s.scrollIntoView()),!0}function Nme(t,e,n){let r=t.tr,s=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=s.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==s.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(l?Q.empty:Q.from(s))))return!1;let f=i.pos,h=f+o.nodeSize;return r.step(new vn(f-(a?1:0),h+(l?1:0),f+1,h-1,new ce((a?Q.empty:Q.from(s.copy(Q.empty))).append(l?Q.empty:Q.from(s.copy(Q.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Eme(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,u=>u.childCount>0&&u.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let a=i.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,d=Q.from(u?t.create():null),f=new ce(Q.from(t.create(null,Q.from(a.type.create(null,d)))),u?3:1,0),h=i.start,p=i.end;n(e.tr.step(new vn(h-(u?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}const Tn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},bd=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let xC=null;const no=function(t,e,n){let r=xC||(xC=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},_me=function(){xC=null},gc=function(t,e,n,r){return n&&(dO(t,e,n,r,-1)||dO(t,e,n,r,1))},Tme=/^(img|br|input|textarea|hr)$/i;function dO(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;
vendor: 6,632 bytes, line 522
522if(e==(s<0?0:rs(t))){let o=t.parentNode;if(!o||o.nodeType!=1||dm(t)||Tme.test(t.nodeName)||t.contentEditable=="false")return!1;e=Tn(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?rs(t):0}else return!1}}function rs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ame(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=rs(t)}else if(t.parentNode&&!dm(t))e=Tn(t),t=t.parentNode;else return null}}function jme(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!dm(t))e=Tn(t)+1,t=t.parentNode;else return null}}function Pme(t,e,n){for(let r=e==0,s=e==rs(t);r||s;){if(t==n)return!0;let i=Tn(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==rs(t)}}function dm(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Zb=function(t){return t.focusNode&&gc(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function xl(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Rme(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Mme(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(rs(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(rs(r.startContainer),r.startOffset)}}}const Oi=typeof navigator<"u"?navigator:null,fO=typeof document<"u"?document:null,rl=Oi&&Oi.userAgent||"",bC=/Edge\/(\d+)/.exec(rl),IU=/MSIE \d/.exec(rl),wC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rl),Tr=!!(IU||wC||bC),Aa=IU?document.documentMode:wC?+wC[1]:bC?+bC[1]:0,ds=!Tr&&/gecko\/(\d+)/i.test(rl);ds&&+(/Firefox\/(\d+)/.exec(rl)||[0,0])[1];const SC=!Tr&&/Chrome\/(\d+)/.exec(rl),Pn=!!SC,LU=SC?+SC[1]:0,Wn=!Tr&&!!Oi&&/Apple Computer/.test(Oi.vendor),wd=Wn&&(/Mobile\/\w+/.test(rl)||!!Oi&&Oi.maxTouchPoints>2),es=wd||(Oi?/Mac/.test(Oi.platform):!1),FU=Oi?/Win/.test(Oi.platform):!1,lo=/Android \d/.test(rl),fm=!!fO&&"webkitFontSmoothing"in fO.documentElement.style,Ome=fm?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Dme(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ki(t,e){return typeof t=="number"?t:t[e]}function Ime(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function hO(t,e,n){let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=bd(o);continue}let a=o,l=a==i.body,u=l?Dme(i):Ime(a),d=0,f=0;if(e.top<u.top+Ki(r,"top")?f=-(u.top-e.top+Ki(s,"top")):e.bottom>u.bottom-Ki(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+Ki(s,"top")-u.top:e.bottom-u.bottom+Ki(s,"bottom")),e.left<u.left+Ki(r,"left")?d=-(u.left-e.left+Ki(s,"left")):e.right>u.right-Ki(r,"right")&&(d=e.right-u.right+Ki(s,"right")),d||f)if(l)i.defaultView.scrollBy(d,f);else{let p=a.scrollLeft,m=a.scrollTop;f&&(a.scrollTop+=f),d&&(a.scrollLeft+=d);let g=a.scrollLeft-p,y=a.scrollTop-m;e={left:e.left-g,top:e.top-y,right:e.right-g,bottom:e.bottom-y}}let h=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:bd(o)}}function Lme(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(i,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,s=l.top;break}}return{refDOM:r,refTop:s,stack:BU(t.dom)}}function BU(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=bd(r));return e}function Fme({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;$U(n,r==0?0:r-e)}function $U(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:s,left:i}=t[n];r.scrollTop!=s+e&&(r.scrollTop=s+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let zc=null;function Bme(t){if(t.setActive)return t.setActive();if(zc)return t.focus(zc);let e=BU(t);t.focus(zc==null?{get preventScroll(){return zc={preventScroll:!0},!0}}:void 0),zc||(zc=!1,$U(e,0))}function VU(t,e){let n,r=2e8,s,i=0,o=e.top,a=e.top,l,u;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let h;if(d.nodeType==1)h=d.getClientRects();else if(d.nodeType==3)h=no(d).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=o&&m.bottom>=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=d,r=g,s=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,d.nodeType==1&&g&&(i=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=d,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=f+1)}}return!n&&l&&(n=l,s=u,r=0),n&&n.nodeType==3?$me(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:VU(n,s)}function $me(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=Fo(r,1);if(o.top!=o.bottom&&X_(e,o)){s={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function X_(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Vme(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function zme(t,e,n){let{node:r,offset:s}=VU(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();i=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function Ume(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>
vendor: 10,484 bytes, lines 522-523
522r.top?s=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(s=a.posAfter),o=!0),!a.contentDOM&&s<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,n,-1)}function zU(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let o=t.childNodes[i];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(X_(e,u))return zU(o,e,u)}}if((i=(i+1)%r)==s)break}return t}function Wme(t,e){let n=t.dom.ownerDocument,r,s=0,i=Mme(n,e.left,e.top);i&&({node:r,offset:s}=i);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!X_(e,u)||(o=zU(t.dom,e,u),!o))return null}if(Wn)for(let u=o;r&&u;u=bd(u))u.draggable&&(r=void 0);if(o=Vme(o,e),r){if(ds&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let d=r.childNodes[s],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&s++}let u;fm&&s&&r.nodeType==1&&(u=r.childNodes[s-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(a=Ume(t,r,s,e))}a==null&&(a=zme(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function pO(t){return t.top<t.bottom||t.left<t.right}function Fo(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(pO(r))return r}return Array.prototype.find.call(n,pO)||t.getBoundingClientRect()}const Hme=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function UU(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=fm||ds;if(r.nodeType==3)if(o&&(Hme.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let l=Fo(no(r,s,s),n);if(ds&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let u=Fo(no(r,s-1,s-1),-1);if(u.top==l.top){let d=Fo(no(r,s,s+1),-1);if(d.top!=l.top)return Nf(d,d.left<u.left)}}return l}else{let l=s,u=s,d=n<0?1:-1;return n<0&&!s?(u++,d=-1):n>=0&&s==r.nodeValue.length?(l--,d=1):n<0?l--:u++,Nf(Fo(no(r,l,u),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==rs(r))){let l=r.childNodes[s-1];if(l.nodeType==1)return e1(l.getBoundingClientRect(),!1)}if(i==null&&s<rs(r)){let l=r.childNodes[s];if(l.nodeType==1)return e1(l.getBoundingClientRect(),!0)}return e1(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==rs(r))){let l=r.childNodes[s-1],u=l.nodeType==3?no(l,rs(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Nf(Fo(u,1),!1)}if(i==null&&s<rs(r)){let l=r.childNodes[s];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?no(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return Nf(Fo(u,-1),!0)}return Nf(Fo(r.nodeType==3?no(r):r,-n),n>=0)}function Nf(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function e1(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function WU(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function qme(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return WU(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let o=UU(t,s.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=no(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let d=l[u];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const Kme=/[\u0590-\u08ac]/;function Gme(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,a=t.domSelection();return a?!Kme.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:o:WU(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&u==g;try{a.collapse(d,f),l&&(l!=d||u!=f)&&a.extend&&a.extend(l,u)}catch{}return h!=null&&(a.caretBidiLevel=h),y}):r.pos==r.start()||r.pos==r.end()}let mO=null,gO=null,yO=!1;function Yme(t,e,n){return mO==e&&gO==n?yO:(mO=e,gO=n,yO=n=="up"||n=="down"?qme(t,e,n):Gme(t,e,n))}const fs=0,vO=1,_l=2,Di=3;class hm{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=fs,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].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 n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==e)return r;r+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,o;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=n>Tn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],i=r+s.size;if(r==e&&i!=r){for(;!s.border&&s.children.length;)for(let o=0;o<s.children.length;o++){let a=s.children[o];if(a.size){s=a;break}}return s}if(e<i)return s.descAt(e-r-s.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,s=0;for(let i=0;r<this.children.length;r++){let o=this.children[r],a=i+o.size;if(a>e||o instanceof qU){s=e-i;break}i=a}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof HU&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Tn(i.dom)+1:0}}else{let i,o=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Tn(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let o=r,a=0;;a++){let l=this.children[a],u=o+l.size;if(s==-1&&e<=u){let d=o+l.border;if(e>=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let f=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){s=Tn(h.dom)+1;break}e-=h.size}s==-1&&(s=0)}if(s>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=Tn(f.dom);break}n+=f.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:s,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,s=!1){let i=Math.min(e,n),o=Math.max(e,n);for(let p=0,m=0;p<this.children.length;p++){let g=this.children[p],y=m+g.size;if(i>m&&o<y)return g.setSelection(e-m-g.border,n-m-g.border,r,s);m=y}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),d=r.domSelectionRange(),f=!1;if((ds||Wn)&&e==n){let{node:p,offset:m}=a;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
523`),f&&m==p.nodeValue.length)for(let g=p,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:Tn(y)+1});break}let b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(ds&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(s=!0)}if(!(s||f&&Wn)&&gc(a.node,a.offset,d.anchorNode,d.anchorOffset)&&gc(l.n
vendor: 4,116 bytes, line 523
523ode,l.offset,d.focusNode,d.focusOffset))return;let h=!1;if((u.extend||e==n)&&!(f&&ds)){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let m=a;a=l,l=m}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,s=0;s<this.children.length;s++){let i=this.children[s],o=r+i.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+i.border,l=o-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?_l:vO,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Di:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?_l:Di}r=o}this.dirty=_l}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?_l:vO;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class HU extends hm{constructor(e,n,r,s){let i,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==fs&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Qme extends hm{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class yc extends hm{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=Ec.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new yc(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Di||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Di&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=fs){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=fs}}slice(e,n,r){let s=yc.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=CC(i,n,o,r)),e>0&&(i=CC(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=s;return s.children=i,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ja extends hm{constructor(e,n,r,s,i,o,a,l,u){super(e,[],i,o),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=a}static create(e,n,r,s,i,o){let a=i.nodeViews[n.type.name],l,u=a&&a(n,i,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,s),d=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=Ec.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let h=d;return d=YU(d,r,n),u?l=new Jme(e,n,r,s,d,f||null,h,u,i,o+1):n.isText?new e0(e,n,r,s,d,h,i):new ja(e,n,r,s,d,f||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
vendor: 5,113 bytes, line 523
523let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Q.empty)}return e}matchesNode(e,n,r){return this.dirty==fs&&e.eq(this.node)&&Pv(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new Zme(this,o&&o.node,e);nge(this.node,this.innerDeco,(u,d,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e,d):u.type.side>=0&&!f&&l.syncToMarks(d==this.node.childCount?mt.none:this.node.child(d).marks,r,e,d),l.placeWidget(u,e,s)},(u,d,f,h)=>{l.syncToMarks(u.marks,r,e,h);let p;l.findNodeMatch(u,d,f,h)||a&&e.state.selection.from>s&&e.state.selection.to<s+u.nodeSize&&(p=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(u,d,f,p,e)||l.updateNextNode(u,d,f,e,h,s)||l.addNode(u,d,f,e,s),s+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==_l)&&(o&&this.protectLocalComposition(e,o),KU(this.contentDOM,this.children,e),wd&&rge(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Oe)||r<n||s>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,a=sge(this.node.content,o,r-n,s-n);return a<0?null:{node:i,pos:a,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Qme(this,i,n,s);e.input.compositionNodes.push(o),this.children=CC(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==Di||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=fs}updateOuterDeco(e){if(Pv(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=GU(this.dom,this.nodeDOM,kC(this.outerDeco,this.node,n),kC(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function xO(t,e,n,r,s){YU(r,e,t);let i=new ja(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class e0 extends ja{constructor(e,n,r,s,i,o,a){super(e,n,r,s,i,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==Di||this.dirty!=fs&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=fs||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=fs,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new e0(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Di)}get domAtom(){return!1}isText(e){return this.node.text==e}}class qU extends hm{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==fs&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Jme extends ja{constructor(e,n,r,s,i,o,a,l,u,d){super(e,n,r,s,i,o,a,u,d),this.spec=l}update(e,n,r,s){if(this.dirty==Di)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}
vendor: 7,890 bytes, line 523
523setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function KU(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i<e.length;i++){let o=e[i],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=bO(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(a,r);if(o instanceof yc){let l=r?r.previousSibling:t.lastChild;KU(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=bO(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const vh=function(t){t&&(this.nodeName=t)};vh.prototype=Object.create(null);const Tl=[new vh];function kC(t,e,n){if(t.length==0)return Tl;let r=n?Tl[0]:new vh,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new vh(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&s.length==1&&s.push(r=new vh(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return s}function GU(t,e,n,r){if(n==Tl&&r==Tl)return e;let s=e;for(let i=0;i<r.length;i++){let o=r[i],a=n[i];if(i){let l;a&&a.nodeName==o.nodeName&&s!=t&&(l=s.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(s),a=Tl[0]),s=l}Xme(s,a||Tl[0],o)}return s}function Xme(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)s.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<s.length;i++)r.indexOf(s[i])==-1&&t.classList.add(s[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(e.style);)t.style.removeProperty(s[1])}n.style&&(t.style.cssText+=n.style)}}function YU(t,e,n){return GU(t,t,Tl,kC(e,n,t.nodeType!=1))}function Pv(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function bO(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Zme{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=ege(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,s){let i=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=fs,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;s<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let d=this.index;d<u;d++){let f=this.top.children[d];if(f.matchesMark(e[o])&&!this.isLocked(f.dom)){l=d;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=yc.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,s,i){let o=this.top.children[s];return o.dirty==Di&&o.dom==o.contentDOM&&(o.dirty=_l),o.update(e,n,r,i)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}e=n}}updateNextNode(e,n,r,s,i,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ja){let u=this.preMatch.matched.get(l);if(u!=null&&u!=i)return!1;let d=l.dom,f,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Di&&Pv(n,l.outerDeco));if(!h&&l.update(e,n,r,s))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(l,e,n,r,s,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=_l,f.updateChildren(s,o+1),f.dirty=fs),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,s,i,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Pv(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let a=ja.create(this.top,n,r,s,i,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,s,i){let o=ja.create(this.top,e,n,r,s,i);o.contentDOM&&o.updateChildren(s,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let i=new HU(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof yc;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof e0)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Wn||Pn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new qU(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function ege(t,e){let n=e,r=n.children.length,s=t.childCount,i=new Map,o=[];e:for(;s>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof yc)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(s-1))break;--s,i.set(a,s),o.push(a)}}return{index:s,matched:i,matches:o.reverse()}}function tge(t,e){return t.type.side-e.type.side}function nge(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);r(d,s,e.forChild(i,d),u),i+=d.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let d,f;for(;o<s.length&&s[o].to==i;){let y=s[o++];y.widget&&(d?(f||(f=[d])).push(y):d=y)}if(d)if(f){f.sort(tge);for(let y=0;y<f.length;y++)n(f[y],u,!!l)}else n(d,u,!!l);let h,p;if(l)p=-1,h=l,l=null;else if(u<t.childCount)p=u,h=t.child(u++);else break;for(let y=0;y<a.length;y++)a[y].to<=i&&a.splice(y--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)a.push(s[o++]);let m=i+h.nodeSize;if(h.isText){let y=m;o<s.length&&s[o].from<y&&(y=s[o].from);for(let b=0;b<a.length;b++)a[b].to<y&&(y=a[b].to);y<m&&(l=h.cut(y-i),h=h.cut(0,y-i),m=y,p=-1)}else for(;o<s.length&&s[o].to<m;)o++;let g=h.isInline&&!h.isLeaf?a.filter(y=>!y.inline):a.slice();r(h,g,e.forChild(i,h),p),i=m}}
vendor: 8,920 bytes, line 523
523function rge(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function sge(t,e,n,r){for(let s=0,i=0;s<t.childCount&&i<=r;){let o=t.child(s++),a=i;if(i+=o.nodeSize,!o.isText)continue;let l=o.text;for(;s<t.childCount;){let u=t.child(s++);if(i+=u.nodeSize,!u.isText)break;l+=u.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function CC(t,e,n,r,s){let i=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],u=a,d=a+=l.size;u>=n||d<=e?i.push(l):(u<e&&i.push(l.slice(0,e-u,r)),s&&(i.push(s),s=void 0),d>n&&i.push(l.slice(n-u,l.size,r)))}return i}function Z_(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(Zb(n)){for(l=o;s&&!s.node;)s=s.parent;let f=s.node;if(s&&f.isAtom&&_e.isSelectable(f)&&s.parent&&!(f.isInline&&Pme(n.focusNode,n.focusOffset,s.dom))){let h=s.posBefore;u=new _e(o==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=o,h=o;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[l,o]=h==t.state.selection.anchor?[h,f]:[f,h],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!u){let f=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;u=eT(t,d,a,f)}return u}function QU(t){return t.editable?t.hasFocus():XU(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function uo(t,e=!1){let n=t.state.selection;if(JU(t,n),!!QU(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Pn){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&gc(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)oge(t);else{let{anchor:r,head:s}=n,i,o;wO&&!(n instanceof Oe)&&(n.$from.parent.inlineContent||(i=SO(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=SO(t,n.to))),t.docView.setSelection(r,s,t,e),wO&&(i&&kO(i),o&&kO(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ige(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const wO=Wn||Pn&&LU<63;function SO(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Wn&&s&&s.contentEditable=="false")return t1(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return t1(s);if(i)return t1(i)}}function t1(t){return t.contentEditable="true",Wn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function kO(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function ige(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!QU(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function oge(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Tn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Tr&&Aa<=11&&(n.disabled=!0,n.disabled=!1)}function JU(t,e){if(e instanceof _e){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(CO(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else CO(t)}function CO(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function eT(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||Oe.between(e,n,r)}function NO(t){return t.editable&&!t.hasFocus()?!1:XU(t)}function XU(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function age(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return gc(e.node,e.offset,n.anchorNode,n.anchorOffset)}function NC(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&Ue.findFrom(i,e)}function zo(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function EO(t,e,n){let r=t.state.selection;if(r instanceof Oe)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return zo(t,new Oe(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=NC(t.state,e);return s&&s instanceof _e?zo(t,s):!1}else if(!(es&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let a=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?_e.isSelectable(i)?zo(t,new _e(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):fm?zo(t,new Oe(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof _e&&r.node.isInline)return zo(t,new Oe(e>0?r.$to:r.$from));{let s=NC(t.state,e);return s?zo(t,s):!1}}}function Rv(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xh(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Uc(t,e){return e<0?lge(t):cge(t)}function lge(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(ds&&n.nodeType==1&&r<Rv(n)&&xh(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(xh(a,-1))s=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(ZU(n))break;{let a=n.previousSibling;for(;a&&xh(a,-1);)s=n.parentNode,i=Tn(a),a=a.previousSibling;if(a)n=a,r=Rv(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?EC(t,n,r):s&&EC(t,s,i)}function cge(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=Rv(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let a=n.childNodes[r];if(xh(a,1))i=n,o=++r;else break}else{if(ZU(n))break;{let a=n.nextSibling;for(;a&&xh(a,1);)i=a.parentNode,o=Tn(a)+1,a=a.nextSibling;if(a)n=a,r=0,s=Rv(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&EC(t,i,o)}function ZU(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function uge(t,e){for(;t&&e==t.childNodes.length&&!dm(t);)e=Tn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function dge(t,e){for(;t&&!e&&!dm(t);)e=Tn(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function EC(t,e,n){if(e.nodeType!=3){let i,o;(o=uge(e,n))?(e=o,n=0):(i=dge(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Zb(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&uo(t)},50)}function _O(t,e){let n=t.state.doc.resolve(e);if(!(Pn||FU)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function TO(t,e,n){let r=t.state.selection;if(r instanceof Oe&&!r.empty||n.indexOf("s")>-1||es&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=NC(t.state,e);if(o&&o instanceof _e)return zo(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,a=r instanceof us?Ue.near(o,e):Ue.findFrom(o,e);return a?zo(t,a):!1}return!1}function AO(t,e){if(!(t.state.selection instanceof Oe))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;
vendor: 4,429 bytes, lines 523-526
523if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function jO(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function fge(t){if(!Wn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;jO(t,r,"true"),setTimeout(()=>jO(t,r,"false"),20)}return!1}function hge(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function pge(t,e){let n=e.keyCode,r=hge(e);if(n==8||es&&n==72&&r=="c")return AO(t,-1)||Uc(t,-1);if(n==46&&!e.shiftKey||es&&n==68&&r=="c")return AO(t,1)||Uc(t,1);if(n==13||n==27)return!0;if(n==37||es&&n==66&&r=="c"){let s=n==37?_O(t,t.state.selection.from)=="ltr"?-1:1:-1;return EO(t,s,r)||Uc(t,s)}else if(n==39||es&&n==70&&r=="c"){let s=n==39?_O(t,t.state.selection.from)=="ltr"?1:-1:1;return EO(t,s,r)||Uc(t,s)}else{if(n==38||es&&n==80&&r=="c")return TO(t,-1,r)||Uc(t,-1);if(n==40||es&&n==78&&r=="c")return fge(t)||TO(t,1,r)||Uc(t,1);if(r==(es?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function tT(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||Ec.fromSchema(t.state.schema),a=i6(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,f=0;for(;u&&u.nodeType==1&&(d=s6[u.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let m=a.createElement(d[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${s} ${i}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
524
525`);return{dom:l,text:h,slice:e}}function e6(t,e,n,r,s){let i=s.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,i||r,t)}),i)return a=new ce(Q.from(t.state.schema.text(e.replace(/\r\n?/g,`
526`))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",h=>h(e,s,r,t));if(f)a=f;else{let h=s.marks(),{schema:p}=t.state,m=Ec.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=o.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),o=vge(n),fm&&xge(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 f=+d[3];f>0;f--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||gh.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:s,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!mge.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)a=bge(PO(a,+d[1],+d[2]),d[4]);else if(a=ce.maxOpen(gge(a.content,s),!0),a.openStart||a.openEnd){let f=0,h=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=PO(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t,l)}),a}const mge=/^(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 gge(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(a=>{if(!o)return;let l=s.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&i.length&&n6(l,i,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=r6(o[o.length-1],i.length));let d=t6(a,l);o.push(d),s=s.matchType(d.type),i=l}}),o)return Q.from(o)}return t}function t6(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Q.from(t));return t}function n6(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=n6(t,e,n,r.last
vendor: 5,170 bytes, line 526
526Child,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==t.length-1?n.type:t[s+1]))return r.copy(r.content.append(Q.from(t6(n,t,s+1))))}}function r6(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,r6(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Q.empty,!0);return t.copy(n.append(r))}function _C(t,e,n,r,s,i){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(i=0),s<r-1&&(a=_C(a,e,n,r,s+1,i)),s>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,i<=s).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(Q.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function PO(t,e,n){return e<t.openStart&&(t=new ce(_C(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ce(_C(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const s6={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let RO=null;function i6(){return RO||(RO=document.implementation.createHTMLDocument("title"))}let n1=null;function yge(t){let e=window.trustedTypes;return e?(n1||(n1=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),n1.createHTML(t)):t}function vge(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=i6().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&s6[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=yge(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function xge(t){let e=t.querySelectorAll(Pn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function bge(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:s,openStart:i,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;s=Q.from(l.create(r[a+1],s)),i++,o++}return new ce(s,i,o)}const ar={},lr={},wge={touchstart:!0,touchmove:!0};class Sge{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 kge(t){for(let e in ar){let n=ar[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Nge(t,r)&&!nT(t,r)&&(t.editable||!(r.type in lr))&&n(t,r)},wge[e]?{passive:!0}:void 0)}Wn&&t.dom.addEventListener("input",()=>null),TC(t)}function ma(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Cge(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function TC(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>nT(t,r))})}function nT(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Nge(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Ege(t,e){!nT(t,e)&&ar[e.type]&&(t.editable||!(e.type in lr))&&ar[e.type](t,e)}lr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!a6(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(lo&&Pn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),wd&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,xl(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||pge(t,n)?n.preventDefault():ma(t,"key")};lr.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};lr.keypress=(t,e)=>{let n=e;if(a6(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||es&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Oe)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function t0(t){return{left:t.clientX,top:t.clientY}}function _ge(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}
vendor: 6,835 bytes, line 526
526function rT(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,a=>o>i.depth?a(t,n,i.nodeAfter,i.before(o),s,!0):a(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function Ru(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Tge(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&_e.isSelectable(r)?(Ru(t,new _e(n)),!0):!1}function Age(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof _e&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o);if(_e.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(Ru(t,_e.create(t.state.doc,s)),!0):!1}function jge(t,e,n,r,s){return rT(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?Age(t,n):Tge(t,n))}function Pge(t,e,n,r){return rT(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function Rge(t,e,n,r){return rT(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||Mge(t,n,r)}function Mge(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ru(t,Oe.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),a=s.before(i);if(o.inlineContent)Ru(t,Oe.create(r,a+1,a+1+o.content.size));else if(_e.isSelectable(o))Ru(t,_e.create(r,a));else continue;return!0}}function sT(t){return Mv(t)}const o6=es?"metaKey":"ctrlKey";ar.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=sT(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&_ge(n,t.input.lastClick)&&!n[o6]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button};let o=t.posAtCoords(t0(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Oge(t,o,n,!!r)):(i=="doubleClick"?Pge:Rge)(t,o.pos,o.inside,n)?n.preventDefault():ma(t,"pointer"))};class Oge{constructor(e,n,r,s){this.view=e,this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[o6],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);i=d.parent,o=d.depth?d.before():0}const a=s?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof _e&&u.from<=o&&u.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ds&&!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)),ma(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(()=>uo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(t0(e))),this.updateAllowDefault(e),this.allowDefault||!n?ma(this.view,"pointer"):jge(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Wn&&this.mightDrag&&!this.mightDrag.node.isAtom||Pn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ru(this.view,Ue.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ma(this.view,"pointer")}move(e){this.updateAllowDefault(e),ma(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}ar.touchstart=t=>{t.input.lastTouch=Date.now(),sT(t),ma(t,"pointer")};ar.touchmove=t=>{t.input.lastTouch=Date.now(),ma(t,"pointer")};ar.contextmenu=t=>sT(t);function a6(t,e){return t.composing?!0:Wn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Dge=lo?5e3:-1;lr.compositionstart=lr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Oe&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Pn&&FU&&Ige(t)))t.markCursor=t.state.storedMarks||n.marks(),Mv(t,!0),t.markCursor=null;else if(Mv(t,!e.selection.empty),ds&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}l6(t,Dge)};function Ige(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}lr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,l6(t,20))};function l6(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Mv(t),e))}function c6(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Fge());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Lge(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Ame(e.focusNode,e.focusOffset),r=jme(e.focusNode,e.focusOffset);
vendor: 4,563 bytes, line 526
526if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function Fge(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Mv(t,e=!1){if(!(lo&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),c6(t),e||t.docView&&t.docView.dirty){let n=Z_(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Bge(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const wp=Tr&&Aa<15||wd&&Ome<604;ar.copy=lr.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=wp?null:n.clipboardData,o=r.content(),{dom:a,text:l}=tT(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):Bge(t,a),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function $ge(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Vge(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Sp(t,r.value,null,s,e):Sp(t,r.textContent,r.innerHTML,s,e)},50)}function Sp(t,e,n,r,s){let i=e6(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,s,i||ce.empty)))return!0;if(!i)return!1;let o=$ge(i),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function u6(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}lr.paste=(t,e)=>{let n=e;if(t.composing&&!lo)return;let r=wp?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Sp(t,u6(r),r.getData("text/html"),s,n)?n.preventDefault():Vge(t,n)};class d6{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const zge=es?"altKey":"ctrlKey";function f6(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[zge]}ar.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(t0(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof _e?s.to-1:s.to))){if(r&&r.mightDrag)o=_e.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(o=_e.create(t.state.doc,f.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:d}=tT(t,a);(!n.dataTransfer.files.length||!Pn||LU>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(wp?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",wp||n.dataTransfer.setData("text/plain",u),t.dragging=new d6(d,f6(t,n),o)};ar.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};lr.dragover=lr.dragenter=(t,e)=>e.preventDefault();lr.drop=(t,e)=>{try{Uge(t,e,t.dragging)}finally{t.dragging=null}};function Uge(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(t0(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",p=>{i=p(i,t,!1)}):i=e6(t,u6(e.dataTransfer),wp?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&f6(t,e));if(t.someProp("handleDrop",p=>p(t,e,i||ce.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let a=i?SU(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let l=t.state.tr;if(o){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=l.doc;if(d?l.replaceRangeWith(u,u,i.content.firstChild):l.replaceRange(u,u,i),l.doc.eq(f))return;let h=l.doc.resolve(u);
vendor: 9,658 bytes, line 526
526if(d&&_e.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new _e(h));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,g,y,b)=>p=b),l.setSelection(eT(t,h,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}ar.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&uo(t)},20))};ar.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ar.beforeinput=(t,e)=>{if(Pn&&lo&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,xl(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in lr)ar[t]=lr[t];function kp(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Ov{constructor(e,n){this.toDOM=e,this.spec=n||ql,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new ir(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ov&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&kp(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Pa{constructor(e,n){this.attrs=e,this.spec=n||ql}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new ir(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Pa&&kp(this.attrs,e.attrs)&&kp(this.spec,e.spec)}static is(e){return e.type instanceof Pa}destroy(){}}class iT{constructor(e,n){this.attrs=e,this.spec=n||ql}map(e,n,r,s){let i=e.mapResult(n.from+s,1);if(i.deleted)return null;let o=e.mapResult(n.to+s,-1);return o.deleted||o.pos<=i.pos?null:new ir(i.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:s}=e.content.findIndex(n.from),i;return s==n.from&&!(i=e.child(r)).isText&&s+i.nodeSize==n.to}eq(e){return this==e||e instanceof iT&&kp(this.attrs,e.attrs)&&kp(this.spec,e.spec)}destroy(){}}class ir{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new ir(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new ir(e,e,new Ov(n,r))}static inline(e,n,r,s){return new ir(e,n,new Pa(r,s))}static node(e,n,r,s){return new ir(e,n,new iT(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof Pa}get widget(){return this.type instanceof Ov}}const Zc=[],ql={};class Mt{constructor(e,n){this.local=e.length?e:Zc,this.children=n.length?n:Zc}static create(e,n){return n.length?Dv(n,e,0,ql):$n}find(e,n,r){let s=[];return this.findInner(e??0,n??1e9,s,0,r),s}findInner(e,n,r,s,i){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+s,a.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,s+a,i)}}map(e,n,r){return this==$n||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ql)}mapInner(e,n,r,s,i){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,s);l&&l.type.valid(n,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?Wge(this.children,o||[],e,n,r,s,i):o?new Mt(o.sort(Kl),Zc):$n}add(e,n){return n.length?this==$n?Mt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let s,i=0;e.forEach((a,l)=>{let u=l+r,d;if(d=p6(n,a,u)){for(s||(s=this.children.slice());i<s.length&&s[i]<l;)i+=3;s[i]==l?s[i+2]=s[i+2].addInner(a,d,u+1):s.splice(i,0,l,l+a.nodeSize,Dv(d,a,u+1,ql)),i+=3}});let o=h6(i?m6(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new Mt(o.length?this.local.concat(o).sort(Kl):this.local,s||this.children)}remove(e){return e.length==0||this==$n?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,a=r[i]+n,l=r[i+1]+n;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>a&&f.to<l&&(e[d]=null,(o||(o=[])).push(f));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[i+2].removeInner(o,a+1);u!=$n?r[i+2]=u:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let a=0;a<s.length;a++)s[a].eq(o,n)&&(s==this.local&&(s=this.local.slice()),s.splice(a--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new Mt(s,r):$n}forChild(e,n){if(this==$n)return this;if(n.isLeaf)return Mt.empty;let r,s;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,o=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>i&&l.type instanceof Pa){let u=Math.max(i,l.from)-i,d=Math.min(o,l.to)-i;u<d&&(s||(s=[])).push(l.copy(u,d))}}if(s){let a=new Mt(s.sort(Kl),Zc);return r?new Qo([a,r]):a}return r||$n}eq(e){if(this==e)return!0;if(!(e instanceof Mt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return oT(this.localsInner(e))}localsInner(e){if(this==$n)return Zc;if(e.inlineContent||!this.local.some(Pa.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Pa||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Mt.empty=new Mt([],[]);Mt.removeOverlap=oT;const $n=Mt.empty;class Qo{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,ql));return Qo.from(r)}forChild(e,n){if(n.isLeaf)return Mt.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=$n&&(i instanceof Qo?r=r.concat(i.members):r.push(i))}return Qo.from(r)}eq(e){if(!(e instanceof Qo)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let o=0;o<i.length;o++)n.push(i[o])}}return n?oT(r?n:n.sort(Kl)):Zc}static from(e){switch(e.length){case 0:return $n;case 1:return e[0];default:return new Qo(e.every(n=>n instanceof Mt)?e:e.reduce((n,r)=>n.concat(r instanceof Mt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Wge(t,e,n,r,s,i,o){let a=t.slice();for(let u=0,d=i;u<n.maps.length;u++){let f=0;n.maps[u].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let b=0;b<a.length;b+=3){let x=a[b+1];if(x<0||h>x+d-f)continue;let w=a[b]+d-f;p>=w?a[b+1]=h<=w?-2:-1:h>=d&&y&&(a[b]+=y,a[b+1]+=y)}f+=y}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let d=n.map(t[u]+i),f=d-s;if(f<0||f>=r.content.size){l=!0;continue}let h=n.map(t[u+1]+i,-1),p=h-s,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let b=a[u+2].mapInner(n,y,d+1,t[u]+i+1,o);b!=$n?(a[u]=f,a[u+1]=p,a[u+2]=b):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=Hge(a,t,e,n,s,i,o),d=Dv(u,r,0,o);e=d.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<d.children.length;f+=3){let p=d.children[f];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,d.children[f],d.children[f+1],d.children[f+2])}}return new Mt(e.sort(Kl),a)}function h6(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let s=t[r];n.push(new ir(s.from+e,s.to+e,s.type))}return n}function Hge(t,e,n,r,s,i,o){function a(l,u){for(let d=0;d<l.local.length;d++){let f=l.local[d].map(r,s,u);f?n.push(f):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function p6(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,s=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>n&&o.to<r&&((s||(s=[])).push(o),t[i]=null);return s}function m6(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Dv(t,e,n,r){let s=[],i=!1;e.forEach((a,l)=>{let u=p6(t,a,l+n);if(u){i=!0;let d=Dv(u,a,n+l+1,r);d!=$n&&s.push(l,l+a.nodeSize,d)}});let o=h6(i?m6(t):t,-n).sort(Kl);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||s.length?new Mt(o,s):$n}function Kl(t,e){return t.from-e.from||t.to-e.to}function oT(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let s=n+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[s]=i.copy(i.from,r.to),MO(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),MO(e,s,r.copy(i.from,r.to)));break}}}return e}function MO(t,e,n){for(;e<t.length&&Kl(n,t[e])>0;)e++;t.splice(e,0,n)}function r1(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=$n&&e.push(r)}
vendor: 10,386 bytes, line 526
526),t.cursorWrapper&&e.push(Mt.create(t.state.doc,[t.cursorWrapper.deco])),Qo.from(e)}const qge={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Kge=Tr&&Aa<=11;class Gge{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 Yge{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Gge,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);Tr&&Aa<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():Wn&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Kge&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,qge)),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 n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(NO(this.view)){if(this.suppressingSelectionUpdates)return uo(this.view);if(Tr&&Aa<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&gc(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 n=new Set,r;for(let i=e.focusNode;i;i=bd(i))n.add(i);for(let i=e.anchorNode;i;i=bd(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&NO(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let f=this.registerMutation(n[d],l);f&&(i=i<0?f.from:Math.min(f.from,i),o=o<0?f.to:Math.max(f.to,o),f.typeOver&&(a=!0))}if(l.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let f=d.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){d.parentNode.removeChild(d);break}f=f.firstChild}}}else if(ds&&l.length){let d=l.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,h]=d;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of d){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||Xge(e,f)!=p)&&h.remove()}}}let u=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Zb(r)&&(u=Z_(e))&&u.eq(Ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,uo(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),Qge(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Zge(e,l)),this.handleDOMChange(i,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||uo(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,i=e.nextSibling;if(Tr&&Aa<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:h}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h)}let o=s&&s.parentNode==e.target?Tn(s)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?Tn(i):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let OO=new WeakMap,DO=!1;function Qge(t){if(!OO.has(t)&&(OO.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=ds,DO)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),DO=!0}}function IO(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return gc(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function Jge(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return IO(t,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?IO(t,n):null}function Xge(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Zge(t,e){var n;let{focusNode:r,focusOffset:s}=t.domSelectionRange();for(let i of e)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=i.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(i,a.firstChild),r==i&&t.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function eye(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],Zb(l)||u.push({node:l.focusNode,offset:l.focusOffset})),Pn&&t.input.lastKeyCode===8)for(let y=i;y>s;y--){let b=r.childNodes[y-1],x=b.pmViewDesc;if(b.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||gh.fromSchema(t.state.schema),p=f.resolve(o),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:tye,context:p});if(u&&u[0].pos!=null){let y=u[0].pos,b=u[1]&&u[1].pos;b==null&&(b=y),m={anchor:y+o,head:b+o}}return{doc:g,sel:m,from:o,to:a}}function tye(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Wn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Wn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const nye=/^(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 rye(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let N=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,E=Z_(t,N);if(E&&!t.state.selection.eq(E)){if(Pn&&lo&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",T=>T(t,xl(13,"Enter"))))return;let _=t.state.tr.setSelection(E);N=="pointer"?_.setMeta("pointer",!0):N=="key"&&_.scrollIntoView(),i&&_.setMeta("composition",i),t.dispatch(_)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=eye(t,e,n),d=t.state.doc,f=d.slice(u.from,u.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=oye(f.content,u.doc.content,u.from,h,p);if(m&&t.input.domChangeCount++,(wd&&t.input.lastIOSEnter>Date.now()-225||lo)&&s.some(N=>N.nodeType==1&&!nye.test(N.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",N=>N(t,xl(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Oe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head)
vendor: 4,138 bytes, line 526
526)m={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let N=LO(t,t.state.doc,u.sel);if(N&&!N.eq(t.state.selection)){let E=t.state.tr.setSelection(N);i&&E.setMeta("composition",i),t.dispatch(E)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof Oe&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Tr&&Aa<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=u.doc.resolveNoCache(m.start-u.from),y=u.doc.resolveNoCache(m.endB-u.from),b=d.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA;if((wd&&t.input.lastIOSEnter>Date.now()-225&&(!x||s.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!x&&g.pos<u.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(u.doc.textBetween(g.pos,y.pos,"","")))&&t.someProp("handleKeyDown",N=>N(t,xl(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&iye(d,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",N=>N(t,xl(8,"Backspace")))){lo&&Pn&&t.domObserver.suppressSelectionUpdates();return}Pn&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),lo&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,y=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(N){return N(t,xl(13,"Enter"))})},20));let w=m.start,S=m.endA,C=N=>{let E=N||t.state.tr.replace(w,S,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let _=LO(t,E.doc,u.sel);_&&!(Pn&&t.composing&&_.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(_.head==w||_.head==E.mapping.map(S)-1)||Tr&&_.empty&&_.head==w)&&E.setSelection(_)}return i&&E.setMeta("composition",i),E.scrollIntoView()},k;if(x)if(g.pos==y.pos){Tr&&Aa<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>uo(t),20));let N=C(t.state.tr.delete(w,S)),E=d.resolve(m.start).marksAcross(d.resolve(m.endA));E&&N.ensureMarks(E),t.dispatch(N)}else if(m.endA==m.endB&&(k=sye(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let N=C(t.state.tr);k.type=="add"?N.addMark(w,S,k.mark):N.removeMark(w,S,k.mark),t.dispatch(N)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let N=g.parent.textBetween(g.parentOffset,y.parentOffset),E=()=>C(t.state.tr.insertText(N,w,S));t.someProp("handleTextInput",_=>_(t,w,S,N,E))||t.dispatch(E())}else t.dispatch(C());else t.dispatch(C())}function LO(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:eT(t,e.resolve(n.anchor),e.resolve(n.head))}function sye(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,a,l;for(let d=0;d<r.length;d++)s=r[d].removeFromSet(s);for(let d=0;d<n.length;d++)i=n[d].removeFromSet(i);if(s.length==1&&i.length==0)a=s[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(s.length==0&&i.length==1)a=i[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(l(e.child(d)));if(Q.from(u).eq(t))return{mark:a,type:o}}function iye(t,e,n,r,s){if(n-e<=s.pos-r.pos||s1(r,!0,!1)<s.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(s1(i,!0,!0));return!o.parent.isTextblock||o.pos>n||s1(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function s1(t,e,n){let r=t.depth,s=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function oye(t,e,n,r,s){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);
vendor: 4,459 bytes, line 526
526if(s=="end"){let l=Math.max(0,i-Math.min(o,a));r-=o+l-i}if(o<i&&t.size<e.size){let l=r<=i&&r>=o?i-r:0;i-=l,i&&i<e.size&&FO(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-o),o=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&FO(t.textBetween(i-1,i+1))&&(i+=l?1:-1),o=i+(o-a),a=i}return{start:i,endA:o,endB:a}}function FO(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class g6{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Sge,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(UO),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=VO(this),$O(this),this.nodeViews=zO(this),this.docView=xO(this.state.doc,BO(this),r1(this),this.dom,this),this.domObserver=new Yge(this,(r,s,i,o)=>rye(this,r,s,i,o)),this.domObserver.start(),kge(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&TC(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(UO),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(c6(this),o=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=zO(this);lye(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&TC(this),this.editable=VO(this),$O(this);let l=r1(this),u=BO(this),d=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(e.doc,u,l);(f||!e.selection.eq(s.selection))&&(o=!0);let h=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Lme(this);if(o){this.domObserver.stop();let p=f&&(Tr||Pn)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&aye(s.selection,e.selection);if(f){let m=Pn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Lge(this)),(i||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=xO(e.doc,u,l,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&age(this))?uo(this,p):(JU(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&Fme(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof _e){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&hO(this,n.getBoundingClientRect(),e)}else hO(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,s=-1;
vendor: 6,082 bytes, line 526
526if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new d6(e.slice,e.move,s<0?void 0:_e.create(this.state.doc,s))}someProp(e,n){let r=this._props&&this._props[e],s;if(r!=null&&(s=n?n(r):r))return s;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(s=n?n(a):a))return s}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let a=i[o].props[e];if(a!=null&&(s=n?n(a):a))return s}}hasFocus(){if(Tr){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Bme(this.dom),uo(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Wme(this,e)}coordsAtPos(e,n=1){return UU(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return Yme(this,n||this.state,e)}pasteHTML(e,n){return Sp(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Sp(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return tT(this,e)}destroy(){this.docView&&(Cge(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],r1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,_me())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Ege(this,e)}domSelectionRange(){let e=this.domSelection();return e?Wn&&this.root.nodeType===11&&Rme(this.dom.ownerDocument)==this.dom&&Jge(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}g6.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function BO(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[ir.node(0,t.state.doc.content.size,e)]}function $O(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ir.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function VO(t){return!t.someProp("editable",e=>e(t.state)===!1)}function aye(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function zO(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function lye(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function UO(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var qa={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:"'"},Iv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},cye=typeof navigator<"u"&&/Mac/.test(navigator.platform),uye=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var An=0;An<10;An++)qa[48+An]=qa[96+An]=String(An);for(var An=1;An<=24;An++)qa[An+111]="F"+An;for(var An=65;An<=90;An++)qa[An]=String.fromCharCode(An+32),Iv[An]=String.fromCharCode(An);for(var i1 in qa)Iv.hasOwnProperty(i1)||(Iv[i1]=qa[i1]);function dye(t){var e=cye&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||uye&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Iv:qa)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const fye=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),hye=typeof navigator<"u"&&/Win/.test(navigator.platform);function pye(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))fye?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),o&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function mye(t){let e=Object.create(null);for(let n in t)e[pye(n)]=t[n];return e}
vendor: 16,864 bytes, line 526
526function o1(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function gye(t){return new Lt({props:{handleKeyDown:y6(t)}})}function y6(t){let e=mye(t);return function(n,r){let s=dye(r),i,o=e[o1(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let a=e[o1(s,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(hye&&r.ctrlKey&&r.altKey)&&(i=qa[r.keyCode])&&i!=s){let a=e[o1(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var yye=Object.defineProperty,aT=(t,e)=>{for(var n in e)yye(t,n,{get:e[n],enumerable:!0})};function n0(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}var r0=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([o,a])=>[o,(...u)=>{const d=a(...u)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],a=!!t,l=t||s.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),o.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(n).map(([f,h])=>[f,(...m)=>{const g=this.buildProps(l,e),y=h(...m)(g);return o.push(y),d}])),run:u};return d}createCan(t){const{rawCommands:e,state:n}=this,r=!1,s=t||n.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o={tr:t,editor:r,view:i,state:n0({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)(o)]))}};return o}},v6={};aT(v6,{blur:()=>vye,clearContent:()=>xye,clearNodes:()=>bye,command:()=>wye,createParagraphNear:()=>Sye,cut:()=>kye,deleteCurrentNode:()=>Cye,deleteNode:()=>Nye,deleteRange:()=>Eye,deleteSelection:()=>_ye,enter:()=>Tye,exitCode:()=>Aye,extendMarkRange:()=>jye,first:()=>Pye,focus:()=>Mye,forEach:()=>Oye,insertContent:()=>Dye,insertContentAt:()=>Fye,joinBackward:()=>Vye,joinDown:()=>$ye,joinForward:()=>zye,joinItemBackward:()=>Uye,joinItemForward:()=>Wye,joinTextblockBackward:()=>Hye,joinTextblockForward:()=>qye,joinUp:()=>Bye,keyboardShortcut:()=>Gye,lift:()=>Yye,liftEmptyBlock:()=>Qye,liftListItem:()=>Jye,newlineInCode:()=>Xye,resetAttributes:()=>Zye,scrollIntoView:()=>eve,selectAll:()=>tve,selectNodeBackward:()=>nve,selectNodeForward:()=>rve,selectParentNode:()=>sve,selectTextblockEnd:()=>ive,selectTextblockStart:()=>ove,setContent:()=>ave,setMark:()=>Tve,setMeta:()=>Ave,setNode:()=>jve,setNodeSelection:()=>Pve,setTextDirection:()=>Rve,setTextSelection:()=>Mve,sinkListItem:()=>Ove,splitBlock:()=>Dve,splitListItem:()=>Ive,toggleList:()=>Fve,toggleMark:()=>Bve,toggleNode:()=>$ve,toggleWrap:()=>Vve,undoInputRule:()=>zve,unsetAllMarks:()=>Uve,unsetMark:()=>Wve,unsetTextDirection:()=>Hve,updateAttributes:()=>qve,wrapIn:()=>Kve,wrapInList:()=>Gve});var vye=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),xye=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),bye=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,f=u.resolve(d.map(l)),h=u.resolve(d.map(l+a.nodeSize)),p=f.blockRange(h);if(!p)return;const m=ef(p);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},wye=t=>e=>t(e),Sye=()=>({state:t,dispatch:e})=>hme(t,e),kye=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new Oe(r.doc.resolve(Math.max(o-1,0)))),!0},Cye=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const a=s.before(i),l=s.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1};function rn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var Nye=t=>({tr:e,state:n,dispatch:r})=>{const s=rn(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const l=i.before(o),u=i.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},Eye=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},_ye=()=>({state:t,dispatch:e})=>tme(t,e),Tye=()=>({commands:t})=>t.keyboardShortcut("Enter"),Aye=()=>({state:t,dispatch:e})=>fme(t,e);function lT(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Lv(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:lT(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function x6(t,e,n={}){return t.find(r=>r.type===e&&Lv(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function WO(t,e,n={}){return!!x6(t,e,n)}function cT(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===e))return;if(!n){const u=r.node.marks.find(d=>d.type===e);u&&(n=u.attrs)}if(!x6([...r.node.marks],e,n))return;let i=r.index,o=t.start()+r.offset,a=i+1,l=o+r.node.nodeSize;for(;i>0&&WO([...t.parent.child(i-1).marks],e,n);)i-=1,o-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&WO([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function No(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var jye=(t,e)=>({tr:n,state:r,dispatch:s})=>{const i=No(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(s){const f=cT(l,i,e);if(f&&f.from<=u&&f.to>=d){const h=Oe.create(o,f.from,f.to);n.setSelection(h)}}return!0},Pye=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function b6(t){return t instanceof Oe}function Al(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function w6(t,e=null){if(!e)return null;const n=Ue.atStart(t),r=Ue.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const s=n.from,i=r.to;return e==="all"?Oe.create(t,Al(0,s,i),Al(t.content.size,s,i)):Oe.create(t,Al(e,s,i),Al(e,s,i))}function HO(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Fv(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Rye(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Mye=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(Fv()||HO())&&r.dom.focus(),Rye()&&!Fv()&&!HO()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!b6(n.state.selection))return o(),!0;const a=w6(s.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||s.setSelection(a),l&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},Oye=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),Dye=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),S6=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&S6(r)}return t};function mg(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return S6(n)}function Cp(t,e,n){if(t instanceof Ta||t instanceof Q)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return Q.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Cp("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,a="";const l=new dU({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?gh.fromSchema(l).parseSlice(mg(t),n.parseOptions):gh.fromSchema(l).parse(mg(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=gh.fromSchema(e);return n.slice?i.parseSlice(mg(t),n.parseOptions).content:i.parse(mg(t),n.parseOptions)}return Cp("",e,n)}function Iye(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof Xt||s instanceof vn))return;const i=t.mapping.maps[r];let o=0;i.forEach((a,l,u,d)=>{o===0&&(o=d)}),t.setSelection(Ue.near(t.doc.resolve(o),n))}var Lye=t=>!("type"in t),Fye=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=y=>{i.emit("contentError",{editor:i,error:y,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Cp(e,i.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=Cp(e,i.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(y){return l(y),!1}let{from:d,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},h=!0,p=!0;if((Lye(a)?a:[a]).forEach(y=>{y.check(),h=h?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),d===f&&p){const{parent:y}=r.doc.resolve(d);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(d-=1,f+=1)}let g;if(h){if(Array.isArray(e))g=e.map(y=>y.text||"").join("");else if(e instanceof Q){let y="";e.forEach(b=>{b.text&&(y+=b.text)}),g=y}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,d,f)}else{g=a;const y=r.doc.resolve(d),b=y.node(),x=y.parentOffset===0,w=b.isText||b.isTextblock,S=b.content.size>0;x&&w&&S&&p&&(d=Math.max(0,d-1)),r.replaceWith(d,f,g)}n.updateSelection&&Iye(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:g})}return!0},Bye=()=>({state:t,dispatch:e})=>lme(t,e),$ye=()=>({state:t,dispatch:e})=>cme(t,e),Vye=()=>({state:t,dispatch:e})=>nme(t,e),zye=()=>({state:t,dispatch:e})=>ome(t,e),Uye=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Qb(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Wye=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Qb(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Hye=()=>({state:t,dispatch:e})=>rme(t,e),qye=()=>({state:t,dispatch:e})=>sme(t,e);function k6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Kye(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))Fv()||k6()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var Gye=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=Kye(t).split(/-(?!$)/),o=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&s&&r.maybeStep(d)}),!0};function Ka(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?rn(e,t.schema):null,a=[];t.doc.nodesBetween(r,s,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(s,h+f.nodeSize);a.push({node:f,from:p,to:m})});const l=s-r,u=a.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>Lv(f.node.attrs,n,{strict:!1}));return i?!!u.length:u.reduce((f,h)=>f+h.to-h.from,0)>=l}var Yye=(t,e={})=>({state:n,dispatch:r})=>{const s=rn(t,n.schema);return Ka(n,s,e)?ume(n,r):!1},Qye=()=>({state:t,dispatch:e})=>pme(t,e),Jye=t=>({state:e,dispatch:n})=>{const r=rn(t,e.schema);return kme(r)(e,n)},Xye=()=>({state:t,dispatch:e})=>dme(t,e);function s0(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function qO(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}var Zye=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=s0(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=rn(t,r.schema)),a==="mark"&&(o=No(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,f)=>{i&&i===d.type&&(l=!0,s&&n.setNodeMarkup(f,void 0,qO(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(h=>{o===h.type&&(l=!0,s&&n.addMark(f,f+d.nodeSize,o.create(qO(h.attrs,e))))})})}),l},eve=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),tve=()=>({tr:t,dispatch:e})=>{if(e){const n=new us(t.doc);t.setSelection(n)}return!0},nve=()=>({state:t,dispatch:e})=>ime(t,e),rve=()=>({state:t,dispatch:e})=>ame(t,e),sve=()=>({state:t,dispatch:e})=>mme(t,e),ive=()=>({state:t,dispatch:e})=>vme(t,e),ove=()=>({state:t,dispatch:e})=>yme(t,e);function AC(t,e,n={},r={}){return Cp(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var ave=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:a})=>{const{doc:l}=i;if(r.preserveWhitespace!=="full"){const u=AC(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return o&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function C6(t,e){const n=No(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function N6(t,e){const n=new _U(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function lve(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function cve(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function uve(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function i0(t){return e=>uve(e.$from,t)}function Se(t,e,n){return t.config[e]===void 0&&t.parent?Se(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Se(t.parent,e,n):null}):t.config[e]}function uT(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Se(e,"addExtensions",n);return r?[e,...uT(r())]:e}).flat(10)}
526function dT(t,e){const n=Ec.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function E6(t){return typeof t=="function"}function at(t,e=void 0,...n){return E6(t)?e?t.bind(e)(...n):t(...n):t}function dve(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Sd(t){const e=t.filter(s=>s.type==="extension"),n=t.filter(s=>s.type==="node"),r=t.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function _6(t){const e=[],{nodeExtensions:n,markExtensions:r}=Sd(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...o,...a];return t.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage,extensions:s},f=Se(u,"addGlobalAttributes",d);if(!f)return;f().forEach(p=>{let m;Array.isArray(p.types)?m=p.types:p.types==="*"?m=l:p.types==="nodes"?m=o:p.types==="marks"?m=a:m=[],m.forEach(g=>{Object.entries(p.attributes).forEach(([y,b])=>{e.push({type:g,name:y,attribute:{...i,...b}})})})})}),s.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage},f=Se(u,"addAttributes",d);if(!f)return;const h=f();Object.entries(h).forEach(([p,m])=>{const g={...i,...m};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:u.name,name:p,attribute:g})})}),e}function fve(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let a=0;a<o;a+=1){const l=t[a];if(l==="'"&&!s){r=!r,n+=l;continue}if(l==='"'&&!r){s=!s,n+=l;continue}if(!r&&!s){if(l==="("){i+=1,n+=l;continue}if(l===")"&&i>0){i-=1,n+=l;continue}if(l===";"&&i===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function KO(t){const e=[],n=fve(t||""),r=n.length;for(let s=0;s<r;s+=1){const i=n[s],o=i.indexOf(":");if(o===-1)continue;const a=i.slice(0,o).trim(),l=i.slice(o+1).trim();a&&l&&e.push([a,l])}return e}function sn(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const a=i?String(i).split(" "):[],l=r[s]?r[s].split(" "):[],u=a.filter(d=>!l.includes(d));r[s]=[...l,...u].join(" ")}else if(s==="style"){const a=new Map([...KO(r[s]),...KO(i)]);r[s]=Array.from(a.entries()).map(([l,u])=>`${l}: ${u}`).join("; ")}else r[s]=i}),r},{})}function Np(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>sn(n,r),{})}function hve(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function GO(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):hve(n.getAttribute(o.name));return a==null?i:{...i,[o.name]:a}},{});return{...r,...s}}}}function YO(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&dve(n)?!1:n!=null))}function QO(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function pve(t,e){var n;const r=_6(t),{nodeExtensions:s,markExtensions:i}=Sd(t),o=(n=s.find(u=>Se(u,"topNode")))==null?void 0:n.name,a=Object.fromEntries(s.map(u=>{const d=r.filter(b=>b.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},h=t.reduce((b,x)=>{const w=Se(x,"extendNodeSchema",f);return{...b,...w?w(u):{}}},{}),p=YO({...h,content:at(Se(u,"content",f)),marks:at(Se(u,"marks",f)),group:at(Se(u,"group",f)),inline:at(Se(u,"inline",f)),atom:at(Se(u,"atom",f)),selectable:at(Se(u,"selectable",f)),draggable:at(Se(u,"draggable",f)),code:at(Se(u,"code",f)),whitespace:at(Se(u,"whitespace",f)),linebreakReplacement:at(Se(u,"linebreakReplacement",f)),defining:at(Se(u,"defining",f)),isolating:at(Se(u,"isolating",f)),attrs:Object.fromEntries(d.map(QO))}),m=at(Se(u,"parseHTML",f));m&&(p.parseDOM=m.map(b=>GO(b,d)));const g=Se(u,"renderHTML",f);g&&(p.toDOM=b=>g({node:b,HTMLAttributes:Np(b,d)}));const y=Se(u,"renderText",f);return y&&(p.toText=y),[u.name,p]})),l=Object.fromEntries(i.map(u=>{const d=r.filter(y=>y.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},h=t.reduce((y,b)=>{const x=Se(b,"extendMarkSchema",f);return{...y,...x?x(u):{}}},{}),p=YO({...h,inclusive:at(Se(u,"inclusive",f)),excludes:at(Se(u,"excludes",f)),group:at(Se(u,"group",f)),spanning:at(Se(u,"spanning",f)),code:at(Se(u,"code",f)),attrs:Object.fromEntries(d.map(QO))}),m=at(Se(u,"parseHTML",f));m&&(p.parseDOM=m.map(y=>GO(y,d)));const g=Se(u,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Np(y,d)})),[u.name,p]}));return new dU({topNode:o,nodes:a,marks:l})}function mve(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function bh(t){return t.sort((n,r)=>{const s=Se(n,"priority")||100,i=Se(r,"priority")||100;return s>i?-1:s<i?1:0})}function T6(t){const e=bh(uT(t)),n=mve(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function A6(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=`
527
528`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,s,(l,u,d,f)=>{var h;l.isBlock&&u>r&&(a+=i);const p=o==null?void 0:o[l.type.name];if(p)return d&&(a+=p({node:l,pos:u,parent:d,index:f,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)==null?void 0:h.slice(Math.max(r,u)-u,s-u))}),a}function gve(t,e){const n={from:0,to:t.content.size};return A6(t,n,e)}function j6(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function yve(t,e){const n=rn(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,a=>{i.push(a)});const o=i.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function P6(t,e){const n=s0(typeof e=="string"?e:e.name,t.schema);return n==="node"?yve(t,e):n==="mark"?C6(t,e):{}}function vve(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function xve(t){const e=vve(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function R6(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(i).map(a,-1),d=e.slice(i).map(l),f=e.invert().map(u,-1),h=e.invert().map(d);r.push({oldRange:{from:f,to:h},newRange:{from:u,to:d}})})}),xve(r)}function fT(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=cT(i,s.type);o&&r.push({mark:s,...o})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var bve=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const a=s.node(i);(a==null?void 0:a.type.name)===e?o=a:i-=1}return[o,i]};function Ef(t,e){return e.nodes[t]||e.marks[t]||null}function ay(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var wve=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,a)=>{var l,u;const d=((u=(l=s.type.spec).toText)==null?void 0:u.call(l,{node:s,pos:i,parent:o,index:a}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?d:d.slice(0,Math.max(0,r-i))}),n};function jC(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?No(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>i?i.name===f.type.name:!0).find(f=>Lv(f.attrs,n,{strict:!1}));let o=0;const a=[];if(s.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(i&&g.inlineContent&&!g.type.allowsMarkType(i))return!1;if(!g.isText&&!g.marks.length)return;const b=Math.max(p,y),x=Math.min(m,y+g.nodeSize),w=x-b;o+=w,a.push(...g.marks.map(S=>({mark:S,from:b,to:x})))})}),o===0)return!1;const l=a.filter(f=>i?i.name===f.mark.type.name:!0).filter(f=>Lv(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),u=a.filter(f=>i?f.mark.type!==i&&f.mark.type.excludes(i):!0).reduce((f,h)=>f+h.to-h.from,0);return(l>0?l+u:l)>=o}function Sve(t,e,n={}){if(!e)return Ka(t,null,n)||jC(t,null,n);const r=s0(e,t.schema);return r==="node"?Ka(t,e,n):r==="mark"?jC(t,e,n):!1}var kve=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=i0(a=>a.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Cve=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function JO(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function a1(t,e){const{nodeExtensions:n}=Sd(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=at(Se(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function o0(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;
vendor: 43,127 bytes, lines 528-601
528if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(i=>{s!==!1&&(o0(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function M6(t){return t instanceof _e}var O6=class D6{constructor(e){this.position=e}static fromJSON(e){return new D6(e.position)}toJSON(){return{position:this.position}}};function Nve(t,e){const n=e.mapping.mapResult(t.position);return{position:new O6(n.pos),mapResult:n}}function Eve(t){return new O6(t)}function _ve(t,e,n){var r;const{selection:s}=e;let i=null;if(b6(s)&&(i=s.$cursor),i){const a=(r=t.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}const{ranges:o}=s;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,f,h)=>{if(u)return!1;if(d.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(d.marks)||!d.marks.some(g=>g.type.excludes(n));u=p&&m}return!u}),u})}var Tve=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:a}=i,l=No(t,r.schema);if(s)if(o){const u=C6(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(d,f,(h,p)=>{const m=Math.max(p,d),g=Math.min(p+h.nodeSize,f);h.marks.find(b=>b.type===l)?h.marks.forEach(b=>{l===b.type&&n.addMark(m,g,l.create({...b.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return _ve(r,n,l)},Ave=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),jve=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=rn(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:a})=>uO(i,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>uO(i,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Pve=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Al(t,0,r.content.size),i=_e.create(r,s);e.setSelection(i)}return!0},Rve=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=i.from,a=i.to),s&&n.doc.nodesBetween(o,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},Mve=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Oe.atStart(r).from,a=Oe.atEnd(r).to,l=Al(s,o,a),u=Al(i,o,a),d=Oe.create(r,l,u);e.setSelection(d)}return!0},Ove=t=>({state:e,dispatch:n})=>{const r=rn(t,e.schema);return Eme(r)(e,n)};function XO(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}var Dve=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:a,$to:l}=i,u=s.extensionManager.attributes,d=ay(u,a.node().type.name,a.node().attrs);if(i instanceof _e&&i.node.isBlock)return!a.parentOffset||!ju(o,a.pos)?!1:(r&&(t&&XO(n,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:lve(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&h?[{type:h,attrs:d}]:void 0,m=ju(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&ju(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:d}]:void 0),r){if(m&&(i instanceof Oe&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&XO(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},Ive=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const a=rn(t,r.schema),{$from:l,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;const f=l.node(-1);if(f.type!==a)return!1;const h=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(s){let b=Q.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-x;E>=l.depth-3;E-=1)b=Q.from(l.node(E).copy(b));const w=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,S={...ay(h,l.node().type.name,l.node().attrs),...e},C=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(S))||void 0;b=b.append(Q.from(a.createAndFill(null,C)||void 0));const k=l.before(l.depth-(x-1));n.replace(k,l.after(-w),new ce(b,4-x,0));let N=-1;n.doc.nodesBetween(k,n.doc.content.size,(E,_)=>{if(N>-1)return!1;E.isTextblock&&E.content.size===0&&(N=_+1)}),N>-1&&n.setSelection(Oe.near(n.doc.resolve(N))),n.scrollIntoView()}return!0}const p=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,m={...ay(h,f.type.name,f.attrs),...e},g={...ay(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const y=p?[{type:a,attrs:m},{type:p,attrs:g}]:[{type:a,attrs:m}];if(!ju(n.doc,l.pos,2))return!1;if(s){const{selection:b,storedMarks:x}=r,{splittableMarks:w}=i.extensionManager,S=x||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!S||!s)return!0;const C=S.filter(k=>w.includes(k.type.name));n.ensureMarks(C)}return!0},l1=(t,e)=>{const n=i0(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&nl(t.doc,n.pos)&&t.join(n.pos),!0},c1=(t,e)=>{const n=i0(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&nl(t.doc,r)&&t.join(r),!0};function Lve(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=1,s=n.nodeSize-1;return Oe.create(e,r,s)}var Fve=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:a,chain:l,commands:u,can:d})=>{const{extensions:f,splittableMarks:h}=s.extensionManager,p=rn(t,o.schema),m=rn(e,o.schema),{selection:g,storedMarks:y}=o,{$from:b,$to:x}=g,w=b.blockRange(x),S=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const C=i0(F=>a1(F.type.name,f))(g),k=g.from===0&&g.to===o.doc.content.size,N=o.doc.content.content,E=N.length===1?N[0]:null,_=k&&E&&a1(E.type.name,f)?{node:E,pos:0,depth:0}:null,T=C??_,P=!!C&&w.depth>=1&&w.depth-C.depth<=1,j=!!_;if((P||j)&&T){if(T.node.type===p)return k&&j?l().command(({tr:F,dispatch:B})=>{const U=Lve(F);return U?(F.setSelection(U),B&&B(F),!0):!1}).liftListItem(m).run():u.liftListItem(m);if(a1(T.node.type.name,f)&&p.validContent(T.node.content))return l().command(()=>(i.setNodeMarkup(T.pos,p),!0)).command(()=>l1(i,p)).command(()=>c1(i,p)).run()}return!n||!S||!a?l().command(()=>d().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>l1(i,p)).command(()=>c1(i,p)).run():l().command(()=>{const F=d().wrapInList(p,r),B=S.filter(U=>h.includes(U.type.name));return i.ensureMarks(B),F?!0:u.clearNodes()}).wrapInList(p,r).command(()=>l1(i,p)).command(()=>c1(i,p)).run()},Bve=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=No(t,r.schema);return jC(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},$ve=(t,e,n={})=>({state:r,commands:s})=>{const i=rn(t,r.schema),o=rn(e,r.schema),a=Ka(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?s.setNode(o,l):s.setNode(i,{...l,...n})},Vve=(t,e={})=>({state:n,commands:r})=>{const s=rn(t,n.schema);return Ka(n,s,e)?r.lift(s):r.wrapIn(s,e)},zve=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(t))){if(e){const o=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else o.delete(i.from,i.to)}return!0}}return!1},Uve=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:s}=n;return r||e&&s.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},Wve=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=No(t,r.schema),{$from:u,empty:d,ranges:f}=a;if(!s)return!0;if(d&&o){let{from:h,to:p}=a;const m=(i=u.marks().find(y=>y.type===l))==null?void 0:i.attrs,g=cT(u,l,m);g&&(h=g.from,p=g.to),n.removeMark(h,p,l)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},Hve=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},qve=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=s0(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=rn(t,r.schema)),a==="mark"&&(o=No(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,f=u.$to.pos;let h,p,m,g;n.selection.empty?r.doc.nodesBetween(d,f,(y,b)=>{i&&i===y.type&&(l=!0,m=Math.max(b,d),g=Math.min(b+y.nodeSize,f),h=b,p=y)}):r.doc.nodesBetween(d,f,(y,b)=>{b<d&&i&&i===y.type&&(l=!0,m=Math.max(b,d),g=Math.min(b+y.nodeSize,f),h=b,p=y),b>=d&&b<=f&&(i&&i===y.type&&(l=!0,s&&n.setNodeMarkup(b,void 0,{...y.attrs,...e})),o&&y.marks.length&&y.marks.forEach(x=>{if(o===x.type&&(l=!0,s)){const w=Math.max(b,d),S=Math.min(b+y.nodeSize,f);n.addMark(w,S,o.create({...x.attrs,...e}))}}))}),p&&(h!==void 0&&s&&n.setNodeMarkup(h,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(y=>{o===y.type&&s&&n.addMark(m,g,o.create({...y.attrs,...e}))}))}),l},Kve=(t,e={})=>({state:n,dispatch:r})=>{const s=rn(t,n.schema);return xme(s,e)(n,r)},Gve=(t,e={})=>({state:n,dispatch:r})=>{const s=rn(t,n.schema);return bme(s,e)(n,r)},Yve=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},a0=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},Qve=(t,e)=>{if(lT(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function gg(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let d=!1;const f=wve(u)+i;return o.forEach(h=>{if(d)return;const p=Qve(f,h.find);if(!p)return;const m=l.state.tr,g=n0({state:l.state,transaction:m}),y={from:r-(p[0].length-i.length),to:s},{commands:b,chain:x,can:w}=new r0({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:b,chain:x,can:w})===null||!m.steps.length||(h.undoable&&m.setMeta(a,{transform:m,from:r,to:s,text:i}),l.dispatch(m),d=!0)}),d}function Jve(t){const{editor:e,rules:n}=t,r=new Lt({state:{init(){return null},apply(s,i,o){const a=s.getMeta(r);if(a)return a;const l=s.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=dT(Q.from(d),o.schema);const{from:f}=l,h=f+d.length;gg({editor:e,from:f,to:h,text:d,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,a){return gg({editor:e,from:i,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&gg({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?gg({editor:e,from:o.pos,to:o.pos,text:`
529`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Xve(t){return Object.prototype.toString.call(t).slice(8,-1)}function yg(t){return Xve(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function I6(t,e){const n={...t};return yg(t)&&yg(e)&&Object.keys(e).forEach(r=>{yg(e[r])&&yg(t[r])?n[r]=I6(t[r],e[r]):n[r]=e[r]}),n}var hT=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...at(Se(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...at(Se(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>I6(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},_c=class L6 extends hT{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new L6(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=o.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Zve(t){return typeof t=="number"}var exe=class{constructor(t){this.find=t.find,this.handler=t.handler}},txe=(t,e,n)=>{if(lT(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function nxe(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new r0({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,s,(p,m)=>{var g,y,b,x,w;if((y=(g=p.type)==null?void 0:g.spec)!=null&&y.code||!(p.isText||p.isTextblock||p.isInline))return;const S=(w=(x=(b=p.content)==null?void 0:b.size)!=null?x:p.nodeSize)!=null?w:0,C=Math.max(r,m),k=Math.min(s,m+S);if(C>=k)return;const N=p.isText?p.text||"":p.textBetween(C-m,k-m,void 0,"");txe(N,i.find,o).forEach(_=>{if(_.index===void 0)return;const T=C+_.index+1,P=T+_[0].length,j={from:n.tr.mapping.map(T),to:n.tr.mapping.map(P)},F=i.handler({state:n,range:j,match:_,commands:l,chain:u,can:d,pasteEvent:o,dropEvent:a});f.push(F)})}),f.every(p=>p!==null)}var vg=null,rxe=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function sxe(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:f,to:h,rule:p,pasteEvt:m})=>{const g=d.tr,y=n0({state:d,transaction:g});if(!(!nxe({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(d=>new Lt({view(f){const h=m=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(m.target)?f.dom.parentElement:null,r&&(vg=e)},p=()=>{vg&&(vg=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(i=r===f.dom.parentElement,a=h,!i){const p=vg;p!=null&&p.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,h)=>{var p;const m=(p=h.clipboardData)==null?void 0:p.getData("text/html");return o=h,s=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!s,y=m.getMeta("uiEvent")==="drop"&&!i,b=m.getMeta("applyPasteRules"),x=!!b;if(!g&&!y&&!x)return;if(x){let{text:C}=b;typeof C=="string"?C=C:C=dT(Q.from(C),p.schema);const{from:k}=b,N=k+C.length,E=rxe(C);return l({rule:d,state:p,from:k,to:{b:N},pasteEvt:E})}const w=h.doc.content.findDiffStart(p.doc.content),S=h.doc.content.findDiffEnd(p.doc.content);if(!(!Zve(w)||!S||w===S.b))return l({rule:d,state:p,from:w,to:S,pasteEvt:o})}}))}var l0=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=T6(t),this.schema=pve(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ef(e.name,this.schema)},r=Se(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return bh([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Ef(r.name,this.schema)},i=[],o=Se(r,"addKeyboardShortcuts",s);let a={};if(r.type==="mark"&&Se(r,"exitable",s)&&(a.ArrowRight=()=>_c.handleExit({editor:t,mark:r})),o){const h=Object.fromEntries(Object.entries(o()).map(([p,m])=>[p,()=>m({editor:t})]));a={...a,...h}}const l=gye(a);i.push(l);const u=Se(r,"addInputRules",s);if(JO(r,t.options.enableInputRules)&&u){const h=u();if(h&&h.length){const p=Jve({editor:t,rules:h}),m=Array.isArray(p)?p:[p];i.push(...m)}}const d=Se(r,"addPasteRules",s);if(JO(r,t.options.enablePasteRules)&&d){const h=d();if(h&&h.length){const p=sxe({editor:t,rules:h});i.push(...p)}}const f=Se(r,"addProseMirrorPlugins",s);if(f){const h=f();i.push(...h)}return i})}get attributes(){return _6(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Sd(this.extensions);return Object.fromEntries(e.filter(n=>!!Se(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:rn(n.name,this.schema)},i=Se(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const a=(l,u,d,f,h)=>{const p=Np(l,r);return o({node:l,view:u,getPos:d,decorations:f,innerDecorations:h,editor:t,extension:n,HTMLAttributes:p})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return bh([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Ef(s.name,this.schema)},o=Se(s,"dispatchTransaction",i);return o?a=>{o.call(i,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return bh([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Ef(s.name,this.schema)},o=Se(s,"transformPastedHTML",i);return o?(a,l)=>{const u=r(a,l);return o.call(i,u)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Sd(this.extensions);return Object.fromEntries(e.filter(n=>!!Se(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:No(n.name,this.schema)},i=Se(n,"addMarkView",s);if(!i)return[];const o=(a,l,u)=>{const d=Np(a,r);return i()({mark:a,view:l,inline:u,editor:t,extension:n,HTMLAttributes:d,updateAttributes:f=>{vxe(a,t,f)}})};return[n.name,o]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ef(e.name,this.schema)};e.type==="mark"&&((n=at(Se(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=Se(e,"onBeforeCreate",r),i=Se(e,"onCreate",r),o=Se(e,"onUpdate",r),a=Se(e,"onSelectionUpdate",r),l=Se(e,"onTransaction",r),u=Se(e,"onFocus",r),d=Se(e,"onBlur",r),f=Se(e,"onDestroy",r);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};l0.resolve=T6;l0.sort=bh;l0.flatten=uT;var ixe={};aT(ixe,{ClipboardTextSerializer:()=>B6,Commands:()=>$6,Delete:()=>V6,Drop:()=>z6,Editable:()=>U6,FocusEvents:()=>H6,Keymap:()=>q6,Paste:()=>K6,Tabindex:()=>G6,TextDirection:()=>Y6,focusEventsPluginKey:()=>W6});var Kt=class F6 extends hT{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new F6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},B6=Kt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Lt({key:new dn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,{ranges:i}=s,o=Math.min(...i.map(d=>d.$from.pos)),a=Math.max(...i.map(d=>d.$to.pos)),l=j6(n);return A6(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),$6=Kt.create({name:"commands",addCommands(){return{...v6}}}),V6=Kt.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,s;const i=()=>{var o,a,l,u;if((u=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const d=N6(t.before,[t,...e]);R6(d).forEach(p=>{d.mapping.mapResult(p.oldRange.from).deletedAfter&&d.mapping.mapResult(p.oldRange.to).deletedBefore&&d.before.nodesBetween(p.oldRange.from,p.oldRange.to,(m,g)=>{const y=g+m.nodeSize-2,b=p.oldRange.from<=g&&y<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:y,newFrom:d.mapping.map(g),newTo:d.mapping.map(y),deletedRange:p.oldRange,newRange:p.newRange,partial:!b,editor:this.editor,transaction:t,combinedTransform:d})})});const h=d.mapping;d.steps.forEach((p,m)=>{var g,y;if(p instanceof $s){const b=h.slice(m).map(p.from,-1),x=h.slice(m).map(p.to),w=h.invert().map(b,-1),S=h.invert().map(x),C=b>0?(g=d.doc.nodeAt(b-1))==null?void 0:g.marks.some(N=>N.eq(p.mark)):!1,k=(y=d.doc.nodeAt(x))==null?void 0:y.marks.some(N=>N.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:w,to:S},newRange:{from:b,to:x},partial:!!(k||C),editor:this.editor,transaction:t,combinedTransform:d})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),z6=Kt.create({name:"drop",addProseMirrorPlugins(){return[new Lt({key:new dn("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),U6=Kt.create({name:"editable",addProseMirrorPlugins(){return[new Lt({key:new dn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),W6=new dn("focusEvents"),H6=Kt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Lt({key:W6,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),q6=Kt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:d,$anchor:f}=l,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,b=g&&m.parent.childCount===1?y===f.pos:Ue.atStart(u).from===h;return!d||!p.type.isTextblock||p.textContent.length||!b||b&&f.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Fv()||k6()?i:s},addProseMirrorPlugins(){return[new Lt({key:new dn("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),s=t.some(g=>g.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:a}=e.selection,l=Ue.atStart(e.doc).from,u=Ue.atEnd(e.doc).to;if(i||!(o===l&&a===u)||!o0(n.doc))return;const h=n.tr,p=n0({state:n,transaction:h}),{commands:m}=new r0({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),K6=Kt.create({name:"paste",addProseMirrorPlugins(){return[new Lt({key:new dn("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),G6=Kt.create({name:"tabindex",addProseMirrorPlugins(){return[new Lt({key:new dn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Y6=Kt.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Sd(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Lt({key:new dn("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),oxe=class Kf{constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Kf(n,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 Kf(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 Kf(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!s&&!o&&l.depth<=this.depth)return;const u=new Kf(l,this.editor,s,s||o?n:null);s&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(i[l]!==n[l])break}}else r=s;s=s.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(o=>{r&&s.length>0||(o.node.type.name===e&&i.every(l=>n[l]===o.node.attrs[l])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},axe=`.ProseMirror {
530  position: relative;
531}
532
533.ProseMirror {
534  word-wrap: break-word;
535  white-space: pre-wrap;
536  white-space: break-spaces;
537  -webkit-font-variant-ligatures: none;
538  font-variant-ligatures: none;
539  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
540}
541
542.ProseMirror [contenteditable="false"] {
543  white-space: normal;
544}
545
546.ProseMirror [contenteditable="false"] [contenteditable="true"] {
547  white-space: pre-wrap;
548}
549
550.ProseMirror pre {
551  white-space: pre-wrap;
552}
553
554img.ProseMirror-separator {
555  display: inline !important;
556  border: none !important;
557  margin: 0 !important;
558  width: 0 !important;
559  height: 0 !important;
560}
561
562.ProseMirror-gapcursor {
563  display: none;
564  pointer-events: none;
565  position: absolute;
566  margin: 0;
567}
568
569.ProseMirror-gapcursor:after {
570  content: "";
571  display: block;
572  position: absolute;
573  top: -2px;
574  width: 20px;
575  border-top: 1px solid black;
576  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
577}
578
579@keyframes ProseMirror-cursor-blink {
580  to {
581    visibility: hidden;
582  }
583}
584
585.ProseMirror-hideselection *::selection {
586  background: transparent;
587}
588
589.ProseMirror-hideselection *::-moz-selection {
590  background: transparent;
591}
592
593.ProseMirror-hideselection * {
594  caret-color: transparent;
595}
596
597.ProseMirror-focused .ProseMirror-gapcursor {
598  display: block;
599}`;function lxe(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}var cxe=class extends Yve{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Nve,createMappablePosition:Eve},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:s,moved:i})=>this.options.onDrop(r,s,i)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=w6(e,this.options.autofocus);this.editorState=yu.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=lxe(axe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=E6(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[U6,B6.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),$6,H6,q6,G6,z6,K6,V6,Y6.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new l0(r,this)}createCommandManager(){this.commandManager=new r0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=AC(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=AC(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new g6(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),s=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return P6(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return Sve(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return dT(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
600
601`,textSerializers:n={}}=t||{};return gve(this.state.doc,{blockSeparator:e,textSerializers:{...j6(this.schema),...n}})}get isEmpty(){return o0(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new oxe(e,this)}get $doc(){return this.$pos(0)}};function kd(t){return new a0({find:t.find,handler:({state:e,range:n,match:r})=>{const s=at(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(fT(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>u).length)return null;d<n.to&&i.delete(d,n.to),u>n.from&&i.delete(n.from+l,u);const h=n.from+l+o.length;i.addMark(n.from+l,h,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function uxe(t){return new a0({find:t.find,handler:({state:e,range:n,match:r})=>{const s=at(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let a=n.to;const l=t.type.create(s);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=o+u;d>a?d=a:a=d+r[1].length;const f=r[0][r[0].length-1];i.insertText(f,o+r[0].length-1),i.replaceWith(d,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;i.insert(u,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(a))}i.scrollIntoView()},undoable:t.undoable})}function PC(t){return new a0({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=at(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function Cd(t){return new a0({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=at(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&G_(l,t.type,i);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>p.includes(y.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(f,i).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&nl(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)},undoable:t.undoable})}function dxe(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof _e){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}var fxe={};aT(fxe,{createAtomBlockMarkdownSpec:()=>hxe,createBlockMarkdownSpec:()=>pxe,createInlineMarkdownSpec:()=>yxe,parseAttributes:()=>pT,parseIndentedBlocks:()=>RC,renderNestedMarkdownContent:()=>gT,serializeAttributes:()=>mT});function pT(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}
601__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const u=s.map(d=>d.trim().slice(1));e.class=u.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,u,d])=>{var f;const h=parseInt(((f=d.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),p=n[h];p&&(e[u]=p.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function mT(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function hxe(t){const{nodeName:e,name:n,parseAttributes:r=pT,serializeAttributes:s=mT,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,u=d=>{if(!a)return d;const f={};return a.forEach(h=>{h in d&&(f[h]=d[h])}),f};return{parseMarkdown:(d,f)=>{const h={...i,...d.attributes};return f.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(d){var f;const h=new RegExp(`^:::${l}(?:\\s|$)`,"m"),p=(f=d.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(d,f,h){const p=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=d.match(p);if(!m)return;const g=m[1]||"",y=r(g);if(!o.find(x=>!(x in y)))return{type:e,raw:m[0],attributes:y}}},renderMarkdown:d=>{const f=u(d.attrs||{}),h=s(f),p=h?` {${h}}`:"";return`:::${l}${p} :::`}}}function pxe(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=pT,serializeAttributes:i=mT,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,u=n||e,d=f=>{if(!l)return f;const h={};return l.forEach(p=>{p in f&&(h[p]=f[p])}),h};return{parseMarkdown:(f,h)=>{let p;if(r){const g=r(f);p=typeof g=="string"?[{type:"text",text:g}]:g}else a==="block"?p=h.parseChildren(f.tokens||[]):p=h.parseInline(f.tokens||[]);const m={...o,...f.attributes};return h.createNode(e,m,p)},markdownTokenizer:{name:e,level:"block",start(f){var h;const p=new RegExp(`^:::${u}`,"m"),m=(h=f.match(p))==null?void 0:h.index;return m!==void 0?m:-1},tokenize(f,h,p){var m;const g=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=f.match(g);if(!y)return;const[b,x=""]=y,w=s(x);let S=1;const C=b.length;let k="";const N=/^:::([\w-]*)(\s.*)?/gm,E=f.slice(C);for(N.lastIndex=0;;){const _=N.exec(E);if(_===null)break;const T=_.index,P=_[1];if(!((m=_[2])!=null&&m.endsWith(":::"))){if(P)S+=1;else if(S-=1,S===0){const j=E.slice(0,T);k=j.trim();const F=f.slice(0,C+T+_[0].length);let B=[];if(k)if(a==="block")for(B=p.blockTokens(j),B.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=p.inlineTokens(U.text))});B.length>0;){const U=B[B.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))B.pop();else break}else B=p.inlineTokens(k);return{type:e,raw:F,attributes:w,content:k,tokens:B}}}}}},renderMarkdown:(f,h)=>{const p=d(f.attrs||{}),m=i(p),g=m?` {${m}}`:"",y=h.renderChildren(f.content||[],`
602
603`);return`:::${u}${g}
604
605${y}
606
607:::`}}}function mxe(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r;e[s]=i||o,r=n.exec(t)}return e}function gxe(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function yxe(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=mxe,serializeAttributes:i=gxe,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,u=n||e,d=h=>{if(!l)return h;const p={};return l.forEach(m=>{const g=typeof m=="string"?m:m.name,y=typeof m=="string"?void 0:m.skipIfDefault;if(g in h){const b=h[g];if(y!==void 0&&b===y)return;p[g]=b}}),p},f=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,p)=>{const m={...o,...h.attributes};if(a)return p.createNode(e,m);const g=r?r(h):h.content||"";return g?p.createNode(e,m,[p.createTextNode(g)]):p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(h){const p=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),m=h.match(p),g=m==null?void 0:m.index;return g!==void 0?g:-1},tokenize(h,p,m){const g=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),y=h.match(g);if(!y)return;let b="",x="";if(a){const[,S]=y;x=S}else{const[,S,C]=y;x=S,b=C||""}const w=s(x.trim());return{type:e,raw:y[0],content:b.trim(),attributes:w}}},renderMarkdown:h=>{let p="";r?p=r(h):h.content&&h.content.length>0&&(p=h.content.filter(b=>b.type==="text").map(b=>b.text).join(""));const m=d(h.attrs||{}),g=i(m),y=g?` ${g}`:"";return a?`[${u}${y}]`:`[${u}${y}]${p}[/${u}]`}}
607}function RC(t,e,n){var r,s,i,o;const a=t.split(`
608`),l=[];let u="",d=0;const f=e.baseIndentSize||2;for(;d<a.length;){const h=a[d],p=h.match(e.itemPattern);if(!p){if(l.length>0)break;if(h.trim()===""){d+=1,u=`${u}${h}
609`;continue}else return}const m=e.extractItemData(p),{indentLevel:g,mainContent:y}=m;u=`${u}${h}
610`;const b=[y];for(d+=1;d<a.length;){const C=a[d];if(C.trim()===""){const N=a.slice(d+1).findIndex(T=>T.trim()!=="");if(N===-1)break;if((((s=(r=a[d+1+N].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>g){b.push(C),u=`${u}${C}
611`,d+=1;continue}else break}if((((o=(i=C.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>g)b.push(C),u=`${u}${C}
612`,d+=1;else break}let x;const w=b.slice(1);if(w.length>0){const C=w.map(k=>k.slice(g+f)).join(`
613`);C.trim()&&(e.customNestedParser?x=e.customNestedParser(C):x=n.blockTokens(C))}const S=e.createToken(m,x);l.push(S)}if(l.length!==0)return{items:l,raw:u}}function gT(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const s=typeof n=="function"?n(r):n,[i,...o]=t.content,a=e.renderChildren([i]);let l=`${s}${a}`;return o&&o.length>0&&o.forEach((u,d)=>{var f,h;const p=(h=(f=e.renderChild)==null?void 0:f.call(e,u,d+1))!=null?h:e.renderChildren([u]);if(p!=null){const m=p.split(`
614`).map(g=>g?e.indent(g):e.indent("")).join(`
615`);l+=u.type==="paragraph"?`
616
617${m}`:`
618${m}`}}),l}function vxe(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((a,l)=>{const u=i.mapping.map(l),d=i.mapping.map(l)+a.nodeSize;let f=null;if(a.marks.forEach(p=>{if(p!==o)return!1;f=p}),!f)return;let h=!1;if(Object.keys(n).forEach(p=>{n[p]!==f.attrs[p]&&(h=!0)}),h){const p=t.type.create({...t.attrs,...n});i.removeMark(u,d,t.type),i.addMark(u,d,p)}}),i.docChanged&&e.view.dispatch(i)}var Gr=class Q6 extends hT{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new Q6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function vc(t){return new exe({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=at(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),f=n.from+l.indexOf(a),h=f+a.length;if(fT(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>f).length)return null;h<n.to&&o.delete(h,n.to),f>n.from&&o.delete(n.from+d,f),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:xxe,getOwnPropertySymbols:bxe}=Object,{hasOwnProperty:wxe}=Object.prototype;function u1(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function xg(t){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,s);const{cache:i}=s,o=i.get(n),a=i.get(r);if(o&&a)return o===r&&a===n;i.set(n,r),i.set(r,n);const l=t(n,r,s);return i.delete(n),i.delete(r),l}}function Sxe(t){return t!=null?t[Symbol.toStringTag]:void 0}function ZO(t){return xxe(t).concat(bxe(t))}const kxe=Object.hasOwn||((t,e)=>wxe.call(t,e));function Tc(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const Cxe="__v",Nxe="__o",Exe="_owner",{getOwnPropertyDescriptor:eD,keys:tD}=Object;function _xe(t,e){return t.byteLength===e.byteLength&&Bv(new Uint8Array(t),new Uint8Array(e))}function Txe(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Axe(t,e){return t.byteLength===e.byteLength&&Bv(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function jxe(t,e){return Tc(t.getTime(),e.getTime())}function Pxe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function Rxe(t,e){return t===e}function nD(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.entries();let o,a,l=0;for(;(o=i.next())&&!o.done;){const u=e.entries();let d=!1,f=0;for(;(a=u.next())&&!a.done;){if(s[f]){f++;continue}const h=o.value,p=a.value;if(n.equals(h[0],p[0],l,f,t,e,n)&&n.equals(h[1],p[1],h[0],p[0],t,e,n)){d=s[f]=!0;break}f++}if(!d)return!1;l++}return!0}const Mxe=Tc;function Oxe(t,e,n){const r=tD(t);let s=r.length;if(tD(e).length!==s)return!1;for(;s-- >0;)if(!J6(t,e,n,r[s]))return!1;return!0}function _f(t,e,n){const r=ZO(t);let s=r.length;if(ZO(e).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!J6(t,e,n,i)||(o=eD(t,i),a=eD(e,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function Dxe(t,e){return Tc(t.valueOf(),e.valueOf())}function Ixe(t,e){return t.source===e.source&&t.flags===e.flags}function rD(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.values();let o,a;for(;(o=i.next())&&!o.done;){const l=e.values();let u=!1,d=0;for(;(a=l.next())&&!a.done;){if(!s[d]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function Bv(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function Lxe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function J6(t,e,n,r){return(r===Exe||r===Nxe||r===Cxe)&&(t.$$typeof||e.$$typeof)?!0:kxe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const Fxe="[object ArrayBuffer]",Bxe="[object Arguments]",$xe="[object Boolean]",Vxe="[object DataView]",zxe="[object Date]",Uxe="[object Error]",Wxe="[object Map]",Hxe="[object Number]",qxe="[object Object]",Kxe="[object RegExp]",Gxe="[object Set]",Yxe="[object String]",Qxe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array
618]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Jxe="[object URL]",Xxe=Object.prototype.toString;function Zxe({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:m}){return function(y,b,x){if(y===b)return!0;if(y==null||b==null)return!1;const w=typeof y;if(w!==typeof b)return!1;if(w!=="object")return w==="number"?a(y,b,x):w==="function"?i(y,b,x):!1;const S=y.constructor;if(S!==b.constructor)return!1;if(S===Object)return l(y,b,x);if(Array.isArray(y))return e(y,b,x);if(S===Date)return r(y,b,x);if(S===RegExp)return d(y,b,x);if(S===Map)return o(y,b,x);if(S===Set)return f(y,b,x);const C=Xxe.call(y);if(C===zxe)return r(y,b,x);if(C===Kxe)return d(y,b,x);if(C===Wxe)return o(y,b,x);if(C===Gxe)return f(y,b,x);if(C===qxe)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,x);if(C===Jxe)return p(y,b,x);if(C===Uxe)return s(y,b,x);if(C===Bxe)return l(y,b,x);if(Qxe[C])return h(y,b,x);if(C===Fxe)return t(y,b,x);if(C===Vxe)return n(y,b,x);if(C===$xe||C===Hxe||C===Yxe)return u(y,b,x);if(m){let k=m[C];if(!k){const N=Sxe(y);N&&(k=m[N])}if(k)return k(y,b,x)}return!1}}function ebe({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:_xe,areArraysEqual:n?_f:Txe,areDataViewsEqual:Axe,areDatesEqual:jxe,areErrorsEqual:Pxe,areFunctionsEqual:Rxe,areMapsEqual:n?u1(nD,_f):nD,areNumbersEqual:Mxe,areObjectsEqual:n?_f:Oxe,arePrimitiveWrappersEqual:Dxe,areRegExpsEqual:Ixe,areSetsEqual:n?u1(rD,_f):rD,areTypedArraysEqual:n?u1(Bv,_f):Bv,areUrlsEqual:Lxe,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=xg(r.areArraysEqual),i=xg(r.areMapsEqual),o=xg(r.areObjectsEqual),a=xg(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:a})}return r}function tbe(t){return function(e,n,r,s,i,o,a){return t(e,n,a)}}function nbe({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(a,l){const{cache:u=t?new WeakMap:void 0,meta:d}=n();return e(a,l,{cache:u,equals:r,meta:d,strict:s})};if(t)return function(a,l){return e(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(a,l){return e(a,l,i)}}const rbe=sl();sl({strict:!0});sl({circular:!0});sl({circular:!0,strict:!0});sl({createInternalComparator:()=>Tc});sl({strict:!0,createInternalComparator:()=>Tc});sl({circular:!0,createInternalComparator:()=>Tc});sl({circular:!0,createInternalComparator:()=>Tc,strict:!0});function sl(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=ebe(t),o=Zxe(i),a=n?n(o):tbe(o);return nbe({circular:e,comparator:o,createState:r,equals:a,strict:s})}var X6={exports:{}},Z6={};/**
619 * @license React
620 * use-sync-external-store-shim/with-selector.production.js
621 *
622 * Copyright (c) Meta Platforms, Inc. and affiliates.
623 *
624 * This source code is licensed under the MIT license found in the
625 * LICENSE file in the root directory of this source tree.
626 */var c0=v,sbe=Bb;function ibe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var obe=typeof Object.is=="function"?Object.is:ibe,abe=sbe.useSyncExternalStore,lbe=c0.useRef,cbe=c0.useEffect,ube=c0.useMemo,dbe=c0.useDebugValue;Z6.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=lbe(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=ube(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return f=m}return f=p}if(m=f,obe(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,s]);var a=abe(t,i[0],i[1]);return cbe(function(){o.hasValue=!0,o.value=a},[a]),dbe(a),a};X6.exports=Z6;var fbe=X6.exports,hbe=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},pbe=({contentComponent:t})=>{const e=Bb.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return c.jsx(c.Fragment,{children:Object.values(e)})};function mbe(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Vx.createPortal(r.reactElement,r.element,n)},t.forEach(s=>s())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(s=>s())}}}var gbe=class extends z.Component{constructor(t){super(t),this.editorContentRef=z.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=mbe(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:hbe(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&c.jsx(pbe,{contentComponent:t.contentComponent})]})}},ybe=v.forwardRef((t,e)=>{const n=z.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return z.createElement(gbe,{key:n,innerRef:e,...t})}),eW=z.memo(ybe),vbe=typeof window<"u"?v.useLayoutEffect:v.useEffect,xbe=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0}
626,this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function bbe(t){var e;const[n]=v.useState(()=>new xbe(t.editor)),r=fbe.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:rbe);return vbe(()=>n.watch(t.editor),[t.editor,n]),v.useDebugValue(r),r}var wbe=!1,MC=typeof window>"u",Sbe=MC||!!(typeof window<"u"&&window.next),kbe=class tW{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(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return MC||Sbe?null:this.createEditor();if(this.options.current.immediatelyRender&&MC&&wbe)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)},onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new cxe(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)==null?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?tW.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}
626):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Cbe(t={},e=[]){const n=v.useRef(t);n.current=t;const[r]=v.useState(()=>new kbe(n)),s=Bb.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return v.useDebugValue(s),v.useEffect(r.onRender(e)),bbe({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var nW=v.createContext({editor:null});nW.Consumer;var Nbe=v.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ebe=()=>v.useContext(Nbe);z.forwardRef((t,e)=>{const{onDragStart:n}=Ebe(),r=t.as||"div";return c.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});z.createContext({markViewContentRef:()=>{}});var yT=v.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});yT.displayName="TiptapContext";var _be=()=>v.useContext(yT);function rW({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=v.useMemo(()=>({editor:r}),[r]),i=v.useMemo(()=>({editor:r}),[r]);return c.jsx(nW.Provider,{value:i,children:c.jsx(yT.Provider,{value:s,children:n})})}rW.displayName="Tiptap";function sW({...t}){const{editor:e}=_be();return c.jsx(eW,{editor:e,...t})}sW.displayName="Tiptap.Content";Object.assign(rW,{Content:sW});var $v=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},Tbe=/^\s*>\s$/,Abe=Gr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return $v("blockquote",{...sn(this.options.HTMLAttributes,t),children:$v("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,a;const d=((a=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?a:e.renderChildren([s])).split(`
627`).map(f=>f.trim()===""?n:`${n} ${f}`);r.push(d.join(`
628`))}),r.join(`
629${n}
630`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Cd({find:Tbe,type:this.type})]}}),jbe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Pbe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Rbe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Mbe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Obe=_c.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return $v("strong",{...sn(this.options.HTMLAttributes,t),children:$v("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
vendor: 7,867 bytes, lines 630-651
630,addInputRules(){return[kd({find:jbe,type:this.type}),kd({find:Rbe,type:this.type})]},addPasteRules(){return[vc({find:Pbe,type:this.type}),vc({find:Mbe,type:this.type})]}}),Dbe=/(^|[^`])`([^`]+)`(?!`)$/,Ibe=/(^|[^`])`([^`]+)`(?!`)/g,Lbe=_c.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",sn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[kd({find:Dbe,type:this.type})]},addPasteRules(){return[vc({find:Ibe,type:this.type})]}}),d1=4,Fbe=/^```([a-z]+)?[\s\n]$/,Bbe=/^~~~([a-z]+)?[\s\n]$/,$be=Gr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:d1,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",sn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const s=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${s}`,e.renderChildren(t.content),"```"].join(`
631`):r=`\`\`\`${s}
632
633\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:d1,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?t.commands.insertContent(a):t.commands.command(({tr:l})=>{const{from:u,to:d}=s,p=r.doc.textBetween(u,d,`
634`,`
635`).split(`
636`).map(m=>a+m).join(`
637`);return l.replaceWith(u,d,r.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:d1,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;return i.parent.type!==this.type?!1:o?t.commands.command(({tr:a})=>{var l;const{pos:u}=i,d=i.start(),f=i.end(),p=r.doc.textBetween(d,f,`
638`,`
639`).split(`
640`);let m=0,g=0;const y=u-d;for(let k=0;k<p.length;k+=1){if(g+p[k].length>=y){m=k;break}g+=p[k].length+1}const x=((l=p[m].match(/^ */))==null?void 0:l[0])||"",w=Math.min(x.length,n);if(w===0)return!0;let S=d;for(let k=0;k<m;k+=1)S+=p[k].length+1;return a.delete(S,S+w),u-S<=w&&a.setSelection(Oe.create(a.doc,S)),!0}):t.commands.command(({tr:a})=>{const{from:l,to:u}=s,h=r.doc.textBetween(l,u,`
641`,`
642`).split(`
643`).map(p=>{var m;const g=((m=p.match(/^ */))==null?void 0:m[0])||"",y=Math.min(g.length,n);return p.slice(y)}).join(`
644`);return a.replaceWith(l,u,r.schema.text(h)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
645
646`);return!i||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const a=s.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(Ue.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[PC({find:Fbe,type:this.type,getAttributes:t=>({language:t[1]})}),PC({find:Bbe,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Lt({key:new dn("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
647`));return o.replaceSelectionWith(this.type.create({language:i},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Oe.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),Vbe=Gr.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
648
649`):""}),zbe=Gr.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",sn(this.options.HTMLAttributes,t)]},renderText(){return`
650`},renderMarkdown:()=>`  
651`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&o){const f=l.filter(h=>a.includes(h.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ube=Gr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,sn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>PC({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
651)\\s$`),type:this.type,getAttributes:{level:t}}))}}),Wbe=Gr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",sn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!dxe(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return M6(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(Oe.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(_e.create(o.doc,l.pos)):o.setSelection(Oe.create(o.doc,l.pos));else{const d=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,f=d==null?void 0:d.create();f&&(o.insert(u,f),o.setSelection(Oe.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[uxe({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
vendor: 4,520 bytes, line 651
651ype})]}}),Hbe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,qbe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Kbe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Gbe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ybe=_c.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",sn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[kd({find:Hbe,type:this.type}),kd({find:Kbe,type:this.type})]},addPasteRules(){return[vc({find:qbe,type:this.type}),vc({find:Gbe,type:this.type})]}});const Qbe="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
651ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Jbe="ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
651ºÐ´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",OC="numeric",DC="ascii",IC="alph
651a",wh="asciinumeric",Gf="alphanumeric",LC="domain",iW="emoji",Xbe="scheme",Zbe="slashscheme",f1="whitespace";function e0e(t,e){return t in e||(e[t]=[]),e[t]}function jl(t,e,n){e[OC]&&(e[wh]=!0,e[Gf]=!0),e[DC]&&(e[wh]=!0,e[IC]=!0),e[wh]&&(e[Gf]=!0),e[IC]&&(e[Gf]=!0),e[Gf]&&(e[LC]=!0),e[iW]&&(e[LC]=!0);for(const r in e){const s=e0e(r,n);s.indexOf(t)<0&&s.push(t)}}function t0e(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function br(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}br.groups={};br.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],i=e.jr[r][1];if(i&&s.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let s=0;s<t.length;s++)this.tt(t[s],e,n,r)},tr(t,e,n,r){r=r||br.groups;let s;return e&&e.j?s=e:(s=new br(e),n&&r&&jl(e,n,r)),this.jr.push([t,s]),s},ts(t,e,n,r){let s=this;const i=t.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(t[o]);return s.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||br.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const i=e;let o,a=s.go(t);if(a?(o=new br,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new br,i){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(t0e(o.t,r),n);jl(i,l,r)}else n&&jl(i,n,r);o.t=i}return s.j[t]=o,o}};const ze=(t,e,n,r,s)=>t.ta(e,n,r,s),Ft=(t,e,n,r,s)=>t.tr(e,n,r,s),sD=(t,e,n,r,s)=>t.ts(e,n,r,s),J=(t,e,n,r,s)=>t.tt(e,n,r,s),Xi="WORD",FC="UWORD",oW="ASCIINUMERICAL",aW="ALPHANUMERICAL",Ep="LOCALHOST",BC="TLD",$C="UTLD",ly="SCHEME",eu="SLASH_SCHEME",vT="NUM",VC="WS",xT="NL",Sh="OPENBRACE",kh="CLOSEBRACE",Vv="OPENBRACKET",zv="CLOSEBRACKET",Uv="OPENPAREN",Wv="CLOSEPAREN",Hv="OPENANGLEBRACKET",qv="CLOSEANGLEBRACKET",Kv="FULLWIDTHLEFTPAREN",Gv="FULLWIDTHRIGHTPAREN",Yv="LEFTCORNERBRACKET",Qv="RIGHTCORNERBRACKET",Jv="LEFTWHITECORNERBRACKET",Xv="RIGHTWHITECORNERBRACKET",Zv="FULLWIDTHLESSTHAN",ex="FULLWIDTHGREATERTHAN",tx="AMPERSAND",nx="APOSTROPHE",rx="ASTERISK",Uo="AT",sx="BACKSLASH",ix="BACKTICK",ox="CARET",Jo="COLON",bT="COMMA",ax="DOLLAR",ai="DOT",lx="EQUALS",wT="EXCLAMATION",Jr="HYPHEN",Ch="PERCENT",cx="PIPE",ux="PLUS",dx="POUND",Nh="QUERY",ST="QUOTE",lW="FULLWIDTHMIDDLEDOT",kT="SEMI",li="SLASH",Eh="TILDE",fx="UNDERSCORE",cW="EMOJI",hx="SYM";var uW=Object.freeze({__proto__:null,ALPHANUMERICAL:aW,AMPERSAND:tx,APOSTROPHE:nx,ASCIINUMERICAL:oW,ASTERISK:rx,AT:Uo,BACKSLASH:sx,BACKTICK:ix,CARET:ox,CLOSEANGLEBRACKET:qv,CLOSEBRACE:kh,CLOSEBRACKET:zv,CLOSEPAREN:Wv,COLON:Jo,COMMA:bT,DOLLAR:ax,DOT:ai,EMOJI:cW,EQUALS:lx,EXCLAMATION:wT,FULLWIDTHGREATERTHAN:ex,FULLWIDTHLEFTPAREN:Kv,FULLWIDTHLESSTHAN:Zv,FULLWIDTHMIDDLEDOT:lW,FULLWIDTHRIGHTPAREN:Gv,HYPHEN:Jr,LEFTCORNERBRACKET:Yv,LEFTWHITECORNERBRACKET:Jv,LOCALHOST:Ep,NL:xT,NUM:vT,OPENANGLEBRACKET:Hv,OPENBRACE:Sh,OPENBRACKET:Vv,OPENPAREN:Uv,PERCENT:Ch,PIPE:cx,PLUS:ux,POUND:dx,QUERY:Nh,QUOTE:ST,RIGHTCORNERBRACKET:Qv,RIGHTWHITECORNERBRACKET:Xv,SCHEME:ly,SEMI:kT,SLASH:li,SLASH_SCHEME:eu,SYM:hx,TILDE:Eh,TLD:BC,UNDERSCORE:fx,UTLD:$C,UWORD:FC,WORD:Xi,WS:VC});const Gi=/[a-z]/,Tf=new RegExp("\\p{L}","u"),h1=new RegExp("\\p{Emoji}","u"),Yi=/\d/,p1=/\s/,iD="\r",m1=`
652`,n0e="️",r0e="‍",g1="";let bg=null,wg=null;function s0e(t=[]){const e={};br.groups=e;const n=new br;bg==null&&(bg=oD(Qbe)),wg==null&&(wg=oD(Jbe)),J(n,"'",nx),J(n,"{",Sh),J(n,"}",kh),J(n,"[",Vv),J(n,"]",zv),J(n,"(",Uv),J(n,")",Wv),J(n,"<",Hv),J(n,">",qv),J(n,"(",Kv),J(n,")",Gv),J(n,"「",Yv),J(n,"」",Qv),J(n,"『",Jv),J(n,"』",Xv),J(n,"<",Zv),J(n,">",ex),J(n,"&",tx),J(n,"*",rx),J(n,"@",Uo),J(n,"`",ix),J(n,"^",ox),J(n,":",Jo),J(n,",",bT),J(n,"$",ax),J(n,".",ai),J(n,"=",lx),J(n,"!",wT),J(n,"-",Jr),J(n,"%",Ch),J(n,"|",cx),J(n,"+",ux),J(n,"#",dx),J(n,"?",Nh),J(n,'"',ST),J(n,"/",li),J(n,";",kT),J(n,"~",Eh),J(n,"_",fx),J(n,"\\",sx),J(n,"・",lW);const r=Ft(n,Yi,vT,{[OC]:!0});Ft(r,Yi,r);const s=Ft(r,Gi,oW,{[wh]:!0}),i=Ft(r,Tf,aW,{[Gf]:!0}),o=Ft(n,Gi,Xi,{[DC]:!0});Ft(o,Yi,s),Ft(o,Gi,o),Ft(s,Yi,s),Ft(s,Gi,s);const a=Ft(n,Tf,FC,{[IC]:!0});Ft(a,Gi),Ft(a,Yi,i),Ft(a,Tf,a),Ft(i,Yi,i),Ft(i,Gi),Ft(i,Tf,i);const l=J(n,m1,xT,{[f1]:!0}),u=J(n,iD,VC,{[f1]:!0}),d=Ft(n,p1,VC,{[f1]:!0});J(n,g1,d),J(u,m1,l),J(u,g1,d),Ft(u,p1,d),J(d,iD),J(d,m1),Ft(d,p1,d),J(d,g1,d);const f=Ft(n,h1,cW,{[iW]:!0});J(f,"#"),Ft(f,h1,f),J(f,n0e,f);const h=J(f,r0e);J(h,"#"),Ft(h,h1,f);const p=[[Gi,o],[Yi,s]],m=[[Gi,null],[Tf,a],[Yi,i]];for(let g=0;g<bg.length;
vendor: 6,708 bytes, line 652
652g++)Mo(n,bg[g],BC,Xi,p);for(let g=0;g<wg.length;g++)Mo(n,wg[g],$C,FC,m);jl(BC,{tld:!0,ascii:!0},e),jl($C,{utld:!0,alpha:!0},e),Mo(n,"file",ly,Xi,p),Mo(n,"mailto",ly,Xi,p),Mo(n,"http",eu,Xi,p),Mo(n,"https",eu,Xi,p),Mo(n,"ftp",eu,Xi,p),Mo(n,"ftps",eu,Xi,p),jl(ly,{scheme:!0,ascii:!0},e),jl(eu,{slashscheme:!0,ascii:!0},e),t=t.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<t.length;g++){const y=t[g][0],x=t[g][1]?{[Xbe]:!0}:{[Zbe]:!0};y.indexOf("-")>=0?x[LC]=!0:Gi.test(y)?Yi.test(y)?x[wh]=!0:x[DC]=!0:x[OC]=!0,sD(n,y,y,x)}return sD(n,"localhost",Ep,{ascii:!0}),n.jd=new br(hx),{start:n,tokens:Object.assign({groups:e},uW)}}function dW(t,e){const n=i0e(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o<r;){let a=t,l=null,u=0,d=null,f=-1,h=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(f=0,h=0,d=a):f>=0&&(f+=n[o].length,h++),u+=n[o].length,i+=n[o].length,o++;i-=f,o-=h,u-=f,s.push({t:d.t,v:e.slice(i-u,i),s:i-u,e:i})}return s}function i0e(t){const e=[],n=t.length;let r=0;for(;r<n;){let s=t.charCodeAt(r),i,o=s<55296||s>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function Mo(t,e,n,r,s){let i;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new br(r),i.jr=s.slice(),t.j[l]=i),t=i}return i=new br(n),i.jr=s.slice(),t.j[e[o-1]]=i,i}function oD(t){const e=[],n=[];let r=0,s="0123456789";for(;r<t.length;){let i=0;for(;s.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}const _p={defaultProtocol:"http",events:null,format:aD,formatHref:aD,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function CT(t,e=null){let n=Object.assign({},_p);t&&(n=Object.assign(n,t instanceof CT?t.o:t));const r=n.ignoreTags,s=[];for(let i=0;i<r.length;i++)s.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=s}CT.prototype={o:_p,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=n.t in s?s[n.t]:_p[t],typeof s=="function"&&r&&(s=s(e,n))):typeof s=="function"&&r&&(s=s(e,n.t,n)),s)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function aD(t){return t}function fW(t,e){this.t="token",this.v=t,this.tk=e}fW.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=_p.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),d=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),u&&(o.rel=u),d&&Object.assign(o,d),{tagName:s,attributes:o,content:i,eventListeners:f}}};function u0(t,e){class n extends fW{constructor(s,i){super(s,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const lD=u0("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cD=u0("text"),o0e=u0("nl"),Sg=u0("url",{isLink:!0,toHref(t=_p.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Ep&&t[1].t===Jo}}),Yr=t=>new br(t);function a0e({groups:t}){const e=t.domain.concat([tx,rx,Uo,sx,ix,ox,ax,lx,Jr,vT,Ch,cx,ux,dx,li,hx,Eh,fx]),n=[nx,Jo,bT,ai,wT,Ch,Nh,ST,kT,Hv,qv,Sh,kh,zv,Vv,Uv,Wv,Kv,Gv,Yv,Qv,Jv,Xv,Zv,ex],r=[tx,nx,rx,sx,ix,ox,ax,lx,Jr,Sh,kh,Ch,cx,ux,dx,Nh,li,hx,Eh,fx],s=Yr(),i=J(s,Eh);ze(i,r,i),ze(i,t.domain,i);const o=Yr(),a=Yr(),l=Yr();ze(s,t.domain,o),ze(s,t.scheme,a),ze(s,t.slashscheme,l),ze(o,r,i),ze(o,t.domain,o);const u=J(o,Uo);J(i,Uo,u),J(a,Uo,u),J(l,Uo,u);const d=J(i,ai);ze(d,r,i),ze(d,t.domain,i);const f=Yr();ze(u,t.domain,f),ze(f,t.domain,f);const h=J(f,ai);ze(h,t.domain,f);const p=Yr(lD);ze(h,t.tld,p),ze(h,t.utld,p),J(u,Ep,p);const m=J(f,Jr);J(m,Jr,m),ze(m,t.domain,f),ze(p,t.domain,f),J(p,ai,h),J(p,Jr,m);const g=J(p,Jo);ze(g,t.numeric,lD);const y=J(o,Jr),b=J(o,ai);J(y,Jr,y),ze(y,t.domain,o),ze(b,r,i),ze(b,t.domain,o);const x=Yr(Sg);ze(b,t.tld,x),ze(b,t.utld,x),ze(x,t.domain,o),ze(x,r,i),J(x,ai,b),J(x,Jr,y),J(x,Uo,u);const w=J(x,Jo),S=Yr(Sg);ze(w,t.numeric,S);const C=Yr(Sg),k=Yr();ze(C,e,C),ze(C,n,k),ze(k,e,C),ze(k,n,k),J(x,li,C),J(S,li,C);const N=J(a,Jo),E=J(l,Jo),_=J(E,li),T=J(_,li);ze(a,t.domain,o),J(a,ai,b),J(a,Jr,y),ze(l,t.domain,o),J(l,ai,b),J(l,Jr,y),ze(N,t.domain,C),J(N,li,C),J(N,Nh,C),ze(T,t.domain,C),ze(T,e,C),J(T,li,C);const P=[[Sh,kh],[Vv,zv],[Uv,Wv],[Hv,qv],[Kv,Gv],[Yv,Qv],[Jv,Xv],[Zv,ex]];for(let j=0;j<P.length;j++){const[F,B]=P[j],U=J(C,F);J(k,F,U),J(U,B,C);const D=Yr(Sg);ze(U,e,D);const L=Yr();ze(U,n),ze(D,e,D),ze(D,n,L),ze(L,e,D),ze(L,n,L),J(D,B,C),J(L,B,C)}return J(s,Ep,x),J(s,xT,o0e),{start:s,tokens:uW}}function l0e(t,e,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let a=t,l=null,u=null,d=0,f=null,h=-1;for(;s<r&&!(l=a.go(n[s].t));)o.push(n[s++]);for(;s<r&&(u=l||a.go(n[s].t));)l=null,a=u,a.accepts()?(h=0,f=a):h>=0&&h++,s++,d++;if(h<0)s-=d,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push(y1(cD,e,o)),o=[]),s-=h,d-=h;const p=f.t,m=n.slice(s-d,s);i.push(y1(p,e,m))}}return o.length>0&&i.push(y1(cD,e,o)),i}function y1(t,e,n){const r=n[0].s,s=n[n.length-1].e,i=e.slice(r,s);return new t(i,n)}const c0e=typeof console<"u"&&console&&console.warn||(()=>{}),u0e="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Nt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function d0e(){return br.groups={},Nt.scanner=null,Nt.parser=null,Nt.tokenQueue=[],Nt.pluginQueue=[],Nt.customSchemes=[],Nt.initialized=!1,Nt}function uD(t,e=!1){if(Nt.initialized&&c0e(`linkifyjs: already initialized - will not register custom scheme "${t}" ${u0e}
652`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
6531. Must only contain digits, lowercase ASCII letters or "-"
6542. Cannot start or end with "-"
6553. "-" cannot repeat`);Nt.customSchemes.push([t,e])}function f0e(){Nt.scanner=s0e(Nt.customSchemes);for(let t=0;t<Nt.tokenQueue.length;t++)Nt.tokenQueue[t][1]({scanner:Nt.scanner});Nt.parser=a0e(Nt.scanner.tokens);for(let t=0;t<Nt.pluginQueue.length;t++)Nt.pluginQueue[t][1]({scanner:Nt.scanner,parser:Nt.parser});return Nt.initialized=!0,Nt}function NT(t){return Nt.initialized||f0e(),l0e(Nt.parser.start,t,dW(Nt.scanner.start,t))}NT.scan=dW;function hW(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new CT(n),s=NT(t),i=[];for(let o=0;o<s.length;o++){const a=s[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}var ET="[\0-   ᠎ -\u2029  ]",h0e=new RegExp(ET),p0e=new RegExp(`${ET}$`),m0e=new RegExp(ET,"g");function g0e(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function y0e(t){return new Lt({key:new dn("autolink"),appendTransaction:(e,n,r)=>{const s=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),i=e.some(u=>u.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,a=N6(n.doc,[...e]);if(R6(a).forEach(({newRange:u})=>{const d=cve(r.doc,u,p=>p.isTextblock);let f,h;if(d.length>1)f=d[0],h=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const p=r.doc.textBetween(u.from,u.to," "," ");if(!p0e.test(p))return;f=d[0],h=r.doc.textBetween(f.pos,u.to,void 0," ")}if(f&&h){const p=h.split(h0e).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],g=f.pos+h.lastIndexOf(m);if(!m)return!1;const y=NT(m).map(b=>b.toObject(t.defaultProtocol));if(!g0e(y))return!1;y.filter(b=>b.isLink).map(b=>({...b,from:g+b.start+1,to:g+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{fT(b.from,b.to,r.doc).some(x=>x.mark.type===t.type)||o.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function v0e(t){return new Lt({key:new dn("handleClickLink"),props:{handleClick:(e,n,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const l=r.target;if(!l)return!1;const u=t.editor.view.dom;o=l.closest("a"),o&&!u.contains(o)&&(o=null)}if(!o)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const l=P6(e.state,t.type.name),u=(s=o.href)!=null?s:l.href,d=(i=o.target)!=null?i:l.target;u&&(window.open(u,d),a=!0)}return a}}})}function x0e(t){return new Lt({key:new dn("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const u=hW(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u||s!==void 0&&!s(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function ul(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!t||t.replace(m0e,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var b0e=_c.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(t=>{if(typeof t=="string"){uD(t);return}uD(t.scheme,t.optionalSlashes)})},onDestroy(){d0e()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>
vendor: 2,526 bytes, line 655
655!!ul(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const s=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!ul(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ul(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",sn(this.options.HTMLAttributes,t),0]:["a",sn(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,s,i;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",a=(i=(s=t.attrs)==null?void 0:s.title)!=null?i:"",l=e.renderChildren(t);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ul(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ul(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vc({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,s=hW(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!ul(o,n),protocols:n,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e}
vendor: 13,291 bytes, lines 655-665
655,type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(y0e({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!ul(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(v0e({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(x0e({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),w0e=Object.defineProperty,S0e=(t,e)=>{for(var n in e)w0e(t,n,{get:e[n],enumerable:!0})},k0e="listItem",dD="textStyle",fD=/^\s*([-+*])\s$/,pW=Gr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",sn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
656`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(k0e,this.editor.getAttributes(dD)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Cd({find:fD,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Cd({find:fD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(dD),editor:this.editor})),[t]}}),mW=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",sn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let s=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(o=>o.type==="paragraph"))s=r(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const l=t.tokens.slice(1),u=r(l);s.push(...u)}}else s=r(t.tokens)}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>gT(t,e,r=>{var s,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(s=r.meta)==null?void 0:s.parentAttrs)==null?void 0:i.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),C0e={};S0e(C0e,{findListItemPos:()=>pm,getNextListDepth:()=>_T,handleBackspace:()=>zC,handleDelete:()=>UC,hasListBefore:()=>gW,hasListItemAfter:()=>N0e,hasListItemBefore:()=>yW,listItemHasSubList:()=>vW,nextListIsDeeper:()=>xW,nextListIsHigher:()=>bW});var pm=(t,e)=>{const{$from:n}=e.selection,r=rn(t,e.schema);let s=null,i=n.depth,o=n.pos,a=null;for(;i>0&&a===null;)s=n.node(i),s.type===r?a=i:(i-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},_T=(t,e)=>{const n=pm(t,e);if(!n)return!1;const[,r]=bve(e,t,n.$pos.pos+4);return r},gW=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},yW=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((n=s.nodeBefore)==null?void 0:n.type.name)!==t)},vW=(t,e,n)=>{if(!n)return!1;const r=rn(t,e.schema);let s=!1;return n.descendants(i=>{i.type===r&&(s=!0)}),s},zC=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ka(t.state,e)&&gW(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),u=[];l.node().descendants((h,p)=>{h.type.name===e&&u.push({node:h,pos:p})});const d=u.at(-1);if(!d)return!1;const f=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},f.end()).joinForward().run()}if(!Ka(t.state,e)||!Cve(t.state))return!1;const r=pm(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=vW(e,t.state,i);return yW(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},xW=(t,e)=>{const n=_T(t,e),r=pm(t,e);return!r||!n?!1:n>r.depth},bW=(t,e)=>{const n=_T(t,e),r=pm(t,e);return!r||!n?!1:n<r.depth},UC=(t,e)=>{if(!Ka(t.state,e)||!kve(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:xW(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():bW(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},N0e=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((n=s.nodeAfter)==null?void 0:n.type.name)!==t)},wW=Kt.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&UC(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&UC(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&zC(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&zC(t,n,r)&&(e=!0)}),e}}}}),hD=/^(\s*)(\d+)\.\s+(.*)$/,E0e=/^\s/;function _0e(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n],i=s.match(hD);if(!i)break;const[,o,a,l]=i,u=o.length;let d=l,f=n+1;const h=[s];for(;f<t.length;){const p=t[f];if(p.match(hD))break;if(p.trim()==="")h.push(p),d+=`
657`,f+=1;else if(p.match(E0e))h.push(p),d+=`
658${p.slice(u+2)}`,f+=1;else break}e.push({indent:u,number:parseInt(a,10),content:d.trim(),raw:h.join(`
659`)}),r=f,n=f}return[e,r]}function SW(t,e,n){var r;const s=[];let i=0;for(;i<t.length;){const o=t[i];if(o.indent===e){const a=o.content.split(`
660`),l=((r=a[0])==null?void 0:r.trim())||"",u=[];l&&u.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.slice(1).join(`
661`).trim();if(d){const p=n.blockTokens(d);u.push(...p)}let f=i+1;const h=[];for(;f<t.length&&t[f].indent>e;)h.push(t[f]),f+=1;if(h.length>0){const p=Math.min(...h.map(g=>g.indent)),m=SW(h,p,n);u.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(g=>g.raw).join(`
662`)})}s.push({type:"list_item",raw:o.raw,tokens:u}),i=f}else i+=1}return s}function T0e(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var A0e="listItem",pD="textStyle",mD=/^(\d+)\.\s$/,kW=Gr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",sn(this.options.HTMLAttributes,n),0]:["ol",sn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?T0e(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
663`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const s=t.split(`
664`),[i,o]=_0e(s);if(i.length===0)return;const a=SW(i,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:a,raw:s.slice(0,o).join(`
665`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(A0e,this.editor.getAttributes(pD)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Cd({find:mD,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Cd({find:mD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(pD)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),j0e=/^\s*(\[([( |x])?\])\s$/,P0e=Gr.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",sn(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const s=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return gT(t,e,s)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=f=>{var h,p;a.ariaLabel=((p=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:p.call(h,f,a.checked))||`Task item checkbox for ${f.textContent||"empty task item"}`};u(t),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=f.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,h])=>{s.setAttribute(f,h)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,o),s.append(i,l),Object.entries(e).forEach(([f,h])=>{s.setAttribute(f,h)});let d=new Set(Object.keys(e));return{dom:s,contentDOM:l,update:f=>{if(f.type!==this.type)return!1;s.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,u(f);const h=r.extensionManager.attributes,p=Np(f,h),m=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return d.forEach(y=>{m.has(y)||(y in g?s.setAttribute(y,g[y]):s.removeAttribute(y))}),Object.entries(p).forEach(([y,b])=>{b==null?y in g?s.setAttribute(y,g[y]):s.removeAttribute(y):s.setAttribute(y,b)}
665),d=m,!0}}}},addInputRules(){return[Cd({find:j0e,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),R0e=Gr.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",sn(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
666`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const o=RC(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=RC(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Kt.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(pW.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(mW.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(wW.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(kW.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(P0e.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(R0e.configure(this.options.taskList)),t}});var kg="&nbsp;",v1=" ",M0e=Gr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",sn(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===kg||n[0].text===kg||n[0].raw===v1||n[0].text===v1)&&r.length===1&&r[0].type==="text"&&(r[0].text===kg||r[0].text===v1)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,s;if(!t)return"";const i=Array.isArray(t.content)?t.content:[];if(i.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n==null?void 0:n.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?kg:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),O0e=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,D0e=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,I0e=_c.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",sn(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}}
vendor: 5,113 bytes, line 666
666,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[kd({find:O0e,type:this.type})]},addPasteRules(){return[vc({find:D0e,type:this.type})]}}),L0e=Gr.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),F0e=_c.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",sn(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function B0e(t={}){return new Lt({view(e){return new $0e(e,t)}})}class $0e{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:m.left,right:m.right,top:g-y,bottom:g+y}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,d=-pageYOffset;else{let f=l.getBoundingClientRect(),h=f.width/l.offsetWidth,p=f.height/l.offsetHeight;u=f.left-l.scrollLeft*h,d=f.top-l.scrollTop*p}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=SU(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ut extends Ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ut.valid(r)?new Ut(r):Ue.near(r)}content(){return ce.empty}eq(e){return e instanceof Ut&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ut(e.resolve(n.pos))}getBookmark(){return new TT(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!V0e(e)||!z0e(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ut.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>
vendor: 19,270 bytes, line 666
6660?e.indexAfter(o)<a.childCount:e.index(o)>0){i=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let l=e.doc.resolve(s);if(Ut.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!_e.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=e.doc.resolve(s);if(Ut.valid(a))return a}return null}}}Ut.prototype.visible=!1;Ut.findFrom=Ut.findGapCursorFrom;Ue.jsonID("gapcursor",Ut);class TT{constructor(e){this.pos=e}map(e){return new TT(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ut.valid(n)?new Ut(n):Ue.near(n)}}function CW(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function V0e(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||CW(s.type))return!0;if(s.inlineContent)return!1}}return!0}function z0e(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||CW(s.type))return!0;if(s.inlineContent)return!1}}return!0}function U0e(){return new Lt({props:{decorations:K0e,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ut.valid(n)?new Ut(n):null},handleClick:H0e,handleKeyDown:W0e,handleDOMEvents:{beforeinput:q0e}}})}const W0e=y6({ArrowLeft:Cg("horiz",-1),ArrowRight:Cg("horiz",1),ArrowUp:Cg("vert",-1),ArrowDown:Cg("vert",1)});function Cg(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Oe){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Ut.findGapCursorFrom(a,e,l);return u?(s&&s(r.tr.setSelection(new Ut(u))),!0):!1}}function H0e(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ut.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&_e.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ut(r))),!0)}function q0e(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ut))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=Q.empty;for(let o=r.length-1;o>=0;o--)s=Q.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new ce(s,0,0));return i.setSelection(Oe.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function K0e(t){if(!(t.selection instanceof Ut))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Mt.create(t.doc,[ir.widget(t.selection.head,e,{key:"gapcursor"})])}var px=200,xn=function(){};xn.prototype.append=function(e){return e.length?(e=xn.from(e),!this.length&&e||e.length<px&&this.leafAppend(e)||this.length<px&&e.leafPrepend(this)||this.appendInner(e)):this};xn.prototype.prepend=function(e){return e.length?xn.from(e).append(this):this};xn.prototype.appendInner=function(e){return new G0e(this,e)};xn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?xn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};xn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};xn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};xn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};xn.from=function(e){return e instanceof xn?e:e&&e.length?new NW(e):xn.empty};var NW=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,a){for(var l=i;l<o;l++)if(s(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,a){for(var l=i-1;l>=o;l--)if(s(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=px)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=px)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(xn);xn.empty=new NW([]);var G0e=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var a=this.left.length;if(s<a&&this.left.forEachInner(r,s,Math.min(i,a),o)===!1||i>a&&this.right.forEachInner(r,Math.max(s-a,0),Math.min(this.length,i)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var a=this.left.length;if(s>a&&this.right.forEachInvertedInner(r,s-a,Math.max(i,a)-a,o+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(s,a),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(xn);const Y0e=500;class Fs{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,a,l,u=[],d=[];return this.items.forEach((f,h)=>{if(!f.step){s||(s=this.remapping(r,h+1),i=s.maps.length),i--,d.push(f);return}if(s){d.push(new ci(f.map));let p=f.step.map(s.slice(i)),m;p&&o.maybeStep(p).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new ci(m,void 0,void 0,u.length+d.length))),i--,m&&s.appendMap(m,i)}else o.maybeStep(f.step);if(f.selection)return a=s?f.selection.map(s.slice(i)):f.selection,l=new Fs(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,s){let i=[],o=this.eventCount,a=this.items,l=!s&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),h=new ci(e.mapping.maps[d],f,n),p;(p=l&&l.merge(h))&&(h=p,d?i.pop():a=a.slice(0,a.length-1)),i.push(h),n&&(o++,n=void 0),s||(l=h)}let u=o-r.depth;return u>J0e&&(a=Q0e(a,u),o-=u),new Fs(a.append(i),o)}remapping(e,n){let r=new xp;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Fs(this.items.append(e.map(n=>new ci(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},s);let l=n;this.items.forEach(h=>{let p=i.getMirror(--l);if(p==null)return;o=Math.min(o,p);let m=i.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(i.slice(l+1,p));y&&a++,r.push(new ci(m,g,y))}else r.push(new ci(m))},s);let u=[];for(let h=n;h<o;h++)u.push(new ci(i.maps[h]));let d=this.items.slice(0,s).append(u).append(r),f=new Fs(d,a);return f.emptyItemCount()>Y0e&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,a)=>{if(a>=e)s.push(o),o.selection&&i++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&i++;let f=new ci(u.invert(),l,d),h,p=s.length-1;(h=s.length&&s[p].merge(f))?s[p]=h:s.push(f)}}else o.map&&r--},this.items.length,0),new Fs(xn.from(s.reverse()),i)}}Fs.empty=new Fs(xn.empty,0);function Q0e(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class ci{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new ci(n.getMap().invert(),n,this.selection)}}}class Wo{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const J0e=20;function X0e(t,e,n,r){let s=n.getMeta(Gl),i;if(s)return s.historyState;n.getMeta(twe)&&(t=new Wo(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Gl))return o.getMeta(Gl).redo?new Wo(t.done.addTransform(n,void 0,r,cy(e)),t.undone,gD(n.mapping.maps),t.prevTime,t.prevComposition):new Wo(t.done,t.undone.addTransform(n,void 0,r,cy(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Z0e(n,t.prevRanges)),u=o?x1(t.prevRanges,n.mapping):gD(n.mapping.maps);return new Wo(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,cy(e)),Fs.empty,u,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Wo(t.done.rebased(n,i),t.undone.rebased(n,i),x1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Wo(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),x1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Z0e(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(n=!0)}),n}function gD(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function x1(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let s=e.map(t[r],1),i=e.map(t[r+1],-1);s<=i&&n.push(s,i)}return n}function ewe(t,e,n){let r=cy(e),s=Gl.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),l=new Wo(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(o).setMeta(Gl,{redo:n,historyState:l})}let b1=!1,yD=null;function cy(t){let e=t.plugins;if(yD!=e){b1=!1,yD=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){b1=!0;break}}return b1}const Gl=new dn("history"),twe=new dn("closeHistory");function nwe(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Lt({key:Gl,state:{init(){return new Wo(Fs.empty,Fs.empty,null,0,-1)},apply(e,n,r){return X0e(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?_W:r=="historyRedo"?TW:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function EW(t,e){return(n,r)=>{let s=Gl.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=ewe(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const _W=EW(!1,!0),TW=EW(!0,!0);Kt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Lt({key:new dn("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit;if(s==null||s===0){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>s){const o=i-s,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,l);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=i-r,u=a-l,d=a;return e.deleteRange(u,d),!(this.storage.characters({node:e.doc})>r)}})]}});var rwe=Kt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[B0e(this.options)]}});Kt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Lt({key:new dn("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return Mt.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(l.isText)return;if(!(s>=u&&s<=u+l.nodeSize-1))return!1;o+=1});let a=0;return t.descendants((l,u)=>{if(l.isText||!(s>=u&&s<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(ir.node(u,u+l.nodeSize,{class:this.options.className}))}),Mt.create(t,i)}}})]}});var swe=Kt.create({name:"gapCursor",addProseMirrorPlugins(){return[U0e()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=at(Se(t,"allowGapCursor",n)))!=null?e:null}}}),vD="placeholder";function iwe(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var owe=Kt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:vD,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${iwe(this.options.dataAttribute)}`:`data-${vD}`;return[new Lt({key:new dn("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:s}=n,i=[];if(!r)return null;const o=this.editor.isEmpty;return e.descendants((a,l)=>{const u=s>=l&&s<=l+a.nodeSize,d=!a.isLeaf&&o0(a);if(!a.type.isTextblock)return this.options.includeChildren;if((u||!this.options.showOnlyCurrent)&&d){const f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);const h=ir.node(l,l+a.nodeSize,{class:f.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),Mt.create(e,i)}}})]}});Kt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Lt({key:new dn("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||M6(n.selection)||t.view.dragging?null:Mt.create(n.doc,[ir.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});var awe="skipTrailingNode";function xD({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var lwe=Kt.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new dn(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new Lt({key:e,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:u}=o,d=e.getState(o),f=a.content.size,h=u.nodes[n];if(!s.some(p=>p.getMeta(awe))&&d)return l.insert(f,h.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!xD({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!xD({node:o,types:r})}}})]}}),cwe=Kt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>_W(t,e),redo:()=>({state:t,dispatch:e})=>TW(t,e)}},addProseMirrorPlugins(){return[nwe(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()}}}),uwe=Kt.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(Obe.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Abe.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(pW.configure(this.options.bulletList)),this.options.code!==!1&&s.push(Lbe.configure(this.options.code)),this.options.codeBlock!==!1&&s.push($be.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(Vbe.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(rwe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(swe.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(zbe.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(Ube.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(cwe.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(Wbe.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(Ybe.configure(this.options.italic)),this.options.listItem!==!1&&s.push(mW.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(wW.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(b0e.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(kW.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(M0e.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(I0e.configure(this.options.strike)),this.options.text!==!1&&s.push(L0e.configure(this.options.text)),this.options.underline!==!1&&s.push(F0e.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(lwe.configure((r=this.options)==null?void 0:r.trailingNode)),s}}
666),dwe=uwe,fwe=owe;const Af=[{label:"Heading 1",icon:"H1",command:"heading1"},{label:"Heading 2",icon:"H2",command:"heading2"},{label:"Heading 3",icon:"H3",command:"heading3"},{label:"Quote",icon:"❝",command:"blockquote"},{label:"Bullet List",icon:"•",command:"bulletList"},{label:"Numbered List",icon:"1.",command:"orderedList"},{label:"Divider",icon:"—",command:"horizontalRule"}];function AW({content:t,onChange:e,placeholder:n="Click here to add details. Type '/' for commands…"}){const[r,s]=v.useState(!1),[i,o]=v.useState({top:0,left:0}),[a,l]=v.useState(0),u=v.useRef(null),d=v.useRef(!1),f=Cbe({extensions:[dwe,fwe.configure({placeholder:n})],content:t,onUpdate:({editor:p})=>{d.current=!0,e(p.getHTML())},editorProps:{attributes:{class:"prose prose-sm max-w-none focus:outline-none min-h-[80px] text-foreground"},handleKeyDown:(p,m)=>{if(r){if(m.key==="ArrowDown")return m.preventDefault(),l(g=>(g+1)%Af.length),!0;if(m.key==="ArrowUp")return m.preventDefault(),l(g=>(g-1+Af.length)%Af.length),!0;if(m.key==="Enter")return m.preventDefault(),h(Af[a].command),!0;if(m.key==="Escape")return s(!1),!0}return!1}}}),h=v.useCallback(p=>{if(!f)return;const{from:m}=f.state.selection,g=f.chain().focus().deleteRange({from:m-1,to:m});switch(p){case"heading1":g.setHeading({level:1}).run();break;case"heading2":g.setHeading({level:2}).run();break;case"heading3":g.setHeading({level:3}).run();break;case"blockquote":g.setBlockquote().run();break;case"bulletList":g.toggleBulletList().run();break;case"orderedList":g.toggleOrderedList().run();break;case"horizontalRule":g.setHorizontalRule().run();break;default:g.run()}s(!1)},[f]);return v.useEffect(()=>{if(!f)return;const p=()=>{var b;const{state:m}=f,{from:g}=m.selection;if(m.doc.textBetween(Math.max(0,g-1),g)==="/"){const x=f.view.coordsAtPos(g),w=(b=u.current)==null?void 0:b.getBoundingClientRect();w&&o({top:x.bottom-w.top+4,left:x.left-w.left}),s(!0),l(0)}else r&&s(!1)};return f.on("transaction",p),()=>{f.off("transaction",p)}},[f,r]),v.useEffect(()=>{f&&!d.current&&t!==f.getHTML()&&f.commands.setContent(t),d.current=!1},[t,f]),c.jsxs("div",{ref:u,className:"relative",children:[c.jsx(eW,{editor:f}),r&&c.jsx("div",{className:"absolute z-50 bg-popover border border-border rounded-md shadow-md py-1 w-48",style:{top:i.top,left:i.left},children:Af.map((p,m)=>c.jsxs("button",{className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-accent ${m===a?"bg-accent":""}`,onMouseDown:g=>{g.preventDefault(),h(p.command)},children:[c.jsx("span",{className:"w-6 text-center text-xs font-mono text-muted-foreground",children:p.icon}),c.jsx("span",{children:p.label})]},p.command))})]})}function jW({noteId:t,contactId:e,contactName:n,onClose:r,onContactChanged:s}){const{toast:i}=ut(),o=xt(),{teamId:a}=ot(),[l,u]=v.useState(""),[d,f]=v.useState(!1),{data:h}=ue({queryKey:["note",t],queryFn:async()=>{const{data:x,error:w}=await I.from("notes").select("*").eq("id",t).single();if(w)throw w;return x},enabled:!!t}),{data:p}=ue({queryKey:["note-author",h==null?void 0:h.author_id],queryFn:async()=>{var S;if(!(h!=null&&h.author_id))return null;const{data:x,error:w}=await I.rpc("get_user_emails",{_user_ids:[h.author_id]});if(w)throw w;return((S=x==null?void 0:x[0])==null?void 0:S.email)??null},enabled:!!(h!=null&&h.author_id)}),{data:m=[]}=ue({queryKey:["contacts",a],queryFn:async()=>{const{data:x,error:w}=await I.from("contacts").select("id, first_name, last_name").eq("team_id",a).order("first_name");if(w)throw w;return x},enabled:!!a});v.useEffect(()=>{h&&u(h.content??"")},[h]);const g=Ee({mutationFn:async x=>{const{error:w}=await I.from("notes").update(x).eq("id",t);if(w)throw w},onSuccess:()=>{o.invalidateQueries({queryKey:["notes",e]}),o.invalidateQueries({queryKey:["notes-all"]}),o.invalidateQueries({queryKey:["note",t]})},onError:x=>i({title:"Error",description:x.message,variant:"destructive"})}),y=x=>{u(x),g.mutate({content:x})},b=x=>{g.mutate({contact_id:x},{onSuccess:()=>{s==null||s(x),o.invalidateQueries({queryKey:["notes",e]}),o.invalidateQueries({queryKey:["notes",x]}),o.invalidateQueries({queryKey:["notes-all"]}),o.invalidateQueries({queryKey:["note",t]}),i({title:"Contact updated"})}})};return t?c.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4",children:[c.jsx(K,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,children:c.jsx(ji,{className:"h-4 w-4"})}),c.jsx("span",{className:"text-xs text-muted-foreground",children:h!=null&&h.created_at?`Created ${ad(new Date(h.created_at),{addSuffix:!0})}`:""})]}),c.jsx(_n,{}),c.jsxs("div",{className:"px-5 py-4 space-y-3.5",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx(hF,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Created by"})]}),c.jsx("span",{className:"text-sm text-foreground",children:p??"—"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx($y,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Last update"})]}),c.jsx("span",{className:"text-sm text-foreground",children:h!=null&&h.updated_at?ad(new Date(h.updated_at),{addSuffix:!0}):"—"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx(Kh,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Related to"})]}),c.jsxs(gd,{open:d,onOpenChange:f,children:[c.jsx(yd,{asChild:!0,children:c.jsxs(K,{variant:"ghost",size:"sm",className:"h-8 px-2 -ml-2 text-sm font-normal justify-between min-w-[140px]",children:[n||"Select contact…",c.jsx(D9,{className:"h-3 w-3 ml-1 opacity-50"})]})}),c.jsx(fc,{className:"w-[220px] p-0",align:"start",children:c.jsxs(V_,{children:[c.jsx(z_,{placeholder:"Search contacts…"}),c.jsxs(U_,{children:[c.jsx(W_,{children:"No contacts found."}),m.map(x=>{const w=`${x.first_name} ${x.last_name||""}`.trim();return c.jsx(H_,{value:w,onSelect:()=>{b(x.id),f(!1)},children:w},x.id)})]})]})})]})]})]}),c.jsx(_n,{}),c.jsxs("div",{className:"flex-1 px-5 py-4",children:[c.jsx("p",{className:"text-sm font-medium mb-3",children:"Note"}
666),c.jsx(AW,{content:l,onChange:y,placeholder:"Type '/' for commands…"})]})]}):null}function hwe({contactId:t,contactName:e,userId:n,initialNoteId:r,onClearInitialNote:s}){const{toast:i}=ut(),o=xt(),[a,l]=v.useState(null);v.useEffect(()=>{r&&(l(r),s==null||s())},[r,s]);const{data:u,isLoading:d}=ue({queryKey:["notes",t],queryFn:async()=>{const{data:m,error:g}=await I.from("notes").select("*").eq("contact_id",t).order("created_at",{ascending:!1});if(g)throw g;return m}}),f=Ee({mutationFn:async()=>{const{data:m,error:g}=await I.from("notes").insert({contact_id:t,author_id:n,content:""}).select().single();if(g)throw g;return m},onSuccess:m=>{o.invalidateQueries({queryKey:["notes",t]}),l(m.id)},onError:m=>{i({title:"Error",description:m.message,variant:"destructive"})}}),h=Ee({mutationFn:async m=>{const{error:g}=await I.from("notes").delete().eq("id",m);if(g)throw g},onSuccess:(m,g)=>{o.invalidateQueries({queryKey:["notes",t]}),a===g&&l(null),i({title:"Note deleted"})}}),p=m=>{const g=document.createElement("div");return g.innerHTML=m,g.textContent||g.innerText||""};return c.jsxs("div",{className:"flex h-full overflow-hidden",children:[c.jsx(Ye.div,{className:"min-w-0 overflow-y-auto",animate:{flexBasis:a?"calc(100% - 380px)":"
666100%"},transition:{duration:.25,ease:"easeOut"},style:{flexShrink:0,flexGrow:a?0:1},children:c.jsxs("div",{className:"px-5",children:[c.jsxs("div",{className:"flex items-center justify-between py-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:"All"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:(u==null?void 0:u.length)??0})]}),c.jsxs(K,{variant:"ghost",size:"sm",className:"text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>f.mutate(),disabled:f.isPending,children:[c.jsx(nn,{className:"h-3.5 w-3.5"}),"Add note"]})]}),d?c.jsx("div",{className:"space-y-1",children:Array.from({length:4}).map((m,g)=>c.jsx(vt,{className:"h-10 w-full rounded"},g))}):u&&u.length>0?c.jsx("div",{className:"space-y-0",children:u.map(m=>{const g=p(m.content);return c.jsxs("div",{className:q("relative flex items-center gap-3 px-3 py-2.5 rounded-md cursor-pointer hover:bg-muted/50 transition-colors group",a===m.id&&"bg-muted"),onClick:()=>l(m.id),children:[c.jsx(nc,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),c.jsx("p",{className:"text-sm text-foreground truncate flex-1",children:g||c.jsx("span",{className:"italic text-muted-foreground/50",children:"Empty note"})}),c.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(m.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),c.jsx(K,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive shrink-0",onClick:y=>{y.stopPropagation(),h.mutate(m.id)},children:c.jsx(qs,{className:"h-3 w-3"})})]},m.id)})}):c.jsxs("div",{className:"flex flex-col items-center py-10 text-center",children:[c.jsx(nc,{className:"h-8 w-8 text-muted-foreground mb-2"}),c.jsx("p",{className:"text-muted-foreground",children:"No notes yet."})]})]})}),a&&c.jsx(Ye.div,{className:"w-[380px] shrink-0 border-l border-border overflow-hidden h-full",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.25,ease:"easeOut"},children:c.jsx(jW,{noteId:a,contactId:t,contactName:e,onClose:()=>l(null)})})]})}var Pe=function(){return Pe=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Pe.apply(this,arguments)};function pwe(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function PW(t,e,n){for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function mm(t){return t.mode==="multiple"}function gm(t){return t.mode==="range"}function d0(t){return t.mode==="single"}var mwe={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function gwe(t,e){return Ze(t,"LLLL y",e)}function ywe(t,e){return Ze(t,"d",e)}function vwe(t,e){return Ze(t,"LLLL",e)}function xwe(t){return"".concat(t)}function bwe(t,e){return Ze(t,"cccccc",e)}function wwe(t,e){return Ze(t,"yyyy",e)}var Swe=Object.freeze({__proto__:null,formatCaption:gwe,formatDay:ywe,formatMonthCaption:vwe,formatWeekNumber:xwe,formatWeekdayName:bwe,formatYearC
666aption:wwe}),kwe=function(t,e,n){return Ze(t,"do MMMM (EEEE)",n)},Cwe=function(){return"Month: "},Nwe=function(){return"Go to next month"},Ewe=function(){return"Go to previous month"},_we=function(t,e){return Ze(t,"cccc",e)},Twe=function(t){return"Week n. ".concat(t)},Awe=function(){return"Year: "},jwe=Object.freeze({__proto__:null,labelDay:kwe,labelMonthDropdown:Cwe,labelNext:Nwe,labelPrevious:Ewe,labelWeekNumber:Twe,labelWeekday:_we,labelYearDropdown:Awe});function Pwe(){var t="buttons",e=mwe,n=v_,r={},s={},i=1,o={},a=new Date;return{captionLayout:t,classNames:e,formatters:Swe,labels:jwe,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:i,styles:o,today:a,mode:"default"}}function Rwe(t){var e=t.fromYear,n=t.toYear,r=t.fromMonth,s=t.toMonth,i=t.fromDate,o=t.toDate;return r?i=_r(r):e&&(i=new Date(e,0,1)),s?o=Nb(s):n&&(o=new Date(n,11,31)),{fromDate:i?sd(i):void 0,toDate:o?sd(o):void 0}}var RW=v.createContext(void 0);function Mwe(t){var e,n=t.initialProps,r=Pwe(),s=Rwe(n),i=s.fromDate,o=s.toDate,a=(e=n.captionLayout)!==null&&e!==void 0?e:r.captionLayout;a!=="buttons"&&(!i||!o)&&(a="buttons");var l;(d0(n)||mm(n)||gm(n))&&(l=n.onSelect);var u=Pe(Pe(Pe({},r),n),{captionLayout:a,classNames:Pe(Pe({},r.classNames),n.classNames),components:Pe({},n.components),formatters:Pe(Pe({},r.formatters),n.formatters),fromDate:i,labels:Pe(Pe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Pe(Pe({},r.modifiers),n.modifiers),modifiersClassNames:Pe(Pe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Pe(Pe({},r.styles),n.styles),toDate:o});return c.jsx(RW.Provider,{value:u,children:t.children})}function St(){var t=v.useContext(RW);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function MW(t){var e=St(),n=e.locale,r=e.classNames,s=e.styles,i=e.formatters.formatCaption;return c.jsx("div",{className:r.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:t.id,children:i(t.displayMonth,{locale:n})})}function Owe(t){return c.jsx("svg",Pe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:c.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function OW(t){var e,n,r=t.onChange,s=t.value,i=t.children,o=t.caption,a=t.className,l=t.style,u=St(),d=(n=(e=u.components)===null||e===void 0?void 0:e.IconDropdown)!==null&&n!==void 0?n:Owe;return c.jsxs("div",{className:a,style:l,children:[c.jsx("span",{className:u.classNames.vhidden,children:t["aria-label"]}),c.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:s,onChange:r,children:i}),c.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[o,c.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Dwe(t){var e,n=St(),r=n.fromDate,s=n.toDate,i=n.styles,o=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return c.jsx(c.Fragment,{});if(!s)return c.jsx(c.Fragment,{});var f=[];if(eue(r,s))for(var h=_r(r),p=r.getMonth();p<=s.getMonth();p++)f.push(Mw(h,p));
666else for(var h=_r(new Date),p=0;p<=11;p++)f.push(Mw(h,p));var m=function(y){var b=Number(y.target.value),x=Mw(_r(t.displayMonth),b);t.onChange(x)},g=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:OW;return c.jsx(g,{name:"months","aria-label":d(),className:l.dropdown_month,style:i.dropdown_month,onChange:m,value:t.displayMonth.getMonth(),caption:a(t.displayMonth,{locale:o}),children:f.map(function(y){return c.jsx("option",{value:y.getMonth(),children:a(y,{locale:o})},y.getMonth())})})}function Iwe(t){var e,n=t.displayMonth,r=St(),s=r.fromDate,i=r.toDate,o=r.locale,a=r.styles,l=r.classNames,u=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,h=[];if(!s)return c.jsx(c.Fragment,{});if(!i)return c.jsx(c.Fragment,{});for(var p=s.getFullYear(),m=i.getFullYear(),g=p;g<=m;g++)h.push(dM(t5(new Date),g));var y=function(x){var w=dM(_r(n),Number(x.target.value));t.onChange(w)},b=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:OW;return c.jsx(b,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:y,value:n.getFullYear(),caption:d(n,{locale:o}),children:h.map(function(x){return c.jsx("option",{value:x.getFullYear(),children:d(x,{locale:o})},x.getFullYear())})})}function Lwe(t,e){var n=v.useState(t),r=n[0],s=n[1],i=e===void 0?r:e;return[i,s]}function Fwe(t){var e=t.month,n=t.defaultMonth,r=t.today,s=e||n||r||new Date,i=t.toDate,o=t.fromDate,a=t.numberOfMonths,l=a===void 0?1:a;if(i&&od(i,s)<0){var u=-1*(l-1);s=Ys(i,u)}return o&&od(s,o)<0&&(s=o),_r(s)}function Bwe(){var t=St(),e=Fwe(t),n=Lwe(e,t.month),r=n[0],s=n[1],i=function(o){var a;if(!t.disableNavigation){var l=_r(o);s(l),(a=t.onMonthChange)===null||a===void 0||a.call(t,l)}};return[r,i]}function $we(t,e){for(var n=e.reverseMonths,r=e.numberOfMonths,s=_r(t),i=_r(Ys(s,r)),o=od(i,s),a=[],l=0;l<o;l++){var u=Ys(s,l);a.push(u)}return n&&(a=a.reverse()),a}function Vwe(t,e){if(!e.disableNavigation){var n=e.toDate,r=e.pagedNavigation,s=e.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=_r(t);if(!n)return Ys(a,o);var l=od(n,t);if(!(l<i))return Ys(a,o)}}function zwe(t,e){if(!e.disableNavigation){var n=e.fromDate,r=e.pagedNavigation,s=e.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=_r(t);if(!n)return Ys(a,-o);var l=od(a,n);if(!(l<=0))return Ys(a,-o)}}var DW=v.createContext(void 0);function Uwe(t){var e=St(),n=Bwe(),r=n[0],s=n[1],i=$we(r,e),o=Vwe(r,e),a=zwe(r,e),l=function(f){return i.some(function(h){return x_(f,h)})},u=function(f,h){l(f)||(h&&a5(f,h)?s(Ys(f,1+e.numberOfMonths*-1)):s(f))},d={currentMonth:r,displayMonths:i,goToMonth:s,goToDate:u,previousMonth:a,nextMonth:o,isDateDisplayed:l};return c.jsx(DW.Provider,{value:d,children:t.children})}function ym(){var t=v.useContext(DW);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function bD(t){var e,n=St(),r=n.classNames,s=n.styles,i=n.components,o=ym().goToMonth,a=function(d){o(Ys(d,t.displayIndex?-t.displayIndex:0))},l=(e=i==null?void 0:i.CaptionLabel)!==null&&e!==void 0?e:MW,u=c.jsx(l,{id:t.id,displayMonth:t.displayMonth});return c.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[c.jsx("div",{className:r.vhidden,children:u}),c.jsx(Dwe,{onChange:a,displayMonth:t.displayMonth}),c.jsx(Iwe,{onChange:a,displayMonth:t.displayMonth})]})}function Wwe(t){return c.jsx("svg",Pe({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:c.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Hwe(t){return c.jsx("svg",Pe({width:"16px",height:"16px",viewBox:"0 0 120 120"}
666,t,{children:c.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var mx=v.forwardRef(function(t,e){var n=St(),r=n.classNames,s=n.styles,i=[r.button_reset,r.button];t.className&&i.push(t.className);var o=i.join(" "),a=Pe(Pe({},s.button_reset),s.button);return t.style&&Object.assign(a,t.style),c.jsx("button",Pe({},t,{ref:e,type:"button",className:o,style:a}))});function qwe(t){var e,n,r=St(),s=r.dir,i=r.locale,o=r.classNames,a=r.styles,l=r.labels,u=l.labelPrevious,d=l.labelNext,f=r.components;if(!t.nextMonth&&!t.previousMonth)return c.jsx(c.Fragment,{});var h=u(t.previousMonth,{locale:i}),p=[o.nav_button,o.nav_button_previous].join(" "),m=d(t.nextMonth,{locale:i}),g=[o.nav_button,o.nav_button_next].join(" "),y=(e=f==null?void 0:f.IconRight)!==null&&e!==void 0?e:Hwe,b=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:Wwe;return c.jsxs("div",{className:o.nav,style:a.nav,children:[!t.hidePrevious&&c.jsx(mx,{name:"previous-month","aria-label":h,className:p,style:a.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:s==="rtl"?c.jsx(y,{className:o.nav_icon,style:a.nav_icon}):c.jsx(b,{className:o.nav_icon,style:a.nav_icon})}),!t.hideNext&&c.jsx(mx,{name:"next-month","aria-label":m,className:g,style:a.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:s==="rtl"?c.jsx(b,{className:o.nav_icon,style:a.nav_icon}):c.jsx(y,{className:o.nav_icon,style:a.nav_icon})})]})}function wD(t){var e=St().numberOfMonths,n=ym(),r=n.previousMonth,s=n.nextMonth,i=n.goToMonth,o=n.displayMonths,a=o.findIndex(function(m){return x_(t.displayMonth,m)}),l=a===0,u=a===o.length-1,d=e>1&&(l||!u),f=e>1&&(u||!l),h=function(){r&&i(r)},p=function(){s&&i(s)};return c.jsx(qwe,{displayMonth:t.displayMonth,hideNext:d,hidePrevious:f,nextMonth:s,previousMonth:r,onPreviousClick:h,onNextClick:p})}function Kwe(t){var e,n=St(),r=n.classNames,s=n.disableNavigation,i=n.styles,o=n.captionLayout,a=n.components,l=(e=a==null?void 0:a.CaptionLabel)!==null&&e!==void 0?e:MW,u;return s?u=c.jsx(l,{id:t.id,displayMonth:t.displayMonth}):o==="dropdown"?u=c.jsx(bD,{displayMonth:t.displayMonth,id:t.id}):o==="dropdown-buttons"?u=c.jsxs(c.Fragment,{children:[c.jsx(bD,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),c.jsx(wD,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):u=c.jsxs(c.Fragment,{children:[c.jsx(l,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),c.jsx(wD,{displayMonth:t.displayMonth,id:t.id})]}),c.jsx("div",{className:r.caption,style:i.caption,children:u})}function Gwe(t){var e=St(),n=e.footer,r=e.styles,s=e.classNames.tfoot;return n?c.jsx("tfoot",{className:s,style:r.tfoot,children:c.jsx("tr",{children:c.jsx("td",{colSpan:8,children:n})})}):c.jsx(c.Fragment,{})}function Ywe(t,e,n){for(var r=n?ac(new Date):Mi(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var o=Zn(r,i);s.push(o)}return s}function Qwe(){var t=St(),e=t.classNames,n=t.styles,r=t.showWeekNumber,s=t.locale,i=t.weekStartsOn,o=t.ISOWeek,a=t.formatters.formatWeekdayName,l=t.labels.labelWeekday,u=Ywe(s,i,o);return c.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&c.jsx("td",{style:n.head_cell,className:e.head_cell}),u.map(function(d,f){return c.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":l(d,{locale:s}),children:a(d,{locale:s})},f)})]})}function Jwe(){var t,e=St(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:Qwe;return c.jsx("thead",{style:r.head,className:n.head,children:c.jsx(i,{})})}function Xwe(t){var e=St(),n=e.locale,r=e.formatters.formatDay;return c.jsx(c.Fragment,{children:r(t.date,{locale:n})})}var AT=v.createContext(void 0);function Zwe(t){if(!mm(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return c.jsx(AT.Provider,{value:e,children:t.children})}return c.jsx(e1e,{initialProps:t.initialProps,children:t.children})}function e1e(t){var e=t.initialProps,n=t.children,r=e.selected,s=e.min,i=e.max,o=function(u,d,f){var h,p;(h=e.onDayClick)===null||h===void 0||h.call(e,u,d,f);var m=!!(d.selected&&s&&(r==null?void 0:r.length)===s);if(!m){var g=!!(!d.selected&&i&&(r==null?void 0:r.length)===i);if(!g){var y=r?PW([],r):[];if(d.selected){var b=y.findIndex(function(x){return Sr(u,x)});y.splice(b,1)}else y.push(u);(p=e.onSelect)===null||p===void 0||p.call(e,y,u,d,f)}}},a={disabled:[]};r&&a.disabled.push(function(u){var d=i&&r.length>i-1,f=r.some(function(h){return Sr(h,u)});return!!(d&&!f)});var l={selected:r,onDayClick:o,modifiers:a};return c.jsx(AT.Provider,{value:l,children:n})}function jT(){var t=v.useContext(AT);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function t1e(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?Sr(s,t)&&Sr(r,t)?void 0:Sr(s,t)?{from:s,to:void 0}:Sr(r,t)?void 0:pv(r,t)?{from:t,to:s}:{from:r,to:t}:s?pv(t,s)?{from:s,to:t}:{from:t,to:s}:r?a5(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var PT=v.createContext(void 0);function n1e(t){if(!gm(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return c.jsx(PT.Provider,{value:e,children:t.children})}return c.jsx(r1e,{initialProps:t.initialProps,children:t.children})}function r1e(t){var e=t.initialProps,n=t.children,r=e.selected,s=r||{},i=s.from,o=s.to,a=e.min,l=e.max,u=function(p,m,g){var y,b;(y=e.onDayClick)===null||y===void 0||y.call(e,p,m,g);var x=t1e(p,r);(b=e.onSelect)===null||b===void 0||b.call(e,x,p,m,g)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],o?(d.range_end=[o],Sr(i,o)||(d.range_middle=[{after:i,before:o}])):d.range_end=[i]):o&&(d.range_start=[o],d.range_end=[o]),a&&(i&&!o&&d.disabled.push({after:ry(i,a-1),before:Zn(i,a-1)}),i&&o&&d.disabled.push({after:i,before:Zn(i,a-1)}),!i&&o&&d.disabled.push({after:ry(o,a-1),before:Zn(o,a-1)})),l){if(i&&!o&&(d.disabled.push({before:Zn(i,-l+1)}),d.disabled.push({after:Zn(i,l-1)})),i&&o){var f=wi(o,i)+1,h=l-f;d.disabled.push({before:ry(i,h)}),d.disabled.push({after:Zn(o,h)})}!i&&o&&(d.disabled.push({before:Zn(o,-l+1)}),d.disabled.push({after:Zn(o,l-1)}))}return c.jsx(PT.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function RT(){var t=v.useContext(PT);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function uy(t){return Array.isArray(t)?PW([],t):t!==void 0?[t]:[]}function s1e(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=uy(s)}),e}var Qs;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(Qs||(Qs={}));var i1e=Qs.Selected,Qi=Qs.Disabled,o1e=Qs.Hidden,a1e=Qs.Today,w1=Qs.RangeEnd,S1=Qs.RangeMiddle,k1=Qs.RangeStart,l1e=Qs.Outside;function c1e(t,e,n){var r,s=(r={},r[i1e]=uy(t.selected),r[Qi]=uy(t.disabled),r[o1e]=uy(t.hidden),r[a1e]=[t.today],r[w1]=[],r[S1]=[],r[k1]=[],r[l1e]=[],r);return t.fromDate&&s[Qi].push({before:t.fromDate}),t.toDate&&s[Qi].push({after:t.toDate}),mm(t)?s[Qi]=s[Qi].concat(e.modifiers[Qi]):gm(t)&&(s[Qi]=s[Qi].concat(n.modifiers[Qi]),s[k1]=n.modifiers[k1],s[S1]=n.modifiers[S1],s[w1]=n.modifiers[w1]),s}var IW=v.createContext(void 0);function u1e(t){var e=St(),n=jT(),r=RT(),s=c1e(e,n,r),i=s1e(e.modifiers),o=Pe(Pe({},s),i);return c.jsx(IW.Provider,{value:o,children:t.children})}function LW(){var t=v.useContext(IW);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function d1e(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function f1e(t){return!!(t&&typeof t=="object"&&"from"in t)}function h1e(t){return!!(t&&typeof t=="object"&&"after"in t)}function p1e(t){return!!(t&&typeof t=="object"&&"before"in t)}function m1e(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function g1e(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=wi(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var o=wi(t,r)>=0&&wi(s,t)>=0;return o}return s?Sr(s,t):r?Sr(r,t):!1}function y1e(t){return g_(t)}function v1e(t){return Array.isArray(t)&&t.every(g_)}function x1e(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(y1e(n))return Sr(t,n);if(v1e(n))return n.includes(t);if(f1e(n))return g1e(t,n);if(m1e(n))return n.dayOfWeek.includes(t.getDay());if(d1e(n)){var r=wi(n.before,t),s=wi(n.after,t),i=r>0,o=s<0,a=pv(n.before,n.after);return a?o&&i:i||o}return h1e(n)?wi(t,n.after)>0:p1e(n)?wi(n.before,t)>0:typeof n=="function"?n(t):!1})}function MT(t,e,n){var r=Object.keys(e).reduce(function(i,o){var a=e[o];return x1e(t,a)&&i.push(o),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!x_(t,n)&&(s.outside=!0),s}function b1e(t,e){for(var n=_r(t[0]),r=Nb(t[t.length-1]),s,i,o=n;o<=r;){var a=MT(o,e),l=!a.disabled&&!a.hidden;if(!l){o=Zn(o,1);continue}if(a.selected)return o;a.today&&!i&&(i=o),s||(s=o),o=Zn(o,1)}return i||s}var w1e=365;function FW(t,e){var n=e.moveBy,r=e.direction,s=e.context,i=e.modifiers,o=e.retry,a=o===void 0?{count:0,lastFocused:t}:o,l=s.weekStartsOn,u=s.fromDate,d=s.toDate,f=s.locale,h={day:Zn,week:Kk,month:Ys,year:zle,startOfWeek:function(y){return s.ISOWeek?ac(y):Mi(y,{locale:f,weekStartsOn:l})},endOfWeek:function(y){return s.ISOWeek?n5(y):y_(y,{locale:f,weekStartsOn:l})}},p=h[n](t,r==="after"?1:-1);r==="before"&&u?p=Ule([u,p]):r==="after"&&d&&(p=Wle([d,p]));var m=!0;if(i){var g=MT(p,i);m=!g.disabled&&!g.hidden}return m?p:a.count>w1e?a.lastFocused:FW(p,{moveBy:n,direction:r,context:s,modifiers:i,retry:Pe(Pe({},a),{count:a.count+1})})}var BW=v.createContext(void 0);function S1e(t){var e=ym(),n=LW(),r=v.useState(),s=r[0],i=r[1],o=v.useState(),a=o[0],l=o[1],u=b1e(e.displayMonths,n),d=s??(a&&e.isDateDisplayed(a))?a:u,f=function(){l(s),i(void 0)},h=function(y){i(y)},p=St(),m=function(y,b){if(s){var x=FW(s,{moveBy:y,direction:b,context:p,modifiers:n});Sr(s,x)||(e.goToDate(x,s),h(x))}},g={focusedDay:s,focusTarget:d,blur:f,focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return c.jsx(BW.Provider,{value:g,children:t.children})}function OT(){var t=v.useContext(BW);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function k1e(t,e){var n=LW(),r=MT(t,n,e);return r}var DT=v.createContext(void 0);function C1e(t){if(!d0(t.initialProps)){var e={selected:void 0};return c.jsx(DT.Provider,{value:e,children:t.children})}return c.jsx(N1e,{initialProps:t.initialProps,children:t.children})}function N1e(t){var e=t.initialProps,n=t.children,r=function(i,o,a){var l,u,d;if((l=e.onDayClick)===null||l===void 0||l.call(e,i,o,a),o.selected&&!e.required){(u=e.onSelect)===null||u===void 0||u.call(e,void 0,i,o,a);return}(d=e.onSelect)===null||d===void 0||d.call(e,i,i,o,a)}
666,s={selected:e.selected,onDayClick:r};return c.jsx(DT.Provider,{value:s,children:n})}function $W(){var t=v.useContext(DT);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function E1e(t,e){var n=St(),r=$W(),s=jT(),i=RT(),o=OT(),a=o.focusDayAfter,l=o.focusDayBefore,u=o.focusWeekAfter,d=o.focusWeekBefore,f=o.blur,h=o.focus,p=o.focusMonthBefore,m=o.focusMonthAfter,g=o.focusYearBefore,y=o.focusYearAfter,b=o.focusStartOfWeek,x=o.focusEndOfWeek,w=function(L){var A,O,W,Z;d0(n)?(A=r.onDayClick)===null||A===void 0||A.call(r,t,e,L):mm(n)?(O=s.onDayClick)===null||O===void 0||O.call(s,t,e,L):gm(n)?(W=i.onDayClick)===null||W===void 0||W.call(i,t,e,L):(Z=n.onDayClick)===null||Z===void 0||Z.call(n,t,e,L)},S=function(L){var A;h(t),(A=n.onDayFocus)===null||A===void 0||A.call(n,t,e,L)},C=function(L){var A;f(),(A=n.onDayBlur)===null||A===void 0||A.call(n,t,e,L)},k=function(L){var A;(A=n.onDayMouseEnter)===null||A===void 0||A.call(n,t,e,L)},N=function(L){var A;(A=n.onDayMouseLeave)===null||A===void 0||A.call(n,t,e,L)},E=function(L){var A;(A=n.onDayPointerEnter)===null||A===void 0||A.call(n,t,e,L)},_=function(L){var A;(A=n.onDayPointerLeave)===null||A===void 0||A.call(n,t,e,L)},T=function(L){var A;(A=n.onDayTouchCancel)===null||A===void 0||A.call(n,t,e,L)},P=function(L){var A;(A=n.onDayTouchEnd)===null||A===void 0||A.call(n,t,e,L)},j=function(L){var A;(A=n.onDayTouchMove)===null||A===void 0||A.call(n,t,e,L)},F=function(L){var A;(A=n.onDayTouchStart)===null||A===void 0||A.call(n,t,e,L)},B=function(L){var A;(A=n.onDayKeyUp)===null||A===void 0||A.call(n,t,e,L)},U=function(L){var A;switch(L.key){case"ArrowLeft":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":L.preventDefault(),L.stopPropagation(),u();break;case"ArrowUp":L.preventDefault(),L.stopPropagation(),d();break;case"PageUp":L.preventDefault(),L.stopPropagation(),L.shiftKey?g():p();break;case"PageDown":L.preventDefault(),L.stopPropagation(),L.shiftKey?y():m();break;case"Home":L.preventDefault(),L.stopPropagation(),b();break;case"End":L.preventDefault(),L.stopPropagation(),x();break}(A=n.onDayKeyDown)===null||A===void 0||A.call(n,t,e,L)},D={onClick:w,onFocus:S,onBlur:C,onKeyDown:U,onKeyUp:B,onMouseEnter:k,onMouseLeave:N,onPointerEnter:E,onPointerLeave:_,onTouchCancel:T,onTouchEnd:P,onTouchMove:j,onTouchStart:F};return D}function _1e(){var t=St(),e=$W(),n=jT(),r=RT(),s=d0(t)?e.selected:mm(t)?n.selected:gm(t)?r.selected:void 0;return s}function T1e(t){return Object.values(Qs).includes(t)}function A1e(t,e){var n=[t.classNames.day];return Object.keys(e).forEach(function(r){var s=t.modifiersClassNames[r];if(s)n.push(s);else if(T1e(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function j1e(t,e){var n=Pe({},t.styles.day);return Object.keys(e).forEach(function(r){var s;n=Pe(Pe({},n),(s=t.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function P1e(t,e,n){var r,s,i,o=St(),a=OT(),l=k1e(t,e),u=E1e(t,l),d=_1e(),f=!!(o.onDayCl
666ick||o.mode!=="default");v.useEffect(function(){var k;l.outside||a.focusedDay&&f&&Sr(a.focusedDay,t)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,t,n,f,l.outside]);var h=A1e(o,l).join(" "),p=j1e(o,l),m=!!(l.outside&&!o.showOutsideDays||l.hidden),g=(i=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:Xwe,y=c.jsx(g,{date:t,displayMonth:e,activeModifiers:l}),b={style:p,className:h,children:y,role:"gridcell"},x=a.focusTarget&&Sr(a.focusTarget,t)&&!l.outside,w=a.focusedDay&&Sr(a.focusedDay,t),S=Pe(Pe(Pe({},b),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=w||x?0:-1,r)),u),C={isButton:f,isHidden:m,activeModifiers:l,selectedDays:d,buttonProps:S,divProps:b};return C}function R1e(t){var e=v.useRef(null),n=P1e(t.date,t.displayMonth,e);return n.isHidden?c.jsx("div",{role:"gridcell"}):n.isButton?c.jsx(mx,Pe({name:"day",ref:e},n.buttonProps)):c.jsx("div",Pe({},n.divProps))}function M1e(t){var e=t.number,n=t.dates,r=St(),s=r.onWeekNumberClick,i=r.styles,o=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(e),{locale:a});if(!s)return c.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:d});var f=l(Number(e),{locale:a}),h=function(p){s(e,n,p)};return c.jsx(mx,{name:"week-number","aria-label":f,className:o.weeknumber,style:i.weeknumber,onClick:h,children:d})}function O1e(t){var e,n,r=St(),s=r.styles,i=r.classNames,o=r.showWeekNumber,a=r.components,l=(e=a==null?void 0:a.Day)!==null&&e!==void 0?e:R1e,u=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:M1e,d;return o&&(d=c.jsx("td",{className:i.cell,style:s.cell,children:c.jsx(u,{number:t.weekNumber,dates:t.dates})})),c.jsxs("tr",{className:i.row,style:s.row,children:[d,t.dates.map(function(f){return c.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:c.jsx(l,{displayMonth:t.displayMonth,date:f})},Jce(f))})]})}function SD(t,e,n){for(var r=n!=null&&n.ISOWeek?n5(e):y_(e,n),s=n!=null&&n.ISOWeek?ac(t):Mi(t,n),i=wi(r,s),o=[],a=0;a<=i;a++)o.push(Zn(s,a));var l=o.reduce(function(u,d){var f=n!=null&&n.ISOWeek?r5(d):i5(d,n),h=u.find(function(p){return p.weekNumber===f});return h?(h.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return l}function D1e(t,e){var n=SD(_r(t),Nb(t),e);if(e!=null&&e.useFixedWeeks){var r=Zce(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],o=Kk(i,6-r),a=SD(Kk(i,1),o,e);n.push.apply(n,a)}}return n}function I1e(t){var e,n,r,s=St(),i=s.locale,o=s.classNames,a=s.styles,l=s.hideHead,u=s.fixedWeeks,d=s.components,f=s.weekStartsOn,h=s.firstWeekContainsDate,p=s.ISOWeek,m=D1e(t.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:i,weekStartsOn:f,firstWeekContainsDate:h}),g=(e=d==null?void 0:d.Head)!==null&&e!==void 0?e:Jwe,y=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:O1e,b=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:Gwe;return c.jsxs("table",{id:t.id,className:o.table,style:a.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!l&&c.jsx(g,{}),c.jsx("tbody",{className:o.tbody,style:a.tbody,children:m.map(function(x){return c.jsx(y,{displayMonth:t.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),c.jsx(b,{displayMonth:t.displayMonth})]})}function L1e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var F1e=L1e()?v.useLayoutEffect:v.useEffect,C1=!1,B1e=0;function kD(){return"react-day-picker-".concat(++B1e)}function $1e(t){var e,n=t??(C1?kD():null),r=v.useState(n),s=r[0],i=r[1];return F1e(function(){s===null&&i(kD())},[]),v.useEffect(function(){C1===!1&&(C1=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function V1e(t){var e,n,r=St(),s=r.dir,i=r.classNames,o=r.styles,a=r.components,l=ym().displayMonths,u=$1e(r.id?"".concat(r.id,"-").concat(t.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(t.displayIndex):void 0,f=[i.month],h=o.month,p=t.displayIndex===0,m=t.displayIndex===l.length-1,g=!p&&!m;s==="rtl"&&(e=[p,m],m=e[0],p=e[1]),p&&(f.push(i.caption_start),h=Pe(Pe({},h),o.caption_start)),m&&(f.push(i.caption_end),h=Pe(Pe({},h),o.caption_end)),g&&(f.push(i.caption_between),h=Pe(Pe({},h),o.caption_between));var y=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Kwe;return c.jsxs("div",{className:f.join(" "),style:h,children:[c.jsx(y,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),c.jsx(I1e,{id:d,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function z1e(t){var e=St(),n=e.classNames,r=e.styles;return c.jsx("div",{className:n.months,style:r.months,children:t.children})}function U1e(t){var e,n,r=t.initialProps,s=St(),i=OT(),o=ym(),a=v.useState(!1),l=a[0],u=a[1];v.useEffect(function(){s.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),u(!0)))},[s.initialFocus,l,i.focus,i.focusTarget,i]);var d=[s.classNames.root,s.className];s.numberOfMonths>1&&d.push(s.classNames.multiple_months),s.showWeekNumber&&d.push(s.classNames.with_weeknumber);var f=Pe(Pe({},s.styles.root),s.style),h=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,g){var y;return Pe(Pe({},m),(y={},y[g]=r[g],y))},{}),p=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:z1e;return c.jsx("div",Pe({className:d.join(" "),style:f,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:c.jsx(p,{children:o.displayMonths.map(function(m,g){return c.jsx(V1e,{displayIndex:g,displayMonth:m},g)})})}))}function W1e(t){var e=t.children,n=pwe(t,["children"]);return c.jsx(Mwe,{initialProps:n,children:c.jsx(Uwe,{children:c.jsx(C1e,{initialProps:n,children:c.jsx(Zwe,{initialProps:n,children:c.jsx(n1e,{initialProps:n,children:c.jsx(u1e,{children:c.jsx(S1e,{children:e})})})})})})})}function H1e(t){return c.jsx(W1e,Pe({},t,{children:c.jsx(U1e,{initialProps:t})}))}function VW({className:t,classNames:e,showOutsideDays:n=!0,...r}){return c.jsx(H1e,{showOutsideDays:n,className:q("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
666ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:q(tp({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:q(tp({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...e},components:{IconLeft:({...s})=>c.jsx(R9,{className:"h-4 w-4"}),IconRight:({...s})=>c.jsx(M9,{className:"h-4 w-4"})},...r})}VW.displayName="Calendar";const Ra=[{value:"no_status",label:"No Status",color:"bg-muted text-muted-foreground"},{value:"todo",label:"To do",color:"bg-blue-100 text-blue-700"},{value:"in_progress",label:"In Progress",color:"bg-amber-100 text-amber-700"},{value:"done",label:"Done",color:"bg-green-100 text-green-700"}];function zW({taskId:t,onClose:e}){const{toast:n}=ut(),{teamId:r}=ot(),s=xt(),[i,o]=v.useState(""),[a,l]=v.useState(""),[u,d]=v.useState("todo"),[f,h]=v.useState(),{data:p}=ue({queryKey:["task",t],queryFn:async()=>{const{data:j,error:F}=await I.from("tasks").select("*").eq("id",t).single();if(F)throw F;return j},enabled:!!t}),{data:m}=ue({queryKey:["task-contact",p==null?void 0:p.contact_id],queryFn:async()=>{const{data:j,error:F}=await I.from("contacts").select("id, first_name, last_name").eq("id",p.contact_id).single();if(F)throw F;return j},enabled:!!(p!=null&&p.contact_id)}),{data:g}=ue({queryKey:["task-creator",p==null?void 0:p.created_by],queryFn:async()=>{var B;if(!(p!=null&&p.created_by))return null;const{data:j,error:F}=await I.rpc("get_user_emails",{_user_ids:[p.created_by]});if(F)throw F;return((B=j==null?void 0:j[0])==null?void 0:B.email)??null},enabled:!!(p!=null&&p.created_by)}),{data:y=[]}=ue({queryKey:["team-members",r],queryFn:async()=>{const{data:j,error:F}=await I.from("team_members").select("user_id").eq("team_id",r);if(F)throw F;const B=j.map(L=>L.user_id),{data:U,error:D}=await I.rpc("get_user_emails",{_user_ids:B});if(D)throw D;return(U??[]).map(L=>({id:L.user_id,name:L.email}))},enabled:!!r}),{data:b=[]}=ue({queryKey:["task-assignees",t],queryFn:async()=>{const{data:j,error:F}=await I.from("task_assignees").select("id, user_id").eq("task_id",t);if(F)throw F;return j},enabled:!!t}),x=Ee({mutationFn:async j=>{const{error:F}=await I.from("task_assignees").insert({task_id:t,user_id:j});if(F)throw F},onSuccess:()=>s.invalidateQueries({queryKey:["task-assignees",t]}),onError:j=>n({title:"Error",description:j.message,variant:"destructive"})}),w=Ee({mutationFn:async j=>{const{error:F}=await I.from("task_assignees").delete().eq("id",j);if(F)throw F},onSuccess:()=>s.invalidateQueries({queryKey:["task-assignees",t]})});v.useEffect(()=>{p&&(o(p.title??""),l(p.body??""),d(p.status??"todo"),h(p.due_at?new Date(p.due_at):void 0))},[p]);const S=Ee({mutationFn:async j=>{const{error:F}=await I.from("tasks").update(j).eq("id",t);if(F)throw F},onSuccess:()=>{s.invalidateQueries({queryKey:["tasks"]}),s.invalidateQueries({queryKey:["task",t]})},onError:j=>n({title:"Error",description:j.message,variant:"destructive"})}),C=()=>{i.trim()&&i!==(p==null?void 0:p.title)&&S.mutate({title:i.trim()})},k=j=>{l(j),S.mutate({body:j})},N=j=>{d(j),S.mutate({status:j})},E=j=>{h(j),S.mutate({due_at:j?j.toISOString():null})};if(!t)return null;const _=Ra.find(j=>j.value===u)??Ra[0],T=b.map(j=>
666j.user_id),P=y.filter(j=>!T.includes(j.id));return c.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4",children:[c.jsx(K,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:e,children:c.jsx(ji,{className:"h-4 w-4"})}),c.jsx("span",{className:"text-xs text-muted-foreground",children:p!=null&&p.created_at?`Created ${ad(new Date(p.created_at),{addSuffix:!0})}`:""})]}),c.jsx(_n,{}),c.jsx("div",{className:"px-5 py-4",children:c.jsx(Je,{value:i,onChange:j=>o(j.target.value),onBlur:C,className:"text-base font-semibold border-none shadow-none px-3 focus-visible:ring-0 h-auto py-2",placeholder:"Task title…"})}),c.jsx(_n,{}),c.jsxs("div",{className:"px-5 py-4 space-y-3.5",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx(hF,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Created by"})]}),c.jsx("span",{className:"text-sm text-foreground",children:g??"—"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx(Fy,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Due Date"})]}),c.jsxs(gd,{children:[c.jsx(yd,{asChild:!0,children:c.jsx("button",{className:"text-sm text-foreground hover:underline",children:f?Ze(f,"MMM d, yyyy"):c.jsx("span",{className:"text-muted-foreground",children:"Set date"})})}),c.jsx(fc,{className:"w-auto p-0",align:"start",children:c.jsx(VW,{mode:"single",selected:f,onSelect:E,initialFocus:!0,className:q("p-3 pointer-events-auto")})})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx(fF,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Status"})]}),c.jsxs(Zd,{value:u,onValueChange:N,children:[c.jsx(Cc,{className:"h-7 w-auto border-none shadow-none p-0 gap-1",children:c.jsx(Ai,{variant:"outline",className:q("text-xs",_.color),children:_.label})}),c.jsx(Nc,{children:Ra.map(j=>c.jsx(zn,{value:j.value,children:c.jsx(Ai,{variant:"outline",className:q("text-xs",j.color),children:j.label})},j.value))})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx($y,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Last update"})]}),c.jsx("span",{className:"text-sm text-foreground",children:p!=null&&p.updated_at?ad(new Date(p.updated_at),{addSuffix:!0}):"—"})]}),m&&c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0",children:[c.jsx(Kh,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Relations"})]}),c.jsxs("span",{className:"text-sm text-foreground",children:[m.first_name," ",m.last_name??""]})]}),c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 w-28 shrink-0 mt-0.5",children:[c.jsx(yo,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Assigned to"})]}),c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[b.map(j=>{const F=y.find(B=>B.id===j.user_id);return c.jsxs(Ai,{variant:"secondary",className:"text-xs gap-1 pr-1",children:[(F==null?void 0:F.name)??"Unknown",c.jsx("button",{onClick:()=>w.mutate(j.id),className:"ml-0.5 hover:text-destructive",children:c.jsx(ji,{className:"h-3 w-3"})})]},j.id)}),P.length>0&&c.jsxs(gd,{children:[c.jsx(yd,{asChild:!0,children:c.jsx("button",{className:"h-5 w-5 rounded-full border border-dashed border-muted-foreground/40 flex items-center justify-center hover:border-foreground transition-colors",children:c.jsx(nn,{className:"h-3 w-3 text-muted-foreground"})})}),c.jsx(fc,{className:"w-48 p-1",align:"start",children:P.map(j=>c.jsx("button",{className:"w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent transition-colors",onClick:()=>x.mutate(j.id),children:j.name},j.id))})]}
666),b.length===0&&P.length===0&&c.jsx("span",{className:"text-sm text-muted-foreground",children:"—"})]})]})]}),c.jsx(_n,{}),c.jsxs(Fb,{defaultValue:"details",className:"flex-1 flex flex-col min-h-0",children:[c.jsxs(lm,{className:"w-full justify-start rounded-none border-b border-border bg-transparent h-auto p-0 px-4",children:[c.jsx(tr,{value:"details",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-3 py-2 text-xs",children:"Details"}),c.jsx(tr,{value:"history",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-3 py-2 text-xs",children:"History"})]}),c.jsx(nr,{value:"details",className:"flex-1 overflow-y-auto p-4 mt-0",children:c.jsx(AW,{content:a,onChange:k,placeholder:"Type '/' for commands"})}),c.jsx(nr,{value:"history",className:"flex-1 overflow-y-auto p-4 mt-0",children:c.jsx(q1e,{taskId:t})})]})]})}function q1e({taskId:t}){return c.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"No activity yet"})}function K1e({contactId:t,userId:e,teamId:n}){const{toast:r}=ut(),s=xt(),[i,o]=v.useState(null),{data:a,isLoading:l}=ue({queryKey:["tasks",t],queryFn:async()=>{const{data:g,error:y}=await I.from("tasks").select("*, contacts(first_name, last_name)").eq("contact_id",t).is("deleted_at",null).order("created_at",{ascending:!1});if(y)throw y;return g}}),u=(a==null?void 0:a.map(g=>g.id))??[],{data:d}=ue({queryKey:["task-assignees",u],queryFn:async()=>{if(u.length===0)return[];const{data:g,error:y}=await I.from("task_assignees").select("task_id, user_id, profiles:user_id(first_name, last_name)").in("task_id",u);if(y)throw y;return g},enabled:u.length>0}),f={};d==null||d.forEach(g=>{f[g.task_id]||(f[g.task_id]=[]),f[g.task_id].push(g)});const h=Ee({mutationFn:async()=>{const{data:g,error:y}=await I.from("tasks").insert({contact_id:t,created_by:e,team_id:n,title:"Untitled task",due_at:new Date().toISOString(),status:"todo"}).select().single();if(y)throw y;return g},onSuccess:g=>{s.invalidateQueries({queryKey:["tasks",t]}),o(g.id),r({title:"Task added"})},onError:g=>r({title:"Error",description:g.message,variant:"destructive"})}),p=Ee({mutationFn:async({id:g,done:y})=>{const{error:b}=await I.from("tasks").update({status:y?"done":"todo"}).eq("id",g);if(b)throw b},onSuccess:()=>s.invalidateQueries({queryKey:["tasks",t]})}),m=Ee({mutationFn:async g=>{const{error:y}=await I.from("tasks").delete().eq("id",g);if(y)throw y},onSuccess:()=>{s.invalidateQueries({queryKey:["tasks",t]}),i&&o(null),r({title:"Task deleted"})}});return c.jsxs("div",{className:"flex h-full overflow-hidden",children:[c.jsx(Ye.div,{className:"min-w-0 overflow-y-auto",animate:{flexBasis:i?"calc(100% - 380px)":"
666100%"},transition:{duration:.25,ease:"easeOut"},style:{flexShrink:0,flexGrow:i?0:1},children:c.jsxs("div",{className:"p-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:"All"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:(a==null?void 0:a.length)??0})]}),c.jsxs(K,{variant:"ghost",size:"sm",className:"text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>h.mutate(),disabled:h.isPending,children:[c.jsx(nn,{className:"h-3.5 w-3.5"}),"Add task"]})]}),l?c.jsx("div",{className:"space-y-1",children:Array.from({length:4}).map((g,y)=>c.jsx(vt,{className:"h-10 w-full rounded"},y))}):a&&a.length>0?c.jsxs(Tb,{children:[c.jsx(Ab,{children:c.jsxs(lc,{children:[c.jsx(pn,{className:"w-10"}),c.jsx(pn,{children:"Title"}),c.jsx(pn,{className:"w-28",children:"Status"}),c.jsx(pn,{className:"w-36",children:"Assigned to"}),c.jsx(pn,{className:"w-36",children:"Related to"}),c.jsx(pn,{className:"w-28",children:"Due Date"}),c.jsx(pn,{className:"w-10"})]})}),c.jsx(jb,{children:a.map(g=>{const y=Ra.find(C=>C.value===g.status)??Ra[0],b=g.contacts,x=b?`${b.first_name} ${b.last_name??""}`.trim():"",S=(f[g.id]??[]).map(C=>{const k=C.profiles;return k?`${k.first_name} ${k.last_name??""}`.trim():""}).filter(Boolean);return c.jsxs(lc,{className:q("cursor-pointer",i===g.id&&"bg-muted"),onClick:()=>o(g.id),children:[c.jsx(mn,{onClick:C=>C.stopPropagation(),children:c.jsx(hd,{checked:g.status==="done",onCheckedChange:C=>p.mutate({id:g.id,done:!!C})})}),c.jsx(mn,{children:c.jsx("span",{className:q("text-sm",g.status==="done"&&"line-through text-muted-foreground"),children:g.title})}),c.jsx(mn,{children:c.jsx(Ai,{variant:"outline",className:q("text-xs",y.color),children:y.label})}),c.jsx(mn,{children:c.jsx("span",{className:"text-sm text-muted-foreground",children:S.length>0?S.join(", "):"—"})}),c.jsx(mn,{children:c.jsx("span",{className:"text-sm text-muted-foreground",children:x||"—"})}),c.jsx(mn,{children:c.jsx("span",{className:"text-sm text-muted-foreground",children:g.due_at?Ze(new Date(g.due_at),"MMM d, yyyy"):"—"})}),c.jsx(mn,{onClick:C=>C.stopPropagation(),children:c.jsx(K,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",onClick:()=>m.mutate(g.id),children:c.jsx(qs,{className:"h-3 w-3"})})})]},g.id)})})]}):c.jsxs("div",{className:"flex flex-col items-center py-10 text-center",children:[c.jsx(Od,{className:"h-8 w-8 text-muted-foreground mb-2"}),c.jsx("p",{className:"text-muted-foreground",children:"No tasks yet."})]})]})}),i&&c.jsx(Ye.div,{className:"w-[380px] shrink-0 border-l border-border overflow-hidden h-full",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.25,ease:"easeOut"},children:c.jsx(zW,{taskId:i,onClose:()=>o(null)})})]})}const G1e=25*1024*1024;function CD(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Y1e(t){return t?t.startsWith("image/")?V9:t.startsWith("video/")?U9:t.startsWith("audio/")?$9:t.includes("zip")||t.includes("archive")||t.includes("tar")||t.includes("rar")?B9:t.includes("pdf")||t.includes("doc")||t.includes("text")?qh:LS:LS}function UW({contactId:t,userId:e,teamId:n}){var w;const{toast:r}=ut(),s=xt(),i=v.useRef(null),[o,a]=v.useState(null),l=t?["files",t]:["files","team",n],{data:u,isLoading:d}=ue({queryKey:l,queryFn:async()=>{let S=I.from("files").select("*").order("created_at",{ascending:!1});t&&(S=S.eq("contact_id",t));const{data:C,error:k}=await S;if(k)throw k;return C}}),f=(u==null?void 0:u.map(S=>S.contact_id).filter(Boolean))??[],h=[...new Set(f)],{data:p}=ue({queryKey:["contacts-for-files",h],queryFn:async()=>{if(h.length===0)return{};const{data:S,error:C}=await I.from("contacts").select("id, first_name, last_name").in("id",h);if(C)throw C;const k={};for(const N of S??[])k[N.id]=`${N.first_name} ${N.last_name??""}`.trim();return k},enabled:!t&&h.length>0}),m=Ee({mutationFn:async S=>{if(S.size>G1e)throw new Error("File exceeds 25MB limit");const C=S.name.split(".").pop(),k=`${n}/${crypto.randomUUID()}.${C}`,{error:N}=await I.storage.from("contact-files").upload(k,S);if(N)throw N;const{error:E}=await I.from("files").insert({team_id:n,contact_id:t||null,uploaded_by:e,file_name:S.name,file_size:S.size,mime_type:S.type||null,storage_path:k});if(E)throw E},onSuccess:()=>{s.invalidateQueries({queryKey:l}),r({title:"File uploaded"})},onError:S=>r({title:"Upload failed",description:S.message,variant:"destructive"})}),g=Ee({mutationFn:async S=>{await I.storage.from("contact-files").remove([S.storage_path]);const{error:C}=await I.from("files").delete().eq("id",S.id);if(C)throw C},onSuccess:()=>{s.invalidateQueries({queryKey:l}),a(null),r({title:"File deleted"})}}),y=S=>{var k;const C=(k=S.target.files)==null?void 0:k[0];C&&m.mutate(C),i.current&&(i.current.value="")},b=u==null?void 0:u.find(S=>S.id===o),x=S=>{const{data:C}=I.storage.from("contact-files").getPublicUrl(S);return C.publicUrl};return c.jsxs("div",{className:"flex h-full overflow-hidden",children:[c.jsx("input",{ref:i,type:"file",className:"hidden",onChange:y}),c.jsx(Ye.div,{className:"min-w-0 overflow-y-auto",animate:{flexBasis:o?"calc(100% - 380px)":"
666100%"},transition:{duration:.25,ease:"easeOut"},style:{flexShrink:0,flexGrow:o?0:1},children:c.jsxs("div",{className:"px-5",children:[c.jsxs("div",{className:"flex items-center justify-between py-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:"All"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:(u==null?void 0:u.length)??0})]}),c.jsxs(K,{variant:"ghost",size:"sm",className:"text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>{var S;return(S=i.current)==null?void 0:S.click()},disabled:m.isPending,children:[c.jsx(nn,{className:"h-3.5 w-3.5"}),m.isPending?"Uploading…":"Upload file"]})]}),d?c.jsx("div",{className:"space-y-1",children:Array.from({length:4}).map((S,C)=>c.jsx(vt,{className:"h-10 w-full rounded"},C))}):u&&u.length>0?c.jsx("div",{className:"space-y-0",children:u.map(S=>{const C=Y1e(S.mime_type);return c.jsxs("div",{className:q("relative flex items-center gap-3 px-3 py-2.5 rounded-md cursor-pointer hover:bg-muted/50 transition-colors group",o===S.id&&"bg-muted"),onClick:()=>a(S.id),children:[c.jsx(C,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),c.jsx("p",{className:"text-sm truncate flex-1",children:S.file_name}),!t&&S.contact_id&&(p==null?void 0:p[S.contact_id])&&c.jsx("span",{className:"text-xs text-muted-foreground shrink-0 max-w-[120px] truncate",children:p[S.contact_id]}),c.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:CD(S.file_size)}),c.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:Ze(new Date(S.created_at),"MMM d")}),c.jsx(K,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive shrink-0",onClick:k=>{k.stopPropagation(),g.mutate(S)},children:c.jsx(qs,{className:"h-3 w-3"})})]},S.id)})}):c.jsxs("div",{className:"flex flex-col items-center py-10 text-center",children:[c.jsx(LS,{className:"h-8 w-8 text-muted-foreground mb-2"}),c.jsx("p",{className:"text-muted-foreground",children:"No files yet."})]})]})}),o&&b&&c.jsx(Ye.div,{className:"w-[380px] shrink-0 border-l border-border overflow-y-auto h-full",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.25,ease:"easeOut"},children:c.jsxs("div",{className:"p-5 space-y-5",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"File Details"}),c.jsx(K,{variant:"ghost",size:"sm",onClick:()=>a(null),className:"text-xs",children:"Close"})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:"Name"}),c.jsx("p",{className:"text-sm font-medium break-all",children:b.file_name})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:"Size"}),c.jsx("p",{className:"text-sm",children:CD(b.file_size)})]}),b.mime_type&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:"Type"}),c.jsx("p",{className:"text-sm",children:b.mime_type})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploaded"}),c.jsx("p",{className:"text-sm",children:Ze(new Date(b.created_at),"MMM d, yyyy 'at' h:mm a")})]}),b.contact_id&&(p==null?void 0:p[b.contact_id])&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:"Contact"}),c.jsx("p",{className:"text-sm font-medium",children:p[b.contact_id]})]})]}),((w=b.mime_type)==null?void 0:w.startsWith("image/"))&&c.jsx("img",{src:x(b.storage_path),alt:b.file_name,className:"w-full rounded-md border border-border"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(K,{variant:"outline",size:"sm",className:"flex-1 gap-1.5",onClick:()=>{const S=x(b.storage_path);window.open(S,"_blank")},children:[c.jsx(pF,{className:"h-3.5 w-3.5"})," Download"]}),c.jsxs(K,{variant:"outline",size:"sm",className:"gap-1.5 text-destructive hover:text-destructive",onClick:()=>g.mutate(b),children:[c.jsx(qs,{className:"h-3.5 w-3.5"})," Delete"]})]})]})})]})}function ND(t){const e=t.match(/^(.+?)\s*<(.+?)>$/);return e?{name:e[1].replace(/"/g,"").trim(),email:e[2]}:{name:t,email:t}}function WW(t){return t.split(" ").map(e=>
666e[0]).filter(Boolean).slice(0,1).join("").toUpperCase()}const ED=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-pink-500","bg-teal-500","bg-indigo-500"];function HW(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return ED[Math.abs(e)%ED.length]}function Q1e(t){try{const e=new Date(t),n=new Date,r=Math.floor((n.getTime()-e.getTime())/(1e3*60*60*24));return r===0?Ze(e,"h:mm a"):r<7?Ze(e,"EEE"):e.getFullYear()===n.getFullYear()?Ze(e,"MMM d"):Ze(e,"MMM d, yyyy")}catch{return t}}function _D(t){try{const e=new Date(t),r=new Date().getTime()-e.getTime(),s=Math.floor(r/6e4);if(s<1)return"just now";if(s<60)return`${s} minutes ago`;const i=Math.floor(s/60);if(i<24)return`${i} hours ago`;const o=Math.floor(i/24);if(o===1)return"1 day ago";if(o<30)return`${o} days ago`;const a=Math.floor(o/30);return a===1?"1 month ago":`${a} months ago`}catch{return t}}function J1e(t){return new DOMParser().parseFromString(t,"text/html").body.textContent||""}function X1e(t,e){if(e){const s=new DOMParser().parseFromString(t,"text/html");s.querySelectorAll(".gmail_quote, .gmail_extra, blockquote").forEach(l=>l.remove());const i=s.body.innerHTML,o=/<div[^>]*>On\s.+?wrote:<\/div>/i,a=i.search(o);return a>0?i.slice(0,a):i}const n=t.split(`
667`),r=[];for(const s of n){if(/^On\s.+wrote:\s*$/.test(s.trim())||s.trimStart().startsWith(">"))break;r.push(s)}return r.join(`
668`).trimEnd()}function Z1e({contactEmail:t}){const[e,n]=v.useState(null),[r,s]=v.useState(null),{data:i,isLoading:o}=ue({queryKey:["google-connection"],queryFn:async()=>{const{data:h,error:p}=await I.from("google_connections").select("*").maybeSingle();if(p)throw p;return h}}),{data:a,isLoading:l,error:u}=ue({queryKey:["gmail-threads",t,r],queryFn:async()=>{const{data:h,error:p}=await I.functions.invoke("google-gmail-proxy",{body:{contactEmail:t,pageToken:r}});if(p)throw p;if(h!=null&&h.error)throw new Error(h.error);return h},enabled:!!i});if(o)return c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(gt,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(!i)return c.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-6",children:[c.jsx(qx,{className:"h-10 w-10 text-muted-foreground"}),c.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Connect your Google account to view emails with this contact."}),c.jsx(K,{variant:"outline",size:"sm",asChild:!0,children:c.jsx($e,{to:"/settings/integrations",children:"Connect Google"})})]});const d=(a==null?void 0:a.threads)||[],f=(a==null?void 0:a.googleEmail)||"";return c.jsxs("div",{className:"flex h-full",children:[c.jsxs("div",{className:`${e?"w-[380px] shrink-0 border-r border-border":"flex-1"} flex flex-col h-full`,children:[c.jsx("div",{className:"px-4 py-3 border-b border-border",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Inbox"}),d.length>0&&c.jsx("span",{className:"text-xs text-muted-foreground",children:d.length})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:l?c.jsx("div",{className:"flex items-center justify-center py-10",children:c.jsx(gt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):u?c.jsx("div",{className:"p-4 text-sm text-destructive",children:"Failed to load emails."}):d.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center px-4",children:[c.jsx(mF,{className:"h-8 w-8 text-muted-foreground mb-2"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["No emails found with ",t]})]}):c.jsxs(c.Fragment,{children:[d.map(h=>{const p=e===h.threadId,m=h.participants||[];return c.jsx("button",{onClick:()=>n(h.threadId),className:`w-full text-left px-4 py-3 border-b border-border hover:bg-muted/50 transition-colors ${p?"bg-muted":""}`,children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"flex -space-x-1.5 shrink-0",children:m.slice(0,2).map((g,y)=>c.jsx("div",{className:`h-6 w-6 rounded-full ${HW(g.email)} flex items-center justify-center text-white text-[10px] font-medium ring-2 ring-background`,children:WW(g.name)},y))}),c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 shrink-0",children:[c.jsx("span",{className:"text-sm text-foreground truncate max-w-[120px]",children:m.map(g=>g.name.split(" ")[0]).join(", ")}),h.messageCount>1&&c.jsx("span",{className:"text-xs text-muted-foreground",children:h.messageCount})]}),c.jsx("span",{className:"text-sm text-muted-foreground truncate flex-1 min-w-0",children:h.subject}),c.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:Q1e(h.date)})]})},h.threadId)}),(a==null?void 0:a.nextPageToken)&&c.jsx("div",{className:"p-3 text-center",children:c.jsx(K,{variant:"ghost",size:"sm",onClick:()=>s(a.nextPageToken),className:"text-xs",children:"Show more"})})]})})]}),e&&c.jsx(eSe,{threadId:e,googleEmail:f,onClose:()=>n(null),enabled:!!i})]})}function eSe({threadId:t,googleEmail:e,onClose:n,enabled:r}){const[s,i]=v.useState(new Set),[o,a]=v.useState(!1),{data:l,isLoading:u}=ue({queryKey:["gmail-thread-detail",t],queryFn:async()=>{const{data:p,error:m}=await I.functions.invoke("google-gmail-proxy",{body:{threadId:t}});if(m)throw m;if(p!=null&&p.error)throw new Error(p.error);return p},enabled:r});if(l&&!o){const p=l.messages[l.messages.length-1];p&&i(new Set([p.id])),a(!0)}const d=p=>{i(m=>{const g=new Set(m);return g.has(p)?g.delete(p):g.add(p),g})};if(u)return c.jsx("div",{className:"flex-1 flex items-center justify-center",children:c.jsx(gt,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(!l)return null;const f=l.messages,h=f[f.length-1];return c.jsxs("div",{className:"flex-1 min-w-0 flex flex-col h-full",children:[c.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-3",children:[c.jsx(qx,{className:"h-4 w-4 text-muted-foreground shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:"Email Thread"}),c.jsx("div",{className:"flex-1"}),c.jsx(K,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:n,children:c.jsx(ji,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[c.jsxs("div",{className:"px-6 pt-6 pb-4 border-b border-border",children:[c.jsx("h2",{className:"text-xl font-semibold text-foreground leading-tight",children:l.subject}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1.5",children:["Last message ",_D(h==null?void 0:h.date)]})]}),c.jsx("div",{className:"divide-y divide-border",children:f.map(p=>{const m=s.has(p.id),g=ND(p.from),y=ND(p.to),b=p.body||"",x=b.includes("<")&&b.includes(">"),w=X1e(b,x),S=J1e(w).slice(0,140);return c.jsxs("div",{className:"px-6 py-4",children:[c.jsxs("button",{onClick:()=>d(p.id),className:"w-full text-left flex items-start gap-3 group",children:[c.jsx("div",{className:`h-7 w-7 rounded-full ${HW(g.email)} flex items-center justify-center text-white text-[10px] font-medium shrink-0 mt-0.5`,children:WW(g.name)}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:g.name}),c.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:_D(p.date)})]}),!m&&c.jsx("p",{className:"text-sm text-muted-foreground truncate mt-0.5",children:S})]})]}),m&&c.jsxs("div",{className:"mt-2 ml-10",children:[c.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["to: ",y.email,", ",y.name]}),x?c.jsx("div",{className:"text-sm text-foreground leading-relaxed [&_a]:text-primary [&_a]:underline [&_img]:max-w-full [&_br]:leading-relaxed",dangerouslySetInnerHTML:{__html:w}}):c.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:w})]})]}
668,p.id)})})]}),c.jsx("div",{className:"p-4 border-t border-border flex justify-end",children:c.jsxs(K,{size:"sm",variant:"ghost",className:"text-muted-foreground",onClick:()=>{const p=`https://mail.google.com/mail/?authuser=${encodeURIComponent(e)}#all/${t}`;window.open(p,"_blank")},children:[c.jsx(Z9,{className:"h-4 w-4 mr-1.5"}),"Reply"]})})]})}function tSe(t){try{const e=Gk(t);return Ze(e,"MMM d, yyyy 'at' h:mm a")}catch{try{return Ze(new Date(t),"MMM d, yyyy")}catch{return t}}}function nSe(t,e){try{const n=Gk(t),r=Gk(e);return Ze(n,"yyyy-MM-dd")===Ze(r,"yyyy-MM-dd")?`${Ze(n,"MMM d, yyyy")} · ${Ze(n,"h:mm a")} – ${Ze(r,"h:mm a")}`:`${Ze(n,"MMM d, h:mm a")} – ${Ze(r,"MMM d, h:mm a")}`}catch{return t}}function rSe({contactEmail:t}){const[e,n]=v.useState(null),[r,s]=v.useState(null),{data:i,isLoading:o}=ue({queryKey:["google-connection"],queryFn:async()=>{const{data:f,error:h}=await I.from("google_connections").select("*").maybeSingle();if(h)throw h;return f}}),{data:a,isLoading:l,error:u}=ue({queryKey:["calendar-events",t,e],queryFn:async()=>{const{data:f,error:h}=await I.functions.invoke("google-calendar-proxy",{body:{contactEmail:t,pageToken:e}});if(h)throw h;if(f!=null&&f.error)throw new Error(f.error);return f},enabled:!!i});if(o)return c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(gt,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(!i)return c.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-6",children:[c.jsx(Fy,{className:"h-10 w-10 text-muted-foreground"}),c.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Connect your Google account to view calendar events with this contact."}),c.jsx(K,{variant:"outline",size:"sm",asChild:!0,children:c.jsx($e,{to:"/settings/integrations",children:"Connect Google"})})]});const d=(a==null?void 0:a.events)||[];return c.jsxs("div",{className:"flex h-full",children:[c.jsxs("div",{className:`${r?"w-[380px] shrink-0 border-r border-border":"flex-1"} flex flex-col h-full`,children:[c.jsx("div",{className:"p-4 border-b border-border",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Events"}),d.length>0&&c.jsx("span",{className:"text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full",children:d.length})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:l?c.jsx("div",{className:"flex items-center justify-center py-10",children:c.jsx(gt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):u?c.jsx("div",{className:"p-4 text-sm text-destructive",children:"Failed to load events. Please try again."}):d.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center px-4",children:[c.jsx(Fy,{className:"h-8 w-8 text-muted-foreground mb-2"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["No events found with ",t]})]}):c.jsxs(c.Fragment,{children:[d.map(f=>{const h=(r==null?void 0:r.id)===f.id;return c.jsxs("button",{onClick:()=>s(f),className:`w-full text-left px-4 py-3 border-b border-border hover:bg-muted/50 transition-colors ${h?"bg-muted":""}`,children:[c.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:f.summary}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:tSe(f.start)}),f.location&&c.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate flex items-center gap-1",children:[c.jsx(kj,{className:"h-3 w-3 shrink-0"}),f.location]})]},f.id)}),(a==null?void 0:a.nextPageToken)&&c.jsx("div",{className:"p-3 text-center",children:c.jsx(K,{variant:"ghost",size:"sm",onClick:()=>n(a.nextPageToken),className:"text-xs",children:"Show more"})})]})})]}),r&&c.jsxs("div",{className:"flex-1 min-w-0 flex flex-col h-full",children:[c.jsx("div",{className:"p-4 border-b border-border",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r.summary}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:nSe(r.start,r.end)})]}),c.jsx(K,{variant:"ghost",size:"sm",onClick:()=>s(null),className:"text-xs text-muted-foreground",children:"✕"})]})}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[r.location&&c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(kj,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-0.5"}),c.jsx("p",{className:"text-sm text-foreground",children:r.location})]}),r.attendees.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx(yo,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Attendees"})]}),c.jsx("div",{className:"space-y-1.5",children:r.attendees.map((f,h)=>c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"text-foreground",children:f.displayName}),c.jsx("span",{className:`text-xs capitalize ${f.responseStatus==="accepted"?"text-green-600 dark:text-green-400":f.responseStatus==="declined"?"text-destructive":"text-muted-foreground"}`,children:f.responseStatus})]},h))})]})]}),r.htmlLink&&c.jsx("div",{className:"p-4 border-t border-border",children:c.jsxs(K,{size:"sm",variant:"outline",onClick:()=>window.open(r.htmlLink,"_blank"),children:[c.jsx(IS,{className:"h-4 w-4 mr-1.5"}),"Open in Google Calendar"]})})]})]})}const sSe={initial:{opacity:0}
668,animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function iSe(t,e){return(((t==null?void 0:t[0])??"")+((e==null?void 0:e[0])??"")).toUpperCase()||"?"}function jf({icon:t,label:e,value:n}){return c.jsxs("div",{className:"flex items-center justify-between gap-2 py-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(t,{className:"h-4 w-4 text-muted-foreground shrink-0"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:e})]}),c.jsx("p",{className:"text-sm font-medium text-foreground truncate text-right",children:n||"—"})]})}function oSe(){const{id:t}=cJ(),e=Dn(),{user:n,teamId:r,role:s}=ot(),{toast:i}=ut(),o=xt(),[a,l]=v.useState(!1),[u,d]=v.useState("timeline"),[f,h]=v.useState(null),{data:p}=ue({queryKey:["kit-connection-exists",r],queryFn:async()=>{const{data:k,error:N}=await I.from("kit_connections").select("id").eq("team_id",r).maybeSingle();if(N)throw N;return k},enabled:!!r}),{data:m,isLoading:g}=ue({queryKey:["contact",t],queryFn:async()=>{const{data:k,error:N}=await I.from("contacts").select("*").eq("id",t).single();if(N)throw N;return k},enabled:!!t}),y=!!p||!!(m!=null&&m.kit_subscriber_id),b=Ee({mutationFn:async k=>{const N=[],E=["first_name","last_name","email","phone","company"];for(const T of E){const P=(m==null?void 0:m[T])??"",j=k[T]||"";
668String(P)!==String(j)&&N.push({field:T,old:String(P||""),new:String(j||"")})}const{error:_}=await I.from("contacts").update({first_name:k.first_name,last_name:k.last_name||null,email:k.email,phone:k.phone||null,company:k.company||null}).eq("id",t);if(_)throw _;return N},onSuccess:k=>{if(n&&k.length>0)for(const N of k)Wa(t,n.id,"field_updated",N);o.invalidateQueries({queryKey:["contact",t]}),o.invalidateQueries({queryKey:["contacts"]}),o.invalidateQueries({queryKey:["activity_log",t]}),l(!1),i({title:"Contact updated"})},onError:k=>{i({title:"Error",description:k.message,variant:"destructive"})}}),x=Ee({mutationFn:async()=>{const{error:k}=await I.from("contacts").delete().eq("id",t);if(k)throw k},onSuccess:()=>{o.invalidateQueries({queryKey:["contacts"]}),e("/contacts"),i({title:"Contact deleted"})},onError:k=>{i({title:"Error",description:k.message,variant:"destructive"})}});if(g)return c.jsxs("div",{className:"p-6 space-y-4",children:[c.jsx(vt,{className:"h-6 w-48"}),c.jsx(vt,{className:"h-4 w-32"}),c.jsx(vt,{className:"h-64 w-full"})]});if(!m)return c.jsxs("div",{className:"p-6",children:[c.jsx("p",{className:"text-muted-foreground",children:"Contact not found."}),c.jsxs(K,{variant:"ghost",onClick:()=>e(-1),className:"mt-2",children:[c.jsx(Iy,{className:"h-4 w-4 mr-1"})," Go back"]})]});const w=`${m.first_name} ${m.last_name??""}`.trim(),S=iSe(m.first_name,m.last_name),C=ad(new Date(m.created_at),{addSuffix:!0});return c.jsxs(Ye.div,{...sSe,className:"flex h-[calc(100vh-3.5rem)] overflow-hidden",children:[c.jsxs(Ei,{children:[c.jsx(K,{variant:"ghost",size:"icon",onClick:()=>e(-1),className:"h-8 w-8",children:c.jsx(Iy,{className:"h-4 w-4"})}),c.jsx("h1",{className:"text-sm font-medium tracking-tight text-foreground",children:w}),m.kit_subscriber_id&&c.jsx(Ua,{className:"ml-1"}),c.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[c.jsx(K,{variant:"ghost",size:"icon",onClick:()=>l(!0),className:"h-8 w-8",children:c.jsx(XN,{className:"h-4 w-4"})}),c.jsxs(L_,{children:[c.jsx(F_,{asChild:!0,children:c.jsx(K,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",children:c.jsx(qs,{className:"h-4 w-4"})})}),c.jsxs($b,{children:[c.jsxs(Vb,{children:[c.jsx(Ub,{children:"Delete contact?"}),c.jsxs(Wb,{children:["This will permanently delete ",w," and all their notes and reminders."]})]}),c.jsxs(zb,{children:[c.jsx(qb,{children:"Cancel"}),c.jsx(Hb,{onClick:()=>x.mutate(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]}),c.jsxs("aside",{className:"w-[380px] shrink-0 border-r border-border overflow-y-auto p-5 space-y-5",children:[c.jsxs("div",{className:"flex flex-col items-start gap-3",children:[c.jsx(D_,{className:"h-16 w-16",children:c.jsx(I_,{className:"bg-primary text-primary-foreground text-xl font-semibold",children:S})}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold text-foreground leading-tight",children:w}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Added ",C]})]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Details"}),c.jsx(jf,{icon:qx,label:"Email",value:m.email}),c.jsx(jf,{icon:J9,label:"Phone",value:m.phone}),c.jsx(jf,{icon:j9,label:"Company",value:m.company}),c.jsx(jf,{icon:Nj,label:"First Name",value:m.first_name}),c.jsx(jf,{icon:Nj,label:"Last Name",value:m.last_name})]}),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Boards"}),c.jsx(The,{contactId:m.id})]}),c.jsx(_he,{contactId:m.id})]}),c.jsx("div",{className:"border-t border-border pt-4",children:c.jsx(Phe,{contactId:m.id})})]}),c.jsx("main",{className:"flex-1 min-w-0 overflow-hidden",children:c.jsxs(Fb,{value:u,onValueChange:d,className:"h-full flex flex-col",children:[c.jsx("div",{className:"border-b border-border px-6 pt-4",children:c.jsxs(lm,{className:"bg-transparent h-auto p-0 gap-0",children:[c.jsxs(tr,{value:"timeline",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-1 text-sm",children:[c.jsx($y,{className:"h-4 w-4 mr-1.5"})," Timeline"]}),c.jsxs(tr,{value:"tasks",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-1 text-sm",children:[c.jsx($y,{className:"h-4 w-4 mr-1.5"})," Tasks"]}),c.jsxs(tr,{value:"notes",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-1 text-sm",children:[c.jsx(qh,{className:"h-4 w-4 mr-1.5"})," Notes"]}),c.jsxs(tr,{value:"files",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-1 text-sm",children:[c.jsx(qh,{className:"h-4 w-4 mr-1.5"})," Files"]}),c.jsxs(tr,{value:"emails",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-1 text-sm",children:[c.jsx(mF,{className:"h-4 w-4 mr-1.5"})," Emails"]}
668),c.jsxs(tr,{value:"calendar",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-1 text-sm",children:[c.jsx(Fy,{className:"h-4 w-4 mr-1.5"})," Calendar"]}),y&&c.jsxs(tr,{value:"kit",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-1 text-sm",children:[c.jsx("img",{src:Ib,alt:"Kit",className:"h-4 w-4 rounded mr-1.5"})," Kit"]})]})}),c.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden",children:[c.jsx(nr,{value:"timeline",className:"mt-0 h-full overflow-y-auto p-6",children:c.jsx(hhe,{contactId:m.id,userId:(n==null?void 0:n.id)??"",teamId:r??"",onOpenNote:k=>{h(k),d("notes")}})}),c.jsx(nr,{value:"tasks",className:"mt-0 h-full",children:c.jsx(K1e,{contactId:m.id,userId:(n==null?void 0:n.id)??"",teamId:r??""})}),c.jsx(nr,{value:"notes",className:"mt-0 h-full",children:c.jsx(hwe,{contactId:m.id,contactName:w,userId:(n==null?void 0:n.id)??"",initialNoteId:f,onClearInitialNote:()=>h(null)})}),c.jsx(nr,{value:"files",className:"mt-0 h-full",children:c.jsx(UW,{contactId:m.id,userId:(n==null?void 0:n.id)??"",teamId:r??""})}),c.jsx(nr,{value:"emails",className:"mt-0 h-full",children:c.jsx(Z1e,{contactEmail:m.email})}),c.jsx(nr,{value:"calendar",className:"mt-0 h-full",children:c.jsx(rSe,{contactEmail:m.email})}),y&&c.jsx(nr,{value:"kit",className:"mt-0 h-full overflow-y-auto p-6",children:c.jsx(ipe,{contactId:m.id,kitSubscriberId:m.kit_subscriber_id?Number(m.kit_subscriber_id):null})})]})]})}),c.jsx(Qp,{open:a,onOpenChange:l,children:c.jsxs(Hd,{children:[c.jsx(Jp,{children:c.jsx(Xp,{children:"Edit Contact"})}),c.jsx("div",{className:"mt-6",children:c.jsx(rC,{onSubmit:k=>b.mutate(k),isLoading:b.isPending,defaultValues:{first_name:m.first_name,last_name:m.last_name??"",email:m.email,phone:m.phone??"",company:m.company??""},submitLabel:"Update"})})]})})]})}function Gn(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var aSe=typeof Symbol=="function"&&Symbol.observable||"@@observable",TD=aSe,N1=()=>Math.random().toString(36).substring(7).split("").join("."),lSe={INIT:`@@redux/INIT${N1()}`,REPLACE:`@@redux/REPLACE${N1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${N1()}`},AD=lSe;function cSe(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function qW(t,e,n){if(typeof t!="function")throw new Error(Gn(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Gn(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Gn(1));return n(qW)(t,e)}let r=t,s=e,i=new Map,o=i,a=0,l=!1;function u(){o===i&&(o=new Map,i.forEach((y,b)=>{o.set(b,y)}))}function d(){if(l)throw new Error(Gn(3));return s}function f(y){if(typeof y!="function")throw new Error(Gn(4));if(l)throw new Error(Gn(5));let b=!0;u();const x=a++;return o.set(x,y),function(){if(b){if(l)throw new Error(Gn(6));b=!1,u(),o.delete(x),i=null}}}function h(y){if(!cSe(y))throw new Error(Gn(7));if(typeof y.type>"u")throw new Error(Gn(8));if(typeof y.type!="string")throw new Error(Gn(17));if(l)throw new Error(Gn(9));try{l=!0,s=r(s,y)}finally{l=!1}return(i=o).forEach(x=>{x()}),y}function p(y){if(typeof y!="function")throw new Error(Gn(10));r=y,h({type:AD.REPLACE})}function m(){const y=f;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Gn(11));function x(){const S=b;S.next&&S.next(d())}return x(),{unsubscribe:y(x)}},[TD](){return this}}}return h({type:AD.INIT}),{dispatch:h,subscribe:f,getState:d,replaceReducer:p,[TD]:m}}function jD(t,e){return function(...n){return e(t.apply(this,n))}}function PD(t,e){if(typeof t=="function")return jD(t,e);if(typeof t!="object"||t===null)throw new Error(Gn(16));const n={};for(const r in t){const s=t[r];typeof s=="function"&&(n[r]=jD(s,e))}return n}function KW(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function uSe(...t){return e=>(n,r)=>{const s=e(n,r);let i=()=>{throw new Error(Gn(15))};const o={getState:s.getState,dispatch:(l,...u)=>i(l,...u)},a=t.map(l=>l(o));return i=KW(...a)(s.dispatch),{...s,dispatch:i}}}var dSe={};/**
669 * @license React
670 * use-sync-external-store-with-selector.production.js
671 *
672 * Copyright (c) Meta Platforms, Inc. and affiliates.
673 *
674 * This source code is licensed under the MIT license found in the
675 * LICENSE file in the root directory of this source tree.
676 */var vm=v;function fSe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}
676var hSe=typeof Object.is=="function"?Object.is:fSe,pSe=vm.useSyncExternalStore,mSe=vm.useRef,gSe=vm.useEffect,ySe=vm.useMemo,vSe=vm.useDebugValue;dSe.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=mSe(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=ySe(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return f=m}return f=p}if(m=f,hSe(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,s]);var a=pSe(t,i[0],i[1]);return gSe(function(){o.hasValue=!0,o.value=a},[a]),vSe(a),a};var xSe=v.version.startsWith("19"),bSe=Symbol.for(xSe?"react.transitional.element":"react.element"),wSe=Symbol.for("react.portal"),SSe=Symbol.for("react.fragment"),kSe=Symbol.for("react.strict_mode"),CSe=Symbol.for("react.profiler"),NSe=Symbol.for("react.consumer"),ESe=Symbol.for("react.context"),GW=Symbol.for("react.forward_ref"),_Se=Symbol.for("react.suspense"),TSe=Symbol.for("react.suspense_list"),IT=Symbol.for("react.memo"),ASe=Symbol.for("react.lazy"),jSe=GW,PSe=IT;function RSe(t){if(typeof t=="object"&&t!==null){const{$$typeof:e}=t;switch(e){case bSe:switch(t=t.type,t){case SSe:case CSe:case kSe:case _Se:case TSe:return t;default:switch(t=t&&t.$$typeof,t){case ESe:case GW:case ASe:case IT:return t;case NSe:return t;default:return e}}case wSe:return e}}}function MSe(t){return RSe(t)===IT}function OSe(t,e,n,r,{areStatesEqual:s,areOwnPropsEqual:i,areStatePropsEqual:o}){let a=!1,l,u,d,f,h;function p(x,w){return l=x,u=w,d=t(l,u),f=e(r,u),h=n(d,f,u),a=!0,h}function m(){return d=t(l,u),e.dependsOnOwnProps&&(f=e(r,u)),h=n(d,f,u),h}function g(){return t.dependsOnOwnProps&&(d=t(l,u)),e.dependsOnOwnProps&&(f=e(r,u)),h=n(d,f,u),h}function y(){const x=t(l,u),w=!o(x,d);return d=x,w&&(h=n(d,f,u)),h}function b(x,w){const S=!i(w,u),C=!s(x,l,w,u);return l=x,u=w,S&&C?m():S?g():C?y():h}return function(w,S){return a?b(w,S):p(w,S)}}function DSe(t,{initMapStateToProps:e,initMapDispatchToProps:n,initMergeProps:r,...s}){const i=e(t,s),o=n(t,s),a=r(t,s);return OSe(i,o,a,t,s)}function ISe(t,e){const n={};for(const r in t){const s=t[r];typeof s=="function"&&(n[r]=(...i)=>e(s(...i)))}return n}function WC(t){return function(n){const r=t(n);function s(){return r}return s.dependsOnOwnProps=!1,s}}function RD(t){return t.dependsOnOwnProps?!!t.dependsOnOwnProps:t.length!==1}function YW(t,e){return function(r,{displayName:s}){const i=function(a,l){return i.dependsOnOwnProps?i.mapToProps(a,l):i.mapToProps(a,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(a,l){i.mapToProps=t,i.dependsOnOwnProps=RD(t);let u=i(a,l);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=RD(u),u=i(a,l)),u},i}}function LT(t,e){return(n,r)=>{throw new Error(`Invalid value of type ${typeof t} for ${e} argument when connecting component ${r.wrappedComponentName}.`)}}function LSe(t){return t&&typeof t=="object"?WC(e=>ISe(t,e)):t?typeof t=="function"?YW(t):LT(t,"mapDispatchToProps"):WC(e=>({dispatch:e}))}function FSe(t){return t?typeof t=="function"?YW(t):LT(t,"mapStateToProps"):WC(()=>({}))}function BSe(t,e,n){return{...n,...t,...e}}function $Se(t){return function(n,{displayName:r,areMergedPropsEqual:s}){let i=!1,o;return function(l,u,d){const f=t(l,u,d);return i?s(f,o)||(o=f):(i=!0,o=f),o}}}function VSe(t){return t?typeof t=="function"?$Se(t):LT(t,"mergeProps"):()=>BSe}function zSe(t){t()}function USe(){let t=null,e=null;return{clear(){t=null,e=null},notify(){zSe(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=t;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=e={callback:n,next:null,prev:e};return s.prev?s.prev.next=s:t=s,function(){!r||t===null||(r=!1,s.next?s.next.prev=s.prev:e=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}var MD={notify(){},get:()=>[]};function QW(t,e){let n,r=MD,s=0,i=!1;function o(g){d();const y=r.subscribe(g);let b=!1;return()=>{b||(b=!0,y(),f())}}function a(){r.notify()}function l(){m.onStateChange&&m.onStateChange()}function u(){return i}function d(){s++,n||(n=e?e.addNestedSub(l):t.subscribe(l),r=USe())}function f(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=MD)}function h(){i||(i=!0,d())}function p(){i&&(i=!1,f())}const m={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:u,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>r};return m}var WSe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",HSe=WSe(),qSe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",KSe=qSe(),GSe=()=>HSe||KSe?v.useLayoutEffect:v.useEffect,gx=GSe();function OD(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function E1(t,e){if(OD(t,e))return!0;
676if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(e,n[s])||!OD(t[n[s]],e[n[s]]))return!1;return!0}var YSe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},QSe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},JSe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},JW={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},XSe={[jSe]:JSe,[PSe]:JW};function DD(t){return MSe(t)?JW:XSe[t.$$typeof]||YSe}var ZSe=Object.defineProperty,eke=Object.getOwnPropertyNames,ID=Object.getOwnPropertySymbols,tke=Object.getOwnPropertyDescriptor,nke=Object.getPrototypeOf,LD=Object.prototype;function HC(t,e){if(typeof e!="string"){if(LD){const i=nke(e);i&&i!==LD&&HC(t,i)}let n=eke(e);ID&&(n=n.concat(ID(e)));const r=DD(t),s=DD(e);for(let i=0;i<n.length;++i){const o=n[i];if(!QSe[o]&&!(s&&s[o])&&!(r&&r[o])){const a=tke(e,o);try{ZSe(t,o,a)}catch{}}}}return t}var _1=Symbol.for("react-redux-context"),T1=typeof globalThis<"u"?globalThis:{};function rke(){if(!v.createContext)return{};const t=T1[_1]??(T1[_1]=new Map);let e=t.get(v.createContext);return e||(e=v.createContext(null),t.set(v.createContext,e)),e}var XW=rke(),ske=[null,null];function ike(t,e,n){gx(()=>t(...e),n)}function oke(t,e,n,r,s,i){t.current=r,n.current=!1,s.current&&(s.current=null,i())}function ake(t,e,n,r,s,i,o,a,l,u,d){if(!t)return()=>{};let f=!1,h=null;const p=()=>{if(f||!a.current)return;const g=e.getState();let y,b;try{y=r(g,s.current)}catch(x){b=x,h=x}b||(h=null),y===i.current?o.current||u():(i.current=y,l.current=y,o.current=!0,d())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,h)throw h}}function lke(t,e){return t===e}function cke(t,e,n,{pure:r,areStatesEqual:s=lke,areOwnPropsEqual:i=E1,areStatePropsEqual:o=E1,areMergedPropsEqual:a=E1,forwardRef:l=!1,context:u=XW}={}){const d=u,f=FSe(t),h=LSe(e),p=VSe(n),m=!!t;return y=>{const b=y.displayName||y.name||"Component",x=`Connect(${b})`,w={shouldHandleStateChanges:m,displayName:x,wrappedComponentName:b,WrappedComponent:y,initMapStateToProps:f,initMapDispatchToProps:h,initMergeProps:p,areStatesEqual:s,areStatePropsEqual:o,areOwnPropsEqual:i,areMergedPropsEqual:a};function S(N){const[E,_,T]=v.useMemo(()=>{const{reactReduxForwardedRef:je,...Tt}=N;return[N.context,je,Tt]},[N]),P=v.useMemo(()=>{let je=d;return E!=null&&E.Consumer,je},[E,d]),j=v.useContext(P),F=!!N.store&&!!N.store.getState&&!!N.store.dispatch,B=!!j&&!!j.store,U=F?N.store:j.store,D=B?j.getServerState:U.getState,L=v.useMemo(()=>DSe(U.dispatch,w),[U]),[A,O]=v.useMemo(()=>{if(!m)return ske;const je=QW(U,F?void 0:j.subscription),Tt=je.notifyNestedSubs.bind(je);return[je,Tt]},[U,F,j]),W=v.useMemo(()=>F?j:{...j,subscription:A},[F,j,A]),Z=v.useRef(void 0),$=v.useRef(T),Y=v.useRef(void 0),ee=v.useRef(!1),ne=v.useRef(!1),be=v.useRef(void 0);gx(()=>(ne.current=!0,()=>{ne.current=!1}),[]);const G=v.useMemo(()=>()=>Y.current&&T===$.current?Y.current:L(U.getState(),T),[U,T]),Ae=v.useMemo(()=>Tt=>A?ake(m,U,A,L,$,Z,ee,ne,Y,O,Tt):()=>{},[A]);ike(oke,[$,Z,ee,T,Y,O]);let Re;try{Re=v.useSyncExternalStore(Ae,G,D?()=>L(D(),T):G)}catch(je){throw be.current&&(je.message+=`
677The error may be correlated with this previous error:
678${be.current.stack}
679
680`),je}gx(()=>{be.current=void 0,Y.current=void 0,Z.current=Re});const De=v.useMemo(()=>v.createElement(y,{...Re,ref:_}),[_,y,Re]);return v.useMemo(()=>m?v.createElement(P.Provider,{value:W},De):De,[P,De,W])}const k=v.memo(S);if(k.WrappedComponent=y,k.displayName=S.displayName=x,l){const E=v.forwardRef(function(T,P){return v.createElement(k,{...T,reactReduxForwardedRef:P})});return E.displayName=x,E.WrappedComponent=y,HC(E,y)}return HC(k,y)}}var ZW=cke;function uke(t){const{children:e,context:n,serverState:r,store:s}=t,i=v.useMemo(()=>{const l=QW(s);return{store:s,subscription:l,getServerState:r?()=>r:void 0}},[s,r]),o=v.useMemo(()=>s.getState(),[s]);gx(()=>{const{subscription:l}=i;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==s.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[i,o]);const a=n||XW;return v.createElement(a.Provider,{value:i},e)}var dke=uke;function fke(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function eH(t,e){var n=v.useState(function(){return{inputs:e,result:t()}})[0],r=v.useRef(!0),s=v.useRef(n),i=r.current||!!(e&&s.current.inputs&&fke(e,s.current.inputs)),o=i?s.current:{inputs:e,result:t()};return v.useEffect(function(){r.current=!1,s.current=o},[o]),o.result}function hke(t,e){return eH(function(){return t},e)}var et=eH,ke=hke,pke="Invariant failed";function mke(t,e){throw new Error(pke)}var Vs=function(e){var n=e.top,r=e.right,s=e.bottom,i=e.left,o=r-i,a=s-n,l={top:n,right:r,bottom:s,left:i,width:o,height:a,x:i,y:n,center:{x:(r+i)/2,y:(s+n)/2}};return l}
680,FT=function(e,n){return{top:e.top-n.top,left:e.left-n.left,bottom:e.bottom+n.bottom,right:e.right+n.right}},FD=function(e,n){return{top:e.top+n.top,left:e.left+n.left,bottom:e.bottom-n.bottom,right:e.right-n.right}},gke=function(e,n){return{top:e.top+n.y,left:e.left+n.x,bottom:e.bottom+n.y,right:e.right+n.x}},A1={top:0,right:0,bottom:0,left:0},BT=function(e){var n=e.borderBox,r=e.margin,s=r===void 0?A1:r,i=e.border,o=i===void 0?A1:i,a=e.padding,l=a===void 0?A1:a,u=Vs(FT(n,s)),d=Vs(FD(n,o)),f=Vs(FD(d,l));return{marginBox:u,borderBox:Vs(n),paddingBox:d,contentBox:f,margin:s,border:o,padding:l}},Qr=function(e){var n=e.slice(0,-2),r=e.slice(-2);if(r!=="px")return 0;var s=Number(n);return isNaN(s)&&mke(),s},yke=function(){return{x:window.pageXOffset,y:window.pageYOffset}},yx=function(e,n){var r=e.borderBox,s=e.border,i=e.margin,o=e.padding,a=gke(r,n);return BT({borderBox:a,border:s,margin:i,padding:o})},vx=function(e,n){return n===void 0&&(n=yke()),yx(e,n)},tH=function(e,n){var r={top:Qr(n.marginTop),right:Qr(n.marginRight),bottom:Qr(n.marginBottom),left:Qr(n.marginLeft)},s={top:Qr(n.paddingTop),right:Qr(n.paddingRight),bottom:Qr(n.paddingBottom),left:Qr(n.paddingLeft)},i={top:Qr(n.borderTopWidth),right:Qr(n.borderRightWidth),bottom:Qr(n.borderBottomWidth),left:Qr(n.borderLeftWidth)};return BT({borderBox:e,margin:r,padding:s,border:i})},nH=function(e){var n=e.getBoundingClientRect(),r=window.getComputedStyle(e);return tH(n,r)},BD=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function vke(t,e){return!!(t===e||BD(t)&&BD(e))}function xke(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!vke(t[n],e[n]))return!1;return!0}function bn(t,e){e===void 0&&(e=xke);var n=null;function r(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];if(n&&n.lastThis===this&&e(s,n.lastArgs))return n.lastResult;var o=t.apply(this,s);return n={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){n=null},r}var Tp=function(e){var n=[],r=null,s=function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];n=a,!r&&(r=requestAnimationFrame(function(){r=null,e.apply(void 0,n)}))};return s.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},s};function xx(){return xx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xx.apply(null,arguments)}function rH(t,e){}rH.bind(null,"warn");rH.bind(null,"error");function Ma(){}function bke(t,e){return{...t,...e}}function as(t,e,n){const r=e.map(s=>{const i=bke(n,s.options);return t.addEventListener(s.eventName,s.fn,i),function(){t.removeEventListener(s.eventName,s.fn,i)}});return function(){r.forEach(i=>{i()})}}const wke="Invariant failed";class bx extends Error{}bx.prototype.toString=function(){return this.message};function se(t,e){throw new bx(wke)}class Ske extends z.Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=Ma,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof bx&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=as(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof bx){this.setState({});return}throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const kke=`
681  Press space bar to start a drag.
682  When dragging you can use the arrow keys to move the item around and escape to cancel.
683  Some screen readers may require you to be in focus mode or to use your pass through key
684`,wx=t=>t+1,Cke=t=>`
685  You have lifted an item in position ${wx(t.source.index)}
686`,sH=(t,e)=>{const n=t.droppableId===e.droppableId,r=wx(t.index),s=wx(e.index);return n?`
687      You have moved the item from position ${r}
688      to position ${s}
689    `:`
690    You have moved the item from position ${r}
691    in list ${t.droppableId}
692    to list ${e.droppableId}
693    in position ${s}
694  `},iH=(t,e,n)=>e.droppableId===n.droppableId?`
695      The item ${t}
696      has been combined with ${n.draggableId}`:`
697      The item ${t}
698      in list ${e.droppableId}
699      has been combined with ${n.draggableId}
700      in list ${n.droppableId}
701    `,Nke=t=>{const e=t.destination;if(e)return sH(t.source,e);const n=t.combine;return n?iH(t.draggableId,t.source,n):"You are over an area that cannot be dropped on"},$D=t=>`
702  The item has returned to its starting position
703  of ${wx(t.index)}
704`,Eke=t=>{if(t.reason==="CANCEL")return`
705      Movement cancelled.
706      ${$D(t.source)}
707    `;const e=t.destination,n=t.combine;return e?`
708      You have dropped the item.
709      ${sH(t.source,e)}
710    `:n?`
711      You have dropped the item.
712      ${iH(t.draggableId,t.source,n)}
713    `:`
714    The item has been dropped while not over a drop area.
715    ${$D(t.source)}
716  `},dy={dragHandleUsageInstructions:kke,onDragStart:Cke,onDragUpdate:Nke,onDragEnd:Eke},wn={x:0,y:0},Rn=(t,e)=>({x:t.x+e.x,y:t.y+e.y}),Br=(t,e)=>({x:t.x-e.x,y:t.y-e.y}),Oa=(t,e)=>t.x===e.x&&t.y===e.y,tf=t=>({x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}),xc=(t,e,n=0)=>t==="x"?{x:e,y:n}:{x:n,y:e},Ap=(t,e)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),VD=(t,e)=>Math.min(...e.map(n=>Ap(t,n))),oH=t=>e=>({x:t(e.x),y:t(e.y)});var _ke=(t,e)=>{const n=Vs({top:Math.max(e.top,t.top),right:Math.min(e.right,t.right),bottom:Math.min(e.bottom,t.bottom),left:Math.max(e.left,t.left)});return n.width<=0||n.height<=0?null:n};const xm=(t,e)=>
716({top:t.top+e.y,left:t.left+e.x,bottom:t.bottom+e.y,right:t.right+e.x}),zD=t=>[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}],Tke={top:0,right:0,bottom:0,left:0},Ake=(t,e)=>e?xm(t,e.scroll.diff.displacement):t,jke=(t,e,n)=>n&&n.increasedBy?{...t,[e.end]:t[e.end]+n.increasedBy[e.line]}:t,Pke=(t,e)=>e&&e.shouldClipSubject?_ke(e.pageMarginBox,t):Vs(t);var Nd=({page:t,withPlaceholder:e,axis:n,frame:r})=>{const s=Ake(t.marginBox,r),i=jke(s,n,e),o=Pke(i,r);return{page:t,withPlaceholder:e,active:o}},$T=(t,e)=>{t.frame||se();const n=t.frame,r=Br(e,n.scroll.initial),s=tf(r),i={...n,scroll:{initial:n.scroll.initial,current:e,diff:{value:r,displacement:s},max:n.scroll.max}},o=Nd({page:t.subject.page,withPlaceholder:t.subject.withPlaceholder,axis:t.axis,frame:i});return{...t,frame:i,subject:o}};const aH=bn(t=>t.reduce((e,n)=>(e[n.descriptor.id]=n,e),{})),lH=bn(t=>t.reduce((e,n)=>(e[n.descriptor.id]=n,e),{})),f0=bn(t=>Object.values(t)),Rke=bn(t=>Object.values(t));var nf=bn((t,e)=>Rke(e).filter(r=>t===r.descriptor.droppableId).sort((r,s)=>r.descriptor.index-s.descriptor.index));function VT(t){return t.at&&t.at.type==="REORDER"?t.at.destination:null}function h0(t){return t.at&&t.at.type==="COMBINE"?t.at.combine:null}var p0=bn((t,e)=>e.filter(n=>n.descriptor.id!==t.descriptor.id)),Mke=({isMovingForward:t,draggable:e,destination:n,insideDestination:r,previousImpact:s})=>{if(!n.isCombineEnabled||!VT(s))return null;function o(p){const m={type:"COMBINE",combine:{draggableId:p,droppableId:n.descriptor.id}};return{...s,at:m}}const a=s.displaced.all,l=a.length?a[0]:null;if(t)return l?o(l):null;const u=p0(e,r);if(!l){if(!u.length)return null;const p=u[u.length-1];return o(p.descriptor.id)}const d=u.findIndex(p=>p.descriptor.id===l);d===-1&&se();const f=d-1;if(f<0)return null;const h=u[f];return o(h.descriptor.id)},rf=(t,e)=>t.descriptor.droppableId===e.descriptor.id;const cH={point:wn,value:0},jp={invisible:{},visible:{},all:[]},Oke={displaced:jp,displacedBy:cH,at:null};var hs=(t,e)=>n=>t<=n&&n<=e,uH=t=>{const e=hs(t.top,t.bottom),n=hs(t.left,t.right);return r=>{if(e(r.top)&&e(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=e(r.top)||e(r.bottom),o=n(r.left)||n(r.right);if(i&&o)return!0;const l=r.top<t.top&&r.bottom>t.bottom,u=r.left<t.left&&r.right>t.right;return l&&u?!0:l&&o||u&&i}},Dke=t=>{const e=hs(t.top,t.bottom),n=hs(t.left,t.right);return r=>e(r.top)&&e(r.bottom)&&n(r.left)&&n(r.right)};const zT={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},dH={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var Ike=t=>e=>{const n=hs(e.top,e.bottom),r=hs(e.left,e.right);return s=>t===zT?n(s.top)&&n(s.bottom):r(s.left)&&r(s.right)};const Lke=(t,e)=>{const n=e.frame?e.frame.scroll.diff.displacement:wn;return xm(t,n)},Fke=(t,e,n)=>e.subject.active?n(e.subject.active)(t):!1,Bke=(t,e,n)=>n(e)(t),UT=({target:t,destination:e,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:s})=>{const i=r?Lke(t,e):t;return Fke(i,e,s)&&Bke(i,n,s)},$ke=t=>UT({...t,isVisibleThroughFrameFn:uH}),fH=t=>UT({...t,isVisibleThroughFrameFn:Dke}),Vke=t=>UT({...t,isVisibleThroughFrameFn:Ike(t.destination.axis)}),zke=(t,e,n)=>{if(typeof n=="boolean")return n;if(!e)return!0;const{invisible:r,visible:s}=e;if(r[t])return!1;const i=s[t];return i?i.shouldAnimate:!0};function Uke(t,e){const n=t.page.marginBox,r={top:e.point.y,right:0,bottom:0,left:e.point.x};return Vs(FT(n,r))}function Pp({afterDragging:t,destination:e,displacedBy:n,viewport:r,forceShouldAnimate:s,last:i}){return t.reduce(function(a,l){const u=Uke(l,n),d=l.descriptor.id;if(a.all.push(d),!$ke({target:u,destination:e,viewport:r,withDroppableDisplacement:!0}))return a.invisible[l.descriptor.id]=!0,a;const h=zke(d,i,s),p={draggableId:d,shouldAnimate:h};return a.visible[d]=p,a},{all:[],visible:{},invisible:{}})}function Wke(t,e){if(!t.length)return 0;const n=t[t.length-1].descriptor.index;return e.inHomeList?n:n+1}function UD({insideDestination:t,inHomeList:e,displacedBy:n,destination:r}){const s=Wke(t,{inHomeList:e});return{displaced:jp,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:s}}}}function Sx({draggable:t,insideDestination:e,destination:n,viewport:r,displacedBy:s,last:i,index:o,forceShouldAnimate:a}){const l=rf(t,n);if(o==null)return UD({insideDestination:e,inHomeList:l,displacedBy:s,destination:n});const u=e.find(m=>m.descriptor.index===o);if(!u)return UD({insideDestination:e,inHomeList:l,displacedBy:s,destination:n});const d=p0(t,e),f=e.indexOf(u),h=d.slice(f);return{displaced:Pp({afterDragging:h,destination:n,displacedBy:s,last:i,viewport:r.frame,forceShouldAnimate:a}),displacedBy:s,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:o}}}}function Ga(t,e){return!!e.effected[t]}var Hke=({isMovingForward:t,destination:e,draggables:n,combine:r,afterCritical:s})=>
716{if(!e.isCombineEnabled)return null;const i=r.draggableId,a=n[i].descriptor.index;return Ga(i,s)?t?a:a-1:t?a+1:a},qke=({isMovingForward:t,isInHomeList:e,insideDestination:n,location:r})=>{if(!n.length)return null;const s=r.index,i=t?s+1:s-1,o=n[0].descriptor.index,a=n[n.length-1].descriptor.index,l=e?a:a+1;return i<o||i>l?null:i},Kke=({isMovingForward:t,isInHomeList:e,draggable:n,draggables:r,destination:s,insideDestination:i,previousImpact:o,viewport:a,afterCritical:l})=>{const u=o.at;if(u||se(),u.type==="REORDER"){const f=qke({isMovingForward:t,isInHomeList:e,location:u.destination,insideDestination:i});return f==null?null:Sx({draggable:n,insideDestination:i,destination:s,viewport:a,last:o.displaced,displacedBy:o.displacedBy,index:f})}const d=Hke({isMovingForward:t,destination:s,displaced:o.displaced,draggables:r,combine:u.combine,afterCritical:l});return d==null?null:Sx({draggable:n,insideDestination:i,destination:s,viewport:a,last:o.displaced,displacedBy:o.displacedBy,index:d})},Gke=({displaced:t,afterCritical:e,combineWith:n,displacedBy:r})=>{const s=!!(t.visible[n]||t.invisible[n]);return Ga(n,e)?s?wn:tf(r.point):s?r.point:wn},Yke=({afterCritical:t,impact:e,draggables:n})=>{const r=h0(e);r||se();const s=r.draggableId,i=n[s].page.borderBox.center,o=Gke({displaced:e.displaced,afterCritical:t,combineWith:s,displacedBy:e.displacedBy});return Rn(i,o)};const hH=(t,e)=>e.margin[t.start]+e.borderBox[t.size]/2,Qke=(t,e)=>e.margin[t.end]+e.borderBox[t.size]/2,WT=(t,e,n)=>e[t.crossAxisStart]+n.margin[t.crossAxisStart]+n.borderBox[t.crossAxisSize]/2,WD=({axis:t,moveRelativeTo:e,isMoving:n})=>xc(t.line,e.marginBox[t.end]+hH(t,n),WT(t,e.marginBox,n)),HD=({axis:t,moveRelativeTo:e,isMoving:n})=>xc(t.line,e.marginBox[t.start]-Qke(t,n),WT(t,e.marginBox,n)),Jke=({axis:t,moveInto:e,isMoving:n})=>xc(t.line,e.contentBox[t.start]+hH(t,n),WT(t,e.contentBox,n));var Xke=({impact:t,draggable:e,draggables:n,droppable:r,afterCritical:s})=>{const i=nf(r.descriptor.id,n),o=e.page,a=r.axis;if(!i.length)return Jke({axis:a,moveInto:r.page,isMoving:o});const{displaced:l,displacedBy:u}=t,d=l.all[0];if(d){const h=n[d];if(Ga(d,s))return HD({axis:a,moveRelativeTo:h.page,isMoving:o});const p=yx(h.page,u.point);return HD({axis:a,moveRelativeTo:p,isMoving:o})}const f=i[i.length-1];if(f.descriptor.id===e.descriptor.id)return o.borderBox.center;if(Ga(f.descriptor.id,s)){const h=yx(f.page,tf(s.displacedBy.point));return WD({axis:a,moveRelativeTo:h,isMoving:o})}return WD({axis:a,moveRelativeTo:f.page,isMoving:o})},qC=(t,e)=>{const n=t.frame;return n?Rn(e,n.scroll.diff.displacement):e};const Zke=({impact:t,draggable:e,droppable:n,draggables:r,afterCritical:s})=>{const i=e.page.borderBox.center,o=t.at;return!n||!o?i:o.type==="REORDER"?Xke({impact:t,draggable:e,draggables:r,droppable:n,afterCritical:s}):Yke({impact:t,draggables:r,afterCritical:s})};var m0=t=>{const e=Zke(t),n=t.droppable;return n?qC(n,e):e},pH=(t,e)=>{const n=Br(e,t.scroll.initial),r=tf(n);return{frame:Vs({top:e.y,bottom:e.y+t.frame.height,left:e.x,right:e.x+t.frame.width}),scroll:{initial:t.scroll.initial,max:t.scroll.max,current:e,diff:{value:n,displacement:r}}}};function qD(t,e){return t.map(n=>e[n])}function eCe(t,e){for(let n=0;n<e.length;n++){const r=e[n].visible[t];if(r)return r}return null}var tCe=({impact:t,viewport:e,destination:n,draggables:r,maxScrollChange:s})=>{const i=pH(e,Rn(e.scroll.current,s)),o=n.frame?$T(n,Rn(n.frame.scroll.current,s)):n,a=t.displaced,l=Pp({afterDragging:qD(a.all,r),destination:n,displacedBy:t.displacedBy,viewport:i.frame,last:a,forceShouldAnimate:!1}),u=Pp({afterDragging:qD(a.all,r),destination:o,displacedBy:t.displacedBy,viewport:e.frame,last:a,forceShouldAnimate:!1}),d={},f={},h=[a,l,u];return a.all.forEach(m=>{const g=eCe(m,h);if(g){f[m]=g;return}d[m]=!0}),{...t,displaced:{all:a.all,invisible:d,visible:f}}},nCe=(t,e)=>Rn(t.scroll.diff.displacement,e),HT=({pageBorderBoxCenter:t,draggable:e,viewport:n})=>{const r=nCe(n,t),s=Br(r,e.page.borderBox.center);return Rn(e.client.borderBox.center,s)},mH=({draggable:t,destination:e,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:s,onlyOnMainAxis:i=!1})=>{const o=Br(n,t.page.borderBox.center),l={target:xm(t.page.borderBox,o),destination:e,withDroppableDisplacement:s,viewport:r};return i?Vke(l):fH(l)},rCe=({isMovingForward:t,draggable:e,destination:n,draggables:r,previousImpact:s,viewport:i,previousPageBorderBoxCenter:o,previousClientSelection:a,afterCritical:l})=>
716{if(!n.isEnabled)return null;const u=nf(n.descriptor.id,r),d=rf(e,n),f=Mke({isMovingForward:t,draggable:e,destination:n,insideDestination:u,previousImpact:s})||Kke({isMovingForward:t,isInHomeList:d,draggable:e,draggables:r,destination:n,insideDestination:u,previousImpact:s,viewport:i,afterCritical:l});if(!f)return null;const h=m0({impact:f,draggable:e,droppable:n,draggables:r,afterCritical:l});if(mH({draggable:e,destination:n,newPageBorderBoxCenter:h,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:HT({pageBorderBoxCenter:h,draggable:e,viewport:i}),impact:f,scrollJumpRequest:null};const m=Br(h,o),g=tCe({impact:f,viewport:i,destination:n,draggables:r,maxScrollChange:m});return{clientSelection:a,impact:g,scrollJumpRequest:m}};const Kn=t=>{const e=t.subject.active;return e||se(),e};var sCe=({isMovingForward:t,pageBorderBoxCenter:e,source:n,droppables:r,viewport:s})=>{const i=n.subject.active;if(!i)return null;const o=n.axis,a=hs(i[o.start],i[o.end]),l=f0(r).filter(d=>d!==n).filter(d=>d.isEnabled).filter(d=>!!d.subject.active).filter(d=>uH(s.frame)(Kn(d))).filter(d=>{const f=Kn(d);return t?i[o.crossAxisEnd]<f[o.crossAxisEnd]:f[o.crossAxisStart]<i[o.crossAxisStart]}).filter(d=>{const f=Kn(d),h=hs(f[o.start],f[o.end]);return a(f[o.start])||a(f[o.end])||h(i[o.start])||h(i[o.end])}).sort((d,f)=>{const h=Kn(d)[o.crossAxisStart],p=Kn(f)[o.crossAxisStart];return t?h-p:p-h}).filter((d,f,h)=>Kn(d)[o.crossAxisStart]===Kn(h[0])[o.crossAxisStart]);if(!l.length)return null;if(l.length===1)return l[0];const u=l.filter(d=>hs(Kn(d)[o.start],Kn(d)[o.end])(e[o.line]));return u.length===1?u[0]:u.length>1?u.sort((d,f)=>Kn(d)[o.start]-Kn(f)[o.start])[0]:l.sort((d,f)=>{const h=VD(e,zD(Kn(d))),p=VD(e,zD(Kn(f)));return h!==p?h-p:Kn(d)[o.start]-Kn(f)[o.start]})[0]};const KD=(t,e)=>{const n=t.page.borderBox.center;return Ga(t.descriptor.id,e)?Br(n,e.displacedBy.point):n},iCe=(t,e)=>{const n=t.page.borderBox;return Ga(t.descriptor.id,e)?xm(n,tf(e.displacedBy.point)):n};var oCe=({pageBorderBoxCenter:t,viewport:e,destination:n,insideDestination:r,afterCritical:s})=>r.filter(o=>fH({target:iCe(o,s),destination:n,viewport:e.frame,withDroppableDisplacement:!0})).sort((o,a)=>{const l=Ap(t,qC(n,KD(o,s))),u=Ap(t,qC(n,KD(a,s)));return l<u?-1:u<l?1:o.descriptor.index-a.descriptor.index})[0]||null,bm=bn(function(e,n){const r=n[e.line];return{value:r,point:xc(e.line,r)}});const aCe=(t,e,n)=>{const r=t.axis;if(t.descriptor.mode==="virtual")return xc(r.line,e[r.line]);const s=t.subject.page.contentBox[r.size],l=nf(t.descriptor.id,n).reduce((u,d)=>u+d.client.marginBox[r.size],0)+e[r.line]-s;return l<=0?null:xc(r.line,l)},gH=(t,e)=>({...t,scroll:{...t.scroll,max:e}}),yH=(t,e,n)=>{const r=t.frame;rf(e,t)&&se(),t.subject.withPlaceholder&&se();const s=bm(t.axis,e.displaceBy).point,i=aCe(t,s,n),o={placeholderSize:s,increasedBy:i,oldFrameMaxScroll:t.frame?t.frame.scroll.max:null};if(!r){const d=Nd({page:t.subject.page,withPlaceholder:o,axis:t.axis,frame:t.frame});return{...t,subject:d}}const a=i?Rn(r.scroll.max,i):r.scroll.max,l=gH(r,a),u=Nd({page:t.subject.page,withPlaceholder:o,axis:t.axis,frame:l});return{...t,subject:u,frame:l}},lCe=t=>{const e=t.subject.withPlaceholder;e||se();const n=t.frame;if(!n){const o=Nd({page:t.subject.page,axis:t.axis,frame:null,withPlaceholder:null});return{...t,subject:o}}const r=e.oldFrameMaxScroll;r||se();const s=gH(n,r),i=Nd({page:t.subject.page,axis:t.axis,frame:s,withPlaceholder:null});return{...t,subject:i,frame:s}};var cCe=({previousPageBorderBoxCenter:t,moveRelativeTo:e,insideDestination:n,draggable:r,draggables:s,destination:i,viewport:o,afterCritical:a})=>{if(!e){if(n.length)return null;const f={displaced:jp,displacedBy:cH,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},h=m0({impact:f,draggable:r,droppable:i,draggables:s,afterCritical:a}),p=rf(r,i)?i:yH(i,r,s);return mH({draggable:r,destination:p,newPageBorderBoxCenter:h,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?f:null}const l=t[i.axis.line]<=e.page.borderBox.center[i.axis.line],u=(()=>{const f=e.descriptor.index;return e.descriptor.id===r.descriptor.id||l?f:f+1})(),d=bm(i.axis,r.displaceBy);return Sx({draggable:r,insideDestination:n,destination:i,viewport:o,displacedBy:d,last:jp,index:u})},uCe=({isMovingForward:t,previousPageBorderBoxCenter:e,draggable:n,isOver:r,draggables:s,droppables:i,viewport:o,afterCritical:a})=>{const l=sCe({isMovingForward:t,pageBorderBoxCenter:e,source:r,droppables:i,viewport:o});if(!l)return null;const u=nf(l.descriptor.id,s),d=oCe({pageBorderBoxCenter:e,viewport:o,destination:l,insideDestination:u,afterCritical:a}),f=cCe({previousPageBorderBoxCenter:e,destination:l,draggable:n,draggables:s,moveRelativeTo:d,insideDestination:u,viewport:o,afterCritical:a});if(!f)return null;const h=m0({impact:f,draggable:n,droppable:l,draggables:s,afterCritical:a});return{clientSelection:HT({pageBorderBoxCenter:h,draggable:n,viewport:o}),impact:f,scrollJumpRequest:null}},zr=t=>{const e=t.at;
716return e?e.type==="REORDER"?e.destination.droppableId:e.combine.droppableId:null};const dCe=(t,e)=>{const n=zr(t);return n?e[n]:null};var fCe=({state:t,type:e})=>{const n=dCe(t.impact,t.dimensions.droppables),r=!!n,s=t.dimensions.droppables[t.critical.droppable.id],i=n||s,o=i.axis.direction,a=o==="vertical"&&(e==="MOVE_UP"||e==="MOVE_DOWN")||o==="horizontal"&&(e==="MOVE_LEFT"||e==="MOVE_RIGHT");if(a&&!r)return null;const l=e==="MOVE_DOWN"||e==="MOVE_RIGHT",u=t.dimensions.draggables[t.critical.draggable.id],d=t.current.page.borderBoxCenter,{draggables:f,droppables:h}=t.dimensions;return a?rCe({isMovingForward:l,previousPageBorderBoxCenter:d,draggable:u,destination:i,draggables:f,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):uCe({isMovingForward:l,previousPageBorderBoxCenter:d,draggable:u,isOver:i,draggables:f,droppables:h,viewport:t.viewport,afterCritical:t.afterCritical})};function yl(t){return t.phase==="DRAGGING"||t.phase==="COLLECTING"}function vH(t){const e=hs(t.top,t.bottom),n=hs(t.left,t.right);return function(s){return e(s.y)&&n(s.x)}}function hCe(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}function pCe({pageBorderBox:t,draggable:e,candidates:n}){const r=e.page.borderBox.center,s=n.map(i=>{const o=i.axis,a=xc(i.axis.line,t.center[o.line],i.page.borderBox.center[o.crossAxisLine]);return{id:i.descriptor.id,distance:Ap(r,a)}}).sort((i,o)=>o.distance-i.distance);return s[0]?s[0].id:null}function mCe({pageBorderBox:t,draggable:e,droppables:n}){const r=f0(n).filter(s=>{if(!s.isEnabled)return!1;const i=s.subject.active;if(!i||!hCe(t,i))return!1;if(vH(i)(t.center))return!0;const o=s.axis,a=i.center[o.crossAxisLine],l=t[o.crossAxisStart],u=t[o.crossAxisEnd],d=hs(i[o.crossAxisStart],i[o.crossAxisEnd]),f=d(l),h=d(u);return!f&&!h?!0:f?l<a:u>a});return r.length?r.length===1?r[0].descriptor.id:pCe({pageBorderBox:t,draggable:e,candidates:r}):null}const xH=(t,e)=>Vs(xm(t,e));var gCe=(t,e)=>{const n=t.frame;return n?xH(e,n.scroll.diff.value):e};function bH({displaced:t,id:e}){return!!(t.visible[e]||t.invisible[e])}function yCe({draggable:t,closest:e,inHomeList:n}){return e?n&&e.descriptor.index>t.descriptor.index?e.descriptor.index-1:e.descriptor.index:null}var vCe=({pageBorderBoxWithDroppableScroll:t,draggable:e,destination:n,insideDestination:r,last:s,viewport:i,afterCritical:o})=>{const a=n.axis,l=bm(n.axis,e.displaceBy),u=l.value,d=t[a.start],f=t[a.end],p=p0(e,r).find(g=>{const y=g.descriptor.id,b=g.page.borderBox.center[a.line],x=Ga(y,o),w=bH({displaced:s,id:y});return x?w?f<=b:d<b-u:w?f<=b+u:d<b})||null,m=yCe({draggable:e,closest:p,inHomeList:rf(e,n)});return Sx({draggable:e,insideDestination:r,destination:n,viewport:i,last:s,displacedBy:l,index:m})};const xCe=4;var bCe=({draggable:t,pageBorderBoxWithDroppableScroll:e,previousImpact:n,destination:r,insideDestination:s,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const o=r.axis,a=bm(r.axis,t.displaceBy),l=a.value,u=e[o.start],d=e[o.end],h=p0(t,s).find(m=>{const g=m.descriptor.id,y=m.page.borderBox,x=y[o.size]/xCe,w=Ga(g,i),S=bH({displaced:n.displaced,id:g});return w?S?d>y[o.start]+x&&d<y[o.end]-x:u>y[o.start]-l+x&&u<y[o.end]-l-x:S?d>y[o.start]+l+x&&d<y[o.end]+l-x:u>y[o.start]+x&&u<y[o.end]-x});return h?{displacedBy:a,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:h.descriptor.id,droppableId:r.descriptor.id}}}:null},wH=({pageOffset:t,draggable:e,draggables:n,droppables:r,previousImpact:s,viewport:i,afterCritical:o})=>{const a=xH(e.page.borderBox,t),l=mCe({pageBorderBox:a,draggable:e,droppables:r});if(!l)return Oke;const u=r[l],d=nf(u.descriptor.id,n),f=gCe(u,a);return bCe({pageBorderBoxWithDroppableScroll:f,draggable:e,previousImpact:s,destination:u,insideDestination:d,afterCritical:o})||vCe({pageBorderBoxWithDroppableScroll:f,draggable:e,destination:u,insideDestination:d,last:s.displaced,viewport:i,afterCritical:o})},qT=(t,e)=>({...t,[e.descriptor.id]:e});const wCe=({previousImpact:t,impact:e,droppables:n})=>{const r=zr(t),s=zr(e);if(!r||r===s)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const o=lCe(i);return qT(n,o)};var SCe=({draggable:t,draggables:e,droppables:n,previousImpact:r,impact:s})=>{const i=wCe({previousImpact:r,impact:s,droppables:n}),o=zr(s);if(!o)return i;const a=n[o];if(rf(t,a)||a.subject.withPlaceholder)return i;const l=yH(a,t,e);return qT(i,l)},_h=({state:t,clientSelection:e,dimensions:n,viewport:r,impact:s,scrollJumpRequest:i})=>{const o=r||t.viewport,a=n||t.dimensions,l=e||t.current.client.selection,u=Br(l,t.initial.client.selection),d={offset:u,selection:l,borderBoxCenter:Rn(t.initial.client.borderBoxCenter,u)},f={selection:Rn(d.selection,o.scroll.current),borderBoxCenter:Rn(d.borderBoxCenter,o.scroll.current),offset:Rn(d.offset,o.scroll.diff.value)},h={client:d,page:f};if(t.phase==="COLLECTING")return{...t,dimensions:a,viewport:o,current:h};const p=a.draggables[t.critical.draggable.id],m=s||wH({pageOffset:f.offset,draggable:p,draggables:a.draggables,droppables:a.droppables,previousImpact:t.impact,viewport:o,afterCritical:t.afterCritical}),g=SCe({draggable:p,impact:m,previousImpact:t.impact,draggables:a.draggables,droppables:a.droppables});return{...t,current:h,dimensions:{draggables:a.draggables,droppables:g},impact:m,viewport:o,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function kCe(t,e){return t.map(n=>e[n])}var SH=({impact:t,viewport:e,draggables:n,destination:r,forceShouldAnimate:s})=>{const i=t.displaced,o=kCe(i.all,n),a=Pp({afterDragging:o,destination:r,displacedBy:t.displacedBy,viewport:e.frame,forceShouldAnimate:s,last:i});return{...t,displaced:a}},kH=({impact:t,draggable:e,droppable:n,draggables:r,viewport:s,afterCritical:i})=>{const o=m0({impact:t,draggable:e,draggables:r,droppable:n,afterCritical:i});return HT({pageBorderBoxCenter:o,draggable:e,viewport:s})},CH=({state:t,dimensions:e,viewport:n})=>{t.movementMode!=="SNAP"&&se();const r=t.impact,s=n||t.viewport,i=e||t.dimensions,{draggables:o,droppables:a}=i,l=o[t.critical.draggable.id],u=zr(r);u||se();const d=a[u],f=SH({impact:r,viewport:s,destination:d,draggables:o}),h=kH({impact:f,draggable:l,droppable:d,draggables:o,viewport:s,afterCritical:t.afterCritical});return _h({impact:f,clientSelection:h,state:t,dimensions:i,viewport:s})},CCe=t=>({index:t.index,droppableId:t.droppableId}),NH=({draggable:t,home:e,draggables:n,viewport:r})=>{const s=bm(e.axis,t.displaceBy),i=nf(e.descriptor.id,n),o=i.indexOf(t);o===-1&&se();const a=i.slice(o+1),l=a.reduce((h,p)=>(h[p.descriptor.id]=!0,h),{}),u={inVirtualList:e.descriptor.mode==="virtual",displacedBy:s,effected:l};return{impact:{displaced:Pp({afterDragging:a,destination:e,displacedBy:s,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:s,at:{type:"REORDER",destination:CCe(t.descriptor)}},afterCritical:u}},NCe=(t,e)=>({draggables:t.draggables,droppables:qT(t.droppables,e)}),ECe=({draggable:t,offset:e,initialWindowScroll:n})=>{const r=yx(t.client,e),s=vx(r,n);return{...t,placeholder:{...t.placeholder,client:r},client:r,page:s}},_Ce=t=>{const e=t.frame;return e||se(),e},TCe=({additions:t,updatedDroppables:e,viewport:n})=>{const r=n.scroll.diff.value;return t.map(s=>{const i=s.descriptor.droppableId,o=e[i],l=_Ce(o).scroll.diff.value,u=Rn(r,l);return ECe({draggable:s,offset:u,initialWindowScroll:n.scroll.initial})})},ACe=({state:t,published:e})=>{const n=e.modified.map(b=>{const x=t.dimensions.droppables[b.droppableId];return $T(x,b.scroll)}),r={...t.dimensions.droppables,...aH(n)},s=lH(TCe({additions:e.additions,updatedDroppables:r,viewport:t.viewport})),i={...t.dimensions.draggables,...s};
716e.removals.forEach(b=>{delete i[b]});const o={droppables:r,draggables:i},a=zr(t.impact),l=a?o.droppables[a]:null,u=o.draggables[t.critical.draggable.id],d=o.droppables[t.critical.droppable.id],{impact:f,afterCritical:h}=NH({draggable:u,home:d,draggables:i,viewport:t.viewport}),p=l&&l.isCombineEnabled?t.impact:f,m=wH({pageOffset:t.current.page.offset,draggable:o.draggables[t.critical.draggable.id],draggables:o.draggables,droppables:o.droppables,previousImpact:p,viewport:t.viewport,afterCritical:h}),g={...t,phase:"DRAGGING",impact:m,onLiftImpact:f,dimensions:o,afterCritical:h,forceShouldAnimate:!1};return t.phase==="COLLECTING"?g:{...g,phase:"DROP_PENDING",reason:t.reason,isWaiting:!1}};const KC=t=>t.movementMode==="SNAP",j1=(t,e,n)=>{const r=NCe(t.dimensions,e);return!KC(t)||n?_h({state:t,dimensions:r}):CH({state:t,dimensions:r})};function P1(t){return t.isDragging&&t.movementMode==="SNAP"?{...t,scrollJumpRequest:null}:t}const GD={phase:"IDLE",completed:null,shouldFlush:!1};var jCe=(t=GD,e)=>{if(e.type==="FLUSH")return{...GD,shouldFlush:!0};if(e.type==="INITIAL_PUBLISH"){t.phase!=="IDLE"&&se();const{critical:n,clientSelection:r,viewport:s,dimensions:i,movementMode:o}=e.payload,a=i.draggables[n.draggable.id],l=i.droppables[n.droppable.id],u={selection:r,borderBoxCenter:a.client.borderBox.center,offset:wn},d={client:u,page:{selection:Rn(u.selection,s.scroll.initial),borderBoxCenter:Rn(u.selection,s.scroll.initial),offset:Rn(u.selection,s.scroll.diff.value)}},f=f0(i.droppables).every(g=>!g.isFixedOnPage),{impact:h,afterCritical:p}=NH({draggable:a,home:l,draggables:i.draggables,viewport:s});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:o,dimensions:i,initial:d,current:d,isWindowScrollAllowed:f,impact:h,afterCritical:p,onLiftImpact:h,viewport:s,scrollJumpRequest:null,forceShouldAnimate:null}}if(e.type==="COLLECTION_STARTING")return t.phase==="COLLECTING"||t.phase==="DROP_PENDING"?t:(t.phase!=="DRAGGING"&&se(),{...t,phase:"COLLECTING"});if(e.type==="PUBLISH_WHILE_DRAGGING")return t.phase==="COLLECTING"||t.phase==="DROP_PENDING"||se(),ACe({state:t,published:e.payload});if(e.type==="MOVE"){if(t.phase==="DROP_PENDING")return t;yl(t)||se();const{client:n}=e.payload;return Oa(n,t.current.client.selection)?t:_h({state:t,clientSelection:n,impact:KC(t)?t.impact:null})}if(e.type==="UPDATE_DROPPABLE_SCROLL"){if(t.phase==="DROP_PENDING"||t.phase==="COLLECTING")return P1(t);yl(t)||se();const{id:n,newScroll:r}=e.payload,s=t.dimensions.droppables[n];if(!s)return t;const i=$T(s,r);return j1(t,i,!1)}if(e.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(t.phase==="DROP_PENDING")return t;yl(t)||se();const{id:n,isEnabled:r}=e.payload,s=t.dimensions.droppables[n];s||se(),s.isEnabled===r&&se();const i={...s,isEnabled:r};return j1(t,i,!0)}if(e.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(t.phase==="DROP_PENDING")return t;yl(t)||se();const{id:n,isCombineEnabled:r}=e.payload,s=t.dimensions.droppables[n];s||se(),s.isCombineEnabled===r&&se();const i={...s,isCombineEnabled:r};return j1(t,i,!0)}if(e.type==="MOVE_BY_WINDOW_SCROLL"){if(t.phase==="DROP_PENDING"||t.phase==="DROP_ANIMATING")return t;yl(t)||se(),t.isWindowScrollAllowed||se();const n=e.payload.newScroll;if(Oa(t.viewport.scroll.current,n))return P1(t);const r=pH(t.viewport,n);return KC(t)?CH({state:t,viewport:r}):_h({state:t,viewport:r})}if(e.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!yl(t))return t;const n=e.payload.maxScroll;if(Oa(n,t.viewport.scroll.max))return t;const r={...t.viewport,scroll:{...t.viewport.scroll,max:n}};return{...t,viewport:r}}if(e.type==="MOVE_UP"||e.type==="MOVE_DOWN"||e.type==="MOVE_LEFT"||e.type==="MOVE_RIGHT"){if(t.phase==="COLLECTING"||t.phase==="DROP_PENDING")return t;t.phase!=="DRAGGING"&&se();const n=fCe({state:t,type:e.type});return n?_h({state:t,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):t}if(e.type==="DROP_PENDING"){const n=e.payload.reason;return t.phase!=="COLLECTING"&&se(),{...t,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(e.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:s}=e.payload;return t.phase==="DRAGGING"||t.phase==="DROP_PENDING"||se(),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:s,dimensions:t.dimensions}}if(e.type==="DROP_COMPLETE"){const{completed:n}=e.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return t};function st(t,e){return t instanceof Object&&"type"in t&&t.type===e}const PCe=t=>({type:"BEFORE_INITIAL_CAPTURE",payload:t}),RCe=t=>({type:"LIFT",payload:t}),MCe=t=>({type:"INITIAL_PUBLISH",payload:t}),OCe=t=>({type:"PUBLISH_WHILE_DRAGGING",payload:t}),DCe=()=>({type:"COLLECTION_STARTING",payload:null}),ICe=t=>({type:"UPDATE_DROPPABLE_SCROLL",payload:t}),LCe=t=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:t}),FCe=t=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:t}),EH=t=>({type:"MOVE",payload:t}),BCe=t=>({type:"MOVE_BY_WINDOW_SCROLL",payload:t}),$Ce=t=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:t}),VCe=()=>({type:"MOVE_UP",payload:null}),zCe=()=>({type:"MOVE_DOWN",payload:null}),UCe=()=>({type:"MOVE_RIGHT",payload:null}),WCe=()=>({type:"MOVE_LEFT",payload:null}),KT=()=>({type:"FLUSH",payload:null}),HCe=t=>({type:"DROP_ANIMATE",payload:t}),GT=t=>({type:"DROP_COMPLETE",payload:t}),_H=t=>({type:"DROP",payload:t}),qCe=t=>({type:"DROP_PENDING",payload:t}),TH=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var KCe=t=>({getState:e,dispatch:n})=>r=>s=>{if(!st(s,"LIFT")){r(s);return}
716const{id:i,clientSelection:o,movementMode:a}=s.payload,l=e();l.phase==="DROP_ANIMATING"&&n(GT({completed:l.completed})),e().phase!=="IDLE"&&se(),n(KT()),n(PCe({draggableId:i,movementMode:a}));const d={draggableId:i,scrollOptions:{shouldPublishImmediately:a==="SNAP"}},{critical:f,dimensions:h,viewport:p}=t.startPublishing(d);n(MCe({critical:f,dimensions:h,clientSelection:o,movementMode:a,viewport:p}))},GCe=t=>()=>e=>n=>{st(n,"INITIAL_PUBLISH")&&t.dragging(),st(n,"DROP_ANIMATE")&&t.dropping(n.payload.completed.result.reason),(st(n,"FLUSH")||st(n,"DROP_COMPLETE"))&&t.resting(),e(n)};const YT={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Rp={opacity:{drop:0,combining:.7},scale:{drop:.75}},AH={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},dl=`${AH.outOfTheWay}s ${YT.outOfTheWay}`,Th={fluid:`opacity ${dl}`,snap:`transform ${dl}, opacity ${dl}`,drop:t=>{const e=`${t}s ${YT.drop}`;return`transform ${e}, opacity ${e}`},outOfTheWay:`transform ${dl}`,placeholder:`height ${dl}, width ${dl}, margin ${dl}`},YD=t=>Oa(t,wn)?void 0:`translate(${t.x}px, ${t.y}px)`,GC={moveTo:YD,drop:(t,e)=>{const n=YD(t);if(n)return e?`${n} scale(${Rp.scale.drop})`:n}},{minDropTime:YC,maxDropTime:jH}=AH,YCe=jH-YC,QD=1500,QCe=.6;var JCe=({current:t,destination:e,reason:n})=>{const r=Ap(t,e);if(r<=0)return YC;if(r>=QD)return jH;const s=r/QD,i=YC+YCe*s,o=n==="CANCEL"?i*QCe:i;return Number(o.toFixed(2))},XCe=({impact:t,draggable:e,dimensions:n,viewport:r,afterCritical:s})=>{const{draggables:i,droppables:o}=n,a=zr(t),l=a?o[a]:null,u=o[e.descriptor.droppableId],d=kH({impact:t,draggable:e,draggables:i,afterCritical:s,droppable:l||u,viewport:r});return Br(d,e.client.borderBox.center)},ZCe=({draggables:t,reason:e,lastImpact:n,home:r,viewport:s,onLiftImpact:i})=>!n.at||e!=="DROP"?{impact:SH({draggables:t,impact:i,destination:r,viewport:s,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:jp},didDropInsideDroppable:!0};const eNe=({getState:t,dispatch:e})=>n=>r=>{if(!st(r,"DROP")){n(r);return}const s=t(),i=r.payload.reason;if(s.phase==="COLLECTING"){e(qCe({reason:i}));return}if(s.phase==="IDLE")return;s.phase==="DROP_PENDING"&&s.isWaiting&&se(),s.phase==="DRAGGING"||s.phase==="DROP_PENDING"||se();const a=s.critical,l=s.dimensions,u=l.draggables[s.critical.draggable.id],{impact:d,didDropInsideDroppable:f}=ZCe({reason:i,lastImpact:s.impact,afterCritical:s.afterCritical,onLiftImpact:s.onLiftImpact,home:s.dimensions.droppables[s.critical.droppable.id],viewport:s.viewport,draggables:s.dimensions.draggables}),h=f?VT(d):null,p=f?h0(d):null,m={index:a.draggable.index,droppableId:a.droppable.id},g={draggableId:u.descriptor.id,type:u.descriptor.type,source:m,reason:i,mode:s.movementMode,destination:h,combine:p},y=XCe({impact:d,draggable:u,dimensions:l,viewport:s.viewport,afterCritical:s.afterCritical}),b={critical:s.critical,afterCritical:s.afterCritical,result:g,impact:d};if(!(!Oa(s.current.client.offset,y)||!!g.combine)){e(GT({completed:b}));return}const w=JCe({current:s.current.client.offset,destination:y,reason:i});e(HCe({newHomeClientOffset:y,dropDuration:w,completed:b}))};var PH=()=>({x:window.pageXOffset,y:window.pageYOffset});function tNe(t){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:e=>{e.target!==window&&e.target!==window.document||t()}}}function nNe({onWindowScroll:t}){function e(){t(PH())}const n=Tp(e),r=tNe(n);let s=Ma;function i(){return s!==Ma}function o(){i()&&se(),s=as(window,[r])}function a(){i()||se(),n.cancel(),s(),s=Ma}return{start:o,stop:a,isActive:i}}const rNe=t=>st(t,"DROP_COMPLETE")||st(t,"DROP_ANIMATE")||st(t,"FLUSH"),sNe=t=>{const e=nNe({onWindowScroll:n=>{t.dispatch(BCe({newScroll:n}))}});return n=>r=>{!e.isActive()&&st(r,"INITIAL_PUBLISH")&&e.start(),e.isActive()&&rNe(r)&&e.stop(),n(r)}};var iNe=t=>{let e=!1,n=!1;const r=setTimeout(()=>{n=!0}),s=i=>{e||n||(e=!0,t(i),clearTimeout(r))};return s.wasCalled=()=>e,s},oNe=()=>{const t=[],e=s=>{const i=t.findIndex(a=>a.timerId===s);i===-1&&se();const[o]=t.splice(i,1);o.callback()};return{add:s=>{const i=setTimeout(()=>e(i)),o={timerId:i,callback:s};t.push(o)},flush:()=>
716{if(!t.length)return;const s=[...t];t.length=0,s.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const aNe=(t,e)=>t==null&&e==null?!0:t==null||e==null?!1:t.droppableId===e.droppableId&&t.index===e.index,lNe=(t,e)=>t==null&&e==null?!0:t==null||e==null?!1:t.draggableId===e.draggableId&&t.droppableId===e.droppableId,cNe=(t,e)=>{if(t===e)return!0;const n=t.draggable.id===e.draggable.id&&t.draggable.droppableId===e.draggable.droppableId&&t.draggable.type===e.draggable.type&&t.draggable.index===e.draggable.index,r=t.droppable.id===e.droppable.id&&t.droppable.type===e.droppable.type;return n&&r},Pf=(t,e)=>{e()},Ng=(t,e)=>({draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:e});function R1(t,e,n,r){if(!t){n(r(e));return}const s=iNe(n);t(e,{announce:s}),s.wasCalled()||n(r(e))}var uNe=(t,e)=>{const n=oNe();let r=null;const s=(f,h)=>{r&&se(),Pf("onBeforeCapture",()=>{const p=t().onBeforeCapture;p&&p({draggableId:f,mode:h})})},i=(f,h)=>{r&&se(),Pf("onBeforeDragStart",()=>{const p=t().onBeforeDragStart;p&&p(Ng(f,h))})},o=(f,h)=>{r&&se();const p=Ng(f,h);r={mode:h,lastCritical:f,lastLocation:p.source,lastCombine:null},n.add(()=>{Pf("onDragStart",()=>R1(t().onDragStart,p,e,dy.onDragStart))})},a=(f,h)=>{const p=VT(h),m=h0(h);r||se();const g=!cNe(f,r.lastCritical);g&&(r.lastCritical=f);const y=!aNe(r.lastLocation,p);y&&(r.lastLocation=p);const b=!lNe(r.lastCombine,m);if(b&&(r.lastCombine=m),!g&&!y&&!b)return;const x={...Ng(f,r.mode),combine:m,destination:p};n.add(()=>{Pf("onDragUpdate",()=>R1(t().onDragUpdate,x,e,dy.onDragUpdate))})},l=()=>{r||se(),n.flush()},u=f=>{r||se(),r=null,Pf("onDragEnd",()=>R1(t().onDragEnd,f,e,dy.onDragEnd))};return{beforeCapture:s,beforeStart:i,start:o,update:a,flush:l,drop:u,abort:()=>{if(!r)return;const f={...Ng(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};u(f)}}},dNe=(t,e)=>{const n=uNe(t,e);return r=>s=>i=>{if(st(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(st(i,"INITIAL_PUBLISH")){const a=i.payload.critical;n.beforeStart(a,i.payload.movementMode),s(i),n.start(a,i.payload.movementMode);return}if(st(i,"DROP_COMPLETE")){const a=i.payload.completed.result;n.flush(),s(i),n.drop(a);return}if(s(i),st(i,"FLUSH")){n.abort();return}const o=r.getState();o.phase==="DRAGGING"&&n.update(o.critical,o.impact)}};const fNe=t=>e=>n=>{if(!st(n,"DROP_ANIMATION_FINISHED")){e(n);return}const r=t.getState();r.phase!=="DROP_ANIMATING"&&se(),t.dispatch(GT({completed:r.completed}))},hNe=t=>{let e=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),e&&(e(),e=null)}return s=>i=>{if((st(i,"FLUSH")||st(i,"DROP_COMPLETE")||st(i,"DROP_ANIMATION_FINISHED"))&&r(),s(i),!st(i,"DROP_ANIMATE"))return;const o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){t.getState().phase==="DROP_ANIMATING"&&t.dispatch(TH())}};n=requestAnimationFrame(()=>{n=null,e=as(window,[o])})}};var pNe=t=>()=>e=>n=>{(st(n,"DROP_COMPLETE")||st(n,"FLUSH")||st(n,"DROP_ANIMATE"))&&t.stopPublishing(),e(n)},mNe=t=>{let e=!1;return()=>n=>r=>{if(st(r,"INITIAL_PUBLISH")){e=!0,t.tryRecordFocus(r.payload.critical.draggable.id),n(r),t.tryRestoreFocusRecorded();return}if(n(r),!!e){if(st(r,"FLUSH")){e=!1,t.tryRestoreFocusRecorded();return}if(st(r,"DROP_COMPLETE")){e=!1;const s=r.payload.completed.result;s.combine&&t.tryShiftRecord(s.draggableId,s.combine.draggableId),t.tryRestoreFocusRecorded()}}}};const gNe=t=>st(t,"DROP_COMPLETE")||st(t,"DROP_ANIMATE")||st(t,"FLUSH");var yNe=t=>e=>n=>r=>{if(gNe(r)){t.stop(),n(r);return}if(st(r,"INITIAL_PUBLISH")){n(r);const s=e.getState();s.phase!=="DRAGGING"&&se(),t.start(s);return}n(r),t.scroll(e.getState())};const vNe=t=>e=>n=>{if(e(n),!st(n,"PUBLISH_WHILE_DRAGGING"))return;const r=t.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||t.dispatch(_H({reason:r.reason})))},xNe=KW;var bNe=({dimensionMarshal:t,focusMarshal:e,styleMarshal:n,getResponders:r,announce:s,autoScroller:i})=>qW(jCe,xNe(uSe(GCe(n),pNe(t),KCe(t),eNe,fNe,hNe,vNe,yNe(i),sNe,mNe(e),dNe(r,s))));const M1=()=>({additions:{},removals:{},modified:{}});function wNe({registry:t,callbacks:e}){let n=M1(),r=null;const s=()=>{r||(e.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:l,removals:u,modified:d}=n,f=Object.keys(l).map(m=>t.draggable.getById(m).getDimension(wn)).sort((m,g)=>m.descriptor.index-g.descriptor.index),h=Object.keys(d).map(m=>{const y=t.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:y}}),p={additions:f,removals:Object.keys(u),modified:h};n=M1(),e.publish(p)}))};return{add:l=>{const u=l.descriptor.id;n.additions[u]=l,n.modified[l.descriptor.droppableId]=!0,n.removals[u]&&delete n.removals[u],s()},remove:l=>{const u=l.descriptor;n.removals[u.id]=!0,n.modified[u.droppableId]=!0,n.additions[u.id]&&delete n.additions[u.id],s()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=M1())}}}var RH=({scrollHeight:t,scrollWidth:e,height:n,width:r})=>{const s=Br({x:e,y:t},{x:r,y:n});return{x:Math.max(0,s.x),y:Math.max(0,s.y)}},MH=()=>{const t=document.documentElement;return t||se(),t},OH=()=>{const t=MH();return RH({scrollHeight:t.scrollHeight,scrollWidth:t.scrollWidth,width:t.clientWidth,height:t.clientHeight})},SNe=()=>{const t=PH(),e=OH(),n=t.y,r=t.x,s=MH(),i=s.clientWidth,o=s.clientHeight,a=r+i,l=n+o;return{frame:Vs({top:n,left:r,right:a,bottom:l}),scroll:{initial:t,current:t,max:e,diff:{value:wn,displacement:wn}}}},kNe=({critical:t,scrollOptions:e,registry:n})=>{const r=SNe(),s=r.scroll.current,i=t.droppable,o=n.droppable.getAllByType(i.type).map(d=>d.callbacks.getDimensionAndWatchScroll(s,e)),a=n.draggable.getAllByType(t.draggable.type).map(d=>d.getDimension(s));return{dimensions:{draggables:lH(a),droppables:aH(o)},critical:t,viewport:r}};function JD(t,e,n){return!(n.descriptor.id===e.id||n.descriptor.type!==e.type||t.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual")}var CNe=(t,e)=>{let n=null;const r=wNe({callbacks:{publish:e.publishWhileDragging,collectionStarting:e.collectionStarting},registry:t}),s=(h,p)=>{t.droppable.exists(h)||se(),n&&e.updateDroppableIsEnabled({id:h,isEnabled:p})},i=(h,p)=>
716{n&&(t.droppable.exists(h)||se(),e.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:p}))},o=(h,p)=>{n&&(t.droppable.exists(h)||se(),e.updateDroppableScroll({id:h,newScroll:p}))},a=(h,p)=>{n&&t.droppable.getById(h).callbacks.scroll(p)},l=()=>{if(!n)return;r.stop();const h=n.critical.droppable;t.droppable.getAllByType(h.type).forEach(p=>p.callbacks.dragStopped()),n.unsubscribe(),n=null},u=h=>{n||se();const p=n.critical.draggable;h.type==="ADDITION"&&JD(t,p,h.value)&&r.add(h.value),h.type==="REMOVAL"&&JD(t,p,h.value)&&r.remove(h.value)};return{updateDroppableIsEnabled:s,updateDroppableIsCombineEnabled:i,scrollDroppable:a,updateDroppableScroll:o,startPublishing:h=>{n&&se();const p=t.draggable.getById(h.draggableId),m=t.droppable.getById(p.descriptor.droppableId),g={draggable:p.descriptor,droppable:m.descriptor},y=t.subscribe(u);return n={critical:g,unsubscribe:y},kNe({critical:g,registry:t,scrollOptions:h.scrollOptions})},stopPublishing:l}},DH=(t,e)=>t.phase==="IDLE"?!0:t.phase!=="DROP_ANIMATING"||t.completed.result.draggableId===e?!1:t.completed.result.reason==="DROP",NNe=t=>{window.scrollBy(t.x,t.y)};const ENe=bn(t=>f0(t).filter(e=>!(!e.isEnabled||!e.frame))),_Ne=(t,e)=>ENe(e).find(r=>(r.frame||se(),vH(r.frame.pageMarginBox)(t)))||null;var TNe=({center:t,destination:e,droppables:n})=>{if(e){const s=n[e];return s.frame?s:null}return _Ne(t,n)};const Mp={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:t=>t**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var ANe=(t,e,n=()=>Mp)=>{const r=n(),s=t[e.size]*r.startFromPercentage,i=t[e.size]*r.maxScrollAtPercentage;return{startScrollingFrom:s,maxScrollValueAt:i}},IH=({startOfRange:t,endOfRange:e,current:n})=>{const r=e-t;return r===0?0:(n-t)/r},QT=1,jNe=(t,e,n=()=>Mp)=>{const r=n();if(t>e.startScrollingFrom)return 0;if(t<=e.maxScrollValueAt)return r.maxPixelScroll;if(t===e.startScrollingFrom)return QT;const i=1-IH({startOfRange:e.maxScrollValueAt,endOfRange:e.startScrollingFrom,current:t}),o=r.maxPixelScroll*r.ease(i);return Math.ceil(o)},PNe=(t,e,n)=>{const r=n(),s=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,o=e,a=i,u=Date.now()-o;if(u>=i)return t;if(u<s)return QT;const d=IH({startOfRange:s,endOfRange:a,current:u}),f=t*r.ease(d);return Math.ceil(f)},XD=({distanceToEdge:t,thresholds:e,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:s})=>{const i=jNe(t,e,s);return i===0?0:r?Math.max(PNe(i,n,s),QT):i},ZD=({container:t,distanceToEdges:e,dragStartTime:n,axis:r,shouldUseTimeDampening:s,getAutoScrollerOptions:i})=>{const o=ANe(t,r,i);return e[r.end]<e[r.start]?XD({distanceToEdge:e[r.end],thresholds:o,dragStartTime:n,shouldUseTimeDampening:s,getAutoScrollerOptions:i}):-1*XD({distanceToEdge:e[r.start],thresholds:o,dragStartTime:n,shouldUseTimeDampening:s,getAutoScrollerOptions:i})},RNe=({container:t,subject:e,proposedScroll:n})=>{const r=e.height>t.height,s=e.width>t.width;return!s&&!r?n:s&&r?null:{x:s?0:n.x,y:r?0:n.y}};const MNe=oH(t=>t===0?0:t);var LH=({dragStartTime:t,container:e,subject:n,center:r,shouldUseTimeDampening:s,getAutoScrollerOptions:i})=>{const o={top:r.y-e.top,right:e.right-r.x,bottom:e.bottom-r.y,left:r.x-e.left},a=ZD({container:e,distanceToEdges:o,dragStartTime:t,axis:zT,shouldUseTimeDampening:s,getAutoScrollerOptions:i}),l=ZD({container:e,distanceToEdges:o,dragStartTime:t,axis:dH,shouldUseTimeDampening:s,getAutoScrollerOptions:i}),u=MNe({x:l,y:a});if(Oa(u,wn))return null;const d=RNe({container:e,subject:n,proposedScroll:u});return d?Oa(d,wn)?null:d:null};const ONe=oH(t=>t===0?0:t>0?1:-1),JT=(()=>{const t=(e,n)=>e<0?e:e>n?e-n:0;return({current:e,max:n,change:r})=>{const s=Rn(e,r),i={x:t(s.x,n.x),y:t(s.y,n.y)};return Oa(i,wn)?null:i}})(),FH=({max:t,current:e,change:n})=>{const r={x:Math.max(e.x,t.x),y:Math.max(e.y,t.y)},s=ONe(n),i=JT({max:r,current:e,change:s});return!i||s.x!==0&&i.x===0||s.y!==0&&i.y===0},XT=(t,e)=>FH({current:t.scroll.current,max:t.scroll.max,change:e}),DNe=(t,e)=>{if(!XT(t,e))return null;const n=t.scroll.max,r=t.scroll.current;return JT({current:r,max:n,change:e})},ZT=(t,e)=>{const n=t.frame;return n?FH({current:n.scroll.current,max:n.scroll.max,change:e}):!1},INe=(t,e)=>{const n=t.frame;return!n||!ZT(t,e)?null:JT({current:n.scroll.current,max:n.scroll.max,change:e})};var LNe=({viewport:t,subject:e,center:n,dragStartTime:r,shouldUseTimeDampening:s,getAutoScrollerOptions:i})=>{const o=LH({dragStartTime:r,container:t.frame,subject:e,center:n,shouldUseTimeDampening:s,getAutoScrollerOptions:i});return o&&XT(t,o)?o:null},FNe=({droppable:t,subject:e,center:n,dragStartTime:r,shouldUseTimeDampening:s,getAutoScrollerOptions:i})=>{const o=t.frame;if(!o)return null;const a=LH({dragStartTime:r,container:o.pageMarginBox,subject:e,center:n,shouldUseTimeDampening:s,getAutoScrollerOptions:i});return a&&ZT(t,a)?a:null},e2=({state:t,dragStartTime:e,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:s,getAutoScrollerOptions:i})=>{const o=t.current.page.borderBoxCenter,l=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){const f=t.viewport,h=LNe({dragStartTime:e,viewport:f,subject:l,center:o,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(h){r(h);return}}const u=TNe({center:o,destination:zr(t.impact),droppables:t.dimensions.droppables});if(!u)return;const d=FNe({dragStartTime:e,droppable:u,subject:l,center:o,shouldUseTimeDampening:n,getAutoScrollerOptions:i});d&&s(u.descriptor.id,d)},BNe=({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:n=()=>Mp})=>{const r=Tp(t),s=Tp(e);let i=null;const o=u=>{i||se();const{shouldUseTimeDampening:d,dragStartTime:f}=i;e2({state:u,scrollWindow:r,scrollDroppable:s,dragStartTime:f,shouldUseTimeDampening:d,getAutoScrollerOptions:n})};return{start:u=>{i&&se();const d=Date.now();let f=!1;const h=()=>{f=!0};e2({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:h,scrollDroppable:h,getAutoScrollerOptions:n}),i={dragStartTime:d,shouldUseTimeDampening:f},f&&o(u)},stop:()=>
716{i&&(r.cancel(),s.cancel(),i=null)},scroll:o}},$Ne=({move:t,scrollDroppable:e,scrollWindow:n})=>{const r=(a,l)=>{const u=Rn(a.current.client.selection,l);t({client:u})},s=(a,l)=>{if(!ZT(a,l))return l;const u=INe(a,l);if(!u)return e(a.descriptor.id,l),null;const d=Br(l,u);return e(a.descriptor.id,d),Br(l,d)},i=(a,l,u)=>{if(!a||!XT(l,u))return u;const d=DNe(l,u);if(!d)return n(u),null;const f=Br(u,d);return n(f),Br(u,f)};return a=>{const l=a.scrollJumpRequest;if(!l)return;const u=zr(a.impact);u||se();const d=s(a.dimensions.droppables[u],l);if(!d)return;const f=a.viewport,h=i(a.isWindowScrollAllowed,f,d);h&&r(a,h)}},VNe=({scrollDroppable:t,scrollWindow:e,move:n,getAutoScrollerOptions:r})=>{const s=BNe({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:r}),i=$Ne({move:n,scrollWindow:e,scrollDroppable:t});return{scroll:l=>{if(!(r().disabled||l.phase!=="DRAGGING")){if(l.movementMode==="FLUID"){s.scroll(l);return}l.scrollJumpRequest&&i(l)}},start:s.start,stop:s.stop}};const Ed="data-rfd",_d=(()=>{const t=`${Ed}-drag-handle`;return{base:t,draggableId:`${t}-draggable-id`,contextId:`${t}-context-id`}})(),QC=(()=>{const t=`${Ed}-draggable`;return{base:t,contextId:`${t}-context-id`,id:`${t}-id`}})(),zNe=(()=>{const t=`${Ed}-droppable`;return{base:t,contextId:`${t}-context-id`,id:`${t}-id`}})(),t2={contextId:`${Ed}-scroll-container-context-id`},UNe=t=>e=>`[${e}="${t}"]`,Rf=(t,e)=>t.map(n=>{const r=n.styles[e];return r?`${n.selector} { ${r} }`:""}).join(" "),WNe="pointer-events: none;";var HNe=t=>{const e=UNe(t),n=(()=>{const a=`
717      cursor: -webkit-grab;
718      cursor: grab;
719    `;return{selector:e(_d.contextId),styles:{always:`
720          -webkit-touch-callout: none;
721          -webkit-tap-highlight-color: rgba(0,0,0,0);
722          touch-action: manipulation;
723        `,resting:a,dragging:WNe,dropAnimating:a}}})(),r=(()=>{const a=`
724      transition: ${Th.outOfTheWay};
725    `;return{selector:e(QC.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}})(),s={selector:e(zNe.contextId),styles:{always:"overflow-anchor: none;"}},o=[r,n,s,{selector:"body",styles:{dragging:`
726        cursor: grabbing;
727        cursor: -webkit-grabbing;
728        user-select: none;
729        -webkit-user-select: none;
730        -moz-user-select: none;
731        -ms-user-select: none;
732        overflow-anchor: none;
733      `}}];return{always:Rf(o,"always"),resting:Rf(o,"resting"),dragging:Rf(o,"dragging"),dropAnimating:Rf(o,"dropAnimating"),userCancel:Rf(o,"userCancel")}};const Ur=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect,O1=()=>{const t=document.querySelector("head");return t||se(),t},n2=t=>{const e=document.createElement("style");return t&&e.setAttribute("nonce",t),e.type="text/css",e};function qNe(t,e){const n=et(()=>HNe(t),[t]),r=v.useRef(null),s=v.useRef(null),i=ke(bn(f=>{const h=s.current;h||se(),h.textContent=f}),[]),o=ke(f=>{const h=r.current;h||se(),h.textContent=f},[]);Ur(()=>{!r.current&&!s.current||se();const f=n2(e),h=n2(e);return r.current=f,s.current=h,f.setAttribute(`${Ed}-always`,t),h.setAttribute(`${Ed}-dynamic`,t),O1().appendChild(f),O1().appendChild(h),o(n.always),i(n.resting),()=>{const p=m=>{const g=m.current;g||se(),O1().removeChild(g),m.current=null};p(r),p(s)}},[e,o,i,n.always,n.resting,t]);const a=ke(()=>i(n.dragging),[i,n.dragging]),l=ke(f=>{if(f==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),u=ke(()=>{s.current&&i(n.resting)},[i,n.resting]);return et(()=>({dragging:a,dropping:l,resting:u}),[a,l,u])}function BH(t,e){return Array.from(t.querySelectorAll(e))}var $H=t=>t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window;function g0(t){return t instanceof $H(t).HTMLElement}function KNe(t,e){const n=`[${_d.contextId}="${t}"]`,r=BH(document,n);if(!r.length)return null;const s=r.find(i=>i.getAttribute(_d.draggableId)===e);return!s||!g0(s)?null:s}function GNe(t){const e=v.useRef({}),n=v.useRef(null),r=v.useRef(null),s=v.useRef(!1),i=ke(function(h,p){const m={id:h,focus:p};return e.current[h]=m,function(){const y=e.current;y[h]!==m&&delete y[h]}},[]),o=ke(function(h){const p=KNe(t,h);p&&p!==document.activeElement&&p.focus()},[t]),a=ke(function(h,p){n.current===h&&(n.current=p)},[]),l=ke(function(){r.current||s.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const h=n.current;h&&o(h)}))},[o]),u=ke(function(h){n.current=null;const p=document.activeElement;p&&p.getAttribute(_d.draggableId)===h&&(n.current=h)},[]);return Ur(()=>(s.current=!0,function(){s.current=!1;const h=r.current;h&&cancelAnimationFrame(h)}),[]),et(()=>({register:i,tryRecordFocus:u,tryRestoreFocusRecorded:l,tryShiftRecord:a}),[i,u,l,a])}function YNe(){const t={draggables:{},droppables:{}},e=[];function n(f){return e.push(f),function(){const p=e.indexOf(f);p!==-1&&e.splice(p,1)}}function r(f){e.length&&e.forEach(h=>h(f))}function s(f){return t.draggables[f]||null}function i(f){const h=s(f);return h||se(),h}const o={register:f=>{t.draggables[f.descriptor.id]=f,r({type:"ADDITION",value:f})},update:(f,h)=>{const p=t.draggables[h.descriptor.id];p&&p.uniqueId===f.uniqueId&&(delete t.draggables[h.descriptor.id],t.draggables[f.descriptor.id]=f)},unregister:f=>{const h=f.descriptor.id,p=s(h);p&&f.uniqueId===p.uniqueId&&(delete t.draggables[h],t.droppables[f.descriptor.droppableId]&&r({type:"REMOVAL",value:f}))},getById:i,findById:s,exists:f=>!!s(f),getAllByType:f=>Object.values(t.draggables).filter(h=>h.descriptor.type===f)};function a(f){return t.droppables[f]||null}function l(f){const h=a(f);return h||se(),h}const u={register:f=>{t.droppables[f.descriptor.id]=f},unregister:f=>{const h=a(f.descriptor.id);h&&f.uniqueId===h.uniqueId&&delete t.droppables[f.descriptor.id]},getById:l,findById:a,exists:f=>!!a(f),getAllByType:f=>Object.values(t.droppables).filter(h=>h.descriptor.type===f)};function d(){t.draggables={},t.droppables={},e.length=0}
733return{draggable:o,droppable:u,subscribe:n,clean:d}}function QNe(){const t=et(YNe,[]);return v.useEffect(()=>function(){t.clean()},[t]),t}var eA=z.createContext(null),kx=()=>{const t=document.body;return t||se(),t};const JNe={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},XNe=t=>`rfd-announcement-${t}`;function ZNe(t){const e=et(()=>XNe(t),[t]),n=v.useRef(null);return v.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=e,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),xx(i.style,JNe),kx().appendChild(i),function(){setTimeout(function(){const l=kx();l.contains(i)&&l.removeChild(i),i===n.current&&(n.current=null)})}},[e]),ke(s=>{const i=n.current;if(i){i.textContent=s;return}},[])}const eEe={separator:"::"};function tA(t,e=eEe){const n=z.useId();return et(()=>`${t}${e.separator}${n}`,[e.separator,t,n])}function tEe({contextId:t,uniqueId:e}){return`rfd-hidden-text-${t}-${e}`}function nEe({contextId:t,text:e}){const n=tA("hidden-text",{separator:"-"}),r=et(()=>tEe({contextId:t,uniqueId:n}),[n,t]);return v.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=e,i.style.display="none",kx().appendChild(i),function(){const a=kx();a.contains(i)&&a.removeChild(i)}},[r,e]),r}var y0=z.createContext(null);function VH(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),e}function rEe(){let t=null;function e(){return!!t}function n(o){return o===t}function r(o){t&&se();const a={abandon:o};return t=a,a}function s(){t||se(),t=null}function i(){t&&(t.abandon(),s())}return{isClaimed:e,isActive:n,claim:r,release:s,tryAbandon:i}}function Op(t){return t.phase==="IDLE"||t.phase==="DROP_ANIMATING"?!1:t.isDragging}const sEe=9,iEe=13,nA=27,zH=32,oEe=33,aEe=34,lEe=35,cEe=36,uEe=37,dEe=38,fEe=39,hEe=40,pEe={[iEe]:!0,[sEe]:!0};var UH=t=>{pEe[t.keyCode]&&t.preventDefault()};const v0=(()=>{const t="visibilitychange";return typeof document>"u"?t:[t,`ms${t}`,`webkit${t}`,`moz${t}`,`o${t}`].find(r=>`on${r}`in document)||t})(),WH=0,r2=5;function mEe(t,e){return Math.abs(e.x-t.x)>=r2||Math.abs(e.y-t.y)>=r2}const s2={type:"IDLE"};function gEe({cancel:t,completed:e,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:s=>{const{button:i,clientX:o,clientY:a}=s;if(i!==WH)return;const l={x:o,y:a},u=n();if(u.type==="DRAGGING"){s.preventDefault(),u.actions.move(l);return}u.type!=="PENDING"&&se();const d=u.point;if(!mEe(d,l))return;s.preventDefault();const f=u.actions.fluidLift(l);r({type:"DRAGGING",actions:f})}},{eventName:"mouseup",fn:s=>{const i=n();if(i.type!=="DRAGGING"){t();return}s.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),e()}},{eventName:"mousedown",fn:s=>{n().type==="DRAGGING"&&s.preventDefault(),t()}},{eventName:"keydown",fn:s=>{if(n().type==="PENDING"){t();return}if(s.keyCode===nA){s.preventDefault(),t();return}UH(s)}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&t()}},{eventName:"webkitmouseforcedown",fn:s=>{const i=n();if(i.type==="IDLE"&&se(),i.actions.shouldRespectForcePress()){t();return}s.preventDefault()}},{eventName:v0,fn:t}]}function yEe(t){const e=v.useRef(s2),n=v.useRef(Ma),r=et(()=>({eventName:"mousedown",fn:function(f){if(f.defaultPrevented||f.button!==WH||f.ctrlKey||f.metaKey||f.shiftKey||f.altKey)return;const h=t.findClosestDraggableId(f);if(!h)return;const p=t.tryGetLock(h,o,{sourceEvent:f});if(!p)return;f.preventDefault();const m={x:f.clientX,y:f.clientY};n.current(),u(p,m)}}),[t]),s=et(()=>({eventName:"webkitmouseforcewillbegin",fn:d=>{if(d.defaultPrevented)return;const f=t.findClosestDraggableId(d);if(!f)return;const h=t.findOptionsForDraggable(f);h&&(h.shouldRespectForcePress||t.canGetLock(f)&&d.preventDefault())}}),[t]),i=ke(function(){const f={passive:!1,capture:!0};n.current=as(window,[s,r],f)},[s,r]),o=ke(()=>{e.current.type!=="IDLE"&&(e.current=s2,n.current(),i())},[i]),a=ke(()=>{const d=e.current;o(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[o]),l=ke(function(){const f={capture:!0,passive:!1},h=gEe({cancel:a,completed:o,getPhase:()=>e.current,setPhase:p=>{e.current=p}});n.current=as(window,h,f)},[a,o]),u=ke(function(f,h){e.current.type!=="IDLE"&&se(),e.current={type:"PENDING",point:h,actions:f},l()},[l]);Ur(function(){return i(),function(){n.current()}},[i])}function vEe(){}const xEe={[aEe]:!0,[oEe]:!0,[cEe]:!0,[lEe]:!0};function bEe(t,e){function n(){e(),t.cancel()}function r(){e(),t.drop()}return[{eventName:"keydown",fn:s=>{if(s.keyCode===nA){s.preventDefault(),n();return}if(s.keyCode===zH){s.preventDefault(),r();return}if(s.keyCode===hEe){s.preventDefault(),t.moveDown();return}if(s.keyCode===dEe){s.preventDefault(),t.moveUp();return}if(s.keyCode===fEe){s.preventDefault(),t.moveRight();return}if(s.keyCode===uEe){s.preventDefault(),t.moveLeft();return}if(xEe[s.keyCode]){s.preventDefault();return}UH(s)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:v0,fn:n}]}function wEe(t){const e=v.useRef(vEe),n=et(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==zH)return;const o=t.findClosestDraggableId(i);if(!o)return;const a=t.tryGetLock(o,d,{sourceEvent:i});if(!a)return;i.preventDefault();let l=!0;const u=a.snapLift();e.current();function d(){l||se(),l=!1,e.current(),r()}e.current=as(window,bEe(u,d),{capture:!0,passive:!1})}}),[t]),r=ke(function(){const i={passive:!1,capture:!0};e.current=as(window,[n],i)},[n]);Ur(function(){return r(),function(){e.current()}},[r])}const D1={type:"IDLE"},SEe=120,kEe=.15;function CEe({cancel:t,getPhase:e}){return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(e().type!=="DRAGGING"){t();return}n.keyCode===nA&&n.preventDefault(),t()}},{eventName:v0,fn:t}]}function NEe({cancel:t,completed:e,getPhase:n}
733){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const s=n();if(s.type!=="DRAGGING"){t();return}s.hasMoved=!0;const{clientX:i,clientY:o}=r.touches[0],a={x:i,y:o};r.preventDefault(),s.actions.move(a)}},{eventName:"touchend",fn:r=>{const s=n();if(s.type!=="DRAGGING"){t();return}r.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),e()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){t();return}r.preventDefault(),t()}},{eventName:"touchforcechange",fn:r=>{const s=n();s.type==="IDLE"&&se();const i=r.touches[0];if(!i||!(i.force>=kEe))return;const a=s.actions.shouldRespectForcePress();if(s.type==="PENDING"){a&&t();return}if(a){if(s.hasMoved){r.preventDefault();return}t();return}r.preventDefault()}},{eventName:v0,fn:t}]}function EEe(t){const e=v.useRef(D1),n=v.useRef(Ma),r=ke(function(){return e.current},[]),s=ke(function(p){e.current=p},[]),i=et(()=>({eventName:"touchstart",fn:function(p){if(p.defaultPrevented)return;const m=t.findClosestDraggableId(p);if(!m)return;const g=t.tryGetLock(m,a,{sourceEvent:p});if(!g)return;const y=p.touches[0],{clientX:b,clientY:x}=y,w={x:b,y:x};n.current(),f(g,w)}}),[t]),o=ke(function(){const p={capture:!0,passive:!1};n.current=as(window,[i],p)},[i]),a=ke(()=>{const h=e.current;h.type!=="IDLE"&&(h.type==="PENDING"&&clearTimeout(h.longPressTimerId),s(D1),n.current(),o())},[o,s]),l=ke(()=>{const h=e.current;a(),h.type==="DRAGGING"&&h.actions.cancel({shouldBlockNextClick:!0}),h.type==="PENDING"&&h.actions.abort()},[a]),u=ke(function(){const p={capture:!0,passive:!1},m={cancel:l,completed:a,getPhase:r},g=as(window,NEe(m),p),y=as(window,CEe(m),p);n.current=function(){g(),y()}},[l,r,a]),d=ke(function(){const p=r();p.type!=="PENDING"&&se();const m=p.actions.fluidLift(p.point);s({type:"DRAGGING",actions:m,hasMoved:!1})},[r,s]),f=ke(function(p,m){r().type!=="IDLE"&&se();const g=setTimeout(d,SEe);s({type:"PENDING",point:m,actions:p,longPressTimerId:g}),u()},[u,r,s,d]);Ur(function(){return o(),function(){n.current();const m=r();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),s(D1))}},[r,o,s]),Ur(function(){return as(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const _Ee=["input","button","textarea","select","option","optgroup","video","audio"];function HH(t,e){if(e==null)return!1;if(_Ee.includes(e.tagName.toLowerCase()))return!0;const r=e.getAttribute("contenteditable");return r==="true"||r===""?!0:e===t?!1:HH(t,e.parentElement)}function TEe(t,e){const n=e.target;return g0(n)?HH(t,n):!1}var AEe=t=>Vs(t.getBoundingClientRect()).center;function jEe(t){return t instanceof $H(t).Element}const PEe=(()=>{const t="matches";return typeof document>"u"?t:[t,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||t})();function qH(t,e){return t==null?null:t[PEe](e)?t:qH(t.parentElement,e)}function REe(t,e){return t.closest?t.closest(e):qH(t,e)}function MEe(t){return`[${_d.contextId}="${t}"]`}function OEe(t,e){const n=e.target;if(!jEe(n))return null;const r=MEe(t),s=REe(n,r);return!s||!g0(s)?null:s}function DEe(t,e){const n=OEe(t,e);return n?n.getAttribute(_d.draggableId):null}function IEe(t,e){const n=`[${QC.contextId}="${t}"]`,s=BH(document,n).find(i=>i.getAttribute(QC.id)===e);return!s||!g0(s)?null:s}function LEe(t){t.preventDefault()}function Eg({expected:t,phase:e,isLockActive:n,shouldWarn:r}){return!(!n()||t!==e)}function KH({lockAPI:t,store:e,registry:n,draggableId:r}){if(t.isClaimed())return!1;const s=n.draggable.findById(r);return!(!s||!s.options.isEnabled||!DH(e.getState(),r))}function FEe({lockAPI:t,contextId:e,store:n,registry:r,draggableId:s,forceSensorStop:i,sourceEvent:o}){if(!KH({lockAPI:t,store:n,registry:r,draggableId:s}))return null;const l=r.draggable.getById(s),u=IEe(e,l.descriptor.id);if(!u||o&&!l.options.canDragInteractiveElements&&TEe(u,o))return null;const d=t.claim(i||Ma);let f="PRE_DRAG";function h(){return l.options.shouldRespectForcePress}function p(){return t.isActive(d)}function m(C,k){Eg({expected:C,phase:f,isLockActive:p,shouldWarn:!0})&&n.dispatch(k())}const g=m.bind(null,"DRAGGING");function y(C){function k(){t.release(),f="COMPLETED"}f!=="PRE_DRAG"&&(k(),se()),n.dispatch(RCe(C.liftActionArgs)),f="DRAGGING";function N(E,_={shouldBlockNextClick:!1}){if(C.cleanup(),_.shouldBlockNextClick){const T=as(window,[{eventName:"click",fn:LEe,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(T)}k(),n.dispatch(_H({reason:E}))}return{isActive:()=>Eg({expected:"DRAGGING",phase:f,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:h,drop:E=>N("DROP",E),cancel:E=>N("CANCEL",E),...C.actions}}function b(C){const k=Tp(E=>{g(()=>EH({client:E}))});return{...y({liftActionArgs:{id:s,clientSelection:C,movementMode:"FLUID"},cleanup:()=>k.cancel(),actions:{move:k}}),move:k}}function x(){const C={moveUp:()=>g(VCe),moveRight:()=>g(UCe),moveDown:()=>g(zCe),moveLeft:()=>g(WCe)};return y({liftActionArgs:{id:s,clientSelection:AEe(u),movementMode:"SNAP"}
733,cleanup:Ma,actions:C})}function w(){Eg({expected:"PRE_DRAG",phase:f,isLockActive:p,shouldWarn:!0})&&t.release()}return{isActive:()=>Eg({expected:"PRE_DRAG",phase:f,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:h,fluidLift:b,snapLift:x,abort:w}}const BEe=[yEe,wEe,EEe];function $Ee({contextId:t,store:e,registry:n,customSensors:r,enableDefaultSensors:s}){const i=[...s?BEe:[],...r||[]],o=v.useState(()=>rEe())[0],a=ke(function(y,b){Op(y)&&!Op(b)&&o.tryAbandon()},[o]);Ur(function(){let y=e.getState();return e.subscribe(()=>{const x=e.getState();a(y,x),y=x})},[o,e,a]),Ur(()=>o.tryAbandon,[o.tryAbandon]);const l=ke(g=>KH({lockAPI:o,registry:n,store:e,draggableId:g}),[o,n,e]),u=ke((g,y,b)=>FEe({lockAPI:o,registry:n,contextId:t,store:e,draggableId:g,forceSensorStop:y||null,sourceEvent:b&&b.sourceEvent?b.sourceEvent:null}),[t,o,n,e]),d=ke(g=>DEe(t,g),[t]),f=ke(g=>{const y=n.draggable.findById(g);return y?y.options:null},[n.draggable]),h=ke(function(){o.isClaimed()&&(o.tryAbandon(),e.getState().phase!=="IDLE"&&e.dispatch(KT()))},[o,e]),p=ke(()=>o.isClaimed(),[o]),m=et(()=>({canGetLock:l,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:f,tryReleaseLock:h,isLockClaimed:p}),[l,u,d,f,h,p]);for(let g=0;g<i.length;g++)i[g](m)}const VEe=t=>({onBeforeCapture:e=>{const n=()=>{t.onBeforeCapture&&t.onBeforeCapture(e)};Ii.flushSync(n)},onBeforeDragStart:t.onBeforeDragStart,onDragStart:t.onDragStart,onDragEnd:t.onDragEnd,onDragUpdate:t.onDragUpdate}),zEe=t=>({...Mp,...t.autoScrollerOptions,durationDampening:{...Mp.durationDampening,...t.autoScrollerOptions}});function Mf(t){return t.current||se(),t.current}function UEe(t){const{contextId:e,setCallbacks:n,sensors:r,nonce:s,dragHandleUsageInstructions:i}=t,o=v.useRef(null),a=VH(t),l=ke(()=>VEe(a.current),[a]),u=ke(()=>zEe(a.current),[a]),d=ZNe(e),f=nEe({contextId:e,text:i}),h=qNe(e,s),p=ke(T=>{Mf(o).dispatch(T)},[]),m=et(()=>PD({publishWhileDragging:OCe,updateDroppableScroll:ICe,updateDroppableIsEnabled:LCe,updateDroppableIsCombineEnabled:FCe,collectionStarting:DCe},p),[p]),g=QNe(),y=et(()=>CNe(g,m),[g,m]),b=et(()=>VNe({scrollWindow:NNe,scrollDroppable:y.scrollDroppable,getAutoScrollerOptions:u,...PD({move:EH},p)}),[y.scrollDroppable,p,u]),x=GNe(e),w=et(()=>bNe({announce:d,autoScroller:b,dimensionMarshal:y,focusMarshal:x,getResponders:l,styleMarshal:h}),[d,b,y,x,l,h]);o.current=w;const S=ke(()=>{const T=Mf(o);T.getState().phase!=="IDLE"&&T.dispatch(KT())},[]),C=ke(()=>{const T=Mf(o).getState();return T.phase==="DROP_ANIMATING"?!0:T.phase==="IDLE"?!1:T.isDragging},[]),k=et(()=>({isDragging:C,tryAbort:S}),[C,S]);n(k);const N=ke(T=>DH(Mf(o).getState(),T),[]),E=ke(()=>yl(Mf(o).getState()),[]),_=et(()=>({marshal:y,focus:x,contextId:e,canLift:N,isMovementAllowed:E,dragHandleUsageInstructionsId:f,registry:g}),[e,y,f,x,N,E,g]);return $Ee({contextId:e,store:w,registry:g,customSensors:r||null,enableDefaultSensors:t.enableDefaultSensors!==!1}),v.useEffect(()=>S,[S]),z.createElement(y0.Provider,{value:_},z.createElement(dke,{context:eA,store:w},t.children))}function WEe(){return z.useId()}function HEe(t){const e=WEe(),n=t.dragHandleUsageInstructions||dy.dragHandleUsageInstructions;return z.createElement(Ske,null,r=>z.createElement(UEe,{nonce:t.nonce,contextId:e,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:t.enableDefaultSensors,sensors:t.sensors,onBeforeCapture:t.onBeforeCapture,onBeforeDragStart:t.onBeforeDragStart,onDragStart:t.onDragStart,onDragUpdate:t.onDragUpdate,onDragEnd:t.onDragEnd,autoScrollerOptions:t.autoScrollerOptions},t.children))}const i2={dragging:5e3,dropAnimating:4500},qEe=(t,e)=>e?Th.drop(e.duration):t?Th.snap:Th.fluid,KEe=(t,e)=>{if(t)return e?Rp.opacity.drop:Rp.opacity.combining},GEe=t=>t.forceShouldAnimate!=null?t.forceShouldAnimate:t.mode==="SNAP";function YEe(t){const n=t.dimension.client,{offset:r,combineWith:s,dropping:i}=t,o=!!s,a=GEe(t),l=!!i,u=l?GC.drop(r,o):GC.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:qEe(a,i),transform:u,opacity:KEe(o,l),zIndex:l?i2.dropAnimating:i2.dragging,pointerEvents:"none"}}function QEe(t){return{transform:GC.moveTo(t.offset),transition:t.shouldAnimateDisplacement?void 0:"none"}}function JEe(t){return t.type==="DRAGGING"?YEe(t):QEe(t)}function XEe(t,e,n=wn){const r=window.getComputedStyle(e),s=e.getBoundingClientRect(),i=tH(s,r),o=vx(i,n),a={client:i,tagName:e.tagName.toLowerCase(),display:r.display},l={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:t,placeholder:a,displaceBy:l,client:i,page:o}}function ZEe(t){const e=tA("draggable"),{descriptor:n,registry:r,getDraggableRef:s,canDragInteractiveElements:i,shouldRespectForcePress:o,isEnabled:a}=t,l=et(()=>({canDragInteractiveElements:i,shouldRespectForcePress:o,isEnabled:a}),[i,a,o]),u=ke(p=>{const m=s();return m||se(),XEe(n,m,p)},[n,s]),d=et(()=>({uniqueId:e,descriptor:n,options:l,getDimension:u}),[n,u,l,e]),f=v.useRef(d),h=v.useRef(!0);Ur(()=>(r.draggable.register(f.current),()=>r.draggable.unregister(f.current)),[r.draggable]),Ur(()=>{if(h.current){h.current=!1;return}const p=f.current;f.current=d,r.draggable.update(d,p)},[d,r.draggable])}var rA=z.createContext(null);function Cx(t){const e=v.useContext(t);return e||se(),e}function e_e(t){t.preventDefault()}const t_e=t=>{const e=v.useRef(null),n=ke((k=null)=>{e.current=k},[]),r=ke(()=>e.current,[]),{contextId:s,dragHandleUsageInstructionsId:i,registry:o}=Cx(y0),{type:a,droppableId:l}=Cx(rA),u=et(()=>({id:t.draggableId,index:t.index,type:a,droppableId:l}),[t.draggableId,t.index,a,l]),{children:d,draggableId:f,isEnabled:h,shouldRespectForcePress:p,canDragInteractiveElements:m,isClone:g,mapped:y,dropAnimationFinished:b}=t;if(!g){const k=et(()=>({descriptor:u,registry:o,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:p,isEnabled:h}),[u,o,r,m,p,h]);ZEe(k)}const x=et(()=>h?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":s,draggable:!1,onDragStart:e_e}:null,[s,i,f,h]),w=ke(k=>{y.type==="DRAGGING"&&y.dropping&&k.propertyName==="transform"&&Ii.flushSync(b)},[b,y]),S=et(()=>{const k=JEe(y),N=y.type==="DRAGGING"&&y.dropping?w:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":s,"data-rfd-draggable-id":f,style:k,onTransitionEnd:N},dragHandleProps:x}},[s,x,f,y,w,n]),C=et(()=>({draggableId:u.id,type:u.type,source:{index:u.index,droppableId:u.droppableId}}),[u.droppableId,u.id,u.index,u.type]);return z.createElement(z.Fragment,null,d(S,y.snapshot,C))};var GH=(t,e)=>t===e,YH=t=>{const{combine:e,destination:n}=t;return n?n.droppableId:e?e.droppableId:null};const n_e=t=>t.combine?t.combine.draggableId:null,r_e=t=>t.at&&t.at.type==="COMBINE"?t.at.combine.draggableId:null;function s_e(){const t=bn((s,i)=>({x:s,y:i})),e=bn((s,i,o=null,a=null,l=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!l,dropAnimation:l,mode:s,draggingOver:o,combineWith:a,combineTargetFor:null})),n=bn((s,i,o,a,l=null,u=null,d=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:u,mode:i,offset:s,dimension:o,forceShouldAnimate:d,snapshot:e(i,a,l,u,null)}}));return(s,i)=>{if(Op(s)){if(s.critical.draggable.id!==i.draggableId)return null;const o=s.current.client.offset,a=s.dimensions.draggables[i.draggableId],l=zr(s.impact),u=r_e(s.impact),d=s.forceShouldAnimate;return n(t(o.x,o.y),s.movementMode,a,i.isClone,l,u,d)}if(s.phase==="DROP_ANIMATING"){const o=s.completed;if(o.result.draggableId!==i.draggableId)return null;const a=i.isClone,l=s.dimensions.draggables[i.draggableId],u=o.result,d=u.mode,f=YH(u),h=n_e(u),m={duration:s.dropDuration,curve:YT.drop,moveTo:s.newHomeClientOffset,opacity:h?Rp.opacity.drop:null,
733scale:h?Rp.scale.drop:null};return{mapped:{type:"DRAGGING",offset:s.newHomeClientOffset,dimension:l,dropping:m,draggingOver:f,combineWith:h,mode:d,forceShouldAnimate:null,snapshot:e(d,a,f,h,m)}}}return null}}function QH(t=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:t,combineWith:null}}const i_e={mapped:{type:"SECONDARY",offset:wn,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:QH(null)}};function o_e(){const t=bn((o,a)=>({x:o,y:a})),e=bn(QH),n=bn((o,a=null,l)=>({mapped:{type:"SECONDARY",offset:o,combineTargetFor:a,shouldAnimateDisplacement:l,snapshot:e(a)}})),r=o=>o?n(wn,o,!0):null,s=(o,a,l,u)=>{const d=l.displaced.visible[o],f=!!(u.inVirtualList&&u.effected[o]),h=h0(l),p=h&&h.draggableId===o?a:null;if(!d){if(!f)return r(p);if(l.displaced.invisible[o])return null;const y=tf(u.displacedBy.point),b=t(y.x,y.y);return n(b,p,!0)}if(f)return r(p);const m=l.displacedBy.point,g=t(m.x,m.y);return n(g,p,d.shouldAnimate)};return(o,a)=>{if(Op(o))return o.critical.draggable.id===a.draggableId?null:s(a.draggableId,o.critical.draggable.id,o.impact,o.afterCritical);if(o.phase==="DROP_ANIMATING"){const l=o.completed;return l.result.draggableId===a.draggableId?null:s(a.draggableId,l.result.draggableId,l.impact,l.afterCritical)}return null}}const a_e=()=>{const t=s_e(),e=o_e();return(r,s)=>t(r,s)||e(r,s)||i_e},l_e={dropAnimationFinished:TH},c_e=ZW(a_e,l_e,null,{context:eA,areStatePropsEqual:GH})(t_e);function JH(t){return Cx(rA).isUsingCloneFor===t.draggableId&&!t.isClone?null:z.createElement(c_e,t)}function u_e(t){const e=typeof t.isDragDisabled=="boolean"?!t.isDragDisabled:!0,n=!!t.disableInteractiveElementBlocking,r=!!t.shouldRespectForcePress;return z.createElement(JH,xx({},t,{isClone:!1,isEnabled:e,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const XH=t=>e=>t===e,d_e=XH("scroll"),f_e=XH("auto"),o2=(t,e)=>e(t.overflowX)||e(t.overflowY),h_e=t=>{const e=window.getComputedStyle(t),n={overflowX:e.overflowX,overflowY:e.overflowY};return o2(n,d_e)||o2(n,f_e)},p_e=()=>!1,ZH=t=>t==null?null:t===document.body?p_e()?t:null:t===document.documentElement?null:h_e(t)?t:ZH(t.parentElement);var JC=t=>({x:t.scrollLeft,y:t.scrollTop});const e8=t=>t?window.getComputedStyle(t).position==="fixed"?!0:e8(t.parentElement):!1;var m_e=t=>{const e=ZH(t),n=e8(t);return{closestScrollable:e,isFixedOnPage:n}},g_e=({descriptor:t,isEnabled:e,isCombineEnabled:n,isFixedOnPage:r,direction:s,client:i,page:o,closest:a})=>{const l=(()=>{if(!a)return null;const{scrollSize:h,client:p}=a,m=RH({scrollHeight:h.scrollHeight,scrollWidth:h.scrollWidth,height:p.paddingBox.height,width:p.paddingBox.width});return{pageMarginBox:a.page.marginBox,frameClient:p,scrollSize:h,shouldClipSubject:a.shouldClipSubject,scroll:{initial:a.scroll,current:a.scroll,max:m,diff:{value:wn,displacement:wn}}}})(),u=s==="vertical"?zT:dH,d=Nd({page:o,withPlaceholder:null,axis:u,frame:l});return{descriptor:t,isCombineEnabled:n,isFixedOnPage:r,axis:u,isEnabled:e,client:i,page:o,frame:l,subject:d}};const y_e=(t,e)=>{const n=nH(t);if(!e||t!==e)return n;const r=n.paddingBox.top-e.scrollTop,s=n.paddingBox.left-e.scrollLeft,i=r+e.scrollHeight,o=s+e.scrollWidth,l=FT({top:r,right:o,bottom:i,left:s},n.border);return BT({borderBox:l,margin:n.margin,border:n.border,padding:n.padding})};var v_e=({ref:t,descriptor:e,env:n,windowScroll:r,direction:s,isDropDisabled:i,isCombineEnabled:o,shouldClipSubject:a})=>{const l=n.closestScrollable,u=y_e(t,l),d=vx(u,r),f=(()=>{if(!l)return null;const p=nH(l),m={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:p,page:vx(p,r),scroll:JC(l),scrollSize:m,shouldClipSubject:a}})();return g_e({descriptor:e,isEnabled:!i,isCombineEnabled:o,isFixedOnPage:n.isFixedOnPage,direction:s,client:u,page:d,closest:f})};const x_e={passive:!1},b_e={passive:!0};var a2=t=>t.shouldPublishImmediately?x_e:b_e;const _g=t=>t&&t.env.closestScrollable||null;function w_e(t){const e=v.useRef(null),n=Cx(y0),r=tA("droppable"),{registry:s,marshal:i}=n,o=VH(t),a=et(()=>({id:t.droppableId,type:t.type,mode:t.mode}),[t.droppableId,t.mode,t.type]),l=v.useRef(a),u=et(()=>bn((S,C)=>{e.current||se();const k={x:S,y:C};i.updateDroppableScroll(a.id,k)}),[a.id,i]),d=ke(()=>{const S=e.current;return!S||!S.env.closestScrollable?wn:JC(S.env.closestScrollable)},[]),f=ke(()=>{const S=d();u(S.x,S.y)},[d,u]),h=et(()=>Tp(f),[f]),p=ke(()=>{const S=e.current,C=_g(S);if(S&&C||se(),S.scrollOptions.shouldPublishImmediately){f();return}h()},[h,f]),m=ke((S,C)=>{e.current&&se();const k=o.current,N=k.getDroppableRef();N||se();const E=m_e(N),_={ref:N,descriptor:a,env:E,scrollOptions:C};e.current=_;const T=v_e({ref:N,descriptor:a,env:E,windowScroll:S,direction:k.direction,isDropDisabled:k.isDropDisabled,isCombine
733Enabled:k.isCombineEnabled,shouldClipSubject:!k.ignoreContainerClipping}),P=E.closestScrollable;return P&&(P.setAttribute(t2.contextId,n.contextId),P.addEventListener("scroll",p,a2(_.scrollOptions))),T},[n.contextId,a,p,o]),g=ke(()=>{const S=e.current,C=_g(S);return S&&C||se(),JC(C)},[]),y=ke(()=>{const S=e.current;S||se();const C=_g(S);e.current=null,C&&(h.cancel(),C.removeAttribute(t2.contextId),C.removeEventListener("scroll",p,a2(S.scrollOptions)))},[p,h]),b=ke(S=>{const C=e.current;C||se();const k=_g(C);k||se(),k.scrollTop+=S.y,k.scrollLeft+=S.x},[]),x=et(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:g,dragStopped:y,scroll:b}),[y,m,g,b]),w=et(()=>({uniqueId:r,descriptor:a,callbacks:x}),[x,a,r]);Ur(()=>(l.current=w.descriptor,s.droppable.register(w),()=>{e.current&&y(),s.droppable.unregister(w)}),[x,a,y,w,i,s.droppable]),Ur(()=>{e.current&&i.updateDroppableIsEnabled(l.current.id,!t.isDropDisabled)},[t.isDropDisabled,i]),Ur(()=>{e.current&&i.updateDroppableIsCombineEnabled(l.current.id,t.isCombineEnabled)},[t.isCombineEnabled,i])}function I1(){}const l2={width:0,height:0,margin:Tke},S_e=({isAnimatingOpenOnMount:t,placeholder:e,animate:n})=>t||n==="close"?l2:{height:e.client.borderBox.height,width:e.client.borderBox.width,margin:e.client.margin},k_e=({isAnimatingOpenOnMount:t,placeholder:e,animate:n})=>{const r=S_e({isAnimatingOpenOnMount:t,placeholder:e,animate:n});return{display:e.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?Th.placeholder:null}},C_e=t=>{const e=v.useRef(null),n=ke(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),{animate:r,onTransitionEnd:s,onClose:i,contextId:o}=t,[a,l]=v.useState(t.animate==="open");v.useEffect(()=>a?r!=="open"?(n(),l(!1),I1):e.current?I1:(e.current=setTimeout(()=>{e.current=null,l(!1)}),n):I1,[r,a,n]);const u=ke(f=>{f.propertyName==="height"&&(s(),r==="close"&&i())},[r,i,s]),d=k_e({isAnimatingOpenOnMount:a,animate:t.animate,placeholder:t.placeholder});return z.createElement(t.placeholder.tagName,{style:d,"data-rfd-placeholder-context-id":o,onTransitionEnd:u,ref:t.innerRef})};var N_e=z.memo(C_e);class E_e extends z.PureComponent{constructor(...e){super(...e),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,n){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!e.on,data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}const __e=t=>{const e=v.useContext(y0);e||se();const{contextId:n,isMovementAllowed:r}=e,s=v.useRef(null),i=v.useRef(null),{children:o,droppableId:a,type:l,mode:u,direction:d,ignoreContainerClipping:f,isDropDisabled:h,isCombineEnabled:p,snapshot:m,useClone:g,updateViewportMaxScroll:y,getContainerForClone:b}=t,x=ke(()=>s.current,[]),w=ke((P=null)=>{s.current=P},[]);ke(()=>i.current,[]);const S=ke((P=null)=>{i.current=P},[]),C=ke(()=>{r()&&y({maxScroll:OH()})},[r,y]);w_e({droppableId:a,type:l,mode:u,direction:d,isDropDisabled:h,isCombineEnabled:p,ignoreContainerClipping:f,getDroppableRef:x});const k=et(()=>z.createElement(E_e,{on:t.placeholder,shouldAnimate:t.shouldAnimatePlaceholder},({onClose:P,data:j,animate:F})=>z.createElement(N_e,{placeholder:j,onClose:P,innerRef:S,animate:F,contextId:n,onTransitionEnd:C})),[n,C,t.placeholder,t.shouldAnimatePlaceholder,S]),N=et(()=>({innerRef:w,placeholder:k,droppableProps:{"data-rfd-droppable-id":a,"data-rfd-droppable-context-id":n}}),[n,a,k,w]),E=g?g.dragging.draggableId:null,_=et(()=>({droppableId:a,type:l,isUsingCloneFor:E}),[a,E,l]);function T(){if(!g)return null;const{dragging:P,render:j}=g,F=z.createElement(JH,{draggableId:P.draggableId,index:P.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(B,U)=>j(B,U,P));return Vx.createPortal(F,b())}return z.createElement(rA.Provider,{value:_},o(N,m),T())};function T_e(){return document.body||se(),document.body}const c2={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombine
733Enabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:T_e},t8=t=>{let e={...t},n;for(n in c2)t[n]===void 0&&(e={...e,[n]:c2[n]});return e},L1=(t,e)=>t===e.droppable.type,u2=(t,e)=>e.draggables[t.draggable.id],A_e=()=>{const t={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},e={...t,shouldAnimatePlaceholder:!1},n=bn(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=bn((i,o,a,l,u,d)=>{const f=u.descriptor.id;if(u.descriptor.droppableId===i){const m=d?{render:d,dragging:n(u.descriptor)}:null,g={isDraggingOver:a,draggingOverWith:a?f:null,draggingFromThisWith:f,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!1,snapshot:g,useClone:m}}if(!o)return e;if(!l)return t;const p={isDraggingOver:a,draggingOverWith:f,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!0,snapshot:p,useClone:null}});return(i,o)=>{const a=t8(o),l=a.droppableId,u=a.type,d=!a.isDropDisabled,f=a.renderClone;if(Op(i)){const h=i.critical;if(!L1(u,h))return e;const p=u2(h,i.dimensions),m=zr(i.impact)===l;return r(l,d,m,m,p,f)}if(i.phase==="DROP_ANIMATING"){const h=i.completed;if(!L1(u,h.critical))return e;const p=u2(h.critical,i.dimensions);return r(l,d,YH(h.result)===l,zr(h.impact)===l,p,f)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const h=i.completed;if(!L1(u,h.critical))return e;const p=zr(h.impact)===l,m=!!(h.impact.at&&h.impact.at.type==="COMBINE"),g=h.critical.droppable.id===l;return p?m?t:e:g?t:e}return e}},j_e={updateViewportMaxScroll:$Ce},P_e=ZW(A_e,j_e,(t,e,n)=>({...t8(n),...t,...e}),{context:eA,areStatePropsEqual:GH})(__e);var R_e=P_e;const F1=30;function M_e({boardId:t,statuses:e,visibleFields:n,fieldDefs:r,searchQuery:s,onMove:i,onRemove:o,onAddToColumn:a}){const l=Dn(),u=d=>{if(!d.destination)return;const{draggableId:f,destination:h}=d;i(f,h.droppableId)};return e.length===0?c.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground",children:"No statuses configured. Open settings to add statuses."}):c.jsx(HEe,{onDragEnd:u,children:c.jsx("div",{className:"flex gap-4 overflow-x-auto h-full",children:e.map(d=>c.jsx(O_e,{boardId:t,status:d,visibleFields:n,fieldDefs:r,searchQuery:s,onAddToColumn:a,navigate:l},d.id))})})}function O_e({boardId:t,status:e,visibleFields:n,fieldDefs:r,searchQuery:s,onAddToColumn:i,navigate:o}){var C;const a=v.useRef(null),l=v.useRef(null),{data:u,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:h}=kB({queryKey:["board-contacts-status",t,e.id],queryFn:async({pageParam:k=0})=>{const N=k*F1,E=N+F1-1,{data:_,error:T,count:P}=await I.from("board_contacts").select("*, contacts(id, first_name, last_name, email, company, phone, kit_subscriber_id)",{count:"exact"}).eq("board_id",t).eq("status_id",e.id).order("updated_at",{ascending:!1}).range(N,E);if(T)throw T;return{data:_??[],total:P??0,page:k}},initialPageParam:0,getNextPageParam:k=>(k.page+1)*F1<k.total?k.page+1:void 0}),p=(u==null?void 0:u.pages.flatMap(k=>k.data))??[],m=s==null?void 0:s.toLowerCase().trim(),g=m?p.filter(k=>{var _;const N=k.contacts;return N?`${N.first_name} ${N.last_name??""}`.toLowerCase().includes(m)||((_=N.email)==null?void 0:_.toLowerCase().includes(m)):!1}):p,y=m?g.length:((C=u==null?void 0:u.pages[0])==null?void 0:C.total)??0,b=g.map(k=>k.contact_id),x=r.filter(k=>k.key!=="company"&&k.key!=="phone"&&n.has(k.key)).map(k=>k.key),{data:w}=ue({queryKey:["board-custom-field-values",t,e.id,b.join(","),x.join(",")],queryFn:async()=>{if(b.length===0||x.length===0)return[];const{data:k,error:N}=await I.from("custom_field_values").select("contact_id, field_definition_id, value").in("contact_id",b).in("field_definition_id",x);if(N)throw N;return k},enabled:b.length>0&&x.length>0}),S=new Map;return w==null||w.forEach(k=>{S.has(k.contact_id)||S.set(k.contact_id,new Map),k.value&&S.get(k.contact_id).set(k.field_definition_id,k.value)}),v.useEffect(()=>{const k=l.current,N=a.current;if(!k||!N)return;const E=new IntersectionObserver(_=>{_[0].isIntersecting&&f&&!h&&d()},{root:N,rootMargin:"100px"});return E.observe(k),()=>E.disconnect()},[f,h,d]),c.jsxs("div",{className:"flex-shrink-0 w-80 flex flex-col min-h-0",children:[c.jsxs("div",{className:`flex items-center gap-2 mb-3 px-1 ${i?"cursor-pointer hover:bg-muted/50 rounded-md py-1 -my-1 transition-colors":""}`,onClick:i?()=>i(e.id):void 0,children:[i&&c.jsx(nn,{className:"h-3.5 w-3.5 text-muted-foreground"}),c.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:e.color}}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:e.name}),c.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:y})]}),c.jsx(R_e,{droppableId:e.id,children:(k,N)=>c.jsxs("div",{ref:E=>{k.innerRef(E),a.current=E},...k.droppableProps,className:`flex-1 min-h-[120px] overflow-y-auto space-y-2 p-2 rounded-lg border border-border transition-colors ${N.isDraggingOver?"bg-accent/50":"bg-muted/30"}`,children:[g.map((E,_)=>{const T=E.contacts;if(!T)return null;const P=`${T.first_name} ${T.last_name??""}`.trim(),j=S.get(E.contact_id);return c.jsx(u_e,{draggableId:E.contact_id,index:_,children:(F,B)=>c.jsx("div",{ref:F.innerRef,...F.draggableProps,...F.dragHandleProps,className:`group bg-background border border-border rounded-md p-4 cursor-grab active:cursor-grabbing transition-shadow ${B.isDragging?"shadow-lg":""}`,children:c.jsxs("div",{className:"min-w-0 cursor-pointer space-y-1.5",onClick:()=>o(`/contacts/${T.id}`),children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("p",{className:"text-sm font-semibold text-foreground truncate hover:underline",children:P}),T.kit_subscriber_id&&c.jsx(Ua,{size:"sm"})]}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:T.email}),(()=>{const U=[];return n.has("company")&&T.company&&U.push({label:"Company",value:T.company,fieldType:"text"}),n.has("phone")&&T.phone&&U.push({label:"Phone",value:T.phone,fieldType:"text"}),r.forEach(D=>
733{if(D.key==="company"||D.key==="phone"||!n.has(D.key))return;const L=j==null?void 0:j.get(D.key);L&&U.push({label:D.label,value:jhe(D.fieldType,L),fieldType:D.fieldType})}),U.length===0?null:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t border-border my-2.5"}),c.jsx("div",{className:"space-y-1.5",children:U.map(D=>c.jsxs("p",{className:`text-xs ${D.fieldType==="text"?"line-clamp-3":"truncate"}`,children:[c.jsxs("span",{className:"font-medium text-muted-foreground/60",children:[D.label,":"]})," ",c.jsx("span",{className:"text-foreground/80",children:D.value})]},D.label))})]})})()]})})},E.contact_id)}),k.placeholder,c.jsx("div",{ref:l,className:"h-1"}),h&&c.jsx("div",{className:"flex justify-center py-2",children:c.jsx(gt,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]})}const D_e=["#6b7280","#3b82f6","#22c55e","#ef4444","#f59e0b","#8b5cf6","#ec4899","#06b6d4"];function I_e({open:t,onOpenChange:e,boardId:n,boardName:r,statuses:s,onDelete:i,isDeleting:o}){const{toast:a}=ut(),l=xt(),[u,d]=v.useState(r),[f,h]=v.useState(""),[p,m]=v.useState("#6b7280"),g=Ee({mutationFn:async w=>{const{error:S}=await I.from("boards").update({name:w}).eq("id",n);if(S)throw S},onSuccess:()=>{l.invalidateQueries({queryKey:["board",n]}),l.invalidateQueries({queryKey:["boards"]}),a({title:"Board renamed"})}}),y=Ee({mutationFn:async({name:w,color:S})=>{const C=s.reduce((N,E)=>Math.max(N,E.position),-1),{error:k}=await I.from("board_statuses").insert({board_id:n,name:w,color:S,position:C+1});if(k)throw k},onSuccess:()=>{l.invalidateQueries({queryKey:["board-statuses",n]}),h(""),a({title:"Status added"})}}),b=Ee({mutationFn:async({id:w,name:S,color:C})=>{const{error:k}=await I.from("board_statuses").update({name:S,color:C}).eq("id",w);if(k)throw k},onSuccess:()=>{l.invalidateQueries({queryKey:["board-statuses",n]})}}),x=Ee({mutationFn:async w=>{const{error:S}=await I.from("board_statuses").delete().eq("id",w);if(S)throw S},onSuccess:()=>{l.invalidateQueries({queryKey:["board-statuses",n]}),l.invalidateQueries({queryKey:["board-contacts",n]}),a({title:"Status deleted"})},onError:w=>{a({title:"Error",description:"Remove contacts from this status first.",variant:"destructive"})}});return c.jsx(Qp,{open:t,onOpenChange:e,children:c.jsxs(Hd,{className:"overflow-y-auto",children:[c.jsx(Jp,{children:c.jsx(Xp,{children:"Board Settings"})}),c.jsxs("div",{className:"mt-6 space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{children:"Board Name"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Je,{value:u,onChange:w=>d(w.target.value)}),c.jsx(K,{size:"sm",disabled:!u.trim()||u===r,onClick:()=>g.mutate(u.trim()),children:"Save"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(pt,{children:"Statuses"}),c.jsx("div",{className:"space-y-2",children:s.map(w=>c.jsx(L_e,{status:w,onUpdate:(S,C)=>b.mutate({id:w.id,name:S,color:C}),onDelete:()=>x.mutate(w.id)},w.id))}),c.jsx("div",{className:"flex gap-2 items-center pt-2 border-t border-border",children:c.jsx("div",{className:"flex gap-1",children:D_e.map(w=>c.jsx("button",{className:`w-5 h-5 rounded-full border-2 transition-all ${p===w?"border-foreground scale-110":"border-transparent"}`,style:{backgroundColor:w},onClick:()=>m(w)},w))})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Je,{placeholder:"New status name",value:f,onChange:w=>h(w.target.value),onKeyDown:w=>{w.key==="Enter"&&f.trim()&&y.mutate({name:f.trim(),color:p})}}),c.jsx(K,{size:"sm",disabled:!f.trim(),onClick:()=>y.mutate({name:f.trim(),color:p}),children:c.jsx(nn,{className:"h-4 w-4"})})]})]}),c.jsx(B_e,{boardId:n}),i&&c.jsxs("div",{className:"space-y-3 pt-4 border-t border-border",children:[c.jsx(pt,{className:"text-destructive",children:"Danger Zone"}),c.jsxs(L_,{children:[c.jsx(F_,{asChild:!0,children:c.jsxs(K,{variant:"destructive",className:"w-full",disabled:o,children:[c.jsx(qs,{className:"h-4 w-4 mr-2"}),o?"Deleting…":"Delete Board"]})}),c.jsxs($b,{children:[c.jsxs(Vb,{children:[c.jsx(Ub,{children:"Delete board?"}),c.jsxs(Wb,{children:['This will permanently delete "',r,'" and all its data.']})]}),c.jsxs(zb,{children:[c.jsx(qb,{children:"Cancel"}),c.jsx(Hb,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]})]})})}function L_e({status:t,onUpdate:e,onDelete:n}){const[r,s]=v.useState(!1),[i,o]=v.useState(t.name);return c.jsxs("div",{className:"flex items-center gap-2 group",children:[c.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:t.color}}),r?c.jsx(Je,{value:i,onChange:a=>o(a.target.value),onBlur:()=>{i.trim()&&i!==t.name&&e(i.trim(),t.color),s(!1)},onKeyDown:a=>{a.key==="Enter"&&(i.trim()&&i!==t.name&&e(i.trim(),t.color),s(!1))},className:"h-8 text-sm",autoFocus:!0}):c.jsx("span",{className:"text-sm flex-1 cursor-pointer hover:underline",onClick:()=>s(!0),children:t.name}),c.jsx(K,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive",onClick:n,children:c.jsx(qs,{className:"h-3 w-3"})})]})}const F_e=[{key:"company",label:"Company"},{key:"phone",label:"Phone"}];function B_e({boardId:t}){const{teamId:e}=ot(),n=xt(),{toast:r}=ut(),{data:s}=ue({queryKey:["custom-field-definitions",e],queryFn:async()=>{const{data:d,error:f}=await I.from("custom_field_definitions").select("id, name, field_type").order("created_at");if(f)throw f;return d},enabled:!!e}),{data:i}=ue({queryKey:["board-field-visibility",t],queryFn:async()=>{const{data:d,error:f}=await I.from("board_field_visibility").select("*").eq("board_id",t);if(f)throw f;return d}}),o=new Map;
733i==null||i.forEach(d=>o.set(d.field_key,d.is_visible));const a=d=>o.has(d)?o.get(d):!0,l=Ee({mutationFn:async({fieldKey:d,visible:f})=>{const{error:h}=await I.from("board_field_visibility").upsert({board_id:t,field_key:d,is_visible:f},{onConflict:"board_id,field_key"});if(h)throw h},onSuccess:()=>{n.invalidateQueries({queryKey:["board-field-visibility",t]})},onError:d=>{r({title:"Error",description:d.message,variant:"destructive"})}}),u=[...F_e,...(s==null?void 0:s.map(d=>({key:d.id,label:d.name})))??[]];return c.jsxs("div",{className:"space-y-3 pt-4 border-t border-border",children:[c.jsx(pt,{children:"Card Fields"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which fields appear on contact cards in this board."}),c.jsxs("div",{className:"space-y-1",children:[u.map(d=>{const f=a(d.key);return c.jsxs("div",{className:"flex items-center justify-between py-1.5 px-1 rounded hover:bg-muted/50",children:[c.jsx("span",{className:"text-sm",children:d.label}),c.jsx(K,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>l.mutate({fieldKey:d.key,visible:!f}),children:f?c.jsx(F9,{className:"h-4 w-4 text-foreground"}):c.jsx(L9,{className:"h-4 w-4 text-muted-foreground"})})]},d.key)}),u.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No custom fields defined yet."})]})]})}function $_e({open:t,onOpenChange:e,boardId:n,statusId:r,statuses:s}){const{teamId:i,user:o}=ot(),{toast:a}=ut(),l=xt(),[u,d]=v.useState(""),[f,h]=v.useState("existing"),{data:p}=ue({queryKey:["kit-connection",i],queryFn:async()=>{const{data:E,error:_}=await I.from("kit_connections").select("id").eq("team_id",i).maybeSingle();if(_)throw _;return E},enabled:!!i}),m=!!p,{data:g}=ue({queryKey:["contacts",i],queryFn:async()=>{const{data:E,error:_}=await I.from("contacts").select("id, first_name, last_name, email, company").order("first_name");if(_)throw _;return E},enabled:!!i&&t}),{data:y}=ue({queryKey:["board-contacts-all",n],queryFn:async()=>{const{data:E,error:_}=await I.from("board_contacts").select("contact_id, status_id").eq("board_id",n);if(_)throw _;return E},enabled:!!n&&t}),b=new Map((y??[]).map(E=>[E.contact_id,E.status_id])),x=new Map(s.map(E=>[E.id,E])),w=Ee({mutationFn:async E=>{const{error:_}=await I.from("board_contacts").insert({board_id:n,contact_id:E,status_id:r});if(_)throw _},onSuccess:()=>{l.invalidateQueries({queryKey:["board-contacts-status",n,r]}),l.invalidateQueries({queryKey:["board-contacts-all",n]}),a({title:"Contact added to board"})},onError:E=>{a({title:"Error",description:E.message,variant:"destructive"})}}),S=Ee({mutationFn:async E=>{const{data:_,error:T}=await I.from("contacts").insert({team_id:i,first_name:E.first_name,last_name:E.last_name||null,email:E.email,phone:E.phone||null,company:E.company||null}).select("id").single();if(T)throw T;const{error:P}=await I.from("board_contacts").insert({board_id:n,contact_id:_.id,status_id:r});if(P)throw P;return _.id},onSuccess:E=>{var _;if(o){Wa(E,o.id,"contact_created");const T=((_=x.get(r))==null?void 0:_.name)??"";Wa(E,o.id,"status_changed",{board_name:"",old_status:"",new_status:T})}l.invalidateQueries({queryKey:["board-contacts-status",n,r]}),l.invalidateQueries({queryKey:["board-contacts-all",n]}),l.invalidateQueries({queryKey:["contacts"]}),a({title:"Contact created and added to board"}),e(!1),C.reset()},onError:E=>{a({title:"Error",description:E.message,variant:"destructive"})}}),C=R5({resolver:O5(F5),defaultValues:{first_name:"",last_name:"",email:"",phone:"",company:""}}),k=g==null?void 0:g.filter(E=>{if(!u)return!0;const _=u.toLowerCase();return`${E.first_name} ${E.last_name??""}`.toLowerCase().includes(_)||E.email.toLowerCase().includes(_)}),N=x.get(r);return c.jsx(Qp,{open:t,onOpenChange:E=>{e(E),E||(d(""),h("existing"),C.reset())},children:c.jsxs(Hd,{side:"right",className:"sm:max-w-md flex flex-col h-full",children:[c.jsx(Jp,{children:c.jsxs(Xp,{children:["Add contact to"," ",N&&c.jsx("span",{style:{color:N.color},children:N.name})]})}),c.jsxs(Fb,{value:f,onValueChange:h,className:"flex flex-col flex-1 min-h-0",children:[c.jsxs(lm,{className:`w-full ${m?"grid grid-cols-3":""}`,children:[c.jsxs(tr,{value:"existing",className:"flex-1",children:[c.jsx(Gh,{className:"h-3.5 w-3.5 mr-1.5"}),"Existing"]}),c.jsxs(tr,{value:"new",className:"flex-1",children:[c.jsx(ZN,{className:"h-3.5 w-3.5 mr-1.5"}),"New Contact"]}),m&&c.jsxs(tr,{value:"kit",className:"flex-1 gap-1.5",children:["Import from ",c.jsx(Ua,{})]})]}),c.jsxs(nr,{value:"existing",className:"flex flex-col flex-1 min-h-0 space-y-3 mt-3 data-[state=inactive]:hidden",children:[c.jsxs("div",{className:"relative flex-shrink-0",children:[c.jsx(Gh,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Je,{placeholder:"Search contacts…",value:u,onChange:E=>d(E.target.value),className:"pl-9"})]}),c.jsx("div",{className:"flex-1 overflow-y-auto space-y-1 mb-4",children:k&&k.length>0?k.map(E=>{const _=`${E.first_name} ${E.last_name??""}`.trim(),T=b.get(E.id),P=T?x.get(T):null,j=!!T;return c.jsxs("div",{className:`flex items-center justify-between p-2 rounded-md hover:bg-secondary ${j?"opacity-70":"cursor-pointer"}`,onClick:()=>{j||w.mutate(E.id)},children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:_}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:E.email})]}),j&&P?c.jsx(Ai,{variant:"outline",className:"flex-shrink-0 text-xs ml-2",style:{borderColor:P.color,color:P.color},children:P.name}):c.jsx(nn,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})]},E.id)}):c.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:u?"No matching contacts.":"No contacts found."})})]}),c.jsx(nr,{value:"new",className:"mt-3 overflow-y-auto data-[state=inactive]:hidden",children:c.jsxs("form",{onSubmit:C.handleSubmit(E=>S.mutate(E)),className:"space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(pt,{htmlFor:"col-first_name",className:"text-xs",children:"First Name *"}),c.jsx(Je,{id:"col-first_name",...C.register("first_name"),className:"h-8 text-sm"}),C.formState.errors.first_name&&c.jsx("p",{className:"text-xs text-destructive",children:C.formState.errors.first_name.message})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(pt,{htmlFor:"col-last_name",className:"text-xs",children:"Last Name"}),c.jsx(Je,{id:"col-last_name",...C.register("last_name"),className:"h-8 text-sm"})]})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(pt,{htmlFor:"col-email",className:"text-xs",children:"Email *"}),c.jsx(Je,{id:"col-email",type:"email",...C.register("email"),className:"h-8 text-sm"}),C.formState.errors.email&&c.jsx("p",{className:"text-xs text-destructive",children:C.formState.errors.email.message})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(pt,{htmlFor:"col-phone",className:"text-xs",children:"Phone"}),c.jsx(Je,{id:"col-phone",...C.register("phone"),className:"h-8 text-sm"})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(pt,{htmlFor:"col-company",className:"text-xs",children:"Company"}),c.jsx(Je,{id:"col-company",...C.register("company"),className:"h-8 text-sm"})]})]}),c.jsx(K,{type:"submit",size:"sm",className:"w-full",disabled:S.isPending,children:S.isPending?"Creating…":"Create & Add to Board"})]})}),m&&c.jsx(nr,{value:"kit",className:"mt-3 flex-1 min-h-0 overflow-y-auto data-[state=inactive]:hidden",children:c.jsx(jV,{boardId:n,statusId:r,onImported:()=>
733{l.invalidateQueries({queryKey:["board-contacts-status",n,r]}),l.invalidateQueries({queryKey:["board-contacts-all",n]}),l.invalidateQueries({queryKey:["contacts"]})}})})]})]})})}const d2={initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function V_e(){var U;const{user:t,teamId:e,role:n}=ot(),{toast:r}=ut(),s=xt(),i=n==="admin"||n==="owner",[o]=kc(),a=o.get("board"),[l,u]=v.useState(null),[d,f]=v.useState(!1),[h,p]=v.useState(null),[m,g]=v.useState(""),{data:y}=ue({queryKey:["membership",t==null?void 0:t.id],queryFn:async()=>{const{data:D,error:L}=await I.from("team_members").select("last_viewed_board_id").eq("user_id",t.id).maybeSingle();if(L)throw L;return D},enabled:!!(t!=null&&t.id)}),{data:b,isLoading:x}=ue({queryKey:["boards",e],queryFn:async()=>{const{data:D,error:L}=await I.from("boards").select("id, name").order("created_at",{ascending:!0});if(L)throw L;return D},enabled:!!e});v.useEffect(()=>{if(!b||b.length===0)return;if(a&&b.some(A=>A.id===a)){u(a);return}if(l&&b.some(A=>A.id===l))return;const D=y==null?void 0:y.last_viewed_board_id,L=D&&b.some(A=>A.id===D);u(L?D:b[0].id)},[b,y,a,l]);const{data:w}=ue({queryKey:["board",l],queryFn:async()=>{const{data:D,error:L}=await I.from("boards").select("*").eq("id",l).single();if(L)throw L;return D},enabled:!!l}),{data:S}=ue({queryKey:["board-statuses",l],queryFn:async()=>{const{data:D,error:L}=await I.from("board_statuses").select("*").eq("board_id",l).order("position");if(L)throw L;return D},enabled:!!l}),C=(S==null?void 0:S.map(D=>D.id))??[],{data:k}=ue({queryKey:["board-field-visibility",l],queryFn:async()=>{const{data:D,error:L}=await I.from("board_field_visibility").select("*").eq("board_id",l);if(L)throw L;return D},enabled:!!l}),{data:N}=ue({queryKey:["custom-field-definitions",e],queryFn:async()=>{const{data:D,error:L}=await I.from("custom_field_definitions").select("id, name, field_type").order("created_at");if(L)throw L;return D},enabled:!!e}),E=(()=>{const D=new Map;k==null||k.forEach(O=>D.set(O.field_key,O.is_visible));const L=["company","phone",...(N==null?void 0:N.map(O=>O.id))??[]],A=new Set;return L.forEach(O=>{const W=D.get(O);(W===void 0||W===!0)&&A.add(O)}),A})(),_=[{key:"company",label:"Company",fieldType:"text"},{key:"phone",label:"Phone",fieldType:"text"},...(N==null?void 0:N.map(D=>({key:D.id,label:D.name,fieldType:D.field_type})))??[]],T=Ee({mutationFn:async D=>{const{error:L}=await I.from("boards").delete().eq("id",D);if(L)throw L},onSuccess:()=>{s.invalidateQueries({queryKey:["boards"]}),u(null),f(!1),r({title:"Board deleted"})},onError:D=>{r({title:"Error",description:D.message,variant:"destructive"})}}),P=Ee({mutationFn:async({contactId:D,statusId:L})=>{const{error:A}=await I.from("board_contacts").update({status_id:L,updated_at:new Date().toISOString()}).eq("board_id",l).eq("contact_id",D);if(A)throw A},onMutate:async({contactId:D,statusId:L})=>{for(const W of C)await s.cancelQueries({queryKey:["board-contacts-status",l,W]});const A={};for(const W of C){const Z=["board-contacts-status",l,W];A[W]=s.getQueryData(Z)}let O=null;for(const W of C){const Z=["board-contacts-status",l,W];s.setQueryData(Z,$=>{if(!$)return $;const Y=$.pages.map(ee=>{const ne=ee.data.find(be=>be.contact_id===D);return ne&&(O={...ne,status_id:L,updated_at:new Date().toISOString()}),{...ee,data:ee.data.filter(be=>be.contact_id!==D),total:ne?ee.total-1:ee.total}});return{...$,pages:Y}})}if(O){const W=["board-contacts-status",l,L];s.setQueryData(W,Z=>{var Y;if(!Z||!((Y=Z.pages)!=null&&Y.length))return{pages:[{data:[O],total:1,page:0}],pageParams:[0]};const $=[...Z.pages];return $[0]={...$[0],data:[O,...$[0].data],total:$[0].total+1},{...Z,pages:$}})}return{snapshots:A}},onError:(D,L,A)=>{if(A!=null&&A.snapshots)for(const O of C){const W=["board-contacts-status",l,O];A.snapshots[O]!==void 0&&s.setQueryData(W,A.snapshots[O])}r({title:"Failed to move contact",variant:"destructive"})},onSettled:()=>{for(const D of C)s.invalidateQueries({queryKey:["board-contacts-status",l,D]})}}),j=Ee({mutationFn:async D=>{const{error:L}=await I.from("board_contacts").delete().eq("board_id",l).eq("contact_id",D);if(L)throw L},onSuccess:()=>{for(const D of C)s.invalidateQueries({queryKey:["board-contacts-status",l,D]});r({title:"Contact removed from board"})}}),F=(U=b==null?void 0:b.find(D=>D.id===l))==null?void 0:U.name,B=c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-sm font-semibold text-foreground",children:F||"Boards"}),c.jsx("div",{className:"absolute left-1/2 -translate-x-1/2",children:c.jsxs("div",{className:"relative",children:[c.jsx(Gh,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),c.jsx(Je,{placeholder:"Search by name or email…",value:m,onChange:D=>g(D.target.value),className:"h-8 w-80 pl-8 text-xs"})]})}),c.jsx("div",{className:"flex items-center gap-1 ml-auto",children:i&&l&&c.jsx(K,{variant:"ghost",size:"icon",onClick:()=>f(!0),className:"h-8 w-8",children:c.jsx(qp,{className:"h-4 w-4"})})})]});return x?c.jsxs(c.Fragment,{children:[c.jsx(Ei,{children:c.jsx(vt,{className:"h-8 w-48"})}),c.jsx("div",{className:"p-6 space-y-4",children:c.jsx(vt,{className:"h-[400px] w-full"})})]}):!b||b.length===0?c.jsxs(c.Fragment,{children:[c.jsx(Ei,{children:B}),c.jsx(Ye.div,{...d2,className:"p-6 space-y-4",children:c.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[c.jsx(Md,{className:"h-10 w-10 text-muted-foreground mb-3"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:"No boards yet. Create one from the sidebar."})]})})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ei,{children:B}),c.jsxs(Ye.div,{...d2,className:"h-full overflow-hidden flex flex-col px-6 pt-4 gap-4",children:[c.jsx("div",{className:"flex-1 min-h-0",children:l?c.jsx(M_e,{boardId:l,statuses:S??[],visibleFields:E,fieldDefs:_,searchQuery:m,onMove:(D,L)=>P.mutate({contactId:D,statusId:L}),onRemove:D=>j.mutate(D),onAddToColumn:D=>p(D)}):c.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground",children:"Select a board to get started."})}),i&&l&&w&&c.jsx(I_e,{open:d,onOpenChange:f,boardId:l,boardName:w.name,statuses:S??[],onDelete:()=>T.mutate(l),isDeleting:T.isPending}),l&&h&&c.jsx($_e,{open:!!h,onOpenChange:D=>{D||p(null)},boardId:l,statusId:h,statuses:S??[]})]})]})}function z_e({tasks:t,onTaskClick:e,onStatusToggle:n}){return c.jsxs(Tb,{children:[c.jsx(Ab,{children:c.jsxs(lc,{children:[c.jsx(pn,{className:"w-10"}),c.jsx(pn,{children:"Title"}),c.jsx(pn,{className:"w-28",children:"Status"}),c.jsx(pn,{className:"w-36",children:"Related to"}),c.jsx(pn,{className:"w-28",children:"Due Date"})]})}),c.jsx(jb,{children:t.map(r=>{const s=Ra.find(a=>a.value===r.status)??Ra[0],i=r.contacts,o=i?`${i.first_name} ${i.last_name??""}`.trim():"";return c.jsxs(lc,{className:"cursor-pointer",onClick:()=>e(r.id),children:[c.jsx(mn,{onClick:a=>a.stopPropagation(),children:c.jsx(hd,{checked:r.status==="done",onCheckedChange:a=>n(r.id,!!a)})}),c.jsx(mn,{children:c.jsx("span",{className:q("text-sm",r.status==="done"&&"line-through text-muted-foreground"),children:r.title})}),c.jsx(mn,{children:c.jsx(Ai,{variant:"outline",className:q("text-xs",s.color),children:s.label})}),c.jsx(mn,{children:c.jsx("span",{className:"text-sm text-muted-foreground",children:o||"—"})}),c.jsx(mn,{children:c.jsx("span",{className:"text-sm text-muted-foreground",children:r.due_at?Ze(new Date(r.due_at),"MMM d, yyyy"):"—"})})]},r.id)})})]})}const U_e=Ra;function W_e({tasks:t,onTaskClick:e,onAddTask:n}){return c.jsx("div",{className:"flex gap-4 h-full overflow-x-auto pb-4",children:U_e.map(r=>{const s=t.filter(i=>i.status===r.value);return c.jsxs("div",{className:"flex-1 min-w-[260px] flex flex-col",children:[c.jsx("div",{className:"flex items-center justify-between mb-3 px-1",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ai,{variant:"outline",className:q("text-xs",r.color),children:r.label}),c.jsx("span",{className:"text-xs text-muted-foreground",children:s.length})]})}),c.jsxs("div",{className:"flex-1 space-y-2 overflow-y-auto",children:[s.map(i=>{const o=i.contacts,a=o?`${o.first_name} ${o.last_name??""}`.trim():"";return c.jsxs(Bs,{className:"p-3 cursor-pointer hover:bg-secondary/50 transition-colors",onClick:()=>e(i.id),children:[c.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:i.title}),c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[i.due_at&&c.jsx("span",{children:Ze(ne
733w Date(i.due_at),"MMM d")}),a&&c.jsxs("span",{children:["· ",a]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ad(new Date(i.created_at),{addSuffix:!0})})]},i.id)}),c.jsxs(K,{variant:"ghost",size:"sm",className:"w-full justify-start text-muted-foreground",onClick:()=>n(r.value),children:[c.jsx(nn,{className:"h-3.5 w-3.5 mr-1.5"})," New"]})]})]},r.value)})})}function H_e(){const{user:t,teamId:e}=ot(),{toast:n}=ut(),r=xt(),[s,i]=v.useState("list"),[o,a]=v.useState(null),[l,u]=v.useState(!1),[d,f]=v.useState(""),[h,p]=v.useState("todo"),{data:m=[],isLoading:g}=ue({queryKey:["tasks",e],queryFn:async()=>{const{data:w,error:S}=await I.from("tasks").select("*, contacts(first_name, last_name)").eq("team_id",e).is("deleted_at",null).order("created_at",{ascending:!1});if(S)throw S;return w},enabled:!!e}),y=Ee({mutationFn:async({title:w,status:S})=>{const{error:C}=await I.from("tasks").insert({title:w,status:S,created_by:t.id,team_id:e,due_at:null});if(C)throw C},onSuccess:()=>{r.invalidateQueries({queryKey:["tasks"]}),u(!1),f(""),p("todo"),n({title:"Task created"})},onError:w=>n({title:"Error",description:w.message,variant:"destructive"})}),b=Ee({mutationFn:async({id:w,done:S})=>{const{error:C}=await I.from("tasks").update({status:S?"done":"todo"}).eq("id",w);if(C)throw C},onSuccess:()=>r.invalidateQueries({queryKey:["tasks"]})}),x=w=>{w&&p(w),u(!0)};return c.jsxs(c.Fragment,{children:[c.jsxs(Ei,{children:[c.jsx("h1",{className:"text-sm font-semibold text-foreground",children:"Tasks"}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["· ",m.length]}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[c.jsxs("div",{className:"flex items-center border border-border rounded-md",children:[c.jsx(K,{variant:s==="list"?"secondary":"ghost",size:"icon",className:"h-7 w-7 rounded-r-none",onClick:()=>i("list"),children:c.jsx(q9,{className:"h-3.5 w-3.5"})}),c.jsx(K,{variant:s==="kanban"?"secondary":"ghost",size:"icon",className:"h-7 w-7 rounded-l-none",onClick:()=>i("kanban"),children:c.jsx(I9,{className:"h-3.5 w-3.5"})})]}),c.jsxs(TE,{open:l,onOpenChange:u,children:[c.jsx(L3,{asChild:!0,children:c.jsxs(K,{size:"sm",className:"h-8",children:[c.jsx(nn,{className:"h-3.5 w-3.5 mr-1.5"})," New Task"]})}),c.jsxs(hb,{className:"sm:max-w-md",children:[c.jsx(pb,{children:c.jsx(mb,{children:"New Task"})}),c.jsxs("form",{onSubmit:w=>{w.preventDefault(),d.trim()&&y.mutate({title:d.trim(),status:h})},className:"space-y-4 mt-2",children:[c.jsx(Je,{placeholder:"Task title…",value:d,onChange:w=>f(w.target.value),autoFocus:!0}),c.jsxs(Zd,{value:h,onValueChange:p,children:[c.jsx(Cc,{children:c.jsx(om,{})}),c.jsxs(Nc,{children:[c.jsx(zn,{value:"no_status",children:"No Status"}),c.jsx(zn,{value:"todo",children:"To do"}),c.jsx(zn,{value:"in_progress",children:"In Progress"}),c.jsx(zn,{value:"done",children:"Done"})]})]}),c.jsx(K,{type:"submit",className:"w-full",disabled:!d.trim()||y.isPending,children:y.isPending?"Creating…":"Create Task"})]})]})]})]})]}),c.jsxs("div",{className:"flex h-full overflow-hidden bg-background",children:[c.jsx(Ye.div,{className:"min-w-0 overflow-y-auto bg-card rounded-r-xl",animate:{flexBasis:o?"calc(100% - 400px)":"100%"},transition:{duration:.25,ease:"easeOut"},style:{flexShrink:0,flexGrow:o?0:1},children:c.jsx("div",{className:"p-6",children:g?c.jsx("div",{className:"text-center py-10 text-muted-foreground text-sm",children:"Loading tasks…"}):m.length===0?c.jsxs("div",{className:"flex flex-col items-center py-20 text-center",children:[c.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:"No tasks yet"}),c.jsxs(K,{size:"sm",onClick:()=>u(!0),children:[c.jsx(nn,{className:"h-3.5 w-3.5 mr-1.5"})," Create your first task"]})]}):s==="list"?c.jsx(z_e,{tasks:m,onTaskClick:a,onStatusToggle:(w,S)=>b.mutate({id:w,done:S})}):c.jsx(W_e,{tasks:m,onTaskClick:a,onAddTask:x})})}),o&&c.jsx(Ye.div,{className:"w-[380px] shrink-0 border-l border-border overflow-hidden h-full",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.25,ease:"easeOut"},children:c.jsx(zW,{taskId:o,onClose:()=>a(null)})})]})]})}function q_e(){const{user:t,teamId:e}=ot(),{toast:n}=ut(),r=xt(),s=Dn(),[i,o]=v.useState(null),{data:a=[],isLoading:l}=ue({queryKey:["notes-all",e],queryFn:async()=>{const{data:m,error:g}=await I.from("notes").select("*, contacts(id, first_name, last_name, team_id)").order("created_at",{ascending:!1});if(g)throw g;return m.filter(y=>!y.contacts||y.contacts.team_id===e)},enabled:!!e}),u=Ee({mutationFn:async()=>{const{data:m,error:g}=await I.from("notes").insert({author_id:t.id,content:""}).select().single();if(g)throw g;return m},onSuccess:m=>{r.invalidateQueries({queryKey:["notes-all"]}),o(m.id)},onError:m=>n({title:"Error",description:m.message,variant:"destructive"})}),d=Ee({mutationFn:async m=>{const{error:g}=await I.from("notes").delete().eq("id",m);if(g)throw g},onSuccess:(m,g)=>{r.invalidateQueries({queryKey:["notes-all"]}),i===g&&o(null),n({title:"Note deleted"})}}),f=m=>{const g=document.createElement("div");return g.innerHTML=m,g.textContent||g.innerText||""},h=a.find(m=>m.id===i),p=h==null?void 0:h.contacts;return c.jsxs(c.Fragment,{children:[c.jsxs(Ei,{children:[c.jsx("h1",{className:"text-sm font-semibold text-foreground",children:"Notes"}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["· ",a.length]}),c.jsx("div",{className:"ml-auto flex items-center gap-2",children:c.jsxs(K,{size:"sm",className:"h-8",onClick:()=>u.mutate(),disabled:u.isPending,children:[c.jsx(nn,{className:"h-3.5 w-3.5 mr-1.5"})," New Note"]})})]}),c.jsxs("div",{className:"flex h-full overflow-hidden bg-background",children:[c.jsx(Ye.div,{className:"min-w-0 overflow-y-auto bg-card rounded-r-xl",animate:{flexBasis:i?"calc(100% - 400px)":"100%"},transition:{duration:.25,ease:"easeOut"},style:{flexShrink:0,flexGrow:i?0:1},children:c.jsx("div",{className:"p-6",children:l?c.jsx("div",{className:"text-center py-10 text-muted-foreground text-sm",children:"Loading notes…"}):a.length===0?c.jsxs("div",{className:"flex flex-col items-center py-20 text-center",children:[c.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:"No notes yet"}),c.jsxs(K,{size:"sm",onClick:()=>u.mutate(),disabled:u.isPending,children:[c.jsx(nn,{className:"h-3.5 w-3.5 mr-1.5"})," Create your first note"]})]}):c.jsx("div",{className:"space-y-0",children:a.map(m=>{const g=f(m.content),y=m.contacts,b=y?`${y.first_name} ${y.last_name||""}`.trim():"";return c.jsxs("div",{className:q("relative flex items-center gap-3 px-3 py-2.5 rounded-md cursor-pointer hover:bg-muted/50 transition-colors group",i===m.id&&"bg-muted"),onClick:()=>o(m.id),children:[c.jsx(nc,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),c.jsx("p",{className:"text-sm text-foreground truncate flex-1",children:g||c.jsx("span",{className:"italic text-muted-foreground
733/50",children:"Empty note"})}),b&&c.jsx("span",{className:"text-xs text-primary hover:underline shrink-0 cursor-pointer",onClick:x=>{x.stopPropagation(),s(`/contacts/${y.id}`)},children:b}),c.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(m.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),c.jsx(K,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive shrink-0",onClick:x=>{x.stopPropagation(),d.mutate(m.id)},children:c.jsx(qs,{className:"h-3 w-3"})})]},m.id)})})})}),i&&c.jsx(Ye.div,{className:"w-[380px] shrink-0 border-l border-border overflow-hidden h-full",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.25,ease:"easeOut"},children:c.jsx(jW,{noteId:i,contactId:(p==null?void 0:p.id)??null,contactName:p?`${p.first_name} ${p.last_name||""}`.trim():"",onClose:()=>o(null),onContactChanged:()=>r.invalidateQueries({queryKey:["notes-all"]})})})]})]})}function K_e(){const{user:t,teamId:e}=ot();return!t||!e?null:c.jsxs("div",{className:"h-[calc(100vh-3.5rem)] flex flex-col",children:[c.jsx(Ei,{children:c.jsx("h1",{className:"text-sm font-medium tracking-tight text-foreground",children:"Files"})}),c.jsx("div",{className:"flex-1 min-h-0",children:c.jsx(UW,{userId:t.id,teamId:e})})]})}const Tg=[{id:"getting-started",title:"Getting Started",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Kitboard is a lightweight CRM built around your people, your boards, and your inbox. The first time you open the app you'll be guided through a short setup."}),c.jsxs("ul",{children:[c.jsx("li",{children:"Sign in with Google or Apple — Kitboard does not use email/password."}),c.jsx("li",{children:"Create your team during onboarding (you become the team owner)."}),c.jsx("li",{children:"Pick a starter template to seed your first board, or start from scratch."}),c.jsxs("li",{children:["Invite teammates from ",c.jsx("em",{children:"Settings → Team"})," at any time."]}),c.jsx("li",{children:"Billing is seat-based — each active member adds one seat."})]})]})},{id:"humans",title:"Humans",body:c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Kitboard calls contacts ",c.jsx("strong",{children:"Humans"}),". Every person you track — clients, leads, collaborators — lives here."]}),c.jsxs("ul",{children:[c.jsxs("li",{children:["Add a Human manually with the ",c.jsx("em",{children:"+ Add Human"})," button on the Humans page."]}),c.jsx("li",{children:"The Humans page uses a split view: list on the left, detail panel on the right."}),c.jsx("li",{children:"Click any field in the detail panel to edit inline — name, email, phone, custom fields."}),c.jsx("li",{children:"See every board the Human appears on, and which column they're currently in."}),c.jsx("li",{children:"The unified timeline merges notes, tasks, files, emails, calendar events, and activity in one feed."}),c.jsx("li",{children:"Tabs split the timeline into Notes, Tasks, Files, Emails, Calendar, and Kit."}),c.jsx("li",{children:"Delete a Human from the detail panel overflow menu — this removes them from every board."})]})]})},{id:"boards",title:"Boards",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Boards are kanban-style pipelines for moving Humans through a process — onboarding, a coaching cohort, a sales pipeline, anything column-shaped."}),c.jsxs("ul",{children:[c.jsx("li",{children:"Create a board from the Boards page; pick a name and an optional template."}),c.jsx("li",{children:"Add columns from the board settings sheet (gear icon top right)."}),c.jsx("li",{children:"Drag Humans between columns; cards reorder by most-recently-updated."}),c.jsxs("li",{children:["Add Humans to a column with the ",c.jsx("em",{children:"+"})," at the top of any column — pick existing Humans or create a new one inline."]}),c.jsx("li",{children:"Click a card to open that Human's full detail panel without leaving the board."}),c.jsx("li",{children:"Rename, archive, or delete a board from the board settings sheet."}),c.jsx("li",{children:"The Dashboard shows your most active board full-width at the top."})]})]})},{id:"tasks",title:"Tasks",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Tasks are todos that can stand on their own or be linked to a Human."}),c.jsxs("ul",{children:[c.jsx("li",{children:"Switch between List view and Kanban view at the top of the Tasks page."}),c.jsxs("li",{children:["Statuses are fixed: ",c.jsx("em",{children:"Todo"}),", ",c.jsx("em",{children:"In Progress"}),", ",c.jsx("em",{children:"Done"}),"."]}),c.jsx("li",{children:"Click a task to open the detail panel with a rich editor for the description."}),c.jsx("li",{children:"Set a due date, assign to a teammate, and link to a Human from the detail panel."}),c.jsx("li",{children:"Tasks linked to a Human appear in that Human's Tasks tab and unified timeline."})]})]})},{id:"notes",title:"Notes",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Notes capture context that doesn't fit in a field — meeting summaries, ideas, history."}),c.jsxs("ul",{children:[c.jsx("li",{children:"Create a note from the Notes page or from a Human's Notes tab."}),c.jsx("li",{children:"The detail panel uses a TipTap rich editor — bold, italics, lists, headings, links."}),c.jsx("li",{children:"Notes appear as compact list rows; the latest snippet previews in the timeline."}),c.jsx("li",{children:"Notes attached to a Human always show on that Human's profile."})]})]})},{id:"files",title:"Files",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Upload PDFs, images, and docs and attach them to a Human."}),c.jsxs("ul",{children:[c.jsx("li",{children:"Maximum file size is 25 MB per upload."}),c.jsx("li",{children:"Files are stored in a private team bucket — only your team can see them."}),c.jsx("li",{children:"Upload from the Files page or directly from a Human's Files tab."}),c.jsx("li",{children:"Click any file to download; use the row menu to delete."})]})]})},{id:"custom-fields",title:"Custom Fields",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Custom fields let you track team-specific data on every Human — birthdays, deal value, renewal dates, anything you need."}),c.jsxs("ul",{children:[c.jsxs("li",{children:["Admins define fields in ",c.jsx("em",{children:"Settings → Custom Fields"}),"."]}),c.jsxs("li",{children:["Field types: ",c.jsx("em",{children:"Text"}),", ",c.jsx("em",{children:"Number"}),", ",c.jsx("em",{children:"Dollar"}),", ",c.jsx("em",{children:"Date"}),"."]}),c.jsxs("li",{children:["Defined fields appear on every Human's detail panel under ",c.jsx("em",{children:"Custom Fields"}),"."]}),c.jsx("li",{children:"Click a field's value to edit inline; press Enter to save, Escape to cancel."}),c.jsx("li",{children:"Dollar values format with currency, dates format human-readable."})]})]})},{id:"kit-integration",title:"Kit.com Integration",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Kitboard syncs two-way with Kit.com (formerly ConvertKit) so your subscribers and their tags stay in lockstep with your Humans."}),c.jsxs("ul",{children:[c.jsxs("li",{children:["Connect from ",c.jsx("em",{children:"Settings → Integrations"})," — authorize via the official Kit OAuth app."]}),c.jsx("li",{children:"Importing is a 3-step flow: pick which subscribers, map tags to fields, confirm."}),c.jsx("li",{children:"Subscribers become Humans; Kit tags and custom fields come along."}),c.jsx("li",{children:"Each synced Human shows a Kit data card with subscriber state, tags, and last activity."}),c.jsx("li",{children:"Changes flow both directions on a schedule — edits in either tool stay in sync."})]})]})},{id:"google-integration",title:"Google Integration",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Connect your personal Google account to see real Gmail threads and Calendar events on each Human."}),c.jsxs("ul",{children:[c.jsxs("li",{children:["Connect from ",c.jsx("em",{children:"Settings → Integrations"}),"; each teammate connects their own Google."]}),c.jsx("li",{children:"The Emails tab on a Human shows recent Gmail threads with that person's address."}),c.jsx("li",{children:"The Calendar tab shows past and upcoming events that include that person."}),c.jsx("li",{children:"All requests proxy through Kitboard — your Google tokens never leave the server."})]})]})},{id:"dashboard",title:"Dashboard",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"The Dashboard is your daily home page when you sign in."}),c.jsxs("ul",{children:[c.jsx("li",{children:"Top: your most active board, full-width and draggable."}
733),c.jsx("li",{children:"Below: a split feed showing recent activity and your upcoming tasks."}),c.jsx("li",{children:"Click any card or row to jump straight into the detail."})]})]})},{id:"settings",title:"Settings",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"The Settings area is split into four tabs."}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Account"})," — your profile, sign out."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Team"})," — invite, remove, and assign roles to teammates; manage seats and billing."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Integrations"})," — connect Kit.com and Google."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Custom Fields"})," — define the fields shown on every Human (admins only)."]})]})]})},{id:"billing",title:"Billing & Subscription",body:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Kitboard uses simple seat-based pricing through Stripe."}),c.jsxs("ul",{children:[c.jsx("li",{children:"Each active team member is one seat — you're charged per seat per month."}),c.jsx("li",{children:"Inviting a new teammate increments your seat count automatically on the next cycle."}),c.jsxs("li",{children:["Manage payment method, invoices, and cancellation through the Stripe customer portal — link from ",c.jsx("em",{children:"Settings → Team"}),"."]}),c.jsx("li",{children:"If a subscription lapses, the app shows a Subscription Required screen until billing is restored."}),c.jsx("li",{children:"We do not issue refunds once a free trial has expired and the subscription has converted to paid. You must cancel before the trial ends to avoid being charged."})]})]})},{id:"feedback",title:"Feedback",body:c.jsx(c.Fragment,{children:c.jsxs("p",{children:["Found a bug or have a feature request? Use the ",c.jsx("em",{children:"Feedback"})," page in the sidebar — it goes straight to the team."]})})}];function n8({title:t="Kitboard Documentation",intro:e="A complete tour of every feature in Kitboard — from your first sign-in to advanced integrations. Use the table of contents to jump to a topic."}){const[n,r]=v.useState(Tg[0].id);return v.useEffect(()=>{const s=new IntersectionObserver(i=>{const o=i.filter(a=>a.isIntersecting).sort((a,l)=>a.boundingClientRect.top-l.boundingClientRect.top)[0];o&&r(o.target.id)},{rootMargin:"-80px 0px -70% 0px",threshold:0});return Tg.forEach(i=>{const o=document.getElementById(i.id);o&&s.observe(o)}),()=>s.disconnect()},[]),c.jsxs("div",{className:"flex gap-12 px-8 py-10 max-w-6xl mx-auto",children:[c.jsx("aside",{className:"hidden md:block w-56 shrink-0",children:c.jsxs("div",{className:"sticky top-20",children:[c.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-3",children:"Contents"}),c.jsx("nav",{className:"flex flex-col gap-1",children:Tg.map(s=>c.jsx("a",{href:`#${s.id}`,className:`text-sm py-1 transition-colors border-l-2 pl-3 -ml-px ${n===s.id?"text-foreground border-primary font-medium":"text-muted-foreground border-transparent hover:text-foreground"}`,children:s.title},s.id))})]})}),c.jsxs("main",{className:"flex-1 min-w-0 max-w-3xl",children:[c.jsxs("header",{className:"mb-12",children:[c.jsx("h1",{className:"text-3xl font-semibold text-foreground tracking-tight",children:t}),c.jsx("p",{className:"mt-3 text-sm text-muted-foreground leading-relaxed",children:e})]}),c.jsx("div",{className:"space-y-2",children:Tg.map(s=>c.jsxs("section",{id:s.id,className:"scroll-mt-20 pt-8 first:pt-0",children:[c.jsx("h2",{className:"text-xl font-semibold text-foreground mb-3",children:s.title}),c.jsx("div",{className:"text-sm text-muted-foreground leading-relaxed space-y-3 [&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1.5 [&_ul]:mt-2 [&_strong]:text-foreground [&_strong]:font-medium [&_em]:text-foreground [&_em]:not-italic [&_em]:font-medium",children:s.body})]},s.id))}),c.jsx("footer",{className:"mt-16 pt-8 border-t border-border text-xs text-muted-foreground",children:"Missing something? Send a note via the Feedback page and we'll add it."})]})]})}function G_e(){return c.jsx(n8,{})}const r8=v.forwardRef(({className:t,...e},n)=>c.jsx("textarea",{className:q("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
733ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));r8.displayName="Textarea";function Y_e(){const[t,e]=v.useState(""),[n,r]=v.useState(!1),{toast:s}=ut(),{user:i}=ot(),o=async()=>{if(t.trim()){r(!0);try{const{error:a}=await I.functions.invoke("send-transactional-email",{body:{templateName:"user-feedback",recipientEmail:"[email protected]",idempotencyKey:`feedback-${i==null?void 0:i.id}-${Date.now()}`,templateData:{userEmail:(i==null?void 0:i.email)??"unknown",feedbackContent:t.trim()}}});if(a)throw a;s({title:"Feedback sent",description:"Thanks for your feedback!"}),e("")}catch{s({title:"Error",description:"Failed to send feedback. Please try again.",variant:"destructive"})}finally{r(!1)}}};return c.jsx("div",{className:"h-full overflow-auto",children:c.jsxs("div",{className:"max-w-lg mx-auto py-10 px-6 space-y-4",children:[c.jsx("h2",{className:"text-lg font-medium text-foreground",children:"Send us feedback"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Let us know what you think — feature requests, bugs, or general thoughts."}),c.jsx(r8,{placeholder:"Your feedback…",value:t,onChange:a=>e(a.target.value),rows:6,className:"resize-none"}),c.jsx(K,{onClick:o,disabled:n||!t.trim(),children:n?"Sending…":"Send feedback"})]})})}const Q_e={initial:{opacity:0}
733,animate:{opacity:1},transition:{duration:.2,ease:"easeOut"}};function J_e(){const{role:t,isLoading:e}=ot();return!e&&t!=="admin"&&t!=="owner"?c.jsx(Eu,{to:"/",replace:!0}):c.jsxs(c.Fragment,{children:[c.jsx(Ei,{children:c.jsx("h1",{className:"text-sm font-semibold text-foreground",children:"Settings"})}),c.jsxs(Ye.div,{...Q_e,className:"p-6 space-y-6",children:[c.jsxs("nav",{className:"flex gap-1 border-b border-border",children:[c.jsx(Mr,{to:"/settings/custom-fields",className:"px-3 py-2 text-sm text-muted-foreground hover:text-foreground border-b-2 border-transparent -mb-px",activeClassName:"text-foreground border-foreground",children:"Custom Fields"}),c.jsx(Mr,{to:"/settings/account",className:"px-3 py-2 text-sm text-muted-foreground hover:text-foreground border-b-2 border-transparent -mb-px",activeClassName:"text-foreground border-foreground",children:"Account"}),c.jsx(Mr,{to:"/settings/team",className:"px-3 py-2 text-sm text-muted-foreground hover:text-foreground border-b-2 border-transparent -mb-px",activeClassName:"text-foreground border-foreground",children:"Team"}),c.jsx(Mr,{to:"/settings/integrations",className:"px-3 py-2 text-sm text-muted-foreground hover:text-foreground border-b-2 border-transparent -mb-px",activeClassName:"text-foreground border-foreground",children:"Integrations"})]}),c.jsx(MB,{})]})]})}const X_e={text:"Text",number:"Number",dollar:"Dollar",date:"Date"};function Z_e(){const{teamId:t}=ot(),{toast:e}=ut(),n=xt(),[r,s]=v.useState(!1),[i,o]=v.useState(""),[a,l]=v.useState("text"),[u,d]=v.useState(null),[f,h]=v.useState(""),{data:p,isLoading:m}=ue({queryKey:["custom_field_definitions",t],queryFn:async()=>{const{data:x,error:w}=await I.from("custom_field_definitions").select("*").eq("team_id",t).order("created_at",{ascending:!0});if(w)throw w;return x},enabled:!!t}),g=Ee({mutationFn:async()=>{const{error:x}=await I.from("custom_field_definitions").insert({team_id:t,name:i.trim(),field_type:a});if(x)throw x},onSuccess:()=>{n.invalidateQueries({queryKey:["custom_field_definitions"]}),o(""),l("text"),s(!1),e({title:"Field created"})},onError:x=>{e({title:"Error",description:x.message,variant:"destructive"})}}),y=Ee({mutationFn:async({id:x,name:w})=>{const{error:S}=await I.from("custom_field_definitions").update({name:w.trim()}).eq("id",x);if(S)throw S},onSuccess:()=>{n.invalidateQueries({queryKey:["custom_field_definitions"]}),d(null),e({title:"Field updated"})},onError:x=>{e({title:"Error",description:x.message,variant:"destructive"})}}),b=Ee({mutationFn:async x=>{const{error:w}=await I.from("custom_field_definitions").delete().eq("id",x);if(w)throw w},onSuccess:()=>{n.invalidateQueries({queryKey:["custom_field_definitions"]}),e({title:"Field deleted"})},onError:x=>{e({title:"Error",description:x.message,variant:"destructive"})}});return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Custom Fields"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Define custom data fields for your contacts."})]}),c.jsxs(K,{variant:"outline",size:"sm",onClick:()=>s(!0),children:[c.jsx(nn,{className:"h-4 w-4 mr-1"})," Add Field"]})]}),r&&c.jsxs("div",{className:"border border-border rounded-md p-4 space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(pt,{htmlFor:"field-name",className:"text-xs",children:"Field Name"}),c.jsx(Je,{id:"field-name",placeholder:"e.g. Deal Value",value:i,onChange:x=>o(x.target.value)})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx(pt,{htmlFor:"field-type",className:"text-xs",children:"Type"}),c.jsxs(Zd,{value:a,onValueChange:l,children:[c.jsx(Cc,{children:c.jsx(om,{})}),c.jsxs(Nc,{children:[c.jsx(zn,{value:"text",children:"Text"}),c.jsx(zn,{value:"number",children:"Number"}),c.jsx(zn,{value:"dollar",children:"Dollar"}),c.jsx(zn,{value:"date",children:"Date"})]})]})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(K,{size:"sm",onClick:()=>g.mutate(),disabled:!i.trim()||g.isPending,children:g.isPending?"Creating…":"Create"}),c.jsx(K,{size:"sm",variant:"ghost",onClick:()=>s(!1),children:"Cancel"})]})]}),m?c.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((x,w)=>c.jsx(vt,{className:"h-12 w-full"},w))}):p&&p.length>0?c.jsx("div",{className:"border border-border rounded-md divide-y divide-border",children:p.map(x=>c.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[u===x.id?c.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[c.jsx(Je,{value:f,onChange:w=>h(w.target.value),className:"h-8 max-w-xs",autoFocus:!0,onKeyDown:w=>{w.key==="Enter"&&f.trim()&&y.mutate({id:x.id,name:f}),w.key==="Escape"&&d(null)}}),c.jsx(K,{size:"sm",variant:"ghost",onClick:()=>y.mutate({id:x.id,name:f}),disabled:!f.trim(),children:"Save"}),c.jsx(K,{size:"sm",variant:"ghost",onClick:()=>d(null),children:"Cancel"})]}):c.jsxs("div",{children:[c.jsx("span",{className:"text-sm font-medium",children:x.name}),c.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:X_e[x.field_type]??x.field_type})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(K,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{d(x.id),h(x.name)},children:c.jsx(XN,{className:"h-3.5 w-3.5"})}),c.jsxs(L_,{children:[c.jsx(F_,{asChild:!0,children:c.jsx(K,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",children:c.jsx(qs,{className:"h-3.5 w-3.5"})})}),c.jsxs($b,{children:[c.jsxs(Vb,{children:[c.jsxs(Ub,{children:['Delete "',x.name,'"?']}),c.jsx(Wb,{children:"This will permanently delete this field and all its values across all contacts."})]}),c.jsxs(zb,{children:[c.jsx(qb,{children:"Cancel"}),c.jsx(Hb,{onClick:()=>b.mutate(x.id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]},x.id))}):c.jsxs("div",{className:"flex flex-col items-center py-12 text-center",children:[c.jsx(H9,{className:"h-8 w-8 text-muted-foreground mb-2"}),c.jsx("p",{className:"text-muted-foreground mb-3",children:"No custom fields defined yet."}),c.jsxs(K,{variant:"outline",size:"sm",onClick:()=>s(!0),children:[c.jsx(nn,{className:"h-4 w-4 mr-1"})," Add your first field"]})]})]})}const eTe=()=>{const t=Bi();return v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),c.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),c.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};function tTe(){const[t,e]=v.useState(!1),{toast:n}=ut(),r=async()=>{e(!0);try{const{data:s,error:i}=await I.functions.invoke("customer-portal");if(i)throw i;if(s!=null&&s.error)throw new Error(s.error);window.open(s.url,"_blank")}catch(s){n({title:"Error",description:s.message,variant:"destructive"})}finally{e(!1)}};return c.jsxs(K,{variant:"outline",onClick:r,disabled:t,children:[t?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-2"}):c.jsx(QN,{className:"h-4 w-4 mr-2"}),"Manage Subscription"]})}function nTe(){const{user:t}=ot(),e=Dn(),{toast:n}=ut(),r=xt(),{data:s}=ue({queryKey:["profile",t==null?void 0:t.id],queryFn:async()=>{const{data:f,error:h}=await I.from("profiles").select("first_name, last_name").eq("id",t.id).single();if(h)throw h;return f},enabled:!!(t!=null&&t.id)}),[i,o]=v.useState(""),[a,l]=v.useState("");v.useEffect(()=>{s&&(o(s.first_name),l(s.last_name))},[s]);const u=Ee({mutationFn:async()=>{const{error:f}=await I.from("profiles").update({first_name:i.trim(),last_name:a.trim()}).eq("id",t.id);if(f)throw f},onSuccess:()=>{r.invalidateQueries({queryKey:["profile",t==null?void 0:t.id]}),n({title:"Profile updated"})},onError:f=>{n({title:"Error",description:f.message,variant:"destructive"})}}),d=async()=>{await I.auth.signOut(),e("/login")};return c.jsxs("div",{className:"space-y-6 max-w-md",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"firstName",children:"First Name"}),c.jsx(Je,{id:"firstName",value:i,onChange:f=>o(f.target.value)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{htmlFor:"lastName",children:"Last Name"}),c.jsx(Je,{id:"lastName",value:a,onChange:f=>l(f.target.value)})]})]}),c.jsx(K,{onClick:()=>u.mutate(),disabled:u.isPending,size:"sm",children:"Save Name"}),c.jsxs("div",{className:"border-t border-border pt-6 space-y-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("label",{className:"text-sm text-muted-foreground",children:"Email"}),c.jsx("p",{className:"text-sm font-medium text-foreground",children:(t==null?void 0:t.email)??"—"})]}),c.jsx(tTe,{})]}),c.jsx("div",{className:"border-t border-border pt-6",children:c.jsxs(K,{variant:"outline",onClick:d,children:[c.jsx(yF,{className:"h-4 w-4 mr-2"}),"Sign out"]})})]})}function rTe(){const{user:t,teamId:e,role:n}=ot(),{toast:r}=ut(),s=xt(),[i,o]=v.useState(!1),[a,l]=v.useState(""),[u,d]=v.useState(""),[f,h]=v.useState(""),[p,m]=v.useState("editor"),g=n==="admin"||n==="owner",{data:y=[],isLoading:b}=ue({queryKey:["team-members",e],queryFn:async()=>
733{if(!e)return[];const{data:P,error:j}=await I.from("team_members").select("id, user_id, role").eq("team_id",e);if(j)throw j;const F=P.map(A=>A.user_id),{data:B}=await I.rpc("get_user_emails",{_user_ids:F}),{data:U}=await I.from("profiles").select("id, first_name, last_name, avatar_url").in("id",F),D=new Map((U??[]).map(A=>[A.id,A])),L=new Map((B??[]).map(A=>[A.user_id,A.email]));return P.map(A=>{const O=D.get(A.user_id);return{...A,email:L.get(A.user_id)??"",first_name:(O==null?void 0:O.first_name)??"",last_name:(O==null?void 0:O.last_name)??"",avatar_url:(O==null?void 0:O.avatar_url)??null}})},enabled:!!e}),x=Ee({mutationFn:async({memberId:P,newRole:j})=>{const{error:F}=await I.from("team_members").update({role:j}).eq("id",P);if(F)throw F},onSuccess:()=>{s.invalidateQueries({queryKey:["team-members",e]}),r({title:"Role updated"})},onError:P=>{r({title:"Error",description:P.message,variant:"destructive"})}}),w=Ee({mutationFn:async P=>{const{error:j}=await I.from("team_members").delete().eq("id",P);if(j)throw j},onSuccess:()=>{s.invalidateQueries({queryKey:["team-members",e]}),r({title:"Team member removed"})},onError:P=>{r({title:"Error",description:P.message,variant:"destructive"})}}),[S,C]=v.useState(null),k=async()=>{try{const{data:P,error:j}=await I.functions.invoke("update-seat-count",{body:{team_id:e,new_quantity:(y.length||1)+1}});if(j||P!=null&&P.error)throw new Error((P==null?void 0:P.error)||(j==null?void 0:j.message));C(null),N.mutate()}catch(P){r({title:"Error adding seat",description:P.message,variant:"destructive"})}},N=Ee({mutationFn:async()=>{const{data:P,error:j}=await I.functions.invoke("invite-team-member",{body:{email:a.trim(),first_name:u.trim(),last_name:f.trim(),role:p,team_id:e}});if(j)throw j;if((P==null?void 0:P.error)==="SEAT_LIMIT_REACHED")throw C(P.message),new Error(P.message);if(P!=null&&P.error)throw new Error(P.error)},onSuccess:()=>{s.invalidateQueries({queryKey:["team-members",e]}),o(!1),l(""),d(""),h(""),m("editor"),C(null),r({title:"Invitation sent"})},onError:P=>{S||r({title:"Error",description:P.message,variant:"destructive"})}}),E=async(P,j,F)=>{const B=F.name.split(".").pop(),U=`${j}.${B}`,{error:D}=await I.storage.from("avatars").upload(U,F,{upsert:!0});if(D){r({title:"Upload failed",description:D.message,variant:"destructive"});return}const{data:{publicUrl:L}}=I.storage.from("avatars").getPublicUrl(U),{error:A}=await I.from("profiles").update({avatar_url:L}).eq("id",j);if(A){r({title:"Error",description:A.message,variant:"destructive"});return}s.invalidateQueries({queryKey:["team-members",e]}),r({title:"Avatar updated"})},_=(P,j,F)=>{var B;return P||j?`${(P==null?void 0:P[0])??""}${(j==null?void 0:j[0])??""}`.toUpperCase():((B=F==null?void 0:F[0])==null?void 0:B.toUpperCase())??"?"},T=P=>`${P.first_name} ${P.last_name}`.trim()||P.email;return b?c.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading team…"}):c.jsxs("div",{className:"space-y-6 max-w-2xl",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Team Members"}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[y.length," member",y.length!==1?"s":""]})]}),g&&c.jsxs(TE,{open:i,onOpenChange:o,children:[c.jsx(L3,{asChild:!0,children:c.jsxs(K,{size:"sm",children:[c.jsx(ZN,{className:"h-4 w-4 mr-2"}),"Invite"]})}),c.jsxs(hb,{children:[c.jsx(pb,{children:c.jsx(mb,{children:"Invite Team Member"})}),c.jsxs("div",{className:"space-y-4 pt-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{children:"Email"}),c.jsx(Je,{type:"email",value:a,onChange:P=>l(P.target.value),placeholder:"[email protected]"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{children:"First Name"}),c.jsx(Je,{value:u,onChange:P=>d(P.target.value)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{children:"Last Name"}),c.jsx(Je,{value:f,onChange:P=>h(P.target.value)})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(pt,{children:"Role"}),c.jsxs(Zd,{value:p,onValueChange:m,children:[c.jsx(Cc,{children:c.jsx(om,{})}),c.jsxs(Nc,{children:[c.jsx(zn,{value:"admin",children:"Admin"}),c.jsx(zn,{value:"editor",children:"Editor"})]})]})]}),S&&c.jsxs("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 p-3 space-y-2",children:[c.jsx("p",{className:"text-sm text-destructive",children:S}),c.jsx(K,{size:"sm",variant:"outline",onClick:k,children:"Add seat & send invite"})]}),c.jsx(K,{onClick:()=>{C(null),N.mutate()},disabled:!a.trim()||N.isPending,className:"w-full",children:N.isPending?"Sending…":"Send Invitation"})]})]})]})]}),c.jsx("div",{className:"border border-border rounded-md divide-y divide-border",children:y.map(P=>c.jsx(sTe,{member:P,isAdmin:g,isSelf:P.user_id===(t==null?void 0:t.id),onRoleChange:j=>x.mutate({memberId:P.id,newRole:j}),onRemove:()=>w.mutate(P.id),onUploadAvatar:j=>E(P.id,P.user_id,j),getInitials:_,getDisplayName:T},P.id))})]})}function sTe({member:t,isAdmin:e,isSelf:n,onRoleChange:r,onRemove:s,onUploadAvatar:i,getInitials:o,getDisplayName:a}){const l=v.useRef(null),u=d=>{var h;const f=(h=d.target.files)==null?void 0:h[0];f&&(i(f),d.target.value="")};return c.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[c.jsxs("div",{className:"relative group",children:[c.jsxs(D_,{className:"h-9 w-9",children:[c.jsx(az,{src:t.avatar_url??void 0}),c.jsx(I_,{className:"text-xs bg-muted text-muted-foreground",children:o(t.first_name,t.last_name,t.email)})]}),e&&c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>{var d;return(d=l.current)==null?void 0:d.click()}
733,className:"absolute inset-0 rounded-full bg-foreground/60 text-background opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:c.jsx(P9,{className:"h-3.5 w-3.5"})}),c.jsx("input",{ref:l,type:"file",accept:"image/*",className:"hidden",onChange:u})]})]}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("p",{className:"text-sm font-medium text-foreground truncate",children:[a(t),n&&c.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"(you)"})]}),c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.email})]}),c.jsx("div",{className:"flex items-center gap-2",children:e&&!n&&t.role!=="owner"?c.jsxs(c.Fragment,{children:[c.jsxs(Zd,{value:t.role,onValueChange:r,children:[c.jsx(Cc,{className:"h-8 w-[100px] text-xs",children:c.jsx(om,{})}),c.jsxs(Nc,{children:[c.jsx(zn,{value:"admin",children:"Admin"}),c.jsx(zn,{value:"editor",children:"Editor"})]})]}),c.jsx(K,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:s,children:c.jsx(qs,{className:"h-3.5 w-3.5"})})]}):c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground px-2",children:[c.jsx(e7,{className:"h-3 w-3"}),c.jsx("span",{className:"capitalize",children:t.role})]})})]})}function iTe(){const{teamId:t,role:e,user:n}=ot(),{toast:r}=ut(),s=xt(),[i,o]=kc();v.useEffect(()=>{const y=i.get("kit");if(y==="connected")r({title:"Kit.com connected successfully!"}),i.delete("kit"),o(i,{replace:!0});else if(y==="error"){const x=i.get("reason")||"unknown";r({title:"Kit.com connection failed",description:`Error: ${x}. Please try again.`,variant:"destructive"}),i.delete("kit"),i.delete("reason"),o(i,{replace:!0})}const b=i.get("google");if(b==="connected")r({title:"Google connected successfully!"}),s.invalidateQueries({queryKey:["google-connection"]}),i.delete("google"),o(i,{replace:!0});else if(b==="error"){const x=i.get("reason")||"unknown";r({title:"Google connection failed",description:`Error: ${x}. Please try again.`,variant:"destructive"}),i.delete("google"),i.delete("reason"),o(i,{replace:!0})}},[i,o,r,s]);const{data:a,isLoading:l}=ue({queryKey:["kit-connection",t],queryFn:async()=>{const{data:y,error:b}=await I.from("kit_connections").select("*").eq("team_id",t).maybeSingle();if(b)throw b;return y},enabled:!!t}),{data:u,isLoading:d}=ue({queryKey:["google-connection"],queryFn:async()=>{const{data:y,error:b}=await I.from("google_connections").select("*").maybeSingle();if(b)throw b;return y},enabled:!!n}),f=Ee({mutationFn:async()=>{const{data:y,error:b}=await I.functions.invoke("kit-oauth-start",{body:{return_url:window.location.origin}});if(b)throw b;if(y!=null&&y.error)throw new Error(y.error);return y.url},onSuccess:y=>{window.location.href=y},onError:y=>{r({title:"Failed to start Kit connection",description:y.message,variant:"destructive"})}}),h=Ee({mutationFn:async()=>{const{error:y}=await I.from("kit_connections").delete().eq("team_id",t);if(y)throw y},onSuccess:()=>{s.invalidateQueries({queryKey:["kit-connection"]}),r({title:"Kit.com disconnected"})},onError:y=>{r({title:"Failed to disconnect",description:y.message,variant:"destructive"})}}),p=Ee({mutationFn:async()=>{const{data:y,error:b}=await I.functions.invoke("google-oauth-start",{body:{return_url:window.location.origin}});if(b)throw b;if(y!=null&&y.error)throw new Error(y.error);return y.url},onSuccess:y=>{window.location.href=y},onError:y=>{r({title:"Failed to start Google connection",description:y.message,variant:"destructive"})}}),m=Ee({mutationFn:async()=>{const{error:y}=await I.from("google_connections").delete().eq("user_id",n.id);if(y)throw y},onSuccess:()=>{s.invalidateQueries({queryKey:["google-connection"]}),r({title:"Google disconnected"})},onError:y=>{r({title:"Failed to disconnect",description:y.message,variant:"destructive"})}});if(l||d)return c.jsxs("div",{className:"space-y-4",children:[c.jsx(vt,{className:"h-32 w-full"}),c.jsx(vt,{className:"h-32 w-full"})]});const g=e==="admin"||e==="owner";return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Integrations"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect third-party services to enhance your KitBoard experience."})]}),c.jsxs("div",{className:"border border-border rounded-lg p-5 space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"h-10 w-10 rounded-lg bg-white flex items-center justify-center border border-border",children:c.jsxs("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",children:[c.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),c.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),c.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),c.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Google"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"View Gmail threads and Calendar events with your contacts"})]})]}),u&&c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",children:[c.jsx(By,{className:"h-3 w-3"}),"Connected"]})]}),u?c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"bg-muted/50 rounded-md p-3 text-sm space-y-1",children:[u.google_email&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Account"}),c.jsx("span",{className:"font-medium text-foreground",children:u.google_email})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Connected"}),c.jsx("span",{className:"font-medium text-foreground",children:u.connected_at?Ze(new Date(u.connected_at),"MMM d, yyyy"):"Unknown"})]})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Your personal Google connection. Email and calendar data is only visible to you."}),c.jsxs(K,{variant:"outline",size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,className:"text-destructive hover:text-destructive",children:[m.isPending?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-1"}):c.jsx(Cj,{className:"h-4 w-4 mr-1"}),"Disconnect"]})]}):c.jsx("div",{children:c.jsxs(K,{onClick:()=>p.mutate(),disabled:p.isPending,size:"sm",children:[p.isPending?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-1"}):c.jsx(Kh,{className:"h-4 w-4 mr-1"}),"Connect Google"]})})]}),c.jsxs("div",{className:"border border-border rounded-lg p-5 space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("img",{src:Ib,alt:"Kit",className:"h-10 w-10 rounded-lg object-cover"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Kit.com"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Import your Kit.com email subscribers as KitBoard contacts"})]})]}),a&&c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",children:[c.jsx(By,{className:"h-3 w-3"}),"Connected"]})]}),a?c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"bg-muted/50 rounded-md p-3 text-sm space-y-1",children:[a.kit_account_name&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Account"}),c.jsx("span",{className:"font-medium text-foreground",children:a.kit_account_name})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Connected"}),c.jsx("span",{className:"font-medium text-foreground",children:a.connected_at?Ze(new Date(a.connected_at),"MMM d, yyyy"):"Unknown"})]})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"You can now import Kit subscribers from the Add Contact dialog on the Contacts page."}),g&&c.jsxs(K,{variant:"outline",size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,className:"text-destructive hover:text-destructive",children:[h.isPending?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-1"}):c.jsx(Cj,{className:"h-4 w-4 mr-1"}),"Disconnect"]})]}):c.jsx("div",{children:g?c.jsxs(K,{onClick:()=>f.mutate(),disabled:f.isPending,size:"sm",children:[f.isPending?c.jsx(gt,{className:"h-4 w-4 animate-spin mr-1"}):c.jsx(Kh,{className:"h-4 w-4 mr-1"}),"Connect Kit.com"]}):c.jsx("p",{className:"text-sm text-muted-foreground",children:"Ask a team admin to connect Kit.com."})})]})]})}function oTe(){const[t]=kc(),e=t.get("token"),[n,r]=v.useState("loading"),[s,i]=v.useState(!1);v.useEffect(()=>{if(!e){r("invalid");return}fetch(`https://pfclmiclwkmsmhpiioqc.supabase.co/functions/v1/handle-email-unsubscribe?token=${e}`,{headers:{apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBmY2xtaWNsd2ttc21ocGlpb3FjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzMwMjA5NDEsImV4cCI6MjA4ODU5Njk0MX0.YWTjX0j1y-YHVrlTXYSRXw6Tmq6nsJ6EbxEu3uvMYFA"}}).then(u=>u.json()).then(u=>{u.valid===!1&&u.reason==="already_unsubscribed"?r("already"):u.valid?r("valid"):r("invalid")}).catch(()=>r("error"))},[e]);const o=async()=>{i(!0);try{const{data:a,error:l}=await I.functions.invoke("handle-email-unsubscribe",{body:{token:e}});if(l)throw l;a!=null&&a.success?r("success"):(a==null?void 0:a.reason)==="already_unsubscribed"?r("already"):r("error")}catch{r("error")}i(!1)};return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx(Bs,{className:"w-full max-w-md",children:c.jsxs(fh,{className:"p-8 text-center space-y-4",children:[n==="loading"&&c.jsx("p",{className:"text-muted-foreground",children:"Verifying…"}),n==="valid"&&c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-xl font-semibold",children:"Unsubscribe"}),c.jsx("p",{className:"text-muted-foreground",children:"Are you sure you want to unsubscribe from KitBoard emails?"}),c.jsx(K,{onClick:o,disabled:s,children:s?"Processing…":"Confirm Unsubscribe"})]}),n==="success"&&c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-xl font-semibold",children:"Unsubscribed"}),c.jsx("p",{className:"text-muted-foreground",children:"You've been successfully unsubscribed."})]}),n==="already"&&c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-xl font-semibold",children:"Already Unsubscribed"}),c.jsx("p",{className:"text-muted-foreground",children:"This email has already been unsubscribed."})]}),n==="invalid"&&c.jsx("p",{className:"text-muted-foreground",children:"Invalid or expired unsubscribe link."}),n==="error"&&c.jsx("p",{className:"text-destructive",children:"Something went wrong. Please try again later."})]})})})}function aTe(){const[t]=kc(),[e,n]=v.useState("loading"),[r,s]=v.useState(null),[i,o]=v.useState(!1),[a,l]=v.useState(!1);v.useEffect(()=>{const d=t.get("redirect_to")||t.get("redirect_uri")||t.get("redirect"),f=t.get("state");d&&Tle(d,f)},[t]),v.useEffect(()=>{let d=!1;return(async()=>{try{if(!p_()){d||(n("error"),s("This page is the entry point for installing KitBoard from the Kit App Store. It looks like you arrived here directly. Please start from your Kit App Store."));return}if(t.get("status")==="connected"){d||n("redirecting"),sM();return}const{data:{session:p}}=await I.auth.getSession();if(!(p!=null&&p.user)){d||n("needs_auth");return}const[{data:m},{data:g}]=await Promise.all([I.from("profiles").select("onboarded").eq("id",p.user.id).maybeSingle(),I.from("team_members").select("team_id").eq("user_id",p.user.id).maybeSingle()]);if(!(m!=null&&m.onboarded)||!(g!=null&&g.team_id)){d||n("needs_onboarding"),window.location.href="/onboarding";return}const{data:y}=await I.from("kit_connections").select("id").eq("team_id",g.team_id).maybeSingle();if(y){d||n("redirecting"),sM();return}d||n("connecting_kit");const{data:b,error:x}=await I.functions.invoke("kit-oauth-start",{body:{return_url:window.location.origin,install_mode:!0}});if(x)throw x;if(b!=null&&b.error)throw new Error(b.error);if(!(b!=null&&b.url))throw new Error("Failed to start Kit OAuth");window.location.href=b.url}catch(h){if(d)return;n("error"),s((h==null?void 0:h.message)||"Something went wrong")}})(),()=>{d=!0}},[t]);const u=async d=>{const f=d==="google"?o:l;f(!0);try{const h=await h_.auth.signInWithOAuth(d,{redirect_uri:window.location.origin});if(h.error){Fr.error(h.error.message||`${d} sign-in failed`),f(!1);return}if(h.redirected)return;window.location.reload()}catch(h){Fr.error(h.message||`${d} sign-in failed`),f(!1)}};return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:c.jsxs(Ye.div,{initial:{opacity:0,y:8}
733,animate:{opacity:1,y:0},transition:{duration:.25},className:"w-full max-w-sm space-y-6 text-center",children:[c.jsxs("div",{className:"flex items-center justify-center gap-3",children:[c.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center text-sm font-semibold text-primary",children:"KB"}),c.jsx("span",{className:"text-muted-foreground",children:"+"}),c.jsx("img",{src:Ib,alt:"Kit",className:"h-10 w-10 rounded-lg object-cover"})]}),e==="loading"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground mx-auto"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Setting up your install…"})]}),e==="needs_auth"&&c.jsxs("div",{className:"space-y-5",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h1",{className:"text-2xl font-medium tracking-tight text-foreground",children:"Install KitBoard for Kit"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in or create your KitBoard account to finish installing."})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(K,{type:"button",variant:"outline",className:"w-full",onClick:()=>u("google"),disabled:i||a,children:i?"Signing in…":"Continue with Google"}),c.jsx(K,{type:"button",variant:"outline",className:"w-full",onClick:()=>u("apple"),disabled:i||a,children:a?"Signing in…":"Continue with Apple"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"We'll bring you back to Kit as soon as you're set up."})]}),e==="needs_onboarding"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground mx-auto"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Finishing your KitBoard setup…"})]}),e==="connecting_kit"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx(gt,{className:"h-6 w-6 animate-spin text-muted-foreground mx-auto"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting your Kit account…"})]}),e==="redirecting"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx(By,{className:"h-6 w-6 text-primary mx-auto"}),c.jsx("p",{className:"text-sm text-foreground",children:"Install complete — sending you back to Kit…"})]}),e==="error"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-sm text-destructive",children:r}),c.jsx(K,{variant:"outline",onClick:()=>window.location.reload(),children:"Try again"})]})]})})}function lTe(){return v.useEffect(()=>{const t=document.title;document.title="Kitboard Support — Help & Documentation";const e=document.querySelector('meta[name="description"]')||(()=>{const r=document.createElement("meta");return r.setAttribute("name","description"),document.head.appendChild(r),r})(),n=e.getAttribute("content");return e.setAttribute("content","Kitboard support and documentation — learn every feature: Humans, Boards, Tasks, Notes, Files, Custom Fields, and Kit.com & Google integrations."),()=>{document.title=t,n!==null&&e.setAttribute("content",n)}},[]),c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx("header",{className:"h-14 border-b border-border",children:c.jsxs("div",{className:"max-w-6xl mx-auto h-full flex items-center justify-between px-8",children:[c.jsx($e,{to:"/",className:"text-sm font-semibold tracking-tight text-foreground",children:"Kitboard"}),c.jsxs("nav",{className:"flex items-center gap-6 text-sm",children:[c.jsx($e,{to:"/",className:"text-muted-foreground hover:text-foreground transition-colors",children:"Home"}),c.jsx($e,{to:"/login",className:"text-foreground font-medium hover:text-primary transition-colors",children:"Sign in"})]})]})}),c.jsx("div",{className:"flex-1",children:c.jsx(n8,{title:"Kitboard Support",intro:"Everything you need to know about using Kitboard. Browse the topics below or jump to a section using the table of contents."})}),c.jsx("footer",{className:"border-t border-border",children:c.jsxs("div",{className:"max-w-6xl mx-auto px-8 py-6 flex items-center justify-between text-xs text-muted-foreground",children:[c.jsxs("span",{children:["© ",new Date().getFullYear()," Kitboard"]}),c.jsx($e,{to:"/",className:"hover:text-foreground transition-colors",children:"kitboard.co"})]})})]})}const cTe="May 15, 2026";function uTe(){return v.useEffect(()=>{const t=document.title;document.title="Privacy Policy — Kitboard";const e=document.querySelector('meta[name="description"]')||(()=>{const r=document.createElement("meta");return r.setAttribute("name","description"),document.head.appendChild(r),r})(),n=e.getAttribute("content");return e.setAttribute("content","How Kitboard collects, uses, shares, and protects your information."),()=>{document.title=t,n!==null&&e.setAttribute("content",n)}},[]),c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx("header",{className:"h-14 border-b border-border",children:c.jsxs("div",{className:"max-w-6xl mx-auto h-full flex items-center justify-between px-8",children:[c.jsx($e,{to:"/",className:"text-sm font-semibold tracking-tight text-foreground",children:"Kitboard"}),c.jsxs("nav",{className:"flex items-center gap-6 text-sm",children:[c.jsx($e,{to:"/",className:"text-muted-foreground hover:text-foreground transition-colors",children:"Home"}),c.jsx($e,{to:"/support",className:"text-muted-foreground hover:text-foreground transition-colors",children:"Support"}),c.jsx($e,{to:"/login",className:"text-foreground font-medium hover:text-primary transition-colors",children:"Sign in"})]})]})}),c.jsx("main",{className:"flex-1",children:c.jsxs("article",{className:"max-w-3xl mx-auto px-8 py-12",children:[c.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-foreground",children:"Privacy Policy"}),c.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Last updated: ",cTe]}),c.jsxs("div",{className:"mt-10 text-sm text-muted-foreground leading-relaxed space-y-4 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:text-foreground [&_h2]:mt-10 [&_h2]:mb-3 [&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1.5 [&_ul]:mt-2 [&_strong]:text-foreground [&_strong]:font-medium [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",children:[c.jsx("h2",{children:"Introduction"}),c.jsx("p",{children:"Kitboard (“Kitboard,” “we,” “us,” or “our”) provides a customer relationship management application that helps creators and small teams organize the people they work with. This Privacy Policy explains what information we collect when you use the Kitboard 
733website and application (the “Service”), how we use it, who we share it with, and the choices you have. By using the Service you agree to the practices described here."}),c.jsx("h2",{children:"Information we collect"}),c.jsx("p",{children:"We collect the following categories of information:"}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Account information."})," When you sign in with Google or Apple, we receive your name, email address, profile picture, and a unique account identifier from the provider. We do not collect or store passwords."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Team and billing information."})," Team name, role assignments, subscription status, and the number of paid seats. Payment details (card number, billing address) are collected and stored by our payment processor, Stripe, not by Kitboard."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Content you create."})," Records you add to the Service such as Humans (contacts), notes, tasks, files you upload, custom field values, and board structures."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Integration data."})," If you connect Kit.com, we access subscribers, tags, and custom fields on your behalf. If you connect Google, we access Gmail message metadata, message content, and Calendar events associated with the people you view in Kitboard. We only access this data to display it inside Kitboard and keep it in sync."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Usage and device data."})," Server logs, IP address, browser type, operating system, referring URLs, and basic product analytics events used to operate, secure, and improve the Service."]})]}),c.jsx("h2",{children:"How we use your information"}),c.jsxs("ul",{children:[c.jsx("li",{children:"To provide, maintain, and improve the Service."}),c.jsx("li",{children:"To synchronize data with the integrations you connect."}),c.jsx("li",{children:"To process payments and manage your subscription."}),c.jsx("li",{children:"To respond to support requests and communicate service updates."}),c.jsx("li",{children:"To detect, prevent, and address fraud, abuse, and security incidents."}),c.jsx("li",{children:"To comply with legal obligations."})]}),c.jsx("p",{children:"We do not sell your personal information, and we do not use the contents of your Gmail messages or your contacts to train machine-learning models."}),c.jsx("h2",{children:"How we share information"}),c.jsx("p",{children:"We share information only as needed to operate the Service:"}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Service providers."})," We use trusted vendors to host and run Kitboard, including Lovable Cloud (database, file storage, authentication), Stripe (payments), Google (Gmail and Calendar integration), Kit.com (subscriber sync), and Resend (transactional email). These providers act on our instructions and are bound by confidentiality and data-protection obligations."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Within your team."})," Content you create in a team workspace is visible to other members of that team according to their role."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Legal compliance."})," We may disclose information if required by law, subpoena, or other legal process, or to protect the rights, safety, or property of Kitboard, our users, or the public."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Business transfers."})," If Kitboard is involved in a merger, acquisition, or sale of assets, your information may be transferred as part of that transaction. We will notify you before your information becomes subject to a different privacy policy."]})]}),c.jsx("p",{children:"We do not sell your personal information to third parties."}),c.jsx("h2",{children:"Data retention"}),c.jsx("p",{children:"We retain your information for as long as your account is active or as needed to provide the Service. When you delete your account, we delete or de-identify your personal information within 30 days, except where we are required to retain it to comply with legal obligations, resolve disputes, or enforce our agreements."}),c.jsx("h2",{children:"Security"}),c.jsx("p",{children:"We protect your data with industry-standard measures, including encryption in transit (TLS) and at rest, row-level access controls that isolate each team's data, and scoped OAuth tokens for third-party integrations. No system is perfectly secure;
733 if we become aware of a breach affecting your information we will notify you in accordance with applicable law."}),c.jsx("h2",{children:"Your rights"}),c.jsx("p",{children:"Depending on where you live, you may have the right to access, correct, export, or delete the personal information we hold about you, to object to or restrict certain processing, and to withdraw consent. You can exercise most of these rights directly in the app, or by contacting us at the address below. We will respond within the time required by applicable law (typically 30 days)."}),c.jsx("p",{children:"California residents have additional rights under the CCPA, including the right to know what categories of personal information we collect and to request deletion. EU/UK residents have rights under the GDPR/UK GDPR, including the right to lodge a complaint with their local supervisory authority."}),c.jsx("h2",{children:"Third-party integrations"}),c.jsx("p",{children:"When you connect a third-party service to Kitboard, that service's own privacy policy governs how it handles your data:"}),c.jsxs("ul",{children:[c.jsxs("li",{children:["Google —"," ",c.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noreferrer",children:"policies.google.com/privacy"})]}),c.jsxs("li",{children:["Kit.com —"," ",c.jsx("a",{href:"https://kit.com/privacy",target:"_blank",rel:"noreferrer",children:"kit.com/privacy"})]}),c.jsxs("li",{children:["Stripe —"," ",c.jsx("a",{href:"https://stripe.com/privacy",target:"_blank",rel:"noreferrer",children:"stripe.com/privacy"})]}),c.jsxs("li",{children:["Apple —"," ",c.jsx("a",{href:"https://www.apple.com/legal/privacy",target:"_blank",rel:"noreferrer",children:"apple.com/legal/privacy"})]})]}),c.jsxs("p",{children:["Kitboard's use and transfer of information received from Google APIs adheres to the"," ",c.jsx("a",{href:"https://developers.google.com/terms/api-services-user-data-policy",target:"_blank",rel:"noreferrer",children:"Google API Services User Data Policy"}),", including the Limited Use requirements."]}),c.jsx("h2",{children:"Cookies and tracking"}),c.jsx("p",{children:"We use a small number of essential cookies to keep you signed in and remember your preferences. We may also use privacy-respecting product analytics to understand how the Service is used. We do not use cross-site advertising cookies."}),c.jsx("h2",{children:"Children's privacy"}),c.jsx("p",{children:"Kitboard is not directed to children under 16, and we do not knowingly collect personal information from children. If you believe a child has provided us with personal information, please contact us and we will delete it."}),c.jsx("h2",{children:"International data transfers"}),c.jsx("p",{children:"Kitboard is operated from the United States, and the data we collect is processed and stored on servers located in the United States and other countries where our service providers operate. Where required, we rely on appropriate safeguards such as Standard Contractual Clauses for international transfers of personal data."}),c.jsx("h2",{children:"Changes to this policy"}),c.jsx("p",{children:"We may update this Privacy Policy from time to time. When we make material changes, we will update the “Last updated” date above and, where appropriate, notify you by email or in the app. Your continued use of the Service after the changes take effect constitutes acceptance of the updated policy."}),c.jsx("h2",{children:"Contact us"}),c.jsxs("p",{children:["Questions about this Privacy Policy or your information? Email us at"," ",c.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]})]})]})}),c.jsx("footer",{className:"border-t border-border",children:c.jsxs("div",{className:"max-w-6xl mx-auto px-8 py-6 flex items-center justify-between text-xs text-muted-foreground",children:[c.jsxs("span",{children:["© ",new Date().getFullYear()," Kitboard"]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx($e,{to:"/support",className:"hover:text-foreground transition-colors",children:"Support"}),c.jsx($e,{to:"/privacy",className:"hover:text-foreground transition-colors",children:"Privacy"})]})]})})]})}const dTe=new vQ,fTe=()=>c.jsx(kQ,{client:dTe,children:c.jsxs(iB,{children:[c.jsx(I7,{}),c.jsx(pG,{}),c.jsx(MJ,{children:c.jsxs(CJ,{children:[c.jsx(Xe,{path:"/",element:c.jsx(Fue,{})}),c.jsx(Xe,{path:"/marketing",element:c.jsx(rle,{})}),c.jsx(Xe,{path:"/login",element:c.jsx(ble,{})}),c.jsx(Xe,{path:"/forgot-password",element:c.jsx(Cle,{})}),c.jsx(Xe,{path:"/reset-password",element:c.jsx(Ele,{})}),c.jsx(Xe,{path:"/signup",element:c.jsx(jle,{})}),c.jsx(Xe,{path:"/auth/callback",element:c.jsx(Rle,{})}),c.jsx(Xe,{path:"/create-team",element:c.jsx(Eu,{to:"/onboarding",replace:!0})}),c.jsx(Xe,{path:"/onboarding",element:c.jsx(Ile,{})}),c.jsx(Xe,{path:"/subscription-required",element:c.jsx(Lle,{})}),c.jsx(Xe,{path:"/checkout-success",element:c.jsx(Fle,{})}),c.jsx(Xe,{path:"/unsubscribe",element:c.jsx(oTe,{})}),c.jsx(Xe,{path:"/kit/install",element:c.jsx(aTe,{})}),c.jsx(Xe,{path:"/support",element:c.jsx(lTe,{})}),c.jsx(Xe,{path:"/privacy",element:c.jsx(uTe,{})}),c.jsxs(Xe,{element:c.jsx(kne,{}),children:[c.jsx(Xe,{path:"/dashboard",element:c.jsx(Pue,{})}),c.jsx(Xe,{path:"/contacts",element:c.jsx(Dfe,{})}),c.jsx(Xe,{path:"/contacts/:id",element:c.jsx(oSe,{})}),c.jsx(Xe,{path:"/tasks",element:c.jsx(H_e,{})}),c.jsx(Xe,{path:"/notes",element:c.jsx(q_e,{})}),c.jsx(Xe,{path:"/files",element:c.jsx(K_e,{})}),c.jsx(Xe,{path:"/boards",element:c.jsx(V_e,{})}),c.jsx(Xe,{path:"/documentation",element:c.jsx(G_e,{})}),c.jsx(Xe,{path:"/feedback",element:c.jsx(Y_e,{})}),c.jsxs(Xe,{path:"/settings",element:c.jsx(J_e,{}),children:[c.jsx(Xe,{index:!0,element:c.jsx(Eu,{to:"custom-fields",replace:!0})}),c.jsx(Xe,{path:"custom-fields",element:c.jsx(Z_e,{})}),c.jsx(Xe,{path:"account",element:c.jsx(nTe,{})}),c.jsx(Xe,{path:"team",element:c.jsx(rTe,{})}),c.jsx(Xe,{path:"integrations",element:c.jsx(iTe,{})})]})]}),c.jsx(Xe,{path:"*",element:c.jsx(eTe,{})})]})})]})});DL(document.getElementById("root")).render(c.jsx(v.StrictMode,{children:c.jsx(fTe,{})}));

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.