var xxe=Object.defineProperty;var i8=e=>{throw TypeError(e)};var wxe=(e,t,n)=>t in e?xxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var bn=(e,t,n)=>wxe(e,typeof t!="symbol"?t+"":t,n),aI=(e,t,n)=>t.has(e)||i8("Cannot "+n);var Ae=(e,t,n)=>(aI(e,t,"read from private field"),n?n.call(e):t.get(e)),Ht=(e,t,n)=>t.has(e)?i8("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),lt=(e,t,n,r)=>(aI(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pn=(e,t,n)=>(aI(e,t,"access private method"),n);var RC=(e,t,n,r)=>({set _(i){lt(e,t,i,n)},get _(){return Ae(e,t,r)}});function bxe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Qh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jee={exports:{}},zN={},Bee={exports:{}},Sn={};/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var h2=Symbol.for("react.element"),Cxe=Symbol.for("react.portal"),Sxe=Symbol.for("react.fragment"),kxe=Symbol.for("react.strict_mode"),_xe=Symbol.for("react.profiler"),jxe=Symbol.for("react.provider"),Bxe=Symbol.for("react.context"),Nxe=Symbol.for("react.forward_ref"),Exe=Symbol.for("react.suspense"),Txe=Symbol.for("react.memo"),Ixe=Symbol.for("react.lazy"),s8=Symbol.iterator;function Pxe(e){return e===null||typeof e!="object"?null:(e=s8&&e[s8]||e["@@iterator"],typeof e=="function"?e:null)}var Nee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Eee=Object.assign,Tee={};function Yv(e,t,n){this.props=e,this.context=t,this.refs=Tee,this.updater=n||Nee}Yv.prototype.isReactComponent={};Yv.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Yv.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Iee(){}Iee.prototype=Yv.prototype;function nD(e,t,n){this.props=e,this.context=t,this.refs=Tee,this.updater=n||Nee}var rD=nD.prototype=new Iee;rD.constructor=nD;Eee(rD,Yv.prototype);rD.isPureReactComponent=!0;var a8=Array.isArray,Pee=Object.prototype.hasOwnProperty,iD={current:null},Oee={key:!0,ref:!0,__self:!0,__source:!0};function Fee(e,t,n){var r,i={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)Pee.call(t,r)&&!Oee.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:h2,type:e,key:s,ref:a,props:i,_owner:iD.current}}function Oxe(e,t){return{$$typeof:h2,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function sD(e){return typeof e=="object"&&e!==null&&e.$$typeof===h2}function Fxe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var o8=/\/+/g;function oI(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Fxe(""+e.key):t.toString(36)}function Fk(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case h2:case Cxe:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+oI(a,0):r,a8(i)?(n="",e!=null&&(n=e.replace(o8,"$&/")+"/"),Fk(i,t,n,"",function(u){return u})):i!=null&&(sD(i)&&(i=Oxe(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(o8,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",a8(e))for(var o=0;o<e.length;o++){s=e[o];var c=r+oI(s,o);a+=Fk(s,t,n,c,i)}else if(c=Pxe(e),typeof c=="function")for(e=c.call(e),o=0;!(s=e.next()).done;)s=s.value,c=r+oI(s,o++),a+=Fk(s,t,n,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function DC(e,t,n){if(e==null)return e;var r=[],i=0;return Fk(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Mxe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Pa={current:null},Mk={transition:null},Lxe={ReactCurrentDispatcher:Pa,ReactCurrentBatchConfig:Mk,ReactCurrentOwner:iD};function Mee(){throw Error("act(...) is not supported in production builds of React.")}Sn.Children={map:DC,forEach:function(e,t,n){DC(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return DC(e,function(){t++}),t},toArray:function(e){return DC(e,function(t){return t})||[]},only:function(e){if(!sD(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Sn.Component=Yv;Sn.Fragment=Sxe;Sn.Profiler=_xe;Sn.PureComponent=nD;Sn.StrictMode=kxe;Sn.Suspense=Exe;Sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lxe;Sn.act=Mee;Sn.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Eee({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=iD.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Pee.call(t,c)&&!Oee.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:h2,type:e.type,key:i,ref:s,props:r,_owner:a}};Sn.createContext=function(e){return e={$$typeof:Bxe,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:jxe,_context:e},e.Consumer=e};Sn.createElement=Fee;Sn.createFactory=function(e){var t=Fee.bind(null,e);return t.type=e,t};Sn.createRef=function(){return{current:null}};Sn.forwardRef=function(e){return{$$typeof:Nxe,render:e}};Sn.isValidElement=sD;Sn.lazy=function(e){return{$$typeof:Ixe,_payload:{_status:-1,_result:e},_init:Mxe}};Sn.memo=function(e,t){return{$$typeof:Txe,type:e,compare:t===void 0?null:t}};Sn.startTransition=function(e){var t=Mk.transition;Mk.transition={};try{e()}finally{Mk.transition=t}};Sn.unstable_act=Mee;Sn.useCallback=function(e,t){return Pa.current.useCallback(e,t)};Sn.useContext=function(e){return Pa.current.useContext(e)};Sn.useDebugValue=function(){};Sn.useDeferredValue=function(e){return Pa.current.useDeferredValue(e)};Sn.useEffect=function(e,t){return Pa.current.useEffect(e,t)};Sn.useId=function(){return Pa.current.useId()};Sn.useImperativeHandle=function(e,t,n){return Pa.current.useImperativeHandle(e,t,n)};Sn.useInsertionEffect=function(e,t){return Pa.current.useInsertionEffect(e,t)};Sn.useLayoutEffect=function(e,t){return Pa.current.useLayoutEffect(e,t)};Sn.useMemo=function(e,t){return Pa.current.useMemo(e,t)};Sn.useReducer=function(e,t,n){return Pa.current.useReducer(e,t,n)};Sn.useRef=function(e){return Pa.current.useRef(e)};Sn.useState=function(e){return Pa.current.useState(e)};Sn.useSyncExternalStore=function(e,t,n){return Pa.current.useSyncExternalStore(e,t,n)};Sn.useTransition=function(){return Pa.current.useTransition()};Sn.version="18.3.1";Bee.exports=Sn;var C=Bee.exports;const re=Mn(C),aD=bxe({__proto__:null,default:re},[C]);/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Rxe=C,Dxe=Symbol.for("react.element"),Uxe=Symbol.for("react.fragment"),Hxe=Object.prototype.hasOwnProperty,Qxe=Rxe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$xe={key:!0,ref:!0,__self:!0,__source:!0};function Lee(e,t,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Hxe.call(t,r)&&!$xe.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Dxe,type:e,key:s,ref:a,props:i,_owner:Qxe.current}}zN.Fragment=Uxe;zN.jsx=Lee;zN.jsxs=Lee;jee.exports=zN;var l=jee.exports,Ree={exports:{}},Vo={},Dee={exports:{}},Uee={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(e){function t($,z){var Q=$.length;$.push(z);e:for(;0<Q;){var ce=Q-1>>>1,R=$[ce];if(0<i(R,z))$[ce]=z,$[Q]=R,Q=ce;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var z=$[0],Q=$.pop();if(Q!==z){$[0]=Q;e:for(var ce=0,R=$.length,M=R>>>1;ce<M;){var Y=2*(ce+1)-1,X=$[Y],V=Y+1,Z=$[V];if(0>i(X,Q))V<R&&0>i(Z,X)?($[ce]=Z,$[V]=Q,ce=V):($[ce]=X,$[Y]=Q,ce=Y);else if(V<R&&0>i(Z,Q))$[ce]=Z,$[V]=Q,ce=V;else break e}}return z}function i($,z){var Q=$.sortIndex-z.sortIndex;return Q!==0?Q:$.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],d=1,h=null,A=3,f=!1,p=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x($){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=$)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function b($){if(m=!1,x($),!p)if(n(c)!==null)p=!0,H(w);else{var z=n(u);z!==null&&W(b,z.startTime-$)}}function w($,z){p=!1,m&&(m=!1,y(B),B=-1),f=!0;var Q=A;try{for(x(z),h=n(c);h!==null&&(!(h.expirationTime>z)||$&&!T());){var ce=h.callback;if(typeof ce=="function"){h.callback=null,A=h.priorityLevel;var R=ce(h.expirationTime<=z);z=e.unstable_now(),typeof R=="function"?h.callback=R:h===n(c)&&r(c),x(z)}else r(c);h=n(c)}if(h!==null)var M=!0;else{var Y=n(u);Y!==null&&W(b,Y.startTime-z),M=!1}return M}finally{h=null,A=Q,f=!1}}var k=!1,j=null,B=-1,E=5,P=-1;function T(){return!(e.unstable_now()-P<E)}function N(){if(j!==null){var $=e.unstable_now();P=$;var z=!0;try{z=j(!0,$)}finally{z?F():(k=!1,j=null)}}else k=!1}var F;if(typeof v=="function")F=function(){v(N)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,U=L.port2;L.port1.onmessage=N,F=function(){U.postMessage(null)}}else F=function(){g(N,0)};function H($){j=$,k||(k=!0,F())}function W($,z){B=g(function(){$(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){p||f||(p=!0,H(w))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return A},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function($){switch(A){case 1:case 2:case 3:var z=3;break;default:z=A}var Q=A;A=z;try{return $()}finally{A=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Q=A;A=$;try{return z()}finally{A=Q}},e.unstable_scheduleCallback=function($,z,Q){var ce=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ce+Q:ce):Q=ce,$){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=Q+R,$={id:d++,callback:z,priorityLevel:$,startTime:Q,expirationTime:R,sortIndex:-1},Q>ce?($.sortIndex=Q,t(u,$),n(c)===null&&$===n(u)&&(m?(y(B),B=-1):m=!0,W(b,Q-ce))):($.sortIndex=R,t(c,$),p||f||(p=!0,H(w))),$},e.unstable_shouldYield=T,e.unstable_wrapCallback=function($){var z=A;return function(){var Q=A;A=z;try{return $.apply(this,arguments)}finally{A=Q}}}})(Uee);Dee.exports=Uee;var zxe=Dee.exports;/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Vxe=C,Qo=zxe;function We(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Hee=new Set,Ab={};function Am(e,t){ev(e,t),ev(e+"Capture",t)}function ev(e,t){for(Ab[e]=t,e=0;e<t.length;e++)Hee.add(t[e])}var yd=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),LO=Object.prototype.hasOwnProperty,Kxe=/^[: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]*$/,l8={},c8={};function qxe(e){return LO.call(c8,e)?!0:LO.call(l8,e)?!1:Kxe.test(e)?c8[e]=!0:(l8[e]=!0,!1)}function Wxe(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Gxe(e,t,n,r){if(t===null||typeof t>"u"||Wxe(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Oa(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var Fs={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fs[e]=new Oa(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fs[t]=new Oa(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fs[e]=new Oa(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fs[e]=new Oa(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fs[e]=new Oa(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fs[e]=new Oa(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fs[e]=new Oa(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fs[e]=new Oa(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fs[e]=new Oa(e,5,!1,e.toLowerCase(),null,!1,!1)});var oD=/[\-:]([a-z])/g;function lD(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(oD,lD);Fs[t]=new Oa(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(oD,lD);Fs[t]=new Oa(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(oD,lD);Fs[t]=new Oa(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fs[e]=new Oa(e,1,!1,e.toLowerCase(),null,!1,!1)});Fs.xlinkHref=new Oa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fs[e]=new Oa(e,1,!1,e.toLowerCase(),null,!0,!0)});function cD(e,t,n,r){var i=Fs.hasOwnProperty(t)?Fs[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Gxe(t,n,i,r)&&(n=null),r||i===null?qxe(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Td=Vxe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,UC=Symbol.for("react.element"),Qg=Symbol.for("react.portal"),$g=Symbol.for("react.fragment"),uD=Symbol.for("react.strict_mode"),RO=Symbol.for("react.profiler"),Qee=Symbol.for("react.provider"),$ee=Symbol.for("react.context"),dD=Symbol.for("react.forward_ref"),DO=Symbol.for("react.suspense"),UO=Symbol.for("react.suspense_list"),hD=Symbol.for("react.memo"),gh=Symbol.for("react.lazy"),zee=Symbol.for("react.offscreen"),u8=Symbol.iterator;function lx(e){return e===null||typeof e!="object"?null:(e=u8&&e[u8]||e["@@iterator"],typeof e=="function"?e:null)}var ei=Object.assign,lI;function Gx(e){if(lI===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);lI=t&&t[1]||""}return`
`+lI+e}var cI=!1;function uI(e,t){if(!e||cI)return"";cI=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
`),s=r.stack.split(`
`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){var c=`
`+i[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=o);break}}}finally{cI=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gx(e):""}function Yxe(e){switch(e.tag){case 5:return Gx(e.type);case 16:return Gx("Lazy");case 13:return Gx("Suspense");case 19:return Gx("SuspenseList");case 0:case 2:case 15:return e=uI(e.type,!1),e;case 11:return e=uI(e.type.render,!1),e;case 1:return e=uI(e.type,!0),e;default:return""}}function HO(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $g:return"Fragment";case Qg:return"Portal";case RO:return"Profiler";case uD:return"StrictMode";case DO:return"Suspense";case UO:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $ee:return(e.displayName||"Context")+".Consumer";case Qee:return(e._context.displayName||"Context")+".Provider";case dD:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hD:return t=e.displayName||null,t!==null?t:HO(e.type)||"Memo";case gh:t=e._payload,e=e._init;try{return HO(e(t))}catch{}}return null}function Xxe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return HO(t);case 8:return t===uD?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function jf(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jxe(e){var t=Vee(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function HC(e){e._valueTracker||(e._valueTracker=Jxe(e))}function Kee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Vee(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function T_(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function QO(e,t){var n=t.checked;return ei({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function d8(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=jf(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qee(e,t){t=t.checked,t!=null&&cD(e,"checked",t,!1)}function $O(e,t){qee(e,t);var n=jf(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zO(e,t.type,n):t.hasOwnProperty("defaultValue")&&zO(e,t.type,jf(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function h8(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zO(e,t,n){(t!=="number"||T_(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yx=Array.isArray;function dy(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+jf(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function VO(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(We(91));return ei({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function f8(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(We(92));if(Yx(n)){if(1<n.length)throw Error(We(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:jf(n)}}function Wee(e,t){var n=jf(t.value),r=jf(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function A8(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Gee(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function KO(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Gee(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var QC,Yee=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(QC=QC||document.createElement("div"),QC.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=QC.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pb(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xw={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},Zxe=["Webkit","ms","Moz","O"];Object.keys(xw).forEach(function(e){Zxe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xw[t]=xw[e]})});function Xee(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||xw.hasOwnProperty(e)&&xw[e]?(""+t).trim():t+"px"}function Jee(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Xee(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var ewe=ei({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 qO(e,t){if(t){if(ewe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(We(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(We(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(We(61))}if(t.style!=null&&typeof t.style!="object")throw Error(We(62))}}function WO(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var GO=null;function fD(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var YO=null,hy=null,fy=null;function p8(e){if(e=p2(e)){if(typeof YO!="function")throw Error(We(280));var t=e.stateNode;t&&(t=GN(t),YO(e.stateNode,e.type,t))}}function Zee(e){hy?fy?fy.push(e):fy=[e]:hy=e}function ete(){if(hy){var e=hy,t=fy;if(fy=hy=null,p8(e),t)for(e=0;e<t.length;e++)p8(t[e])}}function tte(e,t){return e(t)}function nte(){}var dI=!1;function rte(e,t,n){if(dI)return e(t,n);dI=!0;try{return tte(e,t,n)}finally{dI=!1,(hy!==null||fy!==null)&&(nte(),ete())}}function mb(e,t){var n=e.stateNode;if(n===null)return null;var r=GN(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(We(231,t,typeof n));return n}var XO=!1;if(yd)try{var cx={};Object.defineProperty(cx,"passive",{get:function(){XO=!0}}),window.addEventListener("test",cx,cx),window.removeEventListener("test",cx,cx)}catch{XO=!1}function twe(e,t,n,r,i,s,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ww=!1,I_=null,P_=!1,JO=null,nwe={onError:function(e){ww=!0,I_=e}};function rwe(e,t,n,r,i,s,a,o,c){ww=!1,I_=null,twe.apply(nwe,arguments)}function iwe(e,t,n,r,i,s,a,o,c){if(rwe.apply(this,arguments),ww){if(ww){var u=I_;ww=!1,I_=null}else throw Error(We(198));P_||(P_=!0,JO=u)}}function pm(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ite(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m8(e){if(pm(e)!==e)throw Error(We(188))}function swe(e){var t=e.alternate;if(!t){if(t=pm(e),t===null)throw Error(We(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return m8(i),e;if(s===r)return m8(i),t;s=s.sibling}throw Error(We(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(We(189))}}if(n.alternate!==r)throw Error(We(190))}if(n.tag!==3)throw Error(We(188));return n.stateNode.current===n?e:t}function ste(e){return e=swe(e),e!==null?ate(e):null}function ate(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ate(e);if(t!==null)return t;e=e.sibling}return null}var ote=Qo.unstable_scheduleCallback,g8=Qo.unstable_cancelCallback,awe=Qo.unstable_shouldYield,owe=Qo.unstable_requestPaint,xi=Qo.unstable_now,lwe=Qo.unstable_getCurrentPriorityLevel,AD=Qo.unstable_ImmediatePriority,lte=Qo.unstable_UserBlockingPriority,O_=Qo.unstable_NormalPriority,cwe=Qo.unstable_LowPriority,cte=Qo.unstable_IdlePriority,VN=null,au=null;function uwe(e){if(au&&typeof au.onCommitFiberRoot=="function")try{au.onCommitFiberRoot(VN,e,void 0,(e.current.flags&128)===128)}catch{}}var mc=Math.clz32?Math.clz32:fwe,dwe=Math.log,hwe=Math.LN2;function fwe(e){return e>>>=0,e===0?32:31-(dwe(e)/hwe|0)|0}var $C=64,zC=4194304;function Xx(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function F_(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Xx(o):(s&=a,s!==0&&(r=Xx(s)))}else a=n&~i,a!==0?r=Xx(a):s!==0&&(r=Xx(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-mc(t),i=1<<n,r|=e[n],t&=~i;return r}function Awe(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pwe(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-mc(s),o=1<<a,c=i[a];c===-1?(!(o&n)||o&r)&&(i[a]=Awe(o,t)):c<=t&&(e.expiredLanes|=o),s&=~o}}function ZO(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ute(){var e=$C;return $C<<=1,!($C&4194240)&&($C=64),e}function hI(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function f2(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mc(t),e[t]=n}function mwe(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-mc(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function pD(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mc(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var er=0;function dte(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var hte,mD,fte,Ate,pte,e3=!1,VC=[],nf=null,rf=null,sf=null,gb=new Map,yb=new Map,kh=[],gwe="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 y8(e,t){switch(e){case"focusin":case"focusout":nf=null;break;case"dragenter":case"dragleave":rf=null;break;case"mouseover":case"mouseout":sf=null;break;case"pointerover":case"pointerout":gb.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yb.delete(t.pointerId)}}function ux(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=p2(t),t!==null&&mD(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ywe(e,t,n,r,i){switch(t){case"focusin":return nf=ux(nf,e,t,n,r,i),!0;case"dragenter":return rf=ux(rf,e,t,n,r,i),!0;case"mouseover":return sf=ux(sf,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return gb.set(s,ux(gb.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,yb.set(s,ux(yb.get(s)||null,e,t,n,r,i)),!0}return!1}function mte(e){var t=GA(e.target);if(t!==null){var n=pm(t);if(n!==null){if(t=n.tag,t===13){if(t=ite(n),t!==null){e.blockedOn=t,pte(e.priority,function(){fte(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lk(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=t3(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);GO=r,n.target.dispatchEvent(r),GO=null}else return t=p2(n),t!==null&&mD(t),e.blockedOn=n,!1;t.shift()}return!0}function v8(e,t,n){Lk(e)&&n.delete(t)}function vwe(){e3=!1,nf!==null&&Lk(nf)&&(nf=null),rf!==null&&Lk(rf)&&(rf=null),sf!==null&&Lk(sf)&&(sf=null),gb.forEach(v8),yb.forEach(v8)}function dx(e,t){e.blockedOn===t&&(e.blockedOn=null,e3||(e3=!0,Qo.unstable_scheduleCallback(Qo.unstable_NormalPriority,vwe)))}function vb(e){function t(i){return dx(i,e)}if(0<VC.length){dx(VC[0],e);for(var n=1;n<VC.length;n++){var r=VC[n];r.blockedOn===e&&(r.blockedOn=null)}}for(nf!==null&&dx(nf,e),rf!==null&&dx(rf,e),sf!==null&&dx(sf,e),gb.forEach(t),yb.forEach(t),n=0;n<kh.length;n++)r=kh[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<kh.length&&(n=kh[0],n.blockedOn===null);)mte(n),n.blockedOn===null&&kh.shift()}var Ay=Td.ReactCurrentBatchConfig,M_=!0;function xwe(e,t,n,r){var i=er,s=Ay.transition;Ay.transition=null;try{er=1,gD(e,t,n,r)}finally{er=i,Ay.transition=s}}function wwe(e,t,n,r){var i=er,s=Ay.transition;Ay.transition=null;try{er=4,gD(e,t,n,r)}finally{er=i,Ay.transition=s}}function gD(e,t,n,r){if(M_){var i=t3(e,t,n,r);if(i===null)bI(e,t,r,L_,n),y8(e,r);else if(ywe(i,e,t,n,r))r.stopPropagation();else if(y8(e,r),t&4&&-1<gwe.indexOf(e)){for(;i!==null;){var s=p2(i);if(s!==null&&hte(s),s=t3(e,t,n,r),s===null&&bI(e,t,r,L_,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else bI(e,t,r,null,n)}}var L_=null;function t3(e,t,n,r){if(L_=null,e=fD(r),e=GA(e),e!==null)if(t=pm(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ite(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return L_=e,null}function gte(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(lwe()){case AD:return 1;case lte:return 4;case O_:case cwe:return 16;case cte:return 536870912;default:return 16}default:return 16}}var $h=null,yD=null,Rk=null;function yte(){if(Rk)return Rk;var e,t=yD,n=t.length,r,i="value"in $h?$h.value:$h.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[s-r];r++);return Rk=i.slice(e,1<r?1-r:void 0)}function Dk(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function KC(){return!0}function x8(){return!1}function Ko(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?KC:x8,this.isPropagationStopped=x8,this}return ei(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=KC)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=KC)},persist:function(){},isPersistent:KC}),t}var Xv={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vD=Ko(Xv),A2=ei({},Xv,{view:0,detail:0}),bwe=Ko(A2),fI,AI,hx,KN=ei({},A2,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xD,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hx&&(hx&&e.type==="mousemove"?(fI=e.screenX-hx.screenX,AI=e.screenY-hx.screenY):AI=fI=0,hx=e),fI)},movementY:function(e){return"movementY"in e?e.movementY:AI}}),w8=Ko(KN),Cwe=ei({},KN,{dataTransfer:0}),Swe=Ko(Cwe),kwe=ei({},A2,{relatedTarget:0}),pI=Ko(kwe),_we=ei({},Xv,{animationName:0,elapsedTime:0,pseudoElement:0}),jwe=Ko(_we),Bwe=ei({},Xv,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nwe=Ko(Bwe),Ewe=ei({},Xv,{data:0}),b8=Ko(Ewe),Twe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Iwe={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"},Pwe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Owe(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pwe[e])?!!t[e]:!1}function xD(){return Owe}var Fwe=ei({},A2,{key:function(e){if(e.key){var t=Twe[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Dk(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Iwe[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xD,charCode:function(e){return e.type==="keypress"?Dk(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dk(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mwe=Ko(Fwe),Lwe=ei({},KN,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C8=Ko(Lwe),Rwe=ei({},A2,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xD}),Dwe=Ko(Rwe),Uwe=ei({},Xv,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hwe=Ko(Uwe),Qwe=ei({},KN,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),$we=Ko(Qwe),zwe=[9,13,27,32],wD=yd&&"CompositionEvent"in window,bw=null;yd&&"documentMode"in document&&(bw=document.documentMode);var Vwe=yd&&"TextEvent"in window&&!bw,vte=yd&&(!wD||bw&&8<bw&&11>=bw),S8=" ",k8=!1;function xte(e,t){switch(e){case"keyup":return zwe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wte(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zg=!1;function Kwe(e,t){switch(e){case"compositionend":return wte(t);case"keypress":return t.which!==32?null:(k8=!0,S8);case"textInput":return e=t.data,e===S8&&k8?null:e;default:return null}}function qwe(e,t){if(zg)return e==="compositionend"||!wD&&xte(e,t)?(e=yte(),Rk=yD=$h=null,zg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return vte&&t.locale!=="ko"?null:t.data;default:return null}}var Wwe={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 _8(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wwe[e.type]:t==="textarea"}function bte(e,t,n,r){Zee(r),t=R_(t,"onChange"),0<t.length&&(n=new vD("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Cw=null,xb=null;function Gwe(e){Pte(e,0)}function qN(e){var t=qg(e);if(Kee(t))return e}function Ywe(e,t){if(e==="change")return t}var Cte=!1;if(yd){var mI;if(yd){var gI="oninput"in document;if(!gI){var j8=document.createElement("div");j8.setAttribute("oninput","return;"),gI=typeof j8.oninput=="function"}mI=gI}else mI=!1;Cte=mI&&(!document.documentMode||9<document.documentMode)}function B8(){Cw&&(Cw.detachEvent("onpropertychange",Ste),xb=Cw=null)}function Ste(e){if(e.propertyName==="value"&&qN(xb)){var t=[];bte(t,xb,e,fD(e)),rte(Gwe,t)}}function Xwe(e,t,n){e==="focusin"?(B8(),Cw=t,xb=n,Cw.attachEvent("onpropertychange",Ste)):e==="focusout"&&B8()}function Jwe(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qN(xb)}function Zwe(e,t){if(e==="click")return qN(t)}function ebe(e,t){if(e==="input"||e==="change")return qN(t)}function tbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bc=typeof Object.is=="function"?Object.is:tbe;function wb(e,t){if(bc(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!LO.call(t,i)||!bc(e[i],t[i]))return!1}return!0}function N8(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function E8(e,t){var n=N8(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=N8(n)}}function kte(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kte(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _te(){for(var e=window,t=T_();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=T_(e.document)}return t}function bD(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nbe(e){var t=_te(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kte(n.ownerDocument.documentElement,n)){if(r!==null&&bD(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=E8(n,s);var a=E8(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var rbe=yd&&"documentMode"in document&&11>=document.documentMode,Vg=null,n3=null,Sw=null,r3=!1;function T8(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;r3||Vg==null||Vg!==T_(r)||(r=Vg,"selectionStart"in r&&bD(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}),Sw&&wb(Sw,r)||(Sw=r,r=R_(n3,"onSelect"),0<r.length&&(t=new vD("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Vg)))}function qC(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Kg={animationend:qC("Animation","AnimationEnd"),animationiteration:qC("Animation","AnimationIteration"),animationstart:qC("Animation","AnimationStart"),transitionend:qC("Transition","TransitionEnd")},yI={},jte={};yd&&(jte=document.createElement("div").style,"AnimationEvent"in window||(delete Kg.animationend.animation,delete Kg.animationiteration.animation,delete Kg.animationstart.animation),"TransitionEvent"in window||delete Kg.transitionend.transition);function WN(e){if(yI[e])return yI[e];if(!Kg[e])return e;var t=Kg[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jte)return yI[e]=t[n];return e}var Bte=WN("animationend"),Nte=WN("animationiteration"),Ete=WN("animationstart"),Tte=WN("transitionend"),Ite=new Map,I8="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 Df(e,t){Ite.set(e,t),Am(t,[e])}for(var vI=0;vI<I8.length;vI++){var xI=I8[vI],ibe=xI.toLowerCase(),sbe=xI[0].toUpperCase()+xI.slice(1);Df(ibe,"on"+sbe)}Df(Bte,"onAnimationEnd");Df(Nte,"onAnimationIteration");Df(Ete,"onAnimationStart");Df("dblclick","onDoubleClick");Df("focusin","onFocus");Df("focusout","onBlur");Df(Tte,"onTransitionEnd");ev("onMouseEnter",["mouseout","mouseover"]);ev("onMouseLeave",["mouseout","mouseover"]);ev("onPointerEnter",["pointerout","pointerover"]);ev("onPointerLeave",["pointerout","pointerover"]);Am("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Am("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Am("onBeforeInput",["compositionend","keypress","textInput","paste"]);Am("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Am("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Am("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jx="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(" "),abe=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jx));function P8(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,iwe(r,t,void 0,e),e.currentTarget=null}function Pte(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==s&&i.isPropagationStopped())break e;P8(i,o,u),s=c}else for(a=0;a<r.length;a++){if(o=r[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==s&&i.isPropagationStopped())break e;P8(i,o,u),s=c}}}if(P_)throw e=JO,P_=!1,JO=null,e}function Pr(e,t){var n=t[l3];n===void 0&&(n=t[l3]=new Set);var r=e+"__bubble";n.has(r)||(Ote(t,e,2,!1),n.add(r))}function wI(e,t,n){var r=0;t&&(r|=4),Ote(n,e,r,t)}var WC="_reactListening"+Math.random().toString(36).slice(2);function bb(e){if(!e[WC]){e[WC]=!0,Hee.forEach(function(n){n!=="selectionchange"&&(abe.has(n)||wI(n,!1,e),wI(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[WC]||(t[WC]=!0,wI("selectionchange",!1,t))}}function Ote(e,t,n,r){switch(gte(t)){case 1:var i=xwe;break;case 4:i=wwe;break;default:i=gD}n=i.bind(null,t,n,e),i=void 0,!XO||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function bI(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;o!==null;){if(a=GA(o),a===null)return;if(c=a.tag,c===5||c===6){r=s=a;continue e}o=o.parentNode}}r=r.return}rte(function(){var u=s,d=fD(n),h=[];e:{var A=Ite.get(e);if(A!==void 0){var f=vD,p=e;switch(e){case"keypress":if(Dk(n)===0)break e;case"keydown":case"keyup":f=Mwe;break;case"focusin":p="focus",f=pI;break;case"focusout":p="blur",f=pI;break;case"beforeblur":case"afterblur":f=pI;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":f=w8;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=Swe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=Dwe;break;case Bte:case Nte:case Ete:f=jwe;break;case Tte:f=Hwe;break;case"scroll":f=bwe;break;case"wheel":f=$we;break;case"copy":case"cut":case"paste":f=Nwe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=C8}var m=(t&4)!==0,g=!m&&e==="scroll",y=m?A!==null?A+"Capture":null:A;m=[];for(var v=u,x;v!==null;){x=v;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,y!==null&&(b=mb(v,y),b!=null&&m.push(Cb(v,b,x)))),g)break;v=v.return}0<m.length&&(A=new f(A,p,null,n,d),h.push({event:A,listeners:m}))}}if(!(t&7)){e:{if(A=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",A&&n!==GO&&(p=n.relatedTarget||n.fromElement)&&(GA(p)||p[vd]))break e;if((f||A)&&(A=d.window===d?d:(A=d.ownerDocument)?A.defaultView||A.parentWindow:window,f?(p=n.relatedTarget||n.toElement,f=u,p=p?GA(p):null,p!==null&&(g=pm(p),p!==g||p.tag!==5&&p.tag!==6)&&(p=null)):(f=null,p=u),f!==p)){if(m=w8,b="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=C8,b="onPointerLeave",y="onPointerEnter",v="pointer"),g=f==null?A:qg(f),x=p==null?A:qg(p),A=new m(b,v+"leave",f,n,d),A.target=g,A.relatedTarget=x,b=null,GA(d)===u&&(m=new m(y,v+"enter",p,n,d),m.target=x,m.relatedTarget=g,b=m),g=b,f&&p)t:{for(m=f,y=p,v=0,x=m;x;x=Zm(x))v++;for(x=0,b=y;b;b=Zm(b))x++;for(;0<v-x;)m=Zm(m),v--;for(;0<x-v;)y=Zm(y),x--;for(;v--;){if(m===y||y!==null&&m===y.alternate)break t;m=Zm(m),y=Zm(y)}m=null}else m=null;f!==null&&O8(h,A,f,m,!1),p!==null&&g!==null&&O8(h,g,p,m,!0)}}e:{if(A=u?qg(u):window,f=A.nodeName&&A.nodeName.toLowerCase(),f==="select"||f==="input"&&A.type==="file")var w=Ywe;else if(_8(A))if(Cte)w=ebe;else{w=Jwe;var k=Xwe}else(f=A.nodeName)&&f.toLowerCase()==="input"&&(A.type==="checkbox"||A.type==="radio")&&(w=Zwe);if(w&&(w=w(e,u))){bte(h,w,n,d);break e}k&&k(e,A,u),e==="focusout"&&(k=A._wrapperState)&&k.controlled&&A.type==="number"&&zO(A,"number",A.value)}switch(k=u?qg(u):window,e){case"focusin":(_8(k)||k.contentEditable==="true")&&(Vg=k,n3=u,Sw=null);break;case"focusout":Sw=n3=Vg=null;break;case"mousedown":r3=!0;break;case"contextmenu":case"mouseup":case"dragend":r3=!1,T8(h,n,d);break;case"selectionchange":if(rbe)break;case"keydown":case"keyup":T8(h,n,d)}var j;if(wD)e:{switch(e){case"compositionstart":var B="onCompositionStart";break e;case"compositionend":B="onCompositionEnd";break e;case"compositionupdate":B="onCompositionUpdate";break e}B=void 0}else zg?xte(e,n)&&(B="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(B="onCompositionStart");B&&(vte&&n.locale!=="ko"&&(zg||B!=="onCompositionStart"?B==="onCompositionEnd"&&zg&&(j=yte()):($h=d,yD="value"in $h?$h.value:$h.textContent,zg=!0)),k=R_(u,B),0<k.length&&(B=new b8(B,e,null,n,d),h.push({event:B,listeners:k}),j?B.data=j:(j=wte(n),j!==null&&(B.data=j)))),(j=Vwe?Kwe(e,n):qwe(e,n))&&(u=R_(u,"onBeforeInput"),0<u.length&&(d=new b8("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=j))}Pte(h,t)})}function Cb(e,t,n){return{instance:e,listener:t,currentTarget:n}}function R_(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=mb(e,n),s!=null&&r.unshift(Cb(e,s,i)),s=mb(e,t),s!=null&&r.push(Cb(e,s,i))),e=e.return}return r}function Zm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function O8(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,i?(c=mb(n,s),c!=null&&a.unshift(Cb(n,c,o))):i||(c=mb(n,s),c!=null&&a.push(Cb(n,c,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var obe=/\r\n?/g,lbe=/\u0000|\uFFFD/g;function F8(e){return(typeof e=="string"?e:""+e).replace(obe,`
`).replace(lbe,"")}function GC(e,t,n){if(t=F8(t),F8(e)!==t&&n)throw Error(We(425))}function D_(){}var i3=null,s3=null;function a3(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var o3=typeof setTimeout=="function"?setTimeout:void 0,cbe=typeof clearTimeout=="function"?clearTimeout:void 0,M8=typeof Promise=="function"?Promise:void 0,ube=typeof queueMicrotask=="function"?queueMicrotask:typeof M8<"u"?function(e){return M8.resolve(null).then(e).catch(dbe)}:o3;function dbe(e){setTimeout(function(){throw e})}function CI(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),vb(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);vb(t)}function af(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function L8(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Jv=Math.random().toString(36).slice(2),Zc="__reactFiber$"+Jv,Sb="__reactProps$"+Jv,vd="__reactContainer$"+Jv,l3="__reactEvents$"+Jv,hbe="__reactListeners$"+Jv,fbe="__reactHandles$"+Jv;function GA(e){var t=e[Zc];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vd]||n[Zc]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=L8(e);e!==null;){if(n=e[Zc])return n;e=L8(e)}return t}e=n,n=e.parentNode}return null}function p2(e){return e=e[Zc]||e[vd],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qg(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(We(33))}function GN(e){return e[Sb]||null}var c3=[],Wg=-1;function Uf(e){return{current:e}}function Rr(e){0>Wg||(e.current=c3[Wg],c3[Wg]=null,Wg--)}function kr(e,t){Wg++,c3[Wg]=e.current,e.current=t}var Bf={},ia=Uf(Bf),ro=Uf(!1),Dp=Bf;function tv(e,t){var n=e.type.contextTypes;if(!n)return Bf;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function io(e){return e=e.childContextTypes,e!=null}function U_(){Rr(ro),Rr(ia)}function R8(e,t,n){if(ia.current!==Bf)throw Error(We(168));kr(ia,t),kr(ro,n)}function Fte(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(We(108,Xxe(e)||"Unknown",i));return ei({},n,r)}function H_(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bf,Dp=ia.current,kr(ia,e),kr(ro,ro.current),!0}function D8(e,t,n){var r=e.stateNode;if(!r)throw Error(We(169));n?(e=Fte(e,t,Dp),r.__reactInternalMemoizedMergedChildContext=e,Rr(ro),Rr(ia),kr(ia,e)):Rr(ro),kr(ro,n)}var Zu=null,YN=!1,SI=!1;function Mte(e){Zu===null?Zu=[e]:Zu.push(e)}function Abe(e){YN=!0,Mte(e)}function Hf(){if(!SI&&Zu!==null){SI=!0;var e=0,t=er;try{var n=Zu;for(er=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Zu=null,YN=!1}catch(i){throw Zu!==null&&(Zu=Zu.slice(e+1)),ote(AD,Hf),i}finally{er=t,SI=!1}}return null}var Gg=[],Yg=0,Q_=null,$_=0,dl=[],hl=0,Up=null,id=1,sd="";function OA(e,t){Gg[Yg++]=$_,Gg[Yg++]=Q_,Q_=e,$_=t}function Lte(e,t,n){dl[hl++]=id,dl[hl++]=sd,dl[hl++]=Up,Up=e;var r=id;e=sd;var i=32-mc(r)-1;r&=~(1<<i),n+=1;var s=32-mc(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,id=1<<32-mc(t)+i|n<<i|r,sd=s+e}else id=1<<s|n<<i|r,sd=e}function CD(e){e.return!==null&&(OA(e,1),Lte(e,1,0))}function SD(e){for(;e===Q_;)Q_=Gg[--Yg],Gg[Yg]=null,$_=Gg[--Yg],Gg[Yg]=null;for(;e===Up;)Up=dl[--hl],dl[hl]=null,sd=dl[--hl],dl[hl]=null,id=dl[--hl],dl[hl]=null}var Do=null,Oo=null,zr=!1,cc=null;function Rte(e,t){var n=gl(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function U8(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Do=e,Oo=af(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Do=e,Oo=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Up!==null?{id,overflow:sd}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Do=e,Oo=null,!0):!1;default:return!1}}function u3(e){return(e.mode&1)!==0&&(e.flags&128)===0}function d3(e){if(zr){var t=Oo;if(t){var n=t;if(!U8(e,t)){if(u3(e))throw Error(We(418));t=af(n.nextSibling);var r=Do;t&&U8(e,t)?Rte(r,n):(e.flags=e.flags&-4097|2,zr=!1,Do=e)}}else{if(u3(e))throw Error(We(418));e.flags=e.flags&-4097|2,zr=!1,Do=e}}}function H8(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Do=e}function YC(e){if(e!==Do)return!1;if(!zr)return H8(e),zr=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!a3(e.type,e.memoizedProps)),t&&(t=Oo)){if(u3(e))throw Dte(),Error(We(418));for(;t;)Rte(e,t),t=af(t.nextSibling)}if(H8(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(We(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Oo=af(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Oo=null}}else Oo=Do?af(e.stateNode.nextSibling):null;return!0}function Dte(){for(var e=Oo;e;)e=af(e.nextSibling)}function nv(){Oo=Do=null,zr=!1}function kD(e){cc===null?cc=[e]:cc.push(e)}var pbe=Td.ReactCurrentBatchConfig;function fx(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(We(309));var r=n.stateNode}if(!r)throw Error(We(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},t._stringRef=s,t)}if(typeof e!="string")throw Error(We(284));if(!n._owner)throw Error(We(290,e))}return e}function XC(e,t){throw e=Object.prototype.toString.call(t),Error(We(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Q8(e){var t=e._init;return t(e._payload)}function Ute(e){function t(y,v){if(e){var x=y.deletions;x===null?(y.deletions=[v],y.flags|=16):x.push(v)}}function n(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function r(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function i(y,v){return y=uf(y,v),y.index=0,y.sibling=null,y}function s(y,v,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<v?(y.flags|=2,v):x):(y.flags|=2,v)):(y.flags|=1048576,v)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,v,x,b){return v===null||v.tag!==6?(v=TI(x,y.mode,b),v.return=y,v):(v=i(v,x),v.return=y,v)}function c(y,v,x,b){var w=x.type;return w===$g?d(y,v,x.props.children,b,x.key):v!==null&&(v.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===gh&&Q8(w)===v.type)?(b=i(v,x.props),b.ref=fx(y,v,x),b.return=y,b):(b=Kk(x.type,x.key,x.props,null,y.mode,b),b.ref=fx(y,v,x),b.return=y,b)}function u(y,v,x,b){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=II(x,y.mode,b),v.return=y,v):(v=i(v,x.children||[]),v.return=y,v)}function d(y,v,x,b,w){return v===null||v.tag!==7?(v=Sp(x,y.mode,b,w),v.return=y,v):(v=i(v,x),v.return=y,v)}function h(y,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return v=TI(""+v,y.mode,x),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case UC:return x=Kk(v.type,v.key,v.props,null,y.mode,x),x.ref=fx(y,null,v),x.return=y,x;case Qg:return v=II(v,y.mode,x),v.return=y,v;case gh:var b=v._init;return h(y,b(v._payload),x)}if(Yx(v)||lx(v))return v=Sp(v,y.mode,x,null),v.return=y,v;XC(y,v)}return null}function A(y,v,x,b){var w=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return w!==null?null:o(y,v,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case UC:return x.key===w?c(y,v,x,b):null;case Qg:return x.key===w?u(y,v,x,b):null;case gh:return w=x._init,A(y,v,w(x._payload),b)}if(Yx(x)||lx(x))return w!==null?null:d(y,v,x,b,null);XC(y,x)}return null}function f(y,v,x,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(x)||null,o(v,y,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case UC:return y=y.get(b.key===null?x:b.key)||null,c(v,y,b,w);case Qg:return y=y.get(b.key===null?x:b.key)||null,u(v,y,b,w);case gh:var k=b._init;return f(y,v,x,k(b._payload),w)}if(Yx(b)||lx(b))return y=y.get(x)||null,d(v,y,b,w,null);XC(v,b)}return null}function p(y,v,x,b){for(var w=null,k=null,j=v,B=v=0,E=null;j!==null&&B<x.length;B++){j.index>B?(E=j,j=null):E=j.sibling;var P=A(y,j,x[B],b);if(P===null){j===null&&(j=E);break}e&&j&&P.alternate===null&&t(y,j),v=s(P,v,B),k===null?w=P:k.sibling=P,k=P,j=E}if(B===x.length)return n(y,j),zr&&OA(y,B),w;if(j===null){for(;B<x.length;B++)j=h(y,x[B],b),j!==null&&(v=s(j,v,B),k===null?w=j:k.sibling=j,k=j);return zr&&OA(y,B),w}for(j=r(y,j);B<x.length;B++)E=f(j,y,B,x[B],b),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?B:E.key),v=s(E,v,B),k===null?w=E:k.sibling=E,k=E);return e&&j.forEach(function(T){return t(y,T)}),zr&&OA(y,B),w}function m(y,v,x,b){var w=lx(x);if(typeof w!="function")throw Error(We(150));if(x=w.call(x),x==null)throw Error(We(151));for(var k=w=null,j=v,B=v=0,E=null,P=x.next();j!==null&&!P.done;B++,P=x.next()){j.index>B?(E=j,j=null):E=j.sibling;var T=A(y,j,P.value,b);if(T===null){j===null&&(j=E);break}e&&j&&T.alternate===null&&t(y,j),v=s(T,v,B),k===null?w=T:k.sibling=T,k=T,j=E}if(P.done)return n(y,j),zr&&OA(y,B),w;if(j===null){for(;!P.done;B++,P=x.next())P=h(y,P.value,b),P!==null&&(v=s(P,v,B),k===null?w=P:k.sibling=P,k=P);return zr&&OA(y,B),w}for(j=r(y,j);!P.done;B++,P=x.next())P=f(j,y,B,P.value,b),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?B:P.key),v=s(P,v,B),k===null?w=P:k.sibling=P,k=P);return e&&j.forEach(function(N){return t(y,N)}),zr&&OA(y,B),w}function g(y,v,x,b){if(typeof x=="object"&&x!==null&&x.type===$g&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case UC:e:{for(var w=x.key,k=v;k!==null;){if(k.key===w){if(w=x.type,w===$g){if(k.tag===7){n(y,k.sibling),v=i(k,x.props.children),v.return=y,y=v;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===gh&&Q8(w)===k.type){n(y,k.sibling),v=i(k,x.props),v.ref=fx(y,k,x),v.return=y,y=v;break e}n(y,k);break}else t(y,k);k=k.sibling}x.type===$g?(v=Sp(x.props.children,y.mode,b,x.key),v.return=y,y=v):(b=Kk(x.type,x.key,x.props,null,y.mode,b),b.ref=fx(y,v,x),b.return=y,y=b)}return a(y);case Qg:e:{for(k=x.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(y,v.sibling),v=i(v,x.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=II(x,y.mode,b),v.return=y,y=v}return a(y);case gh:return k=x._init,g(y,v,k(x._payload),b)}if(Yx(x))return p(y,v,x,b);if(lx(x))return m(y,v,x,b);XC(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(y,v.sibling),v=i(v,x),v.return=y,y=v):(n(y,v),v=TI(x,y.mode,b),v.return=y,y=v),a(y)):n(y,v)}return g}var rv=Ute(!0),Hte=Ute(!1),z_=Uf(null),V_=null,Xg=null,_D=null;function jD(){_D=Xg=V_=null}function BD(e){var t=z_.current;Rr(z_),e._currentValue=t}function h3(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function py(e,t){V_=e,_D=Xg=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ya=!0),e.firstContext=null)}function Il(e){var t=e._currentValue;if(_D!==e)if(e={context:e,memoizedValue:t,next:null},Xg===null){if(V_===null)throw Error(We(308));Xg=e,V_.dependencies={lanes:0,firstContext:e}}else Xg=Xg.next=e;return t}var YA=null;function ND(e){YA===null?YA=[e]:YA.push(e)}function Qte(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ND(t)):(n.next=i.next,i.next=n),t.interleaved=n,xd(e,r)}function xd(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var yh=!1;function ED(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $te(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ud(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function of(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Dn&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,xd(e,n)}return i=r.interleaved,i===null?(t.next=t,ND(r)):(t.next=i.next,i.next=t),r.interleaved=t,xd(e,n)}function Uk(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pD(e,n)}}function $8(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function K_(e,t,n,r){var i=e.updateQueue;yh=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?s=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(s!==null){var h=i.baseState;a=0,d=u=c=null,o=s;do{var A=o.lane,f=o.eventTime;if((r&A)===A){d!==null&&(d=d.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,m=o;switch(A=t,f=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){h=p.call(f,h,A);break e}h=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,A=typeof p=="function"?p.call(f,h,A):p,A==null)break e;h=ei({},h,A);break e;case 2:yh=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,A=i.effects,A===null?i.effects=[o]:A.push(o))}else f={eventTime:f,lane:A,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=f,c=h):d=d.next=f,a|=A;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;A=o,o=A.next,A.next=null,i.lastBaseUpdate=A,i.shared.pending=null}}while(!0);if(d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Qp|=a,e.lanes=a,e.memoizedState=h}}function z8(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(We(191,i));i.call(r)}}}var m2={},ou=Uf(m2),kb=Uf(m2),_b=Uf(m2);function XA(e){if(e===m2)throw Error(We(174));return e}function TD(e,t){switch(kr(_b,t),kr(kb,e),kr(ou,m2),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:KO(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=KO(t,e)}Rr(ou),kr(ou,t)}function iv(){Rr(ou),Rr(kb),Rr(_b)}function zte(e){XA(_b.current);var t=XA(ou.current),n=KO(t,e.type);t!==n&&(kr(kb,e),kr(ou,n))}function ID(e){kb.current===e&&(Rr(ou),Rr(kb))}var Yr=Uf(0);function q_(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var kI=[];function PD(){for(var e=0;e<kI.length;e++)kI[e]._workInProgressVersionPrimary=null;kI.length=0}var Hk=Td.ReactCurrentDispatcher,_I=Td.ReactCurrentBatchConfig,Hp=0,Zr=null,qi=null,as=null,W_=!1,kw=!1,jb=0,mbe=0;function Hs(){throw Error(We(321))}function OD(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bc(e[n],t[n]))return!1;return!0}function FD(e,t,n,r,i,s){if(Hp=s,Zr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Hk.current=e===null||e.memoizedState===null?xbe:wbe,e=n(r,i),kw){s=0;do{if(kw=!1,jb=0,25<=s)throw Error(We(301));s+=1,as=qi=null,t.updateQueue=null,Hk.current=bbe,e=n(r,i)}while(kw)}if(Hk.current=G_,t=qi!==null&&qi.next!==null,Hp=0,as=qi=Zr=null,W_=!1,t)throw Error(We(300));return e}function MD(){var e=jb!==0;return jb=0,e}function Kc(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return as===null?Zr.memoizedState=as=e:as=as.next=e,as}function Pl(){if(qi===null){var e=Zr.alternate;e=e!==null?e.memoizedState:null}else e=qi.next;var t=as===null?Zr.memoizedState:as.next;if(t!==null)as=t,qi=e;else{if(e===null)throw Error(We(310));qi=e,e={memoizedState:qi.memoizedState,baseState:qi.baseState,baseQueue:qi.baseQueue,queue:qi.queue,next:null},as===null?Zr.memoizedState=as=e:as=as.next=e}return as}function Bb(e,t){return typeof t=="function"?t(e):t}function jI(e){var t=Pl(),n=t.queue;if(n===null)throw Error(We(311));n.lastRenderedReducer=e;var r=qi,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,c=null,u=s;do{var d=u.lane;if((Hp&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=h,a=r):c=c.next=h,Zr.lanes|=d,Qp|=d}u=u.next}while(u!==null&&u!==s);c===null?a=r:c.next=o,bc(r,t.memoizedState)||(Ya=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Zr.lanes|=s,Qp|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function BI(e){var t=Pl(),n=t.queue;if(n===null)throw Error(We(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);bc(s,t.memoizedState)||(Ya=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Vte(){}function Kte(e,t){var n=Zr,r=Pl(),i=t(),s=!bc(r.memoizedState,i);if(s&&(r.memoizedState=i,Ya=!0),r=r.queue,LD(Gte.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||as!==null&&as.memoizedState.tag&1){if(n.flags|=2048,Nb(9,Wte.bind(null,n,r,i,t),void 0,null),us===null)throw Error(We(349));Hp&30||qte(n,t,i)}return i}function qte(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Zr.updateQueue,t===null?(t={lastEffect:null,stores:null},Zr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wte(e,t,n,r){t.value=n,t.getSnapshot=r,Yte(t)&&Xte(e)}function Gte(e,t,n){return n(function(){Yte(t)&&Xte(e)})}function Yte(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bc(e,n)}catch{return!0}}function Xte(e){var t=xd(e,1);t!==null&&gc(t,e,1,-1)}function V8(e){var t=Kc();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bb,lastRenderedState:e},t.queue=e,e=e.dispatch=vbe.bind(null,Zr,e),[t.memoizedState,e]}function Nb(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Zr.updateQueue,t===null?(t={lastEffect:null,stores:null},Zr.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Jte(){return Pl().memoizedState}function Qk(e,t,n,r){var i=Kc();Zr.flags|=e,i.memoizedState=Nb(1|t,n,void 0,r===void 0?null:r)}function XN(e,t,n,r){var i=Pl();r=r===void 0?null:r;var s=void 0;if(qi!==null){var a=qi.memoizedState;if(s=a.destroy,r!==null&&OD(r,a.deps)){i.memoizedState=Nb(t,n,s,r);return}}Zr.flags|=e,i.memoizedState=Nb(1|t,n,s,r)}function K8(e,t){return Qk(8390656,8,e,t)}function LD(e,t){return XN(2048,8,e,t)}function Zte(e,t){return XN(4,2,e,t)}function ene(e,t){return XN(4,4,e,t)}function tne(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nne(e,t,n){return n=n!=null?n.concat([e]):null,XN(4,4,tne.bind(null,t,e),n)}function RD(){}function rne(e,t){var n=Pl();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&OD(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ine(e,t){var n=Pl();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&OD(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function sne(e,t,n){return Hp&21?(bc(n,t)||(n=ute(),Zr.lanes|=n,Qp|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ya=!0),e.memoizedState=n)}function gbe(e,t){var n=er;er=n!==0&&4>n?n:4,e(!0);var r=_I.transition;_I.transition={};try{e(!1),t()}finally{er=n,_I.transition=r}}function ane(){return Pl().memoizedState}function ybe(e,t,n){var r=cf(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},one(e))lne(t,n);else if(n=Qte(e,t,n,r),n!==null){var i=Na();gc(n,e,r,i),cne(n,t,r)}}function vbe(e,t,n){var r=cf(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(one(e))lne(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,bc(o,a)){var c=t.interleaved;c===null?(i.next=i,ND(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Qte(e,t,i,r),n!==null&&(i=Na(),gc(n,e,r,i),cne(n,t,r))}}function one(e){var t=e.alternate;return e===Zr||t!==null&&t===Zr}function lne(e,t){kw=W_=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cne(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pD(e,n)}}var G_={readContext:Il,useCallback:Hs,useContext:Hs,useEffect:Hs,useImperativeHandle:Hs,useInsertionEffect:Hs,useLayoutEffect:Hs,useMemo:Hs,useReducer:Hs,useRef:Hs,useState:Hs,useDebugValue:Hs,useDeferredValue:Hs,useTransition:Hs,useMutableSource:Hs,useSyncExternalStore:Hs,useId:Hs,unstable_isNewReconciler:!1},xbe={readContext:Il,useCallback:function(e,t){return Kc().memoizedState=[e,t===void 0?null:t],e},useContext:Il,useEffect:K8,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qk(4194308,4,tne.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qk(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qk(4,2,e,t)},useMemo:function(e,t){var n=Kc();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kc();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ybe.bind(null,Zr,e),[r.memoizedState,e]},useRef:function(e){var t=Kc();return e={current:e},t.memoizedState=e},useState:V8,useDebugValue:RD,useDeferredValue:function(e){return Kc().memoizedState=e},useTransition:function(){var e=V8(!1),t=e[0];return e=gbe.bind(null,e[1]),Kc().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Zr,i=Kc();if(zr){if(n===void 0)throw Error(We(407));n=n()}else{if(n=t(),us===null)throw Error(We(349));Hp&30||qte(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,K8(Gte.bind(null,r,s,e),[e]),r.flags|=2048,Nb(9,Wte.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Kc(),t=us.identifierPrefix;if(zr){var n=sd,r=id;n=(r&~(1<<32-mc(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=jb++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=mbe++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wbe={readContext:Il,useCallback:rne,useContext:Il,useEffect:LD,useImperativeHandle:nne,useInsertionEffect:Zte,useLayoutEffect:ene,useMemo:ine,useReducer:jI,useRef:Jte,useState:function(){return jI(Bb)},useDebugValue:RD,useDeferredValue:function(e){var t=Pl();return sne(t,qi.memoizedState,e)},useTransition:function(){var e=jI(Bb)[0],t=Pl().memoizedState;return[e,t]},useMutableSource:Vte,useSyncExternalStore:Kte,useId:ane,unstable_isNewReconciler:!1},bbe={readContext:Il,useCallback:rne,useContext:Il,useEffect:LD,useImperativeHandle:nne,useInsertionEffect:Zte,useLayoutEffect:ene,useMemo:ine,useReducer:BI,useRef:Jte,useState:function(){return BI(Bb)},useDebugValue:RD,useDeferredValue:function(e){var t=Pl();return qi===null?t.memoizedState=e:sne(t,qi.memoizedState,e)},useTransition:function(){var e=BI(Bb)[0],t=Pl().memoizedState;return[e,t]},useMutableSource:Vte,useSyncExternalStore:Kte,useId:ane,unstable_isNewReconciler:!1};function nc(e,t){if(e&&e.defaultProps){t=ei({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function f3(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ei({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var JN={isMounted:function(e){return(e=e._reactInternals)?pm(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Na(),i=cf(e),s=ud(r,i);s.payload=t,n!=null&&(s.callback=n),t=of(e,s,i),t!==null&&(gc(t,e,i,r),Uk(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Na(),i=cf(e),s=ud(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=of(e,s,i),t!==null&&(gc(t,e,i,r),Uk(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Na(),r=cf(e),i=ud(n,r);i.tag=2,t!=null&&(i.callback=t),t=of(e,i,r),t!==null&&(gc(t,e,r,n),Uk(t,e,r))}};function q8(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!wb(n,r)||!wb(i,s):!0}function une(e,t,n){var r=!1,i=Bf,s=t.contextType;return typeof s=="object"&&s!==null?s=Il(s):(i=io(t)?Dp:ia.current,r=t.contextTypes,s=(r=r!=null)?tv(e,i):Bf),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=JN,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function W8(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&JN.enqueueReplaceState(t,t.state,null)}function A3(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ED(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Il(s):(s=io(t)?Dp:ia.current,i.context=tv(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(f3(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&JN.enqueueReplaceState(i,i.state,null),K_(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function sv(e,t){try{var n="",r=t;do n+=Yxe(r),r=r.return;while(r);var i=n}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function NI(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function p3(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Cbe=typeof WeakMap=="function"?WeakMap:Map;function dne(e,t,n){n=ud(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){X_||(X_=!0,k3=r),p3(e,t)},n}function hne(e,t,n){n=ud(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){p3(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){p3(e,t),typeof r!="function"&&(lf===null?lf=new Set([this]):lf.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function G8(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Cbe;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Lbe.bind(null,e,t,n),t.then(e,e))}function Y8(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function X8(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ud(-1,1),t.tag=2,of(n,t,1))),n.lanes|=1),e)}var Sbe=Td.ReactCurrentOwner,Ya=!1;function va(e,t,n,r){t.child=e===null?Hte(t,null,n,r):rv(t,e.child,n,r)}function J8(e,t,n,r,i){n=n.render;var s=t.ref;return py(t,i),r=FD(e,t,n,r,s,i),n=MD(),e!==null&&!Ya?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wd(e,t,i)):(zr&&n&&CD(t),t.flags|=1,va(e,t,r,i),t.child)}function Z8(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!KD(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,fne(e,t,s,r,i)):(e=Kk(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:wb,n(a,r)&&e.ref===t.ref)return wd(e,t,i)}return t.flags|=1,e=uf(s,r),e.ref=t.ref,e.return=t,t.child=e}function fne(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(wb(s,r)&&e.ref===t.ref)if(Ya=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Ya=!0);else return t.lanes=e.lanes,wd(e,t,i)}return m3(e,t,n,r,i)}function Ane(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},kr(Zg,No),No|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,kr(Zg,No),No|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,kr(Zg,No),No|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,kr(Zg,No),No|=r;return va(e,t,i,n),t.child}function pne(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function m3(e,t,n,r,i){var s=io(n)?Dp:ia.current;return s=tv(t,s),py(t,i),n=FD(e,t,n,r,s,i),r=MD(),e!==null&&!Ya?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wd(e,t,i)):(zr&&r&&CD(t),t.flags|=1,va(e,t,n,i),t.child)}function e7(e,t,n,r,i){if(io(n)){var s=!0;H_(t)}else s=!1;if(py(t,i),t.stateNode===null)$k(e,t),une(t,n,r),A3(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Il(u):(u=io(n)?Dp:ia.current,u=tv(t,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||c!==u)&&W8(t,a,r,u),yh=!1;var A=t.memoizedState;a.state=A,K_(t,r,a,i),c=t.memoizedState,o!==r||A!==c||ro.current||yh?(typeof d=="function"&&(f3(t,n,d,r),c=t.memoizedState),(o=yh||q8(t,n,o,r,A,c,u))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,$te(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:nc(t.type,o),a.props=u,h=t.pendingProps,A=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Il(c):(c=io(n)?Dp:ia.current,c=tv(t,c));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==h||A!==c)&&W8(t,a,r,c),yh=!1,A=t.memoizedState,a.state=A,K_(t,r,a,i);var p=t.memoizedState;o!==h||A!==p||ro.current||yh?(typeof f=="function"&&(f3(t,n,f,r),p=t.memoizedState),(u=yh||q8(t,n,u,r,A,p,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),r=!1)}return g3(e,t,n,r,s,i)}function g3(e,t,n,r,i,s){pne(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&D8(t,n,!1),wd(e,t,s);r=t.stateNode,Sbe.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=rv(t,e.child,null,s),t.child=rv(t,null,o,s)):va(e,t,o,s),t.memoizedState=r.state,i&&D8(t,n,!0),t.child}function mne(e){var t=e.stateNode;t.pendingContext?R8(e,t.pendingContext,t.pendingContext!==t.context):t.context&&R8(e,t.context,!1),TD(e,t.containerInfo)}function t7(e,t,n,r,i){return nv(),kD(i),t.flags|=256,va(e,t,n,r),t.child}var y3={dehydrated:null,treeContext:null,retryLane:0};function v3(e){return{baseLanes:e,cachePool:null,transitions:null}}function gne(e,t,n){var r=t.pendingProps,i=Yr.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),kr(Yr,i&1),e===null)return d3(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=tE(a,r,0,null),e=Sp(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=v3(n),t.memoizedState=y3,e):DD(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return kbe(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=i.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=uf(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=uf(o,s):(s=Sp(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?v3(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=y3,r}return s=e.child,e=s.sibling,r=uf(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function DD(e,t){return t=tE({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function JC(e,t,n,r){return r!==null&&kD(r),rv(t,e.child,null,n),e=DD(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kbe(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=NI(Error(We(422))),JC(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=tE({mode:"visible",children:r.children},i,0,null),s=Sp(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&rv(t,e.child,null,a),t.child.memoizedState=v3(a),t.memoizedState=y3,s);if(!(t.mode&1))return JC(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(We(419)),r=NI(s,r,void 0),JC(e,t,a,r)}if(o=(a&e.childLanes)!==0,Ya||o){if(r=us,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,xd(e,i),gc(r,e,i,-1))}return VD(),r=NI(Error(We(421))),JC(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Rbe.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Oo=af(i.nextSibling),Do=t,zr=!0,cc=null,e!==null&&(dl[hl++]=id,dl[hl++]=sd,dl[hl++]=Up,id=e.id,sd=e.overflow,Up=t),t=DD(t,r.children),t.flags|=4096,t)}function n7(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),h3(e.return,t,n)}function EI(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function yne(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(va(e,t,r.children,n),r=Yr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&n7(e,n,t);else if(e.tag===19)n7(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(kr(Yr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&q_(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),EI(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&q_(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}EI(t,!0,n,null,s);break;case"together":EI(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $k(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wd(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qp|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(We(153));if(t.child!==null){for(e=t.child,n=uf(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=uf(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function _be(e,t,n){switch(t.tag){case 3:mne(t),nv();break;case 5:zte(t);break;case 1:io(t.type)&&H_(t);break;case 4:TD(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;kr(z_,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(kr(Yr,Yr.current&1),t.flags|=128,null):n&t.child.childLanes?gne(e,t,n):(kr(Yr,Yr.current&1),e=wd(e,t,n),e!==null?e.sibling:null);kr(Yr,Yr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return yne(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),kr(Yr,Yr.current),r)break;return null;case 22:case 23:return t.lanes=0,Ane(e,t,n)}return wd(e,t,n)}var vne,x3,xne,wne;vne=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};x3=function(){};xne=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,XA(ou.current);var s=null;switch(n){case"input":i=QO(e,i),r=QO(e,r),s=[];break;case"select":i=ei({},i,{value:void 0}),r=ei({},r,{value:void 0}),s=[];break;case"textarea":i=VO(e,i),r=VO(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=D_)}qO(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ab.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ab.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Pr("scroll",e),s||o===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};wne=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ax(e,t){if(!zr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Qs(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function jbe(e,t,n){var r=t.pendingProps;switch(SD(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qs(t),null;case 1:return io(t.type)&&U_(),Qs(t),null;case 3:return r=t.stateNode,iv(),Rr(ro),Rr(ia),PD(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(YC(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,cc!==null&&(B3(cc),cc=null))),x3(e,t),Qs(t),null;case 5:ID(t);var i=XA(_b.current);if(n=t.type,e!==null&&t.stateNode!=null)xne(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(We(166));return Qs(t),null}if(e=XA(ou.current),YC(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Zc]=t,r[Sb]=s,e=(t.mode&1)!==0,n){case"dialog":Pr("cancel",r),Pr("close",r);break;case"iframe":case"object":case"embed":Pr("load",r);break;case"video":case"audio":for(i=0;i<Jx.length;i++)Pr(Jx[i],r);break;case"source":Pr("error",r);break;case"img":case"image":case"link":Pr("error",r),Pr("load",r);break;case"details":Pr("toggle",r);break;case"input":d8(r,s),Pr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Pr("invalid",r);break;case"textarea":f8(r,s),Pr("invalid",r)}qO(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&GC(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&GC(r.textContent,o,e),i=["children",""+o]):Ab.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Pr("scroll",r)}switch(n){case"input":HC(r),h8(r,s,!0);break;case"textarea":HC(r),A8(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=D_)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Gee(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Zc]=t,e[Sb]=r,vne(e,t,!1,!1),t.stateNode=e;e:{switch(a=WO(n,r),n){case"dialog":Pr("cancel",e),Pr("close",e),i=r;break;case"iframe":case"object":case"embed":Pr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Jx.length;i++)Pr(Jx[i],e);i=r;break;case"source":Pr("error",e),i=r;break;case"img":case"image":case"link":Pr("error",e),Pr("load",e),i=r;break;case"details":Pr("toggle",e),i=r;break;case"input":d8(e,r),i=QO(e,r),Pr("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ei({},r,{value:void 0}),Pr("invalid",e);break;case"textarea":f8(e,r),i=VO(e,r),Pr("invalid",e);break;default:i=r}qO(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var c=o[s];s==="style"?Jee(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Yee(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&pb(e,c):typeof c=="number"&&pb(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ab.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Pr("scroll",e):c!=null&&cD(e,s,c,a))}switch(n){case"input":HC(e),h8(e,r,!1);break;case"textarea":HC(e),A8(e);break;case"option":r.value!=null&&e.setAttribute("value",""+jf(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?dy(e,!!r.multiple,s,!1):r.defaultValue!=null&&dy(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=D_)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Qs(t),null;case 6:if(e&&t.stateNode!=null)wne(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(We(166));if(n=XA(_b.current),XA(ou.current),YC(t)){if(r=t.stateNode,n=t.memoizedProps,r[Zc]=t,(s=r.nodeValue!==n)&&(e=Do,e!==null))switch(e.tag){case 3:GC(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&GC(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Zc]=t,t.stateNode=r}return Qs(t),null;case 13:if(Rr(Yr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(zr&&Oo!==null&&t.mode&1&&!(t.flags&128))Dte(),nv(),t.flags|=98560,s=!1;else if(s=YC(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(We(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(We(317));s[Zc]=t}else nv(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qs(t),s=!1}else cc!==null&&(B3(cc),cc=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Yr.current&1?Xi===0&&(Xi=3):VD())),t.updateQueue!==null&&(t.flags|=4),Qs(t),null);case 4:return iv(),x3(e,t),e===null&&bb(t.stateNode.containerInfo),Qs(t),null;case 10:return BD(t.type._context),Qs(t),null;case 17:return io(t.type)&&U_(),Qs(t),null;case 19:if(Rr(Yr),s=t.memoizedState,s===null)return Qs(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Ax(s,!1);else{if(Xi!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=q_(e),a!==null){for(t.flags|=128,Ax(s,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,e=a.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return kr(Yr,Yr.current&1|2),t.child}e=e.sibling}s.tail!==null&&xi()>av&&(t.flags|=128,r=!0,Ax(s,!1),t.lanes=4194304)}else{if(!r)if(e=q_(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ax(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!zr)return Qs(t),null}else 2*xi()-s.renderingStartTime>av&&n!==1073741824&&(t.flags|=128,r=!0,Ax(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=xi(),t.sibling=null,n=Yr.current,kr(Yr,r?n&1|2:n&1),t):(Qs(t),null);case 22:case 23:return zD(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?No&1073741824&&(Qs(t),t.subtreeFlags&6&&(t.flags|=8192)):Qs(t),null;case 24:return null;case 25:return null}throw Error(We(156,t.tag))}function Bbe(e,t){switch(SD(t),t.tag){case 1:return io(t.type)&&U_(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return iv(),Rr(ro),Rr(ia),PD(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ID(t),null;case 13:if(Rr(Yr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(We(340));nv()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Rr(Yr),null;case 4:return iv(),null;case 10:return BD(t.type._context),null;case 22:case 23:return zD(),null;case 24:return null;default:return null}}var ZC=!1,Js=!1,Nbe=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Jg(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ci(e,t,r)}else n.current=null}function w3(e,t,n){try{n()}catch(r){ci(e,t,r)}}var r7=!1;function Ebe(e,t){if(i3=M_,e=_te(),bD(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,c=-1,u=0,d=0,h=e,A=null;t:for(;;){for(var f;h!==n||i!==0&&h.nodeType!==3||(o=a+i),h!==s||r!==0&&h.nodeType!==3||(c=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(f=h.firstChild)!==null;)A=h,h=f;for(;;){if(h===e)break t;if(A===n&&++u===i&&(o=a),A===s&&++d===r&&(c=a),(f=h.nextSibling)!==null)break;h=A,A=h.parentNode}h=f}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(s3={focusedElem:e,selectionRange:n},M_=!1,yt=t;yt!==null;)if(t=yt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,yt=e;else for(;yt!==null;){t=yt;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,g=p.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:nc(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(We(163))}}catch(b){ci(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,yt=e;break}yt=t.return}return p=r7,r7=!1,p}function _w(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&w3(t,n,s)}i=i.next}while(i!==r)}}function ZN(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function b3(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function bne(e){var t=e.alternate;t!==null&&(e.alternate=null,bne(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zc],delete t[Sb],delete t[l3],delete t[hbe],delete t[fbe])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cne(e){return e.tag===5||e.tag===3||e.tag===4}function i7(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cne(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function C3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=D_));else if(r!==4&&(e=e.child,e!==null))for(C3(e,t,n),e=e.sibling;e!==null;)C3(e,t,n),e=e.sibling}function S3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(S3(e,t,n),e=e.sibling;e!==null;)S3(e,t,n),e=e.sibling}var Cs=null,sc=!1;function eh(e,t,n){for(n=n.child;n!==null;)Sne(e,t,n),n=n.sibling}function Sne(e,t,n){if(au&&typeof au.onCommitFiberUnmount=="function")try{au.onCommitFiberUnmount(VN,n)}catch{}switch(n.tag){case 5:Js||Jg(n,t);case 6:var r=Cs,i=sc;Cs=null,eh(e,t,n),Cs=r,sc=i,Cs!==null&&(sc?(e=Cs,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Cs.removeChild(n.stateNode));break;case 18:Cs!==null&&(sc?(e=Cs,n=n.stateNode,e.nodeType===8?CI(e.parentNode,n):e.nodeType===1&&CI(e,n),vb(e)):CI(Cs,n.stateNode));break;case 4:r=Cs,i=sc,Cs=n.stateNode.containerInfo,sc=!0,eh(e,t,n),Cs=r,sc=i;break;case 0:case 11:case 14:case 15:if(!Js&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&w3(n,t,a),i=i.next}while(i!==r)}eh(e,t,n);break;case 1:if(!Js&&(Jg(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ci(n,t,o)}eh(e,t,n);break;case 21:eh(e,t,n);break;case 22:n.mode&1?(Js=(r=Js)||n.memoizedState!==null,eh(e,t,n),Js=r):eh(e,t,n);break;default:eh(e,t,n)}}function s7(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Nbe),t.forEach(function(r){var i=Dbe.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ql(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:Cs=o.stateNode,sc=!1;break e;case 3:Cs=o.stateNode.containerInfo,sc=!0;break e;case 4:Cs=o.stateNode.containerInfo,sc=!0;break e}o=o.return}if(Cs===null)throw Error(We(160));Sne(s,a,i),Cs=null,sc=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){ci(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)kne(t,e),t=t.sibling}function kne(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ql(t,e),Qc(e),r&4){try{_w(3,e,e.return),ZN(3,e)}catch(m){ci(e,e.return,m)}try{_w(5,e,e.return)}catch(m){ci(e,e.return,m)}}break;case 1:ql(t,e),Qc(e),r&512&&n!==null&&Jg(n,n.return);break;case 5:if(ql(t,e),Qc(e),r&512&&n!==null&&Jg(n,n.return),e.flags&32){var i=e.stateNode;try{pb(i,"")}catch(m){ci(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,a=n!==null?n.memoizedProps:s,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&qee(i,s),WO(o,a);var u=WO(o,s);for(a=0;a<c.length;a+=2){var d=c[a],h=c[a+1];d==="style"?Jee(i,h):d==="dangerouslySetInnerHTML"?Yee(i,h):d==="children"?pb(i,h):cD(i,d,h,u)}switch(o){case"input":$O(i,s);break;case"textarea":Wee(i,s);break;case"select":var A=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?dy(i,!!s.multiple,f,!1):A!==!!s.multiple&&(s.defaultValue!=null?dy(i,!!s.multiple,s.defaultValue,!0):dy(i,!!s.multiple,s.multiple?[]:"",!1))}i[Sb]=s}catch(m){ci(e,e.return,m)}}break;case 6:if(ql(t,e),Qc(e),r&4){if(e.stateNode===null)throw Error(We(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){ci(e,e.return,m)}}break;case 3:if(ql(t,e),Qc(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vb(t.containerInfo)}catch(m){ci(e,e.return,m)}break;case 4:ql(t,e),Qc(e);break;case 13:ql(t,e),Qc(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(QD=xi())),r&4&&s7(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Js=(u=Js)||d,ql(t,e),Js=u):ql(t,e),Qc(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(yt=e,d=e.child;d!==null;){for(h=yt=d;yt!==null;){switch(A=yt,f=A.child,A.tag){case 0:case 11:case 14:case 15:_w(4,A,A.return);break;case 1:Jg(A,A.return);var p=A.stateNode;if(typeof p.componentWillUnmount=="function"){r=A,n=A.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){ci(r,n,m)}}break;case 5:Jg(A,A.return);break;case 22:if(A.memoizedState!==null){o7(h);continue}}f!==null?(f.return=A,yt=f):o7(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=h.stateNode,c=h.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=Xee("display",a))}catch(m){ci(e,e.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){ci(e,e.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:ql(t,e),Qc(e),r&4&&s7(e);break;case 21:break;default:ql(t,e),Qc(e)}}function Qc(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Cne(n)){var r=n;break e}n=n.return}throw Error(We(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(pb(i,""),r.flags&=-33);var s=i7(e);S3(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=i7(e);C3(e,o,a);break;default:throw Error(We(161))}}catch(c){ci(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tbe(e,t,n){yt=e,_ne(e)}function _ne(e,t,n){for(var r=(e.mode&1)!==0;yt!==null;){var i=yt,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||ZC;if(!a){var o=i.alternate,c=o!==null&&o.memoizedState!==null||Js;o=ZC;var u=Js;if(ZC=a,(Js=c)&&!u)for(yt=i;yt!==null;)a=yt,c=a.child,a.tag===22&&a.memoizedState!==null?l7(i):c!==null?(c.return=a,yt=c):l7(i);for(;s!==null;)yt=s,_ne(s),s=s.sibling;yt=i,ZC=o,Js=u}a7(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,yt=s):a7(e)}}function a7(e){for(;yt!==null;){var t=yt;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Js||ZN(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Js)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:nc(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&z8(t,s,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}z8(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&vb(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(We(163))}Js||t.flags&512&&b3(t)}catch(A){ci(t,t.return,A)}}if(t===e){yt=null;break}if(n=t.sibling,n!==null){n.return=t.return,yt=n;break}yt=t.return}}function o7(e){for(;yt!==null;){var t=yt;if(t===e){yt=null;break}var n=t.sibling;if(n!==null){n.return=t.return,yt=n;break}yt=t.return}}function l7(e){for(;yt!==null;){var t=yt;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ZN(4,t)}catch(c){ci(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){ci(t,i,c)}}var s=t.return;try{b3(t)}catch(c){ci(t,s,c)}break;case 5:var a=t.return;try{b3(t)}catch(c){ci(t,a,c)}}}catch(c){ci(t,t.return,c)}if(t===e){yt=null;break}var o=t.sibling;if(o!==null){o.return=t.return,yt=o;break}yt=t.return}}var Ibe=Math.ceil,Y_=Td.ReactCurrentDispatcher,UD=Td.ReactCurrentOwner,bl=Td.ReactCurrentBatchConfig,Dn=0,us=null,Fi=null,Ps=0,No=0,Zg=Uf(0),Xi=0,Eb=null,Qp=0,eE=0,HD=0,jw=null,Va=null,QD=0,av=1/0,Yu=null,X_=!1,k3=null,lf=null,eS=!1,zh=null,J_=0,Bw=0,_3=null,zk=-1,Vk=0;function Na(){return Dn&6?xi():zk!==-1?zk:zk=xi()}function cf(e){return e.mode&1?Dn&2&&Ps!==0?Ps&-Ps:pbe.transition!==null?(Vk===0&&(Vk=ute()),Vk):(e=er,e!==0||(e=window.event,e=e===void 0?16:gte(e.type)),e):1}function gc(e,t,n,r){if(50<Bw)throw Bw=0,_3=null,Error(We(185));f2(e,n,r),(!(Dn&2)||e!==us)&&(e===us&&(!(Dn&2)&&(eE|=n),Xi===4&&_h(e,Ps)),so(e,r),n===1&&Dn===0&&!(t.mode&1)&&(av=xi()+500,YN&&Hf()))}function so(e,t){var n=e.callbackNode;pwe(e,t);var r=F_(e,e===us?Ps:0);if(r===0)n!==null&&g8(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&g8(n),t===1)e.tag===0?Abe(c7.bind(null,e)):Mte(c7.bind(null,e)),ube(function(){!(Dn&6)&&Hf()}),n=null;else{switch(dte(r)){case 1:n=AD;break;case 4:n=lte;break;case 16:n=O_;break;case 536870912:n=cte;break;default:n=O_}n=One(n,jne.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function jne(e,t){if(zk=-1,Vk=0,Dn&6)throw Error(We(327));var n=e.callbackNode;if(my()&&e.callbackNode!==n)return null;var r=F_(e,e===us?Ps:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Z_(e,r);else{t=r;var i=Dn;Dn|=2;var s=Nne();(us!==e||Ps!==t)&&(Yu=null,av=xi()+500,Cp(e,t));do try{Fbe();break}catch(o){Bne(e,o)}while(!0);jD(),Y_.current=s,Dn=i,Fi!==null?t=0:(us=null,Ps=0,t=Xi)}if(t!==0){if(t===2&&(i=ZO(e),i!==0&&(r=i,t=j3(e,i))),t===1)throw n=Eb,Cp(e,0),_h(e,r),so(e,xi()),n;if(t===6)_h(e,r);else{if(i=e.current.alternate,!(r&30)&&!Pbe(i)&&(t=Z_(e,r),t===2&&(s=ZO(e),s!==0&&(r=s,t=j3(e,s))),t===1))throw n=Eb,Cp(e,0),_h(e,r),so(e,xi()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(We(345));case 2:FA(e,Va,Yu);break;case 3:if(_h(e,r),(r&130023424)===r&&(t=QD+500-xi(),10<t)){if(F_(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Na(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=o3(FA.bind(null,e,Va,Yu),t);break}FA(e,Va,Yu);break;case 4:if(_h(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-mc(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=xi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ibe(r/1960))-r,10<r){e.timeoutHandle=o3(FA.bind(null,e,Va,Yu),r);break}FA(e,Va,Yu);break;case 5:FA(e,Va,Yu);break;default:throw Error(We(329))}}}return so(e,xi()),e.callbackNode===n?jne.bind(null,e):null}function j3(e,t){var n=jw;return e.current.memoizedState.isDehydrated&&(Cp(e,t).flags|=256),e=Z_(e,t),e!==2&&(t=Va,Va=n,t!==null&&B3(t)),e}function B3(e){Va===null?Va=e:Va.push.apply(Va,e)}function Pbe(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!bc(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _h(e,t){for(t&=~HD,t&=~eE,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-mc(t),r=1<<n;e[n]=-1,t&=~r}}function c7(e){if(Dn&6)throw Error(We(327));my();var t=F_(e,0);if(!(t&1))return so(e,xi()),null;var n=Z_(e,t);if(e.tag!==0&&n===2){var r=ZO(e);r!==0&&(t=r,n=j3(e,r))}if(n===1)throw n=Eb,Cp(e,0),_h(e,t),so(e,xi()),n;if(n===6)throw Error(We(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,FA(e,Va,Yu),so(e,xi()),null}function $D(e,t){var n=Dn;Dn|=1;try{return e(t)}finally{Dn=n,Dn===0&&(av=xi()+500,YN&&Hf())}}function $p(e){zh!==null&&zh.tag===0&&!(Dn&6)&&my();var t=Dn;Dn|=1;var n=bl.transition,r=er;try{if(bl.transition=null,er=1,e)return e()}finally{er=r,bl.transition=n,Dn=t,!(Dn&6)&&Hf()}}function zD(){No=Zg.current,Rr(Zg)}function Cp(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cbe(n)),Fi!==null)for(n=Fi.return;n!==null;){var r=n;switch(SD(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&U_();break;case 3:iv(),Rr(ro),Rr(ia),PD();break;case 5:ID(r);break;case 4:iv();break;case 13:Rr(Yr);break;case 19:Rr(Yr);break;case 10:BD(r.type._context);break;case 22:case 23:zD()}n=n.return}if(us=e,Fi=e=uf(e.current,null),Ps=No=t,Xi=0,Eb=null,HD=eE=Qp=0,Va=jw=null,YA!==null){for(t=0;t<YA.length;t++)if(n=YA[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}YA=null}return e}function Bne(e,t){do{var n=Fi;try{if(jD(),Hk.current=G_,W_){for(var r=Zr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}W_=!1}if(Hp=0,as=qi=Zr=null,kw=!1,jb=0,UD.current=null,n===null||n.return===null){Xi=1,Eb=t,Fi=null;break}e:{var s=e,a=n.return,o=n,c=t;if(t=Ps,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var A=d.alternate;A?(d.updateQueue=A.updateQueue,d.memoizedState=A.memoizedState,d.lanes=A.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=Y8(a);if(f!==null){f.flags&=-257,X8(f,a,o,s,t),f.mode&1&&G8(s,u,t),t=f,c=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(c),t.updateQueue=m}else p.add(c);break e}else{if(!(t&1)){G8(s,u,t),VD();break e}c=Error(We(426))}}else if(zr&&o.mode&1){var g=Y8(a);if(g!==null){!(g.flags&65536)&&(g.flags|=256),X8(g,a,o,s,t),kD(sv(c,o));break e}}s=c=sv(c,o),Xi!==4&&(Xi=2),jw===null?jw=[s]:jw.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=dne(s,c,t);$8(s,y);break e;case 1:o=c;var v=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(lf===null||!lf.has(x)))){s.flags|=65536,t&=-t,s.lanes|=t;var b=hne(s,o,t);$8(s,b);break e}}s=s.return}while(s!==null)}Tne(n)}catch(w){t=w,Fi===n&&n!==null&&(Fi=n=n.return);continue}break}while(!0)}function Nne(){var e=Y_.current;return Y_.current=G_,e===null?G_:e}function VD(){(Xi===0||Xi===3||Xi===2)&&(Xi=4),us===null||!(Qp&268435455)&&!(eE&268435455)||_h(us,Ps)}function Z_(e,t){var n=Dn;Dn|=2;var r=Nne();(us!==e||Ps!==t)&&(Yu=null,Cp(e,t));do try{Obe();break}catch(i){Bne(e,i)}while(!0);if(jD(),Dn=n,Y_.current=r,Fi!==null)throw Error(We(261));return us=null,Ps=0,Xi}function Obe(){for(;Fi!==null;)Ene(Fi)}function Fbe(){for(;Fi!==null&&!awe();)Ene(Fi)}function Ene(e){var t=Pne(e.alternate,e,No);e.memoizedProps=e.pendingProps,t===null?Tne(e):Fi=t,UD.current=null}function Tne(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Bbe(n,t),n!==null){n.flags&=32767,Fi=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xi=6,Fi=null;return}}else if(n=jbe(n,t,No),n!==null){Fi=n;return}if(t=t.sibling,t!==null){Fi=t;return}Fi=t=e}while(t!==null);Xi===0&&(Xi=5)}function FA(e,t,n){var r=er,i=bl.transition;try{bl.transition=null,er=1,Mbe(e,t,n,r)}finally{bl.transition=i,er=r}return null}function Mbe(e,t,n,r){do my();while(zh!==null);if(Dn&6)throw Error(We(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(We(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(mwe(e,s),e===us&&(Fi=us=null,Ps=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||eS||(eS=!0,One(O_,function(){return my(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=bl.transition,bl.transition=null;var a=er;er=1;var o=Dn;Dn|=4,UD.current=null,Ebe(e,n),kne(n,e),nbe(s3),M_=!!i3,s3=i3=null,e.current=n,Tbe(n),owe(),Dn=o,er=a,bl.transition=s}else e.current=n;if(eS&&(eS=!1,zh=e,J_=i),s=e.pendingLanes,s===0&&(lf=null),uwe(n.stateNode),so(e,xi()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(X_)throw X_=!1,e=k3,k3=null,e;return J_&1&&e.tag!==0&&my(),s=e.pendingLanes,s&1?e===_3?Bw++:(Bw=0,_3=e):Bw=0,Hf(),null}function my(){if(zh!==null){var e=dte(J_),t=bl.transition,n=er;try{if(bl.transition=null,er=16>e?16:e,zh===null)var r=!1;else{if(e=zh,zh=null,J_=0,Dn&6)throw Error(We(331));var i=Dn;for(Dn|=4,yt=e.current;yt!==null;){var s=yt,a=s.child;if(yt.flags&16){var o=s.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(yt=u;yt!==null;){var d=yt;switch(d.tag){case 0:case 11:case 15:_w(8,d,s)}var h=d.child;if(h!==null)h.return=d,yt=h;else for(;yt!==null;){d=yt;var A=d.sibling,f=d.return;if(bne(d),d===u){yt=null;break}if(A!==null){A.return=f,yt=A;break}yt=f}}}var p=s.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(m!==null)}}yt=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,yt=a;else e:for(;yt!==null;){if(s=yt,s.flags&2048)switch(s.tag){case 0:case 11:case 15:_w(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,yt=y;break e}yt=s.return}}var v=e.current;for(yt=v;yt!==null;){a=yt;var x=a.child;if(a.subtreeFlags&2064&&x!==null)x.return=a,yt=x;else e:for(a=v;yt!==null;){if(o=yt,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:ZN(9,o)}}catch(w){ci(o,o.return,w)}if(o===a){yt=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,yt=b;break e}yt=o.return}}if(Dn=i,Hf(),au&&typeof au.onPostCommitFiberRoot=="function")try{au.onPostCommitFiberRoot(VN,e)}catch{}r=!0}return r}finally{er=n,bl.transition=t}}return!1}function u7(e,t,n){t=sv(n,t),t=dne(e,t,1),e=of(e,t,1),t=Na(),e!==null&&(f2(e,1,t),so(e,t))}function ci(e,t,n){if(e.tag===3)u7(e,e,n);else for(;t!==null;){if(t.tag===3){u7(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(lf===null||!lf.has(r))){e=sv(n,e),e=hne(t,e,1),t=of(t,e,1),e=Na(),t!==null&&(f2(t,1,e),so(t,e));break}}t=t.return}}function Lbe(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Na(),e.pingedLanes|=e.suspendedLanes&n,us===e&&(Ps&n)===n&&(Xi===4||Xi===3&&(Ps&130023424)===Ps&&500>xi()-QD?Cp(e,0):HD|=n),so(e,t)}function Ine(e,t){t===0&&(e.mode&1?(t=zC,zC<<=1,!(zC&130023424)&&(zC=4194304)):t=1);var n=Na();e=xd(e,t),e!==null&&(f2(e,t,n),so(e,n))}function Rbe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ine(e,n)}function Dbe(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(We(314))}r!==null&&r.delete(t),Ine(e,n)}var Pne;Pne=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ro.current)Ya=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ya=!1,_be(e,t,n);Ya=!!(e.flags&131072)}else Ya=!1,zr&&t.flags&1048576&&Lte(t,$_,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;$k(e,t),e=t.pendingProps;var i=tv(t,ia.current);py(t,n),i=FD(null,t,r,e,i,n);var s=MD();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,io(r)?(s=!0,H_(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ED(t),i.updater=JN,t.stateNode=i,i._reactInternals=t,A3(t,r,e,n),t=g3(null,t,r,!0,s,n)):(t.tag=0,zr&&s&&CD(t),va(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch($k(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Hbe(r),e=nc(r,e),i){case 0:t=m3(null,t,r,e,n);break e;case 1:t=e7(null,t,r,e,n);break e;case 11:t=J8(null,t,r,e,n);break e;case 14:t=Z8(null,t,r,nc(r.type,e),n);break e}throw Error(We(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nc(r,i),m3(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nc(r,i),e7(e,t,r,i,n);case 3:e:{if(mne(t),e===null)throw Error(We(387));r=t.pendingProps,s=t.memoizedState,i=s.element,$te(e,t),K_(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=sv(Error(We(423)),t),t=t7(e,t,r,n,i);break e}else if(r!==i){i=sv(Error(We(424)),t),t=t7(e,t,r,n,i);break e}else for(Oo=af(t.stateNode.containerInfo.firstChild),Do=t,zr=!0,cc=null,n=Hte(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(nv(),r===i){t=wd(e,t,n);break e}va(e,t,r,n)}t=t.child}return t;case 5:return zte(t),e===null&&d3(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,a3(r,i)?a=null:s!==null&&a3(r,s)&&(t.flags|=32),pne(e,t),va(e,t,a,n),t.child;case 6:return e===null&&d3(t),null;case 13:return gne(e,t,n);case 4:return TD(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rv(t,null,r,n):va(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nc(r,i),J8(e,t,r,i,n);case 7:return va(e,t,t.pendingProps,n),t.child;case 8:return va(e,t,t.pendingProps.children,n),t.child;case 12:return va(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,kr(z_,r._currentValue),r._currentValue=a,s!==null)if(bc(s.value,a)){if(s.children===i.children&&!ro.current){t=wd(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=ud(-1,n&-n),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),h3(s.return,n,t),o.lanes|=n;break}c=c.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(We(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),h3(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}va(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,py(t,n),i=Il(i),r=r(i),t.flags|=1,va(e,t,r,n),t.child;case 14:return r=t.type,i=nc(r,t.pendingProps),i=nc(r.type,i),Z8(e,t,r,i,n);case 15:return fne(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nc(r,i),$k(e,t),t.tag=1,io(r)?(e=!0,H_(t)):e=!1,py(t,n),une(t,r,i),A3(t,r,i,n),g3(null,t,r,!0,e,n);case 19:return yne(e,t,n);case 22:return Ane(e,t,n)}throw Error(We(156,t.tag))};function One(e,t){return ote(e,t)}function Ube(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gl(e,t,n,r){return new Ube(e,t,n,r)}function KD(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hbe(e){if(typeof e=="function")return KD(e)?1:0;if(e!=null){if(e=e.$$typeof,e===dD)return 11;if(e===hD)return 14}return 2}function uf(e,t){var n=e.alternate;return n===null?(n=gl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kk(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")KD(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case $g:return Sp(n.children,i,s,t);case uD:a=8,i|=8;break;case RO:return e=gl(12,n,t,i|2),e.elementType=RO,e.lanes=s,e;case DO:return e=gl(13,n,t,i),e.elementType=DO,e.lanes=s,e;case UO:return e=gl(19,n,t,i),e.elementType=UO,e.lanes=s,e;case zee:return tE(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qee:a=10;break e;case $ee:a=9;break e;case dD:a=11;break e;case hD:a=14;break e;case gh:a=16,r=null;break e}throw Error(We(130,e==null?e:typeof e,""))}return t=gl(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Sp(e,t,n,r){return e=gl(7,e,r,t),e.lanes=n,e}function tE(e,t,n,r){return e=gl(22,e,r,t),e.elementType=zee,e.lanes=n,e.stateNode={isHidden:!1},e}function TI(e,t,n){return e=gl(6,e,null,t),e.lanes=n,e}function II(e,t,n){return t=gl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qbe(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hI(0),this.expirationTimes=hI(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hI(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function qD(e,t,n,r,i,s,a,o,c){return e=new Qbe(e,t,n,o,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=gl(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ED(s),e}function $be(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qg,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Fne(e){if(!e)return Bf;e=e._reactInternals;e:{if(pm(e)!==e||e.tag!==1)throw Error(We(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(io(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(We(171))}if(e.tag===1){var n=e.type;if(io(n))return Fte(e,n,t)}return t}function Mne(e,t,n,r,i,s,a,o,c){return e=qD(n,r,!0,e,i,s,a,o,c),e.context=Fne(null),n=e.current,r=Na(),i=cf(n),s=ud(r,i),s.callback=t??null,of(n,s,i),e.current.lanes=i,f2(e,i,r),so(e,r),e}function nE(e,t,n,r){var i=t.current,s=Na(),a=cf(i);return n=Fne(n),t.context===null?t.context=n:t.pendingContext=n,t=ud(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=of(i,t,a),e!==null&&(gc(e,i,a,s),Uk(e,i,a)),a}function ej(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function d7(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function WD(e,t){d7(e,t),(e=e.alternate)&&d7(e,t)}function zbe(){return null}var Lne=typeof reportError=="function"?reportError:function(e){console.error(e)};function GD(e){this._internalRoot=e}rE.prototype.render=GD.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(We(409));nE(e,t,null,null)};rE.prototype.unmount=GD.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$p(function(){nE(null,e,null,null)}),t[vd]=null}};function rE(e){this._internalRoot=e}rE.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ate();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kh.length&&t!==0&&t<kh[n].priority;n++);kh.splice(n,0,e),n===0&&mte(e)}};function YD(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function iE(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function h7(){}function Vbe(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=ej(a);s.call(u)}}var a=Mne(t,r,e,0,null,!1,!1,"",h7);return e._reactRootContainer=a,e[vd]=a.current,bb(e.nodeType===8?e.parentNode:e),$p(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=ej(c);o.call(u)}}var c=qD(e,0,!1,null,null,!1,!1,"",h7);return e._reactRootContainer=c,e[vd]=c.current,bb(e.nodeType===8?e.parentNode:e),$p(function(){nE(t,c,n,r)}),c}function sE(e,t,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var c=ej(a);o.call(c)}}nE(t,a,e,i)}else a=Vbe(n,t,e,i,r);return ej(a)}hte=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xx(t.pendingLanes);n!==0&&(pD(t,n|1),so(t,xi()),!(Dn&6)&&(av=xi()+500,Hf()))}break;case 13:$p(function(){var r=xd(e,1);if(r!==null){var i=Na();gc(r,e,1,i)}}),WD(e,1)}};mD=function(e){if(e.tag===13){var t=xd(e,134217728);if(t!==null){var n=Na();gc(t,e,134217728,n)}WD(e,134217728)}};fte=function(e){if(e.tag===13){var t=cf(e),n=xd(e,t);if(n!==null){var r=Na();gc(n,e,t,r)}WD(e,t)}};Ate=function(){return er};pte=function(e,t){var n=er;try{return er=e,t()}finally{er=n}};YO=function(e,t,n){switch(t){case"input":if($O(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=GN(r);if(!i)throw Error(We(90));Kee(r),$O(r,i)}}}break;case"textarea":Wee(e,n);break;case"select":t=n.value,t!=null&&dy(e,!!n.multiple,t,!1)}};tte=$D;nte=$p;var Kbe={usingClientEntryPoint:!1,Events:[p2,qg,GN,Zee,ete,$D]},px={findFiberByHostInstance:GA,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qbe={bundleType:px.bundleType,version:px.version,rendererPackageName:px.rendererPackageName,rendererConfig:px.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Td.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ste(e),e===null?null:e.stateNode},findFiberByHostInstance:px.findFiberByHostInstance||zbe,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 tS=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tS.isDisabled&&tS.supportsFiber)try{VN=tS.inject(qbe),au=tS}catch{}}Vo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kbe;Vo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!YD(t))throw Error(We(200));return $be(e,t,null,n)};Vo.createRoot=function(e,t){if(!YD(e))throw Error(We(299));var n=!1,r="",i=Lne;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=qD(e,1,!1,null,null,n,!1,r,i),e[vd]=t.current,bb(e.nodeType===8?e.parentNode:e),new GD(t)};Vo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(We(188)):(e=Object.keys(e).join(","),Error(We(268,e)));return e=ste(t),e=e===null?null:e.stateNode,e};Vo.flushSync=function(e){return $p(e)};Vo.hydrate=function(e,t,n){if(!iE(t))throw Error(We(200));return sE(null,e,t,!0,n)};Vo.hydrateRoot=function(e,t,n){if(!YD(e))throw Error(We(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=Lne;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Mne(t,null,e,1,n??null,i,!1,s,a),e[vd]=t.current,bb(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new rE(t)};Vo.render=function(e,t,n){if(!iE(t))throw Error(We(200));return sE(null,e,t,!1,n)};Vo.unmountComponentAtNode=function(e){if(!iE(e))throw Error(We(40));return e._reactRootContainer?($p(function(){sE(null,null,e,!1,function(){e._reactRootContainer=null,e[vd]=null})}),!0):!1};Vo.unstable_batchedUpdates=$D;Vo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!iE(n))throw Error(We(200));if(e==null||e._reactInternals===void 0)throw Error(We(38));return sE(e,t,n,!1,r)};Vo.version="18.3.1-next-f1338f8080-20240426";function Rne(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rne)}catch(e){console.error(e)}}Rne(),Ree.exports=Vo;var Qf=Ree.exports;const XD=Mn(Qf);var Dne,f7=Qf;Dne=f7.createRoot,f7.hydrateRoot;const Wbe=1,Gbe=1e6;let PI=0;function Ybe(){return PI=(PI+1)%Number.MAX_SAFE_INTEGER,PI.toString()}const OI=new Map,A7=e=>{if(OI.has(e))return;const t=setTimeout(()=>{OI.delete(e),Nw({type:"REMOVE_TOAST",toastId:e})},Gbe);OI.set(e,t)},Xbe=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Wbe)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?A7(n):e.toasts.forEach(r=>{A7(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},qk=[];let Wk={toasts:[]};function Nw(e){Wk=Xbe(Wk,e),qk.forEach(t=>{t(Wk)})}function De({...e}){const t=Ybe(),n=i=>Nw({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>Nw({type:"DISMISS_TOAST",toastId:t});return Nw({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function $f(){const[e,t]=C.useState(Wk);return C.useEffect(()=>(qk.push(t),()=>{const n=qk.indexOf(t);n>-1&&qk.splice(n,1)}),[e]),{...e,toast:De,dismiss:n=>Nw({type:"DISMISS_TOAST",toastId:n})}}function at(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function p7(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Une(...e){return t=>{let n=!1;const r=e.map(i=>{const s=p7(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():p7(e[i],null)}}}}function sn(...e){return C.useCallback(Une(...e),e)}function Jbe(e,t){const n=C.createContext(t),r=s=>{const{children:a,...o}=s,c=C.useMemo(()=>o,Object.values(o));return l.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function i(s){const a=C.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function fs(e,t=[]){let n=[];function r(s,a){const o=C.createContext(a),c=n.length;n=[...n,a];const u=h=>{var y;const{scope:A,children:f,...p}=h,m=((y=A==null?void 0:A[e])==null?void 0:y[c])||o,g=C.useMemo(()=>p,Object.values(p));return l.jsx(m.Provider,{value:g,children:f})};u.displayName=s+"Provider";function d(h,A){var m;const f=((m=A==null?void 0:A[e])==null?void 0:m[c])||o,p=C.useContext(f);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(a=>C.createContext(a));return function(o){const c=(o==null?void 0:o[e])||s;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,Zbe(i,...t)]}function Zbe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const h=c(s)[`__scope${u}`];return{...o,...h}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function zp(e){const t=t1e(e),n=C.forwardRef((r,i)=>{const{children:s,...a}=r,o=C.Children.toArray(s),c=o.find(n1e);if(c){const u=c.props.children,d=o.map(h=>h===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:h);return l.jsx(t,{...a,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,d):null})}return l.jsx(t,{...a,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var e1e=zp("Slot");function t1e(e){const t=C.forwardRef((n,r)=>{const{children:i,...s}=n;if(C.isValidElement(i)){const a=i1e(i),o=r1e(s,i.props);return i.type!==C.Fragment&&(o.ref=r?Une(r,a):a),C.cloneElement(i,o)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hne=Symbol("radix.slottable");function Qne(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Hne,t}function n1e(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hne}function r1e(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{const c=s(...o);return i(...o),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function i1e(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function aE(e){const t=e+"CollectionProvider",[n,r]=fs(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:g,children:y}=m,v=re.useRef(null),x=re.useRef(new Map).current;return l.jsx(i,{scope:g,itemMap:x,collectionRef:v,children:y})};a.displayName=t;const o=e+"CollectionSlot",c=zp(o),u=re.forwardRef((m,g)=>{const{scope:y,children:v}=m,x=s(o,y),b=sn(g,x.collectionRef);return l.jsx(c,{ref:b,children:v})});u.displayName=o;const d=e+"CollectionItemSlot",h="data-radix-collection-item",A=zp(d),f=re.forwardRef((m,g)=>{const{scope:y,children:v,...x}=m,b=re.useRef(null),w=sn(g,b),k=s(d,y);return re.useEffect(()=>(k.itemMap.set(b,{ref:b,...x}),()=>void k.itemMap.delete(b))),l.jsx(A,{[h]:"",ref:w,children:v})});f.displayName=d;function p(m){const g=s(e+"CollectionConsumer",m);return re.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((k,j)=>x.indexOf(k.ref.current)-x.indexOf(j.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:f},p,r]}var s1e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_t=s1e.reduce((e,t)=>{const n=zp(`Primitive.${t}`),r=C.forwardRef((i,s)=>{const{asChild:a,...o}=i,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $ne(e,t){e&&Qf.flushSync(()=>e.dispatchEvent(t))}function Yi(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function a1e(e,t=globalThis==null?void 0:globalThis.document){const n=Yi(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var o1e="DismissableLayer",N3="dismissableLayer.update",l1e="dismissableLayer.pointerDownOutside",c1e="dismissableLayer.focusOutside",m7,zne=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zv=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...c}=e,u=C.useContext(zne),[d,h]=C.useState(null),A=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=C.useState({}),p=sn(t,j=>h(j)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),v=d?m.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=y,w=d1e(j=>{const B=j.target,E=[...u.branches].some(P=>P.contains(B));!b||E||(i==null||i(j),a==null||a(j),j.defaultPrevented||o==null||o())},A),k=h1e(j=>{const B=j.target;[...u.branches].some(P=>P.contains(B))||(s==null||s(j),a==null||a(j),j.defaultPrevented||o==null||o())},A);return a1e(j=>{v===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&o&&(j.preventDefault(),o()))},A),C.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(m7=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),g7(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(A.body.style.pointerEvents=m7)}},[d,A,n,u]),C.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),g7())},[d,u]),C.useEffect(()=>{const j=()=>f({});return document.addEventListener(N3,j),()=>document.removeEventListener(N3,j)},[]),l.jsx(_t.div,{...c,ref:p,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:at(e.onFocusCapture,k.onFocusCapture),onBlurCapture:at(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:at(e.onPointerDownCapture,w.onPointerDownCapture)})});Zv.displayName=o1e;var u1e="DismissableLayerBranch",Vne=C.forwardRef((e,t)=>{const n=C.useContext(zne),r=C.useRef(null),i=sn(t,r);return C.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(_t.div,{...e,ref:i})});Vne.displayName=u1e;function d1e(e,t=globalThis==null?void 0:globalThis.document){const n=Yi(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let c=function(){Kne(l1e,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function h1e(e,t=globalThis==null?void 0:globalThis.document){const n=Yi(e),r=C.useRef(!1);return C.useEffect(()=>{const i=s=>{s.target&&!r.current&&Kne(c1e,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function g7(){const e=new CustomEvent(N3);document.dispatchEvent(e)}function Kne(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$ne(i,s):i.dispatchEvent(s)}var f1e=Zv,A1e=Vne,Zi=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},p1e="Portal",g2=C.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=C.useState(!1);Zi(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?XD.createPortal(l.jsx(_t.div,{...r,ref:t}),a):null});g2.displayName=p1e;function m1e(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var aa=e=>{const{present:t,children:n}=e,r=g1e(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=sn(r.ref,y1e(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:s}):null};aa.displayName="Presence";function g1e(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),s=C.useRef("none"),a=e?"mounted":"unmounted",[o,c]=m1e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=nS(r.current);s.current=o==="mounted"?u:"none"},[o]),Zi(()=>{const u=r.current,d=i.current;if(d!==e){const A=s.current,f=nS(u);e?c("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&A!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Zi(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=f=>{const m=nS(r.current).includes(f.animationName);if(f.target===t&&m&&(c("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},A=f=>{f.target===t&&(s.current=nS(r.current))};return t.addEventListener("animationstart",A),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",A),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function nS(e){return(e==null?void 0:e.animationName)||"none"}function y1e(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var v1e=aD[" useInsertionEffect ".trim().toString()]||Zi;function lo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,a]=x1e({defaultProp:t,onChange:n}),o=e!==void 0,c=o?e:i;{const d=C.useRef(e!==void 0);C.useEffect(()=>{const h=d.current;h!==o&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${o?"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=o},[o,r])}const u=C.useCallback(d=>{var h;if(o){const A=w1e(d)?d(e):d;A!==e&&((h=a.current)==null||h.call(a,A))}else s(d)},[o,e,s,a]);return[c,u]}function x1e({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),s=C.useRef(t);return v1e(()=>{s.current=t},[t]),C.useEffect(()=>{var a;i.current!==n&&((a=s.current)==null||a.call(s,n),i.current=n)},[n,i]),[n,r,s]}function w1e(e){return typeof e=="function"}var qne=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"}),b1e="VisuallyHidden",oE=C.forwardRef((e,t)=>l.jsx(_t.span,{...e,ref:t,style:{...qne,...e.style}}));oE.displayName=b1e;var C1e=oE,JD="ToastProvider",[ZD,S1e,k1e]=aE("Toast"),[Wne,_Tt]=fs("Toast",[k1e]),[_1e,lE]=Wne(JD),Gne=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=e,[o,c]=C.useState(null),[u,d]=C.useState(0),h=C.useRef(!1),A=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${JD}\`. Expected non-empty \`string\`.`),l.jsx(ZD.Provider,{scope:t,children:l.jsx(_1e,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:C.useCallback(()=>d(f=>f+1),[]),onToastRemove:C.useCallback(()=>d(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:A,children:a})})};Gne.displayName=JD;var Yne="ToastViewport",j1e=["F8"],E3="toast.viewportPause",T3="toast.viewportResume",Xne=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=j1e,label:i="Notifications ({hotkey})",...s}=e,a=lE(Yne,n),o=S1e(n),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),h=C.useRef(null),A=sn(t,h,a.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=a.toastCount>0;C.useEffect(()=>{const g=y=>{var x;r.length!==0&&r.every(b=>y[b]||y.code===b)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),C.useEffect(()=>{const g=c.current,y=h.current;if(p&&g&&y){const v=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(E3);y.dispatchEvent(k),a.isClosePausedRef.current=!0}},x=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(T3);y.dispatchEvent(k),a.isClosePausedRef.current=!1}},b=k=>{!g.contains(k.relatedTarget)&&x()},w=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",v),g.addEventListener("focusout",b),g.addEventListener("pointermove",v),g.addEventListener("pointerleave",w),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",v),g.removeEventListener("focusout",b),g.removeEventListener("pointermove",v),g.removeEventListener("pointerleave",w),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[p,a.isClosePausedRef]);const m=C.useCallback(({tabbingDirection:g})=>{const v=o().map(x=>{const b=x.ref.current,w=[b,...U1e(b)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?v.reverse():v).flat()},[o]);return C.useEffect(()=>{const g=h.current;if(g){const y=v=>{var w,k,j;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const B=document.activeElement,E=v.shiftKey;if(v.target===g&&E){(w=u.current)==null||w.focus();return}const N=m({tabbingDirection:E?"backwards":"forwards"}),F=N.findIndex(L=>L===B);FI(N.slice(F+1))?v.preventDefault():E?(k=u.current)==null||k.focus():(j=d.current)==null||j.focus()}};return g.addEventListener("keydown",y),()=>g.removeEventListener("keydown",y)}},[o,m]),l.jsxs(A1e,{ref:c,role:"region","aria-label":i.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&l.jsx(I3,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});FI(g)}}),l.jsx(ZD.Slot,{scope:n,children:l.jsx(_t.ol,{tabIndex:-1,...s,ref:A})}),p&&l.jsx(I3,{ref:d,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});FI(g)}})]})});Xne.displayName=Yne;var Jne="ToastFocusProxy",I3=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=lE(Jne,n);return l.jsx(oE,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=s.viewport)!=null&&u.contains(o))&&r()}})});I3.displayName=Jne;var y2="Toast",B1e="toast.swipeStart",N1e="toast.swipeMove",E1e="toast.swipeCancel",T1e="toast.swipeEnd",Zne=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...a}=e,[o,c]=lo({prop:r,defaultProp:i??!0,onChange:s,caller:y2});return l.jsx(aa,{present:n||o,children:l.jsx(O1e,{open:o,...a,ref:t,onClose:()=>c(!1),onPause:Yi(e.onPause),onResume:Yi(e.onResume),onSwipeStart:at(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:at(e.onSwipeMove,u=>{const{x:d,y:h}=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",`${h}px`)}),onSwipeCancel:at(e.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:at(e.onSwipeEnd,u=>{const{x:d,y:h}=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",`${h}px`),c(!1)})})})});Zne.displayName=y2;var[I1e,P1e]=Wne(y2,{onClose(){}}),O1e=C.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:A,onSwipeEnd:f,...p}=e,m=lE(y2,n),[g,y]=C.useState(null),v=sn(t,L=>y(L)),x=C.useRef(null),b=C.useRef(null),w=i||m.duration,k=C.useRef(0),j=C.useRef(w),B=C.useRef(0),{onToastAdd:E,onToastRemove:P}=m,T=Yi(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=m.viewport)==null||U.focus()),a()}),N=C.useCallback(L=>{!L||L===1/0||(window.clearTimeout(B.current),k.current=new Date().getTime(),B.current=window.setTimeout(T,L))},[T]);C.useEffect(()=>{const L=m.viewport;if(L){const U=()=>{N(j.current),u==null||u()},H=()=>{const W=new Date().getTime()-k.current;j.current=j.current-W,window.clearTimeout(B.current),c==null||c()};return L.addEventListener(E3,H),L.addEventListener(T3,U),()=>{L.removeEventListener(E3,H),L.removeEventListener(T3,U)}}},[m.viewport,w,c,u,N]),C.useEffect(()=>{s&&!m.isClosePausedRef.current&&N(w)},[s,w,m.isClosePausedRef,N]),C.useEffect(()=>(E(),()=>P()),[E,P]);const F=C.useMemo(()=>g?are(g):null,[g]);return m.viewport?l.jsxs(l.Fragment,{children:[F&&l.jsx(F1e,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),l.jsx(I1e,{scope:n,onClose:T,children:Qf.createPortal(l.jsx(ZD.ItemSlot,{scope:n,children:l.jsx(f1e,{asChild:!0,onEscapeKeyDown:at(o,()=>{m.isFocusedToastEscapeKeyDownRef.current||T(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(_t.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...p,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:at(e.onKeyDown,L=>{L.key==="Escape"&&(o==null||o(L.nativeEvent),L.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,T()))}),onPointerDown:at(e.onPointerDown,L=>{L.button===0&&(x.current={x:L.clientX,y:L.clientY})}),onPointerMove:at(e.onPointerMove,L=>{if(!x.current)return;const U=L.clientX-x.current.x,H=L.clientY-x.current.y,W=!!b.current,$=["left","right"].includes(m.swipeDirection),z=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Q=$?z(0,U):0,ce=$?0:z(0,H),R=L.pointerType==="touch"?10:2,M={x:Q,y:ce},Y={originalEvent:L,delta:M};W?(b.current=M,rS(N1e,h,Y,{discrete:!1})):y7(M,m.swipeDirection,R)?(b.current=M,rS(B1e,d,Y,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(U)>R||Math.abs(H)>R)&&(x.current=null)}),onPointerUp:at(e.onPointerUp,L=>{const U=b.current,H=L.target;if(H.hasPointerCapture(L.pointerId)&&H.releasePointerCapture(L.pointerId),b.current=null,x.current=null,U){const W=L.currentTarget,$={originalEvent:L,delta:U};y7(U,m.swipeDirection,m.swipeThreshold)?rS(T1e,f,$,{discrete:!0}):rS(E1e,A,$,{discrete:!0}),W.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),F1e=e=>{const{__scopeToast:t,children:n,...r}=e,i=lE(y2,t),[s,a]=C.useState(!1),[o,c]=C.useState(!1);return R1e(()=>a(!0)),C.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:l.jsx(g2,{asChild:!0,children:l.jsx(oE,{...r,children:s&&l.jsxs(l.Fragment,{children:[i.label," ",n]})})})},M1e="ToastTitle",ere=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(_t.div,{...r,ref:t})});ere.displayName=M1e;var L1e="ToastDescription",tre=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(_t.div,{...r,ref:t})});tre.displayName=L1e;var nre="ToastAction",rre=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(sre,{altText:n,asChild:!0,children:l.jsx(eU,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${nre}\`. Expected non-empty \`string\`.`),null)});rre.displayName=nre;var ire="ToastClose",eU=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=P1e(ire,n);return l.jsx(sre,{asChild:!0,children:l.jsx(_t.button,{type:"button",...r,ref:t,onClick:at(e.onClick,i.onClose)})})});eU.displayName=ire;var sre=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return l.jsx(_t.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function are(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),D1e(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...are(r))}}),t}function rS(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$ne(i,s):i.dispatchEvent(s)}var y7=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),s=r>i;return t==="left"||t==="right"?s&&r>n:!s&&i>n};function R1e(e=()=>{}){const t=Yi(e);Zi(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function D1e(e){return e.nodeType===e.ELEMENT_NODE}function U1e(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function FI(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var H1e=Gne,ore=Xne,lre=Zne,cre=ere,ure=tre,dre=rre,hre=eU;function fre(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fre(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fre(e))&&(r&&(r+=" "),r+=t);return r}const v7=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,x7=Fn,v2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return x7(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],h=s==null?void 0:s[u];if(d===null)return null;const A=v7(d)||v7(h);return i[u][A]}),o=n&&Object.entries(n).reduce((u,d)=>{let[h,A]=d;return A===void 0||(u[h]=A),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:A,...f}=d;return Object.entries(f).every(p=>{let[m,g]=p;return Array.isArray(g)?g.includes({...s,...o}[m]):{...s,...o}[m]===g})?[...u,h,A]:u},[]);return x7(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Q1e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Are=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var $1e={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"};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z1e=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},c)=>C.createElement("svg",{ref:c,...$1e,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Are("lucide",i),...o},[...a.map(([u,d])=>C.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qe=(e,t)=>{const n=C.forwardRef(({className:r,...i},s)=>C.createElement(z1e,{ref:s,iconNode:t,className:Are(`lucide-${Q1e(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tj=Qe("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-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mm=Qe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xa=Qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tU=Qe("Bath",[["path",{d:"M10 4 8 6",key:"1rru8s"}],["path",{d:"M17 19v2",key:"ts1sot"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M7 19v2",key:"12npes"}],["path",{d:"M9 5 7.621 3.621A2.121 2.121 0 0 0 4 5v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5",key:"14ym8i"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pre=Qe("BedDouble",[["path",{d:"M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8",key:"1k78r4"}],["path",{d:"M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4",key:"fb3tl2"}],["path",{d:"M12 4v6",key:"1dcgq2"}],["path",{d:"M2 18h20",key:"ajqnye"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const V1e=Qe("Bed",[["path",{d:"M2 4v16",key:"vw9hq8"}],["path",{d:"M2 8h18a2 2 0 0 1 2 2v10",key:"1dgv2r"}],["path",{d:"M2 17h20",key:"18nfp3"}],["path",{d:"M6 8v9",key:"1yriud"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K1e=Qe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const q1e=Qe("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gk=Qe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const W1e=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mre=Qe("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cl=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const G1e=Qe("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gre=Qe("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yre=Qe("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sl=Qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yc=Qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vre=Qe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vc=Qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y1e=Qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const X1e=Qe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nU=Qe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const e0=Qe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xre=Qe("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x2=Qe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rU=Qe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const J1e=Qe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Z1e=Qe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const P3=Qe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const e2e=Qe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const t2e=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ao=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w7=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tb=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const n2e=Qe("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const r2e=Qe("FileCheck",[["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:"m9 15 2 2 4-4",key:"1grp1n"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wre=Qe("FileDown",[["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:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vp=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bre=Qe("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w2=Qe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const i2e=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const s2e=Qe("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const a2e=Qe("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const o2e=Qe("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cre=Qe("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const l2e=Qe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const c2e=Qe("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iU=Qe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const O3=Qe("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const u2e=Qe("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const d2e=Qe("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b7=Qe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sre=Qe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const h2e=Qe("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const f2e=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const A2e=Qe("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const p2e=Qe("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const m2e=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ea=Qe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kre=Qe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _re=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yk=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ov=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const C7=Qe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nj=Qe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const df=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jre=Qe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const g2e=Qe("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bre=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kp=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const y2e=Qe("PiggyBank",[["path",{d:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2V5z",key:"1ivx2i"}],["path",{d:"M2 9v1c0 1.1.9 2 2 2h1",key:"nm575m"}],["path",{d:"M16 11h.01",key:"xkw8gn"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F3=Qe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kp=Qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v2e=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x2e=Qe("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nu=Qe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w2e=Qe("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ib=Qe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cE=Qe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nre=Qe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sU=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b2e=Qe("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const C2e=Qe("ShieldCheck",[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Os=Qe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ere=Qe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M3=Qe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uE=Qe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ol=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S2e=Qe("Trees",[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const k2e=Qe("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tre=Qe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qp=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ire=Qe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _2e=Qe("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pre=Qe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dE=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j2e=Qe("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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const B2e=Qe("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S7=Qe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ra=Qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ore=Qe("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),aU="-",N2e=e=>{const t=T2e(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const o=a.split(aU);return o[0]===""&&o.length!==1&&o.shift(),Fre(o,t)||E2e(a)},getConflictingClassGroupIds:(a,o)=>{const c=n[a]||[];return o&&r[a]?[...c,...r[a]]:c}}},Fre=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Fre(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(aU);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},k7=/^\[(.+)\]$/,E2e=e=>{if(k7.test(e)){const t=k7.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},T2e=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return P2e(Object.entries(e.classGroups),n).forEach(([s,a])=>{L3(a,r,s,t)}),r},L3=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:_7(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(I2e(i)){L3(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{L3(a,_7(t,s),n,r)})})},_7=(e,t)=>{let n=e;return t.split(aU).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},I2e=e=>e.isThemeGetter,P2e=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[t+a,o])):s);return[n,i]}):e,O2e=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},Mre="!",F2e=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=o=>{const c=[];let u=0,d=0,h;for(let g=0;g<o.length;g++){let y=o[g];if(u===0){if(y===i&&(r||o.slice(g,g+s)===t)){c.push(o.slice(d,g)),d=g+s;continue}if(y==="/"){h=g;continue}}y==="["?u++:y==="]"&&u--}const A=c.length===0?o:o.substring(d),f=A.startsWith(Mre),p=f?A.substring(1):A,m=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}};return n?o=>n({className:o,parseClassName:a}):a},M2e=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},L2e=e=>({cache:O2e(e.cacheSize),parseClassName:F2e(e),...N2e(e)}),R2e=/\s+/,D2e=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(R2e);let o="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:h,baseClassName:A,maybePostfixModifierPosition:f}=n(u);let p=!!f,m=r(p?A.substring(0,f):A);if(!m){if(!p){o=u+(o.length>0?" "+o:o);continue}if(m=r(A),!m){o=u+(o.length>0?" "+o:o);continue}p=!1}const g=M2e(d).join(":"),y=h?g+Mre:g,v=y+m;if(s.includes(v))continue;s.push(v);const x=i(m,p);for(let b=0;b<x.length;++b){const w=x[b];s.push(y+w)}o=u+(o.length>0?" "+o:o)}return o};function U2e(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Lre(t))&&(r&&(r+=" "),r+=n);return r}const Lre=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Lre(e[r]))&&(n&&(n+=" "),n+=t);return n};function H2e(e,...t){let n,r,i,s=a;function a(c){const u=t.reduce((d,h)=>h(d),e());return n=L2e(u),r=n.cache.get,i=n.cache.set,s=o,o(c)}function o(c){const u=r(c);if(u)return u;const d=D2e(c,n);return i(c,d),d}return function(){return s(U2e.apply(null,arguments))}}const Ir=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Rre=/^\[(?:([a-z-]+):)?(.+)\]$/i,Q2e=/^\d+\/\d+$/,$2e=new Set(["px","full","screen"]),z2e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V2e=/\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$/,K2e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,q2e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W2e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ru=e=>gy(e)||$2e.has(e)||Q2e.test(e),th=e=>t0(e,"length",nCe),gy=e=>!!e&&!Number.isNaN(Number(e)),MI=e=>t0(e,"number",gy),mx=e=>!!e&&Number.isInteger(Number(e)),G2e=e=>e.endsWith("%")&&gy(e.slice(0,-1)),fn=e=>Rre.test(e),nh=e=>z2e.test(e),Y2e=new Set(["length","size","percentage"]),X2e=e=>t0(e,Y2e,Dre),J2e=e=>t0(e,"position",Dre),Z2e=new Set(["image","url"]),eCe=e=>t0(e,Z2e,iCe),tCe=e=>t0(e,"",rCe),gx=()=>!0,t0=(e,t,n)=>{const r=Rre.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},nCe=e=>V2e.test(e)&&!K2e.test(e),Dre=()=>!1,rCe=e=>q2e.test(e),iCe=e=>W2e.test(e),sCe=()=>{const e=Ir("colors"),t=Ir("spacing"),n=Ir("blur"),r=Ir("brightness"),i=Ir("borderColor"),s=Ir("borderRadius"),a=Ir("borderSpacing"),o=Ir("borderWidth"),c=Ir("contrast"),u=Ir("grayscale"),d=Ir("hueRotate"),h=Ir("invert"),A=Ir("gap"),f=Ir("gradientColorStops"),p=Ir("gradientColorStopPositions"),m=Ir("inset"),g=Ir("margin"),y=Ir("opacity"),v=Ir("padding"),x=Ir("saturate"),b=Ir("scale"),w=Ir("sepia"),k=Ir("skew"),j=Ir("space"),B=Ir("translate"),E=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",fn,t],N=()=>[fn,t],F=()=>["",Ru,th],L=()=>["auto",gy,fn],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",fn],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[gy,fn];return{cacheSize:500,separator:":",theme:{colors:[gx],spacing:[Ru,th],blur:["none","",nh,fn],brightness:ce(),borderColor:[e],borderRadius:["none","","full",nh,fn],borderSpacing:N(),borderWidth:F(),contrast:ce(),grayscale:z(),hueRotate:ce(),invert:z(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[G2e,th],inset:T(),margin:T(),opacity:ce(),padding:N(),saturate:ce(),scale:ce(),sepia:z(),skew:ce(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",fn]}],container:["container"],columns:[{columns:[nh]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"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(),fn]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mx,fn]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",fn]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",mx,fn]}],"grid-cols":[{"grid-cols":[gx]}],"col-start-end":[{col:["auto",{span:["full",mx,fn]},fn]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[gx]}],"row-start-end":[{row:["auto",{span:[mx,fn]},fn]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fn]}],gap:[{gap:[A]}],"gap-x":[{"gap-x":[A]}],"gap-y":[{"gap-y":[A]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fn,t]}],"min-w":[{"min-w":[fn,t,"min","max","fit"]}],"max-w":[{"max-w":[fn,t,"none","full","min","max","fit","prose",{screen:[nh]},nh]}],h:[{h:[fn,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fn,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fn,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fn,t,"auto","min","max","fit"]}],"font-size":[{text:["base",nh,th]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",MI]}],"font-family":[{font:[gx]}],"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",fn]}],"line-clamp":[{"line-clamp":["none",gy,MI]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ru,fn]}],"list-image":[{"list-image":["none",fn]}],"list-style-type":[{list:["none","disc","decimal",fn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ru,th]}],"underline-offset":[{"underline-offset":["auto",Ru,fn]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fn]}],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",fn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),J2e]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",X2e]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eCe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:H()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Ru,fn]}],"outline-w":[{outline:[Ru,th]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ru,th]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",nh,tCe]}],"shadow-color":[{shadow:[gx]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",nh,fn]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[x]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",fn]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",fn]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",fn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[mx,fn]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"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",fn]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fn]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fn]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ru,th,MI]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-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"]}}},aCe=H2e(sCe);function ot(...e){return aCe(Fn(e))}const oCe=H1e,Ure=C.forwardRef(({className:e,...t},n)=>l.jsx(ore,{ref:n,className:ot("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]",e),...t}));Ure.displayName=ore.displayName;const lCe=v2("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"}}),Hre=C.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(lre,{ref:r,className:ot(lCe({variant:t}),e),...n}));Hre.displayName=lre.displayName;const cCe=C.forwardRef(({className:e,...t},n)=>l.jsx(dre,{ref:n,className:ot("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",e),...t}));cCe.displayName=dre.displayName;const Qre=C.forwardRef(({className:e,...t},n)=>l.jsx(hre,{ref:n,className:ot("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",e),"toast-close":"",...t,children:l.jsx(ra,{className:"h-4 w-4"})}));Qre.displayName=hre.displayName;const $re=C.forwardRef(({className:e,...t},n)=>l.jsx(cre,{ref:n,className:ot("text-sm font-semibold",e),...t}));$re.displayName=cre.displayName;const zre=C.forwardRef(({className:e,...t},n)=>l.jsx(ure,{ref:n,className:ot("text-sm opacity-90",e),...t}));zre.displayName=ure.displayName;function uCe(){const{toasts:e}=$f();return l.jsxs(oCe,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return l.jsxs(Hre,{...s,children:[l.jsxs("div",{className:"grid gap-1",children:[n&&l.jsx($re,{children:n}),r&&l.jsx(zre,{children:r})]}),i,l.jsx(Qre,{})]},t)}),l.jsx(Ure,{})]})}var j7=["light","dark"],dCe="(prefers-color-scheme: dark)",hCe=C.createContext(void 0),fCe={setTheme:e=>{},themes:[]},ACe=()=>{var e;return(e=C.useContext(hCe))!=null?e:fCe};C.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,attrs:o,nonce:c})=>{let u=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(p=>`'${p}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=i?j7.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",A=(p,m=!1,g=!0)=>{let y=a?a[p]:p,v=m?p+"|| ''":`'${y}'`,x="";return i&&g&&!m&&j7.includes(p)&&(x+=`d.style.colorScheme = '${p}';`),n==="class"?m||y?x+=`c.add(${v})`:x+="null":y&&(x+=`d[s](n,${v})`),x},f=e?`!function(){${d}${A(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${dCe}',m=window.matchMedia(t);if(m.media!==t||m.matches){${A("dark")}}else{${A("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${A(a?"x[e]":"e",!0)}}${u?"":"else{"+A(s,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${A(a?"x[e]":"e",!0)}}else{${A(s,!1,!1)};}${h}}catch(t){}}();`;return C.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var pCe=e=>{switch(e){case"success":return yCe;case"info":return xCe;case"warning":return vCe;case"error":return wCe;default:return null}},mCe=Array(12).fill(0),gCe=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},mCe.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),vCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.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"})),xCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),wCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),bCe=re.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"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),CCe=()=>{let[e,t]=re.useState(document.hidden);return re.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},R3=1,SCe=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:R3++,a=this.toasts.find(c=>c.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:r}),{...c,...t,id:s,dismissible:o,title:r}):c):this.addToast({title:r,...i,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let i=t instanceof Promise?t:t(),s=r!==void 0,a,o=i.then(async u=>{if(a=["resolve",u],re.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(_Ce(u)&&!u.ok){s=!1;let d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description;this.create({id:r,type:"error",message:d,description:h})}else if(n.success!==void 0){s=!1;let d=typeof n.success=="function"?await n.success(u):n.success,h=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"success",message:d,description:h})}}).catch(async u=>{if(a=["reject",u],n.error!==void 0){s=!1;let d=typeof n.error=="function"?await n.error(u):n.error,h=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"error",message:d,description:h})}}).finally(()=>{var u;s&&(this.dismiss(r),r=void 0),(u=n.finally)==null||u.call(n)}),c=()=>new Promise((u,d)=>o.then(()=>a[0]==="reject"?d(a[1]):u(a[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||R3++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},$a=new SCe,kCe=(e,t)=>{let n=(t==null?void 0:t.id)||R3++;return $a.addToast({title:e,...t,id:n}),n},_Ce=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jCe=kCe,BCe=()=>$a.toasts,NCe=()=>$a.getActiveToasts(),Ew=Object.assign(jCe,{success:$a.success,info:$a.info,warning:$a.warning,error:$a.error,custom:$a.custom,message:$a.message,promise:$a.promise,dismiss:$a.dismiss,loading:$a.loading},{getHistory:BCe,getToasts:NCe});function ECe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}ECe(`: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;left: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}: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%);--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%)}
`);function iS(e){return e.label!==void 0}var TCe=3,ICe="32px",PCe="16px",B7=4e3,OCe=356,FCe=14,MCe=20,LCe=200;function Wl(...e){return e.filter(Boolean).join(" ")}function RCe(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var DCe=e=>{var t,n,r,i,s,a,o,c,u,d,h;let{invert:A,toast:f,unstyled:p,interacting:m,setHeights:g,visibleToasts:y,heights:v,index:x,toasts:b,expanded:w,removeToast:k,defaultRichColors:j,closeButton:B,style:E,cancelButtonStyle:P,actionButtonStyle:T,className:N="",descriptionClassName:F="",duration:L,position:U,gap:H,loadingIcon:W,expandByDefault:$,classNames:z,icons:Q,closeButtonAriaLabel:ce="Close toast",pauseWhenPageIsHidden:R}=e,[M,Y]=re.useState(null),[X,V]=re.useState(null),[Z,de]=re.useState(!1),[ue,se]=re.useState(!1),[he,ie]=re.useState(!1),[Ce,Ie]=re.useState(!1),[te,je]=re.useState(!1),[nt,rt]=re.useState(0),[Ne,st]=re.useState(0),we=re.useRef(f.duration||L||B7),He=re.useRef(null),Ve=re.useRef(null),Dt=x===0,pt=x+1<=y,ye=f.type,Be=f.dismissible!==!1,Ge=f.className||"",Ue=f.descriptionClassName||"",Ze=re.useMemo(()=>v.findIndex(Ut=>Ut.toastId===f.id)||0,[v,f.id]),pe=re.useMemo(()=>{var Ut;return(Ut=f.closeButton)!=null?Ut:B},[f.closeButton,B]),mt=re.useMemo(()=>f.duration||L||B7,[f.duration,L]),ft=re.useRef(0),wt=re.useRef(0),Rt=re.useRef(0),zt=re.useRef(null),[gt,Lt]=U.split("-"),Mt=re.useMemo(()=>v.reduce((Ut,Wt,wn)=>wn>=Ze?Ut:Ut+Wt.height,0),[v,Ze]),qt=CCe(),nr=f.invert||A,tn=ye==="loading";wt.current=re.useMemo(()=>Ze*H+Mt,[Ze,Mt]),re.useEffect(()=>{we.current=mt},[mt]),re.useEffect(()=>{de(!0)},[]),re.useEffect(()=>{let Ut=Ve.current;if(Ut){let Wt=Ut.getBoundingClientRect().height;return st(Wt),g(wn=>[{toastId:f.id,height:Wt,position:f.position},...wn]),()=>g(wn=>wn.filter(Nr=>Nr.toastId!==f.id))}},[g,f.id]),re.useLayoutEffect(()=>{if(!Z)return;let Ut=Ve.current,Wt=Ut.style.height;Ut.style.height="auto";let wn=Ut.getBoundingClientRect().height;Ut.style.height=Wt,st(wn),g(Nr=>Nr.find(At=>At.toastId===f.id)?Nr.map(At=>At.toastId===f.id?{...At,height:wn}:At):[{toastId:f.id,height:wn,position:f.position},...Nr])},[Z,f.title,f.description,g,f.id]);let Bt=re.useCallback(()=>{se(!0),rt(wt.current),g(Ut=>Ut.filter(Wt=>Wt.toastId!==f.id)),setTimeout(()=>{k(f)},LCe)},[f,k,g,wt]);re.useEffect(()=>{if(f.promise&&ye==="loading"||f.duration===1/0||f.type==="loading")return;let Ut;return w||m||R&&qt?(()=>{if(Rt.current<ft.current){let Wt=new Date().getTime()-ft.current;we.current=we.current-Wt}Rt.current=new Date().getTime()})():we.current!==1/0&&(ft.current=new Date().getTime(),Ut=setTimeout(()=>{var Wt;(Wt=f.onAutoClose)==null||Wt.call(f,f),Bt()},we.current)),()=>clearTimeout(Ut)},[w,m,f,ye,R,qt,Bt]),re.useEffect(()=>{f.delete&&Bt()},[Bt,f.delete]);function jn(){var Ut,Wt,wn;return Q!=null&&Q.loading?re.createElement("div",{className:Wl(z==null?void 0:z.loader,(Ut=f==null?void 0:f.classNames)==null?void 0:Ut.loader,"sonner-loader"),"data-visible":ye==="loading"},Q.loading):W?re.createElement("div",{className:Wl(z==null?void 0:z.loader,(Wt=f==null?void 0:f.classNames)==null?void 0:Wt.loader,"sonner-loader"),"data-visible":ye==="loading"},W):re.createElement(gCe,{className:Wl(z==null?void 0:z.loader,(wn=f==null?void 0:f.classNames)==null?void 0:wn.loader),visible:ye==="loading"})}return re.createElement("li",{tabIndex:0,ref:Ve,className:Wl(N,Ge,z==null?void 0:z.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[ye],(n=f==null?void 0:f.classNames)==null?void 0:n[ye]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:j,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":Z,"data-promise":!!f.promise,"data-swiped":te,"data-removed":ue,"data-visible":pt,"data-y-position":gt,"data-x-position":Lt,"data-index":x,"data-front":Dt,"data-swiping":he,"data-dismissible":Be,"data-type":ye,"data-invert":nr,"data-swipe-out":Ce,"data-swipe-direction":X,"data-expanded":!!(w||$&&Z),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${ue?nt:wt.current}px`,"--initial-height":$?"auto":`${Ne}px`,...E,...f.style},onDragEnd:()=>{ie(!1),Y(null),zt.current=null},onPointerDown:Ut=>{tn||!Be||(He.current=new Date,rt(wt.current),Ut.target.setPointerCapture(Ut.pointerId),Ut.target.tagName!=="BUTTON"&&(ie(!0),zt.current={x:Ut.clientX,y:Ut.clientY}))},onPointerUp:()=>{var Ut,Wt,wn,Nr;if(Ce||!Be)return;zt.current=null;let At=Number(((Ut=Ve.current)==null?void 0:Ut.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ur=Number(((Wt=Ve.current)==null?void 0:Wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ln=new Date().getTime()-((wn=He.current)==null?void 0:wn.getTime()),gr=M==="x"?At:Ur,or=Math.abs(gr)/Ln;if(Math.abs(gr)>=MCe||or>.11){rt(wt.current),(Nr=f.onDismiss)==null||Nr.call(f,f),V(M==="x"?At>0?"right":"left":Ur>0?"down":"up"),Bt(),Ie(!0),je(!1);return}ie(!1),Y(null)},onPointerMove:Ut=>{var Wt,wn,Nr,At;if(!zt.current||!Be||((Wt=window.getSelection())==null?void 0:Wt.toString().length)>0)return;let Ur=Ut.clientY-zt.current.y,Ln=Ut.clientX-zt.current.x,gr=(wn=e.swipeDirections)!=null?wn:RCe(U);!M&&(Math.abs(Ln)>1||Math.abs(Ur)>1)&&Y(Math.abs(Ln)>Math.abs(Ur)?"x":"y");let or={x:0,y:0};M==="y"?(gr.includes("top")||gr.includes("bottom"))&&(gr.includes("top")&&Ur<0||gr.includes("bottom")&&Ur>0)&&(or.y=Ur):M==="x"&&(gr.includes("left")||gr.includes("right"))&&(gr.includes("left")&&Ln<0||gr.includes("right")&&Ln>0)&&(or.x=Ln),(Math.abs(or.x)>0||Math.abs(or.y)>0)&&je(!0),(Nr=Ve.current)==null||Nr.style.setProperty("--swipe-amount-x",`${or.x}px`),(At=Ve.current)==null||At.style.setProperty("--swipe-amount-y",`${or.y}px`)}},pe&&!f.jsx?re.createElement("button",{"aria-label":ce,"data-disabled":tn,"data-close-button":!0,onClick:tn||!Be?()=>{}:()=>{var Ut;Bt(),(Ut=f.onDismiss)==null||Ut.call(f,f)},className:Wl(z==null?void 0:z.closeButton,(i=f==null?void 0:f.classNames)==null?void 0:i.closeButton)},(s=Q==null?void 0:Q.close)!=null?s:bCe):null,f.jsx||C.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:re.createElement(re.Fragment,null,ye||f.icon||f.promise?re.createElement("div",{"data-icon":"",className:Wl(z==null?void 0:z.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||jn():null,f.type!=="loading"?f.icon||(Q==null?void 0:Q[ye])||pCe(ye):null):null,re.createElement("div",{"data-content":"",className:Wl(z==null?void 0:z.content,(o=f==null?void 0:f.classNames)==null?void 0:o.content)},re.createElement("div",{"data-title":"",className:Wl(z==null?void 0:z.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?re.createElement("div",{"data-description":"",className:Wl(F,Ue,z==null?void 0:z.description,(u=f==null?void 0:f.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),C.isValidElement(f.cancel)?f.cancel:f.cancel&&iS(f.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||P,onClick:Ut=>{var Wt,wn;iS(f.cancel)&&Be&&((wn=(Wt=f.cancel).onClick)==null||wn.call(Wt,Ut),Bt())},className:Wl(z==null?void 0:z.cancelButton,(d=f==null?void 0:f.classNames)==null?void 0:d.cancelButton)},f.cancel.label):null,C.isValidElement(f.action)?f.action:f.action&&iS(f.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||T,onClick:Ut=>{var Wt,wn;iS(f.action)&&((wn=(Wt=f.action).onClick)==null||wn.call(Wt,Ut),!Ut.defaultPrevented&&Bt())},className:Wl(z==null?void 0:z.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function N7(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function UCe(e,t){let n={};return[e,t].forEach((r,i)=>{let s=i===1,a=s?"--mobile-offset":"--offset",o=s?PCe:ICe;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=o:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),n}var HCe=C.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:A,style:f,visibleToasts:p=TCe,toastOptions:m,dir:g=N7(),gap:y=FCe,loadingIcon:v,icons:x,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:w}=e,[k,j]=re.useState([]),B=re.useMemo(()=>Array.from(new Set([r].concat(k.filter(R=>R.position).map(R=>R.position)))),[k,r]),[E,P]=re.useState([]),[T,N]=re.useState(!1),[F,L]=re.useState(!1),[U,H]=re.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=re.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=re.useRef(null),Q=re.useRef(!1),ce=re.useCallback(R=>{j(M=>{var Y;return(Y=M.find(X=>X.id===R.id))!=null&&Y.delete||$a.dismiss(R.id),M.filter(({id:X})=>X!==R.id)})},[]);return re.useEffect(()=>$a.subscribe(R=>{if(R.dismiss){j(M=>M.map(Y=>Y.id===R.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{XD.flushSync(()=>{j(M=>{let Y=M.findIndex(X=>X.id===R.id);return Y!==-1?[...M.slice(0,Y),{...M[Y],...R},...M.slice(Y+1)]:[R,...M]})})})}),[]),re.useEffect(()=>{if(d!=="system"){H(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:M})=>{H(M?"dark":"light")})}catch{R.addListener(({matches:Y})=>{try{H(Y?"dark":"light")}catch(X){console.error(X)}})}},[d]),re.useEffect(()=>{k.length<=1&&N(!1)},[k]),re.useEffect(()=>{let R=M=>{var Y,X;i.every(V=>M[V]||M.code===V)&&(N(!0),(Y=W.current)==null||Y.focus()),M.code==="Escape"&&(document.activeElement===W.current||(X=W.current)!=null&&X.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[i]),re.useEffect(()=>{if(W.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,Q.current=!1)}},[W.current]),re.createElement("section",{ref:t,"aria-label":`${b} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((R,M)=>{var Y;let[X,V]=R.split("-");return k.length?re.createElement("ol",{key:R,dir:g==="auto"?N7():g,tabIndex:-1,ref:W,className:o,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":X,"data-lifted":T&&k.length>1&&!s,"data-x-position":V,style:{"--front-toast-height":`${((Y=E[0])==null?void 0:Y.height)||0}px`,"--width":`${OCe}px`,"--gap":`${y}px`,...f,...UCe(c,u)},onBlur:Z=>{Q.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(Q.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,z.current=Z.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{F||N(!1)},onDragEnd:()=>N(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},k.filter(Z=>!Z.position&&M===0||Z.position===R).map((Z,de)=>{var ue,se;return re.createElement(DCe,{key:Z.id,icons:x,index:de,toast:Z,defaultRichColors:h,duration:(ue=m==null?void 0:m.duration)!=null?ue:A,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:p,closeButton:(se=m==null?void 0:m.closeButton)!=null?se:a,interacting:F,position:R,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:ce,toasts:k.filter(he=>he.position==Z.position),heights:E.filter(he=>he.position==Z.position),setHeights:P,expandByDefault:s,gap:y,loadingIcon:v,expanded:T,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});const QCe=({...e})=>{const{theme:t="system"}=ACe();return l.jsx(HCe,{theme:t,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"}},...e})};var $Ce=aD[" useId ".trim().toString()]||(()=>{}),zCe=0;function kl(e){const[t,n]=C.useState($Ce());return Zi(()=>{n(r=>r??String(zCe++))},[e]),t?`radix-${t}`:""}const VCe=["top","right","bottom","left"],Nf=Math.min,To=Math.max,rj=Math.round,sS=Math.floor,lu=e=>({x:e,y:e}),KCe={left:"right",right:"left",bottom:"top",top:"bottom"},qCe={start:"end",end:"start"};function D3(e,t,n){return To(e,Nf(t,n))}function bd(e,t){return typeof e=="function"?e(t):e}function Cd(e){return e.split("-")[0]}function n0(e){return e.split("-")[1]}function oU(e){return e==="x"?"y":"x"}function lU(e){return e==="y"?"height":"width"}const WCe=new Set(["top","bottom"]);function ru(e){return WCe.has(Cd(e))?"y":"x"}function cU(e){return oU(ru(e))}function GCe(e,t,n){n===void 0&&(n=!1);const r=n0(e),i=cU(e),s=lU(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=ij(a)),[a,ij(a)]}function YCe(e){const t=ij(e);return[U3(e),t,U3(t)]}function U3(e){return e.replace(/start|end/g,t=>qCe[t])}const E7=["left","right"],T7=["right","left"],XCe=["top","bottom"],JCe=["bottom","top"];function ZCe(e,t,n){switch(e){case"top":case"bottom":return n?t?T7:E7:t?E7:T7;case"left":case"right":return t?XCe:JCe;default:return[]}}function eSe(e,t,n,r){const i=n0(e);let s=ZCe(Cd(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(U3)))),s}function ij(e){return e.replace(/left|right|bottom|top/g,t=>KCe[t])}function tSe(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vre(e){return typeof e!="number"?tSe(e):{top:e,right:e,bottom:e,left:e}}function sj(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function I7(e,t,n){let{reference:r,floating:i}=e;const s=ru(t),a=cU(t),o=lU(a),c=Cd(t),u=s==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,A=r[o]/2-i[o]/2;let f;switch(c){case"top":f={x:d,y:r.y-i.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-i.width,y:h};break;default:f={x:r.x,y:r.y}}switch(n0(t)){case"start":f[a]-=A*(n&&u?-1:1);break;case"end":f[a]+=A*(n&&u?-1:1);break}return f}const nSe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=I7(u,r,c),A=r,f={},p=0;for(let m=0;m<o.length;m++){const{name:g,fn:y}=o[m],{x:v,y:x,data:b,reset:w}=await y({x:d,y:h,initialPlacement:r,placement:A,strategy:i,middlewareData:f,rects:u,platform:a,elements:{reference:e,floating:t}});d=v??d,h=x??h,f={...f,[g]:{...f[g],...b}},w&&p<=50&&(p++,typeof w=="object"&&(w.placement&&(A=w.placement),w.rects&&(u=w.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:d,y:h}=I7(u,A,c)),m=-1)}return{x:d,y:h,placement:A,strategy:i,middlewareData:f}};async function Pb(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:A=!1,padding:f=0}=bd(t,e),p=Vre(f),g=o[A?h==="floating"?"reference":"floating":h],y=sj(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:c})),v=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),b=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},w=sj(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:c}):v);return{top:(y.top-w.top+p.top)/b.y,bottom:(w.bottom-y.bottom+p.bottom)/b.y,left:(y.left-w.left+p.left)/b.x,right:(w.right-y.right+p.right)/b.x}}const rSe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:c}=t,{element:u,padding:d=0}=bd(e,t)||{};if(u==null)return{};const h=Vre(d),A={x:n,y:r},f=cU(i),p=lU(f),m=await a.getDimensions(u),g=f==="y",y=g?"top":"left",v=g?"bottom":"right",x=g?"clientHeight":"clientWidth",b=s.reference[p]+s.reference[f]-A[f]-s.floating[p],w=A[f]-s.reference[f],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let j=k?k[x]:0;(!j||!await(a.isElement==null?void 0:a.isElement(k)))&&(j=o.floating[x]||s.floating[p]);const B=b/2-w/2,E=j/2-m[p]/2-1,P=Nf(h[y],E),T=Nf(h[v],E),N=P,F=j-m[p]-T,L=j/2-m[p]/2+B,U=D3(N,L,F),H=!c.arrow&&n0(i)!=null&&L!==U&&s.reference[p]/2-(L<N?P:T)-m[p]/2<0,W=H?L<N?L-N:L-F:0;return{[f]:A[f]+W,data:{[f]:U,centerOffset:L-U-W,...H&&{alignmentOffset:W}},reset:H}}}),iSe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:A,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=bd(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Cd(i),v=ru(o),x=Cd(o)===o,b=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=A||(x||!m?[ij(o)]:YCe(o)),k=p!=="none";!A&&k&&w.push(...eSe(o,m,p,b));const j=[o,...w],B=await Pb(t,g),E=[];let P=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&E.push(B[y]),h){const L=GCe(i,a,b);E.push(B[L[0]],B[L[1]])}if(P=[...P,{placement:i,overflows:E}],!E.every(L=>L<=0)){var T,N;const L=(((T=s.flip)==null?void 0:T.index)||0)+1,U=j[L];if(U&&(!(h==="alignment"?v!==ru(U):!1)||P.every($=>$.overflows[0]>0&&ru($.placement)===v)))return{data:{index:L,overflows:P},reset:{placement:U}};let H=(N=P.filter(W=>W.overflows[0]<=0).sort((W,$)=>W.overflows[1]-$.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(f){case"bestFit":{var F;const W=(F=P.filter($=>{if(k){const z=ru($.placement);return z===v||z==="y"}return!0}).map($=>[$.placement,$.overflows.filter(z=>z>0).reduce((z,Q)=>z+Q,0)]).sort(($,z)=>$[1]-z[1])[0])==null?void 0:F[0];W&&(H=W);break}case"initialPlacement":H=o;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function P7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O7(e){return VCe.some(t=>e[t]>=0)}const sSe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=bd(e,t);switch(r){case"referenceHidden":{const s=await Pb(t,{...i,elementContext:"reference"}),a=P7(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:O7(a)}}}case"escaped":{const s=await Pb(t,{...i,altBoundary:!0}),a=P7(s,n.floating);return{data:{escapedOffsets:a,escaped:O7(a)}}}default:return{}}}}},Kre=new Set(["left","top"]);async function aSe(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Cd(n),o=n0(n),c=ru(n)==="y",u=Kre.has(a)?-1:1,d=s&&c?-1:1,h=bd(t,e);let{mainAxis:A,crossAxis:f,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof p=="number"&&(f=o==="end"?p*-1:p),c?{x:f*d,y:A*u}:{x:A*u,y:f*d}}const oSe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=t,c=await aSe(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:a}}}}},lSe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...c}=bd(e,t),u={x:n,y:r},d=await Pb(t,c),h=ru(Cd(i)),A=oU(h);let f=u[A],p=u[h];if(s){const g=A==="y"?"top":"left",y=A==="y"?"bottom":"right",v=f+d[g],x=f-d[y];f=D3(v,f,x)}if(a){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=p+d[g],x=p-d[y];p=D3(v,p,x)}const m=o.fn({...t,[A]:f,[h]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[A]:s,[h]:a}}}}}},cSe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=bd(e,t),d={x:n,y:r},h=ru(i),A=oU(h);let f=d[A],p=d[h];const m=bd(o,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const x=A==="y"?"height":"width",b=s.reference[A]-s.floating[x]+g.mainAxis,w=s.reference[A]+s.reference[x]-g.mainAxis;f<b?f=b:f>w&&(f=w)}if(u){var y,v;const x=A==="y"?"width":"height",b=Kre.has(Cd(i)),w=s.reference[h]-s.floating[x]+(b&&((y=a.offset)==null?void 0:y[h])||0)+(b?0:g.crossAxis),k=s.reference[h]+s.reference[x]+(b?0:((v=a.offset)==null?void 0:v[h])||0)-(b?g.crossAxis:0);p<w?p=w:p>k&&(p=k)}return{[A]:f,[h]:p}}}},uSe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:o}=t,{apply:c=()=>{},...u}=bd(e,t),d=await Pb(t,u),h=Cd(i),A=n0(i),f=ru(i)==="y",{width:p,height:m}=s.floating;let g,y;h==="top"||h==="bottom"?(g=h,y=A===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(y=h,g=A==="end"?"top":"bottom");const v=m-d.top-d.bottom,x=p-d.left-d.right,b=Nf(m-d[g],v),w=Nf(p-d[y],x),k=!t.middlewareData.shift;let j=b,B=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),k&&!A){const P=To(d.left,0),T=To(d.right,0),N=To(d.top,0),F=To(d.bottom,0);f?B=p-2*(P!==0||T!==0?P+T:To(d.left,d.right)):j=m-2*(N!==0||F!==0?N+F:To(d.top,d.bottom))}await c({...t,availableWidth:B,availableHeight:j});const E=await a.getDimensions(o.floating);return p!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function hE(){return typeof window<"u"}function r0(e){return qre(e)?(e.nodeName||"").toLowerCase():"#document"}function Uo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xu(e){var t;return(t=(qre(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qre(e){return hE()?e instanceof Node||e instanceof Uo(e).Node:!1}function Cc(e){return hE()?e instanceof Element||e instanceof Uo(e).Element:!1}function pu(e){return hE()?e instanceof HTMLElement||e instanceof Uo(e).HTMLElement:!1}function F7(e){return!hE()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Uo(e).ShadowRoot}const dSe=new Set(["inline","contents"]);function b2(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Sc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!dSe.has(i)}const hSe=new Set(["table","td","th"]);function fSe(e){return hSe.has(r0(e))}const ASe=[":popover-open",":modal"];function fE(e){return ASe.some(t=>{try{return e.matches(t)}catch{return!1}})}const pSe=["transform","translate","scale","rotate","perspective"],mSe=["transform","translate","scale","rotate","perspective","filter"],gSe=["paint","layout","strict","content"];function uU(e){const t=dU(),n=Cc(e)?Sc(e):e;return pSe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mSe.some(r=>(n.willChange||"").includes(r))||gSe.some(r=>(n.contain||"").includes(r))}function ySe(e){let t=Ef(e);for(;pu(t)&&!lv(t);){if(uU(t))return t;if(fE(t))return null;t=Ef(t)}return null}function dU(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vSe=new Set(["html","body","#document"]);function lv(e){return vSe.has(r0(e))}function Sc(e){return Uo(e).getComputedStyle(e)}function AE(e){return Cc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ef(e){if(r0(e)==="html")return e;const t=e.assignedSlot||e.parentNode||F7(e)&&e.host||xu(e);return F7(t)?t.host:t}function Wre(e){const t=Ef(e);return lv(t)?e.ownerDocument?e.ownerDocument.body:e.body:pu(t)&&b2(t)?t:Wre(t)}function Ob(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Wre(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Uo(i);if(s){const o=H3(a);return t.concat(a,a.visualViewport||[],b2(i)?i:[],o&&n?Ob(o):[])}return t.concat(i,Ob(i,[],n))}function H3(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gre(e){const t=Sc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=pu(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=rj(n)!==s||rj(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function hU(e){return Cc(e)?e:e.contextElement}function yy(e){const t=hU(e);if(!pu(t))return lu(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Gre(t);let a=(s?rj(n.width):n.width)/r,o=(s?rj(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const xSe=lu(0);function Yre(e){const t=Uo(e);return!dU()||!t.visualViewport?xSe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wSe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Uo(e)?!1:t}function Wp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=hU(e);let a=lu(1);t&&(r?Cc(r)&&(a=yy(r)):a=yy(e));const o=wSe(s,n,r)?Yre(s):lu(0);let c=(i.left+o.x)/a.x,u=(i.top+o.y)/a.y,d=i.width/a.x,h=i.height/a.y;if(s){const A=Uo(s),f=r&&Cc(r)?Uo(r):r;let p=A,m=H3(p);for(;m&&r&&f!==p;){const g=yy(m),y=m.getBoundingClientRect(),v=Sc(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,b=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,h*=g.y,c+=x,u+=b,p=Uo(m),m=H3(p)}}return sj({width:d,height:h,x:c,y:u})}function fU(e,t){const n=AE(e).scrollLeft;return t?t.left+n:Wp(xu(e)).left+n}function Xre(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:fU(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function bSe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=xu(r),o=t?fE(t.floating):!1;if(r===a||o&&s)return n;let c={scrollLeft:0,scrollTop:0},u=lu(1);const d=lu(0),h=pu(r);if((h||!h&&!s)&&((r0(r)!=="body"||b2(a))&&(c=AE(r)),pu(r))){const f=Wp(r);u=yy(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const A=a&&!h&&!s?Xre(a,c,!0):lu(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+A.x,y:n.y*u.y-c.scrollTop*u.y+d.y+A.y}}function CSe(e){return Array.from(e.getClientRects())}function SSe(e){const t=xu(e),n=AE(e),r=e.ownerDocument.body,i=To(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=To(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+fU(e);const o=-n.scrollTop;return Sc(r).direction==="rtl"&&(a+=To(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function kSe(e,t){const n=Uo(e),r=xu(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,c=0;if(i){s=i.width,a=i.height;const u=dU();(!u||u&&t==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}return{width:s,height:a,x:o,y:c}}const _Se=new Set(["absolute","fixed"]);function jSe(e,t){const n=Wp(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=pu(e)?yy(e):lu(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,c=i*s.x,u=r*s.y;return{width:a,height:o,x:c,y:u}}function M7(e,t,n){let r;if(t==="viewport")r=kSe(e,n);else if(t==="document")r=SSe(xu(e));else if(Cc(t))r=jSe(t,n);else{const i=Yre(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return sj(r)}function Jre(e,t){const n=Ef(e);return n===t||!Cc(n)||lv(n)?!1:Sc(n).position==="fixed"||Jre(n,t)}function BSe(e,t){const n=t.get(e);if(n)return n;let r=Ob(e,[],!1).filter(o=>Cc(o)&&r0(o)!=="body"),i=null;const s=Sc(e).position==="fixed";let a=s?Ef(e):e;for(;Cc(a)&&!lv(a);){const o=Sc(a),c=uU(a);!c&&o.position==="fixed"&&(i=null),(s?!c&&!i:!c&&o.position==="static"&&!!i&&_Se.has(i.position)||b2(a)&&!c&&Jre(e,a))?r=r.filter(d=>d!==a):i=o,a=Ef(a)}return t.set(e,r),r}function NSe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?fE(t)?[]:BSe(t,this._c):[].concat(n),r],o=a[0],c=a.reduce((u,d)=>{const h=M7(t,d,i);return u.top=To(h.top,u.top),u.right=Nf(h.right,u.right),u.bottom=Nf(h.bottom,u.bottom),u.left=To(h.left,u.left),u},M7(t,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ESe(e){const{width:t,height:n}=Gre(e);return{width:t,height:n}}function TSe(e,t,n){const r=pu(t),i=xu(t),s=n==="fixed",a=Wp(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=lu(0);function u(){c.x=fU(i)}if(r||!r&&!s)if((r0(t)!=="body"||b2(i))&&(o=AE(t)),r){const f=Wp(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else i&&u();s&&!r&&i&&u();const d=i&&!r&&!s?Xre(i,o):lu(0),h=a.left+o.scrollLeft-c.x-d.x,A=a.top+o.scrollTop-c.y-d.y;return{x:h,y:A,width:a.width,height:a.height}}function LI(e){return Sc(e).position==="static"}function L7(e,t){if(!pu(e)||Sc(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xu(e)===n&&(n=n.ownerDocument.body),n}function Zre(e,t){const n=Uo(e);if(fE(e))return n;if(!pu(e)){let i=Ef(e);for(;i&&!lv(i);){if(Cc(i)&&!LI(i))return i;i=Ef(i)}return n}let r=L7(e,t);for(;r&&fSe(r)&&LI(r);)r=L7(r,t);return r&&lv(r)&&LI(r)&&!uU(r)?n:r||ySe(e)||n}const ISe=async function(e){const t=this.getOffsetParent||Zre,n=this.getDimensions,r=await n(e.floating);return{reference:TSe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function PSe(e){return Sc(e).direction==="rtl"}const OSe={convertOffsetParentRelativeRectToViewportRelativeRect:bSe,getDocumentElement:xu,getClippingRect:NSe,getOffsetParent:Zre,getElementRects:ISe,getClientRects:CSe,getDimensions:ESe,getScale:yy,isElement:Cc,isRTL:PSe};function eie(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FSe(e,t){let n=null,r;const i=xu(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:A,height:f}=u;if(o||t(),!A||!f)return;const p=sS(h),m=sS(i.clientWidth-(d+A)),g=sS(i.clientHeight-(h+f)),y=sS(d),x={rootMargin:-p+"px "+-m+"px "+-g+"px "+-y+"px",threshold:To(0,Nf(1,c))||1};let b=!0;function w(k){const j=k[0].intersectionRatio;if(j!==c){if(!b)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!eie(u,e.getBoundingClientRect())&&a(),b=!1}try{n=new IntersectionObserver(w,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(e)}return a(!0),s}function MSe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=hU(e),d=i||s?[...u?Ob(u):[],...Ob(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const h=u&&o?FSe(u,n):null;let A=-1,f=null;a&&(f=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(t)})),n()}),u&&!c&&f.observe(u),f.observe(t));let p,m=c?Wp(e):null;c&&g();function g(){const y=Wp(e);m&&!eie(m,y)&&n(),m=y,p=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),h==null||h(),(y=f)==null||y.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const LSe=oSe,RSe=lSe,DSe=iSe,USe=uSe,HSe=sSe,R7=rSe,QSe=cSe,$Se=(e,t,n)=>{const r=new Map,i={platform:OSe,...n},s={...i.platform,_c:r};return nSe(e,t,{...i,platform:s})};var zSe=typeof document<"u",VSe=function(){},Xk=zSe?C.useLayoutEffect:VSe;function aj(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!aj(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!aj(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function tie(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function D7(e,t){const n=tie(e);return Math.round(t*n)/n}function RI(e){const t=C.useRef(e);return Xk(()=>{t.current=e}),t}function KSe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=e,[d,h]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[A,f]=C.useState(r);aj(A,r)||f(r);const[p,m]=C.useState(null),[g,y]=C.useState(null),v=C.useCallback($=>{$!==k.current&&(k.current=$,m($))},[]),x=C.useCallback($=>{$!==j.current&&(j.current=$,y($))},[]),b=s||p,w=a||g,k=C.useRef(null),j=C.useRef(null),B=C.useRef(d),E=c!=null,P=RI(c),T=RI(i),N=RI(u),F=C.useCallback(()=>{if(!k.current||!j.current)return;const $={placement:t,strategy:n,middleware:A};T.current&&($.platform=T.current),$Se(k.current,j.current,$).then(z=>{const Q={...z,isPositioned:N.current!==!1};L.current&&!aj(B.current,Q)&&(B.current=Q,Qf.flushSync(()=>{h(Q)}))})},[A,t,n,T,N]);Xk(()=>{u===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const L=C.useRef(!1);Xk(()=>(L.current=!0,()=>{L.current=!1}),[]),Xk(()=>{if(b&&(k.current=b),w&&(j.current=w),b&&w){if(P.current)return P.current(b,w,F);F()}},[b,w,F,P,E]);const U=C.useMemo(()=>({reference:k,floating:j,setReference:v,setFloating:x}),[v,x]),H=C.useMemo(()=>({reference:b,floating:w}),[b,w]),W=C.useMemo(()=>{const $={position:n,left:0,top:0};if(!H.floating)return $;const z=D7(H.floating,d.x),Q=D7(H.floating,d.y);return o?{...$,transform:"translate("+z+"px, "+Q+"px)",...tie(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:Q}},[n,o,H.floating,d.x,d.y]);return C.useMemo(()=>({...d,update:F,refs:U,elements:H,floatingStyles:W}),[d,F,U,H,W])}const qSe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?R7({element:r.current,padding:i}).fn(n):{}:r?R7({element:r,padding:i}).fn(n):{}}}},WSe=(e,t)=>({...LSe(e),options:[e,t]}),GSe=(e,t)=>({...RSe(e),options:[e,t]}),YSe=(e,t)=>({...QSe(e),options:[e,t]}),XSe=(e,t)=>({...DSe(e),options:[e,t]}),JSe=(e,t)=>({...USe(e),options:[e,t]}),ZSe=(e,t)=>({...HSe(e),options:[e,t]}),eke=(e,t)=>({...qSe(e),options:[e,t]});var tke="Arrow",nie=C.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return l.jsx(_t.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});nie.displayName=tke;var nke=nie;function pE(e){const[t,n]=C.useState(void 0);return Zi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var AU="Popper",[rie,i0]=fs(AU),[rke,iie]=rie(AU),sie=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.useState(null);return l.jsx(rke,{scope:t,anchor:r,onAnchorChange:i,children:n})};sie.displayName=AU;var aie="PopperAnchor",oie=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=iie(aie,n),a=C.useRef(null),o=sn(t,a);return C.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:l.jsx(_t.div,{...i,ref:o})});oie.displayName=aie;var pU="PopperContent",[ike,ske]=rie(pU),lie=C.forwardRef((e,t)=>{var Z,de,ue,se,he,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:A=!1,updatePositionStrategy:f="optimized",onPlaced:p,...m}=e,g=iie(pU,n),[y,v]=C.useState(null),x=sn(t,Ce=>v(Ce)),[b,w]=C.useState(null),k=pE(b),j=(k==null?void 0:k.width)??0,B=(k==null?void 0:k.height)??0,E=r+(s!=="center"?"-"+s:""),P=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(u)?u:[u],N=T.length>0,F={padding:P,boundary:T.filter(oke),altBoundary:N},{refs:L,floatingStyles:U,placement:H,isPositioned:W,middlewareData:$}=KSe({strategy:"fixed",placement:E,whileElementsMounted:(...Ce)=>MSe(...Ce,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[WSe({mainAxis:i+B,alignmentAxis:a}),c&&GSe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?YSe():void 0,...F}),c&&XSe({...F}),JSe({...F,apply:({elements:Ce,rects:Ie,availableWidth:te,availableHeight:je})=>{const{width:nt,height:rt}=Ie.reference,Ne=Ce.floating.style;Ne.setProperty("--radix-popper-available-width",`${te}px`),Ne.setProperty("--radix-popper-available-height",`${je}px`),Ne.setProperty("--radix-popper-anchor-width",`${nt}px`),Ne.setProperty("--radix-popper-anchor-height",`${rt}px`)}}),b&&eke({element:b,padding:o}),lke({arrowWidth:j,arrowHeight:B}),A&&ZSe({strategy:"referenceHidden",...F})]}),[z,Q]=die(H),ce=Yi(p);Zi(()=>{W&&(ce==null||ce())},[W,ce]);const R=(Z=$.arrow)==null?void 0:Z.x,M=(de=$.arrow)==null?void 0:de.y,Y=((ue=$.arrow)==null?void 0:ue.centerOffset)!==0,[X,V]=C.useState();return Zi(()=>{y&&V(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(se=$.transformOrigin)==null?void 0:se.x,(he=$.transformOrigin)==null?void 0:he.y].join(" "),...((ie=$.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(ike,{scope:n,placedSide:z,onArrowChange:w,arrowX:R,arrowY:M,shouldHideArrow:Y,children:l.jsx(_t.div,{"data-side":z,"data-align":Q,...m,ref:x,style:{...m.style,animation:W?void 0:"none"}})})})});lie.displayName=pU;var cie="PopperArrow",ake={top:"bottom",right:"left",bottom:"top",left:"right"},uie=C.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=ske(cie,r),a=ake[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(nke,{...i,ref:n,style:{...i.style,display:"block"}})})});uie.displayName=cie;function oke(e){return e!==null}var lke=e=>({name:"transformOrigin",options:e,fn(t){var g,y,v;const{placement:n,rects:r,middlewareData:i}=t,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,o=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=die(n),h={start:"0%",center:"50%",end:"100%"}[d],A=(((y=i.arrow)==null?void 0:y.x)??0)+o/2,f=(((v=i.arrow)==null?void 0:v.y)??0)+c/2;let p="",m="";return u==="bottom"?(p=a?h:`${A}px`,m=`${-c}px`):u==="top"?(p=a?h:`${A}px`,m=`${r.floating.height+c}px`):u==="right"?(p=`${-c}px`,m=a?h:`${f}px`):u==="left"&&(p=`${r.floating.width+c}px`,m=a?h:`${f}px`),{data:{x:p,y:m}}}});function die(e){const[t,n="center"]=e.split("-");return[t,n]}var mU=sie,mE=oie,gU=lie,yU=uie,[gE,BTt]=fs("Tooltip",[i0]),yE=i0(),hie="TooltipProvider",cke=700,Q3="tooltip.open",[uke,vU]=gE(hie),fie=e=>{const{__scopeTooltip:t,delayDuration:n=cke,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,a=C.useRef(!0),o=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(uke,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:C.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:s})};fie.displayName=hie;var Fb="Tooltip",[dke,vE]=gE(Fb),Aie=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,c=vU(Fb,e.__scopeTooltip),u=yE(t),[d,h]=C.useState(null),A=kl(),f=C.useRef(0),p=a??c.disableHoverableContent,m=o??c.delayDuration,g=C.useRef(!1),[y,v]=lo({prop:r,defaultProp:i??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(Q3))):c.onClose(),s==null||s(j)},caller:Fb}),x=C.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),b=C.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,v(!0)},[v]),w=C.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v(!1)},[v]),k=C.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,v(!0),f.current=0},m)},[m,v]);return C.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),l.jsx(mU,{...u,children:l.jsx(dke,{scope:t,contentId:A,open:y,stateAttribute:x,trigger:d,onTriggerChange:h,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?k():b()},[c.isOpenDelayedRef,k,b]),onTriggerLeave:C.useCallback(()=>{p?w():(window.clearTimeout(f.current),f.current=0)},[w,p]),onOpen:b,onClose:w,disableHoverableContent:p,children:n})})};Aie.displayName=Fb;var $3="TooltipTrigger",pie=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=vE($3,n),s=vU($3,n),a=yE(n),o=C.useRef(null),c=sn(t,o,i.onTriggerChange),u=C.useRef(!1),d=C.useRef(!1),h=C.useCallback(()=>u.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(mE,{asChild:!0,...a,children:l.jsx(_t.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:at(e.onPointerMove,A=>{A.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:at(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:at(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:at(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:at(e.onBlur,i.onClose),onClick:at(e.onClick,i.onClose)})})});pie.displayName=$3;var hke="TooltipPortal",[NTt,fke]=gE(hke,{forceMount:void 0}),cv="TooltipContent",mie=C.forwardRef((e,t)=>{const n=fke(cv,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=vE(cv,e.__scopeTooltip);return l.jsx(aa,{present:r||a.open,children:a.disableHoverableContent?l.jsx(gie,{side:i,...s,ref:t}):l.jsx(Ake,{side:i,...s,ref:t})})}),Ake=C.forwardRef((e,t)=>{const n=vE(cv,e.__scopeTooltip),r=vU(cv,e.__scopeTooltip),i=C.useRef(null),s=sn(t,i),[a,o]=C.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=r,A=C.useCallback(()=>{o(null),h(!1)},[h]),f=C.useCallback((p,m)=>{const g=p.currentTarget,y={x:p.clientX,y:p.clientY},v=vke(y,g.getBoundingClientRect()),x=xke(y,v),b=wke(m.getBoundingClientRect()),w=Cke([...x,...b]);o(w),h(!0)},[h]);return C.useEffect(()=>()=>A(),[A]),C.useEffect(()=>{if(c&&d){const p=g=>f(g,d),m=g=>f(g,c);return c.addEventListener("pointerleave",p),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",m)}}},[c,d,f,A]),C.useEffect(()=>{if(a){const p=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},v=(c==null?void 0:c.contains(g))||(d==null?void 0:d.contains(g)),x=!bke(y,a);v?A():x&&(A(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,d,a,u,A]),l.jsx(gie,{...e,ref:s})}),[pke,mke]=gE(Fb,{isInside:!1}),gke=Qne("TooltipContent"),gie=C.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,c=vE(cv,n),u=yE(n),{onClose:d}=c;return C.useEffect(()=>(document.addEventListener(Q3,d),()=>document.removeEventListener(Q3,d)),[d]),C.useEffect(()=>{if(c.trigger){const h=A=>{const f=A.target;f!=null&&f.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),l.jsx(Zv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:l.jsxs(gU,{"data-state":c.stateAttribute,...u,...o,ref:t,style:{...o.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:[l.jsx(gke,{children:r}),l.jsx(pke,{scope:n,isInside:!0,children:l.jsx(C1e,{id:c.contentId,role:"tooltip",children:i||r})})]})})});mie.displayName=cv;var yie="TooltipArrow",yke=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=yE(n);return mke(yie,n).isInside?null:l.jsx(yU,{...i,...r,ref:t})});yke.displayName=yie;function vke(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function xke(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function wke(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function bke(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s],c=t[a],u=o.x,d=o.y,h=c.x,A=c.y;d>r!=A>r&&n<(h-u)*(r-d)/(A-d)+u&&(i=!i)}return i}function Cke(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Ske(t)}function Ske(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var kke=fie,_ke=Aie,jke=pie,vie=mie;const xU=kke,wU=_ke,bU=jke,xE=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(vie,{ref:r,sideOffset:t,className:ot("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",e),...n}));xE.displayName=vie.displayName;var s0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gp=typeof window>"u"||"Deno"in globalThis;function xa(){}function Bke(e,t){return typeof e=="function"?e(t):e}function z3(e){return typeof e=="number"&&e>=0&&e!==1/0}function xie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hf(e,t){return typeof e=="function"?e(t):e}function ll(e,t){return typeof e=="function"?e(t):e}function U7(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==CU(a,t.options))return!1}else if(!Mb(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function H7(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Yp(t.options.mutationKey)!==Yp(s))return!1}else if(!Mb(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function CU(e,t){return((t==null?void 0:t.queryKeyHashFn)||Yp)(e)}function Yp(e){return JSON.stringify(e,(t,n)=>V3(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Mb(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Mb(e[n],t[n])):!1}function wie(e,t){if(e===t)return e;const n=Q7(e)&&Q7(t);if(n||V3(e)&&V3(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),a=s.length,o=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<a;d++){const h=n?d:s[d];(!n&&c.has(h)||n)&&e[h]===void 0&&t[h]===void 0?(o[h]=void 0,u++):(o[h]=wie(e[h],t[h]),o[h]===e[h]&&e[h]!==void 0&&u++)}return i===a&&u===i?e:o}return t}function oj(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Q7(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function V3(e){if(!$7(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$7(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $7(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nke(e){return new Promise(t=>{setTimeout(t,e)})}function K3(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?wie(e,t):t}function Eke(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Tke(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var SU=Symbol();function bie(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===SU?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cie(e,t){return typeof e=="function"?e(...t):!!e}var fp,Ih,Qy,gee,Ike=(gee=class extends s0{constructor(){super();Ht(this,fp);Ht(this,Ih);Ht(this,Qy);lt(this,Qy,t=>{if(!Gp&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Ae(this,Ih)||this.setEventListener(Ae(this,Qy))}onUnsubscribe(){var t;this.hasListeners()||((t=Ae(this,Ih))==null||t.call(this),lt(this,Ih,void 0))}setEventListener(t){var n;lt(this,Qy,t),(n=Ae(this,Ih))==null||n.call(this),lt(this,Ih,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Ae(this,fp)!==t&&(lt(this,fp,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Ae(this,fp)=="boolean"?Ae(this,fp):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fp=new WeakMap,Ih=new WeakMap,Qy=new WeakMap,gee),kU=new Ike,$y,Ph,zy,yee,Pke=(yee=class extends s0{constructor(){super();Ht(this,$y,!0);Ht(this,Ph);Ht(this,zy);lt(this,zy,t=>{if(!Gp&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Ae(this,Ph)||this.setEventListener(Ae(this,zy))}onUnsubscribe(){var t;this.hasListeners()||((t=Ae(this,Ph))==null||t.call(this),lt(this,Ph,void 0))}setEventListener(t){var n;lt(this,zy,t),(n=Ae(this,Ph))==null||n.call(this),lt(this,Ph,t(this.setOnline.bind(this)))}setOnline(t){Ae(this,$y)!==t&&(lt(this,$y,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Ae(this,$y)}},$y=new WeakMap,Ph=new WeakMap,zy=new WeakMap,yee),lj=new Pke;function q3(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Oke(e){return Math.min(1e3*2**e,3e4)}function Sie(e){return(e??"online")==="online"?lj.isOnline():!0}var kie=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function DI(e){return e instanceof kie}function _ie(e){let t=!1,n=0,r=!1,i;const s=q3(),a=m=>{var g;r||(A(new kie(m)),(g=e.abort)==null||g.call(e))},o=()=>{t=!0},c=()=>{t=!1},u=()=>kU.isFocused()&&(e.networkMode==="always"||lj.isOnline())&&e.canRun(),d=()=>Sie(e.networkMode)&&e.canRun(),h=m=>{var g;r||(r=!0,(g=e.onSuccess)==null||g.call(e,m),i==null||i(),s.resolve(m))},A=m=>{var g;r||(r=!0,(g=e.onError)==null||g.call(e,m),i==null||i(),s.reject(m))},f=()=>new Promise(m=>{var g;i=y=>{(r||u())&&m(y)},(g=e.onPause)==null||g.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),p=()=>{if(r)return;let m;const g=n===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(h).catch(y=>{var k;if(r)return;const v=e.retry??(Gp?0:3),x=e.retryDelay??Oke,b=typeof x=="function"?x(n,y):x,w=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!w){A(y);return}n++,(k=e.onFail)==null||k.call(e,n,y),Nke(b).then(()=>u()?void 0:f()).then(()=>{t?A(y):p()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?p():f().then(p),s)}}var Fke=e=>setTimeout(e,0);function Mke(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=Fke;const s=o=>{t?e.push(o):i(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||a()}return c},batchCalls:o=>(...c)=>{s(()=>{o(...c)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Wi=Mke(),Ap,vee,jie=(vee=class{constructor(){Ht(this,Ap)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),z3(this.gcTime)&&lt(this,Ap,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Gp?1/0:5*60*1e3))}clearGcTimeout(){Ae(this,Ap)&&(clearTimeout(Ae(this,Ap)),lt(this,Ap,void 0))}},Ap=new WeakMap,vee),Vy,pp,ol,mp,qs,l2,gp,rc,Wu,xee,Lke=(xee=class extends jie{constructor(t){super();Ht(this,rc);Ht(this,Vy);Ht(this,pp);Ht(this,ol);Ht(this,mp);Ht(this,qs);Ht(this,l2);Ht(this,gp);lt(this,gp,!1),lt(this,l2,t.defaultOptions),this.setOptions(t.options),this.observers=[],lt(this,mp,t.client),lt(this,ol,Ae(this,mp).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,lt(this,Vy,Rke(this.options)),this.state=t.state??Ae(this,Vy),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Ae(this,qs))==null?void 0:t.promise}setOptions(t){this.options={...Ae(this,l2),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ae(this,ol).remove(this)}setData(t,n){const r=K3(this.state.data,t,this.options);return pn(this,rc,Wu).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){pn(this,rc,Wu).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=Ae(this,qs))==null?void 0:r.promise;return(i=Ae(this,qs))==null||i.cancel(t),n?n.then(xa).catch(xa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ae(this,Vy))}isActive(){return this.observers.some(t=>ll(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===SU||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>hf(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!xie(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Ae(this,qs))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Ae(this,qs))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Ae(this,ol).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Ae(this,qs)&&(Ae(this,gp)?Ae(this,qs).cancel({revert:!0}):Ae(this,qs).cancelRetry()),this.scheduleGc()),Ae(this,ol).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pn(this,rc,Wu).call(this,{type:"invalidate"})}fetch(t,n){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Ae(this,qs))return Ae(this,qs).continueRetry(),Ae(this,qs).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(f=>f.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,i=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(lt(this,gp,!0),r.signal)})},s=()=>{const A=bie(this.options,n),p=(()=>{const m={client:Ae(this,mp),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return lt(this,gp,!1),this.options.persister?this.options.persister(A,p,this):A(p)},o=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Ae(this,mp),state:this.state,fetchFn:s};return i(A),A})();(u=this.options.behavior)==null||u.onFetch(o,this),lt(this,pp,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&pn(this,rc,Wu).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const c=A=>{var f,p,m,g;DI(A)&&A.silent||pn(this,rc,Wu).call(this,{type:"error",error:A}),DI(A)||((p=(f=Ae(this,ol).config).onError)==null||p.call(f,A,this),(g=(m=Ae(this,ol).config).onSettled)==null||g.call(m,this.state.data,A,this)),this.scheduleGc()};return lt(this,qs,_ie({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:A=>{var f,p,m,g;if(A===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(A)}catch(y){c(y);return}(p=(f=Ae(this,ol).config).onSuccess)==null||p.call(f,A,this),(g=(m=Ae(this,ol).config).onSettled)==null||g.call(m,A,this.state.error,this),this.scheduleGc()},onError:c,onFail:(A,f)=>{pn(this,rc,Wu).call(this,{type:"failed",failureCount:A,error:f})},onPause:()=>{pn(this,rc,Wu).call(this,{type:"pause"})},onContinue:()=>{pn(this,rc,Wu).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),Ae(this,qs).start()}},Vy=new WeakMap,pp=new WeakMap,ol=new WeakMap,mp=new WeakMap,qs=new WeakMap,l2=new WeakMap,gp=new WeakMap,rc=new WeakSet,Wu=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Bie(r.data,this.options),fetchMeta:t.meta??null};case"success":return lt(this,pp,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return DI(i)&&i.revert&&Ae(this,pp)?{...Ae(this,pp),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Wi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Ae(this,ol).notify({query:this,type:"updated",action:t})})},xee);function Bie(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Sie(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rke(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Yc,wee,Dke=(wee=class extends s0{constructor(t={}){super();Ht(this,Yc);this.config=t,lt(this,Yc,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??CU(i,n);let a=this.get(s);return a||(a=new Lke({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){Ae(this,Yc).has(t.queryHash)||(Ae(this,Yc).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Ae(this,Yc).get(t.queryHash);n&&(t.destroy(),n===t&&Ae(this,Yc).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Wi.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Ae(this,Yc).get(t)}getAll(){return[...Ae(this,Yc).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>U7(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>U7(t,r)):n}notify(t){Wi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Wi.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Wi.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yc=new WeakMap,wee),Xc,ma,yp,Jc,dh,bee,Uke=(bee=class extends jie{constructor(t){super();Ht(this,Jc);Ht(this,Xc);Ht(this,ma);Ht(this,yp);this.mutationId=t.mutationId,lt(this,ma,t.mutationCache),lt(this,Xc,[]),this.state=t.state||Nie(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Ae(this,Xc).includes(t)||(Ae(this,Xc).push(t),this.clearGcTimeout(),Ae(this,ma).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){lt(this,Xc,Ae(this,Xc).filter(n=>n!==t)),this.scheduleGc(),Ae(this,ma).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Ae(this,Xc).length||(this.state.status==="pending"?this.scheduleGc():Ae(this,ma).remove(this))}continue(){var t;return((t=Ae(this,yp))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,b,w,k,j,B;const n=()=>{pn(this,Jc,dh).call(this,{type:"continue"})};lt(this,yp,_ie({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,P)=>{pn(this,Jc,dh).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{pn(this,Jc,dh).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ae(this,ma).canRun(this)}));const r=this.state.status==="pending",i=!Ae(this,yp).canStart();try{if(r)n();else{pn(this,Jc,dh).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(s=Ae(this,ma).config).onMutate)==null?void 0:a.call(s,t,this));const P=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,t));P!==this.state.context&&pn(this,Jc,dh).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const E=await Ae(this,yp).start();return await((d=(u=Ae(this,ma).config).onSuccess)==null?void 0:d.call(u,E,t,this.state.context,this)),await((A=(h=this.options).onSuccess)==null?void 0:A.call(h,E,t,this.state.context)),await((p=(f=Ae(this,ma).config).onSettled)==null?void 0:p.call(f,E,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,E,null,t,this.state.context)),pn(this,Jc,dh).call(this,{type:"success",data:E}),E}catch(E){try{throw await((v=(y=Ae(this,ma).config).onError)==null?void 0:v.call(y,E,t,this.state.context,this)),await((b=(x=this.options).onError)==null?void 0:b.call(x,E,t,this.state.context)),await((k=(w=Ae(this,ma).config).onSettled)==null?void 0:k.call(w,void 0,E,this.state.variables,this.state.context,this)),await((B=(j=this.options).onSettled)==null?void 0:B.call(j,void 0,E,t,this.state.context)),E}finally{pn(this,Jc,dh).call(this,{type:"error",error:E})}}finally{Ae(this,ma).runNext(this)}}},Xc=new WeakMap,ma=new WeakMap,yp=new WeakMap,Jc=new WeakSet,dh=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Wi.batch(()=>{Ae(this,Xc).forEach(r=>{r.onMutationUpdate(t)}),Ae(this,ma).notify({mutation:this,type:"updated",action:t})})},bee);function Nie(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nd,ic,c2,Cee,Hke=(Cee=class extends s0{constructor(t={}){super();Ht(this,nd);Ht(this,ic);Ht(this,c2);this.config=t,lt(this,nd,new Set),lt(this,ic,new Map),lt(this,c2,0)}build(t,n,r){const i=new Uke({mutationCache:this,mutationId:++RC(this,c2)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Ae(this,nd).add(t);const n=aS(t);if(typeof n=="string"){const r=Ae(this,ic).get(n);r?r.push(t):Ae(this,ic).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Ae(this,nd).delete(t)){const n=aS(t);if(typeof n=="string"){const r=Ae(this,ic).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&Ae(this,ic).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=aS(t);if(typeof n=="string"){const r=Ae(this,ic).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=aS(t);if(typeof n=="string"){const i=(r=Ae(this,ic).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Wi.batch(()=>{Ae(this,nd).forEach(t=>{this.notify({type:"removed",mutation:t})}),Ae(this,nd).clear(),Ae(this,ic).clear()})}getAll(){return Array.from(Ae(this,nd))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>H7(n,r))}findAll(t={}){return this.getAll().filter(n=>H7(t,n))}notify(t){Wi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Wi.batch(()=>Promise.all(t.map(n=>n.continue().catch(xa))))}},nd=new WeakMap,ic=new WeakMap,c2=new WeakMap,Cee);function aS(e){var t;return(t=e.options.scope)==null?void 0:t.id}function z7(e){return{onFetch:(t,n)=>{var d,h,A,f,p;const r=t.options,i=(A=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:A.direction,s=((f=t.state.data)==null?void 0:f.pages)||[],a=((p=t.state.data)==null?void 0:p.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const g=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=bie(t.options,t.fetchOptions),v=async(x,b,w)=>{if(m)return Promise.reject();if(b==null&&x.pages.length)return Promise.resolve(x);const j=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:b,direction:w?"backward":"forward",meta:t.options.meta};return g(T),T})(),B=await y(j),{maxPages:E}=t.options,P=w?Tke:Eke;return{pages:P(x.pages,B,E),pageParams:P(x.pageParams,b,E)}};if(i&&s.length){const x=i==="backward",b=x?Qke:V7,w={pages:s,pageParams:a},k=b(r,w);o=await v(w,k,x)}else{const x=e??s.length;do{const b=c===0?a[0]??r.initialPageParam:V7(r,o);if(c>0&&b==null)break;o=await v(o,b),c++}while(c<x)}return o};t.options.persister?t.fetchFn=()=>{var m,g;return(g=(m=t.options).persister)==null?void 0:g.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function V7(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Qke(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ai,Oh,Fh,Ky,qy,Mh,Wy,Gy,See,$ke=(See=class{constructor(e={}){Ht(this,ai);Ht(this,Oh);Ht(this,Fh);Ht(this,Ky);Ht(this,qy);Ht(this,Mh);Ht(this,Wy);Ht(this,Gy);lt(this,ai,e.queryCache||new Dke),lt(this,Oh,e.mutationCache||new Hke),lt(this,Fh,e.defaultOptions||{}),lt(this,Ky,new Map),lt(this,qy,new Map),lt(this,Mh,0)}mount(){RC(this,Mh)._++,Ae(this,Mh)===1&&(lt(this,Wy,kU.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ae(this,ai).onFocus())})),lt(this,Gy,lj.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ae(this,ai).onOnline())})))}unmount(){var e,t;RC(this,Mh)._--,Ae(this,Mh)===0&&((e=Ae(this,Wy))==null||e.call(this),lt(this,Wy,void 0),(t=Ae(this,Gy))==null||t.call(this),lt(this,Gy,void 0))}isFetching(e){return Ae(this,ai).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Ae(this,Oh).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ae(this,ai).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Ae(this,ai).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(hf(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Ae(this,ai).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=Ae(this,ai).get(r.queryHash),s=i==null?void 0:i.state.data,a=Bke(t,s);if(a!==void 0)return Ae(this,ai).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Wi.batch(()=>Ae(this,ai).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ae(this,ai).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Ae(this,ai);Wi.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Ae(this,ai);return Wi.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wi.batch(()=>Ae(this,ai).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(xa).catch(xa)}invalidateQueries(e,t={}){return Wi.batch(()=>(Ae(this,ai).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wi.batch(()=>Ae(this,ai).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(xa)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(xa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Ae(this,ai).build(this,t);return n.isStaleByTime(hf(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xa).catch(xa)}fetchInfiniteQuery(e){return e.behavior=z7(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xa).catch(xa)}ensureInfiniteQueryData(e){return e.behavior=z7(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return lj.isOnline()?Ae(this,Oh).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ae(this,ai)}getMutationCache(){return Ae(this,Oh)}getDefaultOptions(){return Ae(this,Fh)}setDefaultOptions(e){lt(this,Fh,e)}setQueryDefaults(e,t){Ae(this,Ky).set(Yp(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Ae(this,Ky).values()],n={};return t.forEach(r=>{Mb(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Ae(this,qy).set(Yp(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Ae(this,qy).values()],n={};return t.forEach(r=>{Mb(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Ae(this,Fh).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=CU(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===SU&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Ae(this,Fh).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Ae(this,ai).clear(),Ae(this,Oh).clear()}},ai=new WeakMap,Oh=new WeakMap,Fh=new WeakMap,Ky=new WeakMap,qy=new WeakMap,Mh=new WeakMap,Wy=new WeakMap,Gy=new WeakMap,See),Ha,Nn,u2,ga,vp,Yy,Lh,Rh,d2,Xy,Jy,xp,wp,Dh,Zy,Wn,Zx,W3,G3,Y3,X3,J3,Z3,eF,Eie,kee,zke=(kee=class extends s0{constructor(t,n){super();Ht(this,Wn);Ht(this,Ha);Ht(this,Nn);Ht(this,u2);Ht(this,ga);Ht(this,vp);Ht(this,Yy);Ht(this,Lh);Ht(this,Rh);Ht(this,d2);Ht(this,Xy);Ht(this,Jy);Ht(this,xp);Ht(this,wp);Ht(this,Dh);Ht(this,Zy,new Set);this.options=n,lt(this,Ha,t),lt(this,Rh,null),lt(this,Lh,q3()),this.options.experimental_prefetchInRender||Ae(this,Lh).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&&(Ae(this,Nn).addObserver(this),K7(Ae(this,Nn),this.options)?pn(this,Wn,Zx).call(this):this.updateResult(),pn(this,Wn,X3).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tF(Ae(this,Nn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tF(Ae(this,Nn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pn(this,Wn,J3).call(this),pn(this,Wn,Z3).call(this),Ae(this,Nn).removeObserver(this)}setOptions(t){const n=this.options,r=Ae(this,Nn);if(this.options=Ae(this,Ha).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ll(this.options.enabled,Ae(this,Nn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pn(this,Wn,eF).call(this),Ae(this,Nn).setOptions(this.options),n._defaulted&&!oj(this.options,n)&&Ae(this,Ha).getQueryCache().notify({type:"observerOptionsUpdated",query:Ae(this,Nn),observer:this});const i=this.hasListeners();i&&q7(Ae(this,Nn),r,this.options,n)&&pn(this,Wn,Zx).call(this),this.updateResult(),i&&(Ae(this,Nn)!==r||ll(this.options.enabled,Ae(this,Nn))!==ll(n.enabled,Ae(this,Nn))||hf(this.options.staleTime,Ae(this,Nn))!==hf(n.staleTime,Ae(this,Nn)))&&pn(this,Wn,W3).call(this);const s=pn(this,Wn,G3).call(this);i&&(Ae(this,Nn)!==r||ll(this.options.enabled,Ae(this,Nn))!==ll(n.enabled,Ae(this,Nn))||s!==Ae(this,Dh))&&pn(this,Wn,Y3).call(this,s)}getOptimisticResult(t){const n=Ae(this,Ha).getQueryCache().build(Ae(this,Ha),t),r=this.createResult(n,t);return Kke(this,r)&&(lt(this,ga,r),lt(this,Yy,this.options),lt(this,vp,Ae(this,Nn).state)),r}getCurrentResult(){return Ae(this,ga)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){Ae(this,Zy).add(t)}getCurrentQuery(){return Ae(this,Nn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Ae(this,Ha).defaultQueryOptions(t),r=Ae(this,Ha).getQueryCache().build(Ae(this,Ha),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return pn(this,Wn,Zx).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Ae(this,ga)))}createResult(t,n){var E;const r=Ae(this,Nn),i=this.options,s=Ae(this,ga),a=Ae(this,vp),o=Ae(this,Yy),u=t!==r?t.state:Ae(this,u2),{state:d}=t;let h={...d},A=!1,f;if(n._optimisticResults){const P=this.hasListeners(),T=!P&&K7(t,n),N=P&&q7(t,r,n,i);(T||N)&&(h={...h,...Bie(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=h;f=h.data;let y=!1;if(n.placeholderData!==void 0&&f===void 0&&g==="pending"){let P;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(P=s.data,y=!0):P=typeof n.placeholderData=="function"?n.placeholderData((E=Ae(this,Jy))==null?void 0:E.state.data,Ae(this,Jy)):n.placeholderData,P!==void 0&&(g="success",f=K3(s==null?void 0:s.data,P,n),A=!0)}if(n.select&&f!==void 0&&!y)if(s&&f===(a==null?void 0:a.data)&&n.select===Ae(this,d2))f=Ae(this,Xy);else try{lt(this,d2,n.select),f=n.select(f),f=K3(s==null?void 0:s.data,f,n),lt(this,Xy,f),lt(this,Rh,null)}catch(P){lt(this,Rh,P)}Ae(this,Rh)&&(p=Ae(this,Rh),f=Ae(this,Xy),m=Date.now(),g="error");const v=h.fetchStatus==="fetching",x=g==="pending",b=g==="error",w=x&&v,k=f!==void 0,B={status:g,fetchStatus:h.fetchStatus,isPending:x,isSuccess:g==="success",isError:b,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:h.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:b&&!k,isPaused:h.fetchStatus==="paused",isPlaceholderData:A,isRefetchError:b&&k,isStale:_U(t,n),refetch:this.refetch,promise:Ae(this,Lh),isEnabled:ll(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=F=>{B.status==="error"?F.reject(B.error):B.data!==void 0&&F.resolve(B.data)},T=()=>{const F=lt(this,Lh,B.promise=q3());P(F)},N=Ae(this,Lh);switch(N.status){case"pending":t.queryHash===r.queryHash&&P(N);break;case"fulfilled":(B.status==="error"||B.data!==N.value)&&T();break;case"rejected":(B.status!=="error"||B.error!==N.reason)&&T();break}}return B}updateResult(){const t=Ae(this,ga),n=this.createResult(Ae(this,Nn),this.options);if(lt(this,vp,Ae(this,Nn).state),lt(this,Yy,this.options),Ae(this,vp).data!==void 0&&lt(this,Jy,Ae(this,Nn)),oj(n,t))return;lt(this,ga,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!Ae(this,Zy).size)return!0;const a=new Set(s??Ae(this,Zy));return this.options.throwOnError&&a.add("error"),Object.keys(Ae(this,ga)).some(o=>{const c=o;return Ae(this,ga)[c]!==t[c]&&a.has(c)})};pn(this,Wn,Eie).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pn(this,Wn,X3).call(this)}},Ha=new WeakMap,Nn=new WeakMap,u2=new WeakMap,ga=new WeakMap,vp=new WeakMap,Yy=new WeakMap,Lh=new WeakMap,Rh=new WeakMap,d2=new WeakMap,Xy=new WeakMap,Jy=new WeakMap,xp=new WeakMap,wp=new WeakMap,Dh=new WeakMap,Zy=new WeakMap,Wn=new WeakSet,Zx=function(t){pn(this,Wn,eF).call(this);let n=Ae(this,Nn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(xa)),n},W3=function(){pn(this,Wn,J3).call(this);const t=hf(this.options.staleTime,Ae(this,Nn));if(Gp||Ae(this,ga).isStale||!z3(t))return;const r=xie(Ae(this,ga).dataUpdatedAt,t)+1;lt(this,xp,setTimeout(()=>{Ae(this,ga).isStale||this.updateResult()},r))},G3=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ae(this,Nn)):this.options.refetchInterval)??!1},Y3=function(t){pn(this,Wn,Z3).call(this),lt(this,Dh,t),!(Gp||ll(this.options.enabled,Ae(this,Nn))===!1||!z3(Ae(this,Dh))||Ae(this,Dh)===0)&&lt(this,wp,setInterval(()=>{(this.options.refetchIntervalInBackground||kU.isFocused())&&pn(this,Wn,Zx).call(this)},Ae(this,Dh)))},X3=function(){pn(this,Wn,W3).call(this),pn(this,Wn,Y3).call(this,pn(this,Wn,G3).call(this))},J3=function(){Ae(this,xp)&&(clearTimeout(Ae(this,xp)),lt(this,xp,void 0))},Z3=function(){Ae(this,wp)&&(clearInterval(Ae(this,wp)),lt(this,wp,void 0))},eF=function(){const t=Ae(this,Ha).getQueryCache().build(Ae(this,Ha),this.options);if(t===Ae(this,Nn))return;const n=Ae(this,Nn);lt(this,Nn,t),lt(this,u2,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Eie=function(t){Wi.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Ae(this,ga))}),Ae(this,Ha).getQueryCache().notify({query:Ae(this,Nn),type:"observerResultsUpdated"})})},kee);function Vke(e,t){return ll(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function K7(e,t){return Vke(e,t)||e.state.data!==void 0&&tF(e,t,t.refetchOnMount)}function tF(e,t,n){if(ll(t.enabled,e)!==!1&&hf(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&_U(e,t)}return!1}function q7(e,t,n,r){return(e!==t||ll(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_U(e,n)}function _U(e,t){return ll(t.enabled,e)!==!1&&e.isStaleByTime(hf(t.staleTime,e))}function Kke(e,t){return!oj(e.getCurrentResult(),t)}var Uh,Hh,Qa,rd,gd,Jk,nF,_ee,qke=(_ee=class extends s0{constructor(n,r){super();Ht(this,gd);Ht(this,Uh);Ht(this,Hh);Ht(this,Qa);Ht(this,rd);lt(this,Uh,n),this.setOptions(r),this.bindMethods(),pn(this,gd,Jk).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=Ae(this,Uh).defaultMutationOptions(n),oj(this.options,r)||Ae(this,Uh).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ae(this,Qa),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Yp(r.mutationKey)!==Yp(this.options.mutationKey)?this.reset():((i=Ae(this,Qa))==null?void 0:i.state.status)==="pending"&&Ae(this,Qa).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Ae(this,Qa))==null||n.removeObserver(this)}onMutationUpdate(n){pn(this,gd,Jk).call(this),pn(this,gd,nF).call(this,n)}getCurrentResult(){return Ae(this,Hh)}reset(){var n;(n=Ae(this,Qa))==null||n.removeObserver(this),lt(this,Qa,void 0),pn(this,gd,Jk).call(this),pn(this,gd,nF).call(this)}mutate(n,r){var i;return lt(this,rd,r),(i=Ae(this,Qa))==null||i.removeObserver(this),lt(this,Qa,Ae(this,Uh).getMutationCache().build(Ae(this,Uh),this.options)),Ae(this,Qa).addObserver(this),Ae(this,Qa).execute(n)}},Uh=new WeakMap,Hh=new WeakMap,Qa=new WeakMap,rd=new WeakMap,gd=new WeakSet,Jk=function(){var r;const n=((r=Ae(this,Qa))==null?void 0:r.state)??Nie();lt(this,Hh,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},nF=function(n){Wi.batch(()=>{var r,i,s,a,o,c,u,d;if(Ae(this,rd)&&this.hasListeners()){const h=Ae(this,Hh).variables,A=Ae(this,Hh).context;(n==null?void 0:n.type)==="success"?((i=(r=Ae(this,rd)).onSuccess)==null||i.call(r,n.data,h,A),(a=(s=Ae(this,rd)).onSettled)==null||a.call(s,n.data,null,h,A)):(n==null?void 0:n.type)==="error"&&((c=(o=Ae(this,rd)).onError)==null||c.call(o,n.error,h,A),(d=(u=Ae(this,rd)).onSettled)==null||d.call(u,void 0,n.error,h,A))}this.listeners.forEach(h=>{h(Ae(this,Hh))})})},_ee),Tie=C.createContext(void 0),As=e=>{const t=C.useContext(Tie);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Wke=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Tie.Provider,{value:e,children:t})),Iie=C.createContext(!1),Gke=()=>C.useContext(Iie);Iie.Provider;function Yke(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Xke=C.createContext(Yke()),Jke=()=>C.useContext(Xke),Zke=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},e_e=e=>{C.useEffect(()=>{e.clearReset()},[e])},t_e=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Cie(n,[e.error,r])),n_e=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},r_e=(e,t)=>e.isLoading&&e.isFetching&&!t,i_e=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,W7=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function s_e(e,t,n){var h,A,f,p,m;const r=Gke(),i=Jke(),s=As(),a=s.defaultQueryOptions(e);(A=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||A.call(h,a),a._optimisticResults=r?"isRestoring":"optimistic",n_e(a),Zke(a,i),e_e(i);const o=!s.getQueryCache().get(a.queryHash),[c]=C.useState(()=>new t(s,a)),u=c.getOptimisticResult(a),d=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(g=>{const y=d?c.subscribe(Wi.batchCalls(g)):xa;return c.updateResult(),y},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setOptions(a)},[a,c]),i_e(a,u))throw W7(a,c,i);if(t_e({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((p=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,a,u),a.experimental_prefetchInRender&&!Gp&&r_e(u,r)){const g=o?W7(a,c,i):(m=s.getQueryCache().get(a.queryHash))==null?void 0:m.promise;g==null||g.catch(xa).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function Br(e,t){return s_e(e,zke)}function Ms(e,t){const n=As(),[r]=C.useState(()=>new qke(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const i=C.useSyncExternalStore(C.useCallback(a=>r.subscribe(Wi.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=C.useCallback((a,o)=>{r.mutate(a,o).catch(xa)},[r]);if(i.error&&Cie(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}/**
 * @remix-run/router v1.23.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function Lb(){return Lb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lb.apply(this,arguments)}var Vh;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Vh||(Vh={}));const G7="popstate";function a_e(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:a,hash:o}=r.location;return rF("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:cj(i)}return l_e(t,n,null,e)}function ki(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Pie(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function o_e(){return Math.random().toString(36).substr(2,8)}function Y7(e,t){return{usr:e.state,key:e.key,idx:t}}function rF(e,t,n,r){return n===void 0&&(n=null),Lb({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?a0(t):t,{state:n,key:t&&t.key||r||o_e()})}function cj(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function a0(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function l_e(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=Vh.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Lb({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){o=Vh.Pop;let g=d(),y=g==null?null:g-u;u=g,c&&c({action:o,location:m.location,delta:y})}function A(g,y){o=Vh.Push;let v=rF(m.location,g,y);u=d()+1;let x=Y7(v,u),b=m.createHref(v);try{a.pushState(x,"",b)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(b)}s&&c&&c({action:o,location:m.location,delta:1})}function f(g,y){o=Vh.Replace;let v=rF(m.location,g,y);u=d();let x=Y7(v,u),b=m.createHref(v);a.replaceState(x,"",b),s&&c&&c({action:o,location:m.location,delta:0})}function p(g){let y=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof g=="string"?g:cj(g);return v=v.replace(/ $/,"%20"),ki(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let m={get action(){return o},get location(){return e(i,a)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(G7,h),c=g,()=>{i.removeEventListener(G7,h),c=null}},createHref(g){return t(i,g)},createURL:p,encodeLocation(g){let y=p(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:A,replace:f,go(g){return a.go(g)}};return m}var X7;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(X7||(X7={}));function c_e(e,t,n){return n===void 0&&(n="/"),u_e(e,t,n,!1)}function u_e(e,t,n,r){let i=typeof t=="string"?a0(t):t,s=jU(i.pathname||"/",n);if(s==null)return null;let a=Oie(e);d_e(a);let o=null;for(let c=0;o==null&&c<a.length;++c){let u=b_e(s);o=x_e(a[c],u,r)}return o}function Oie(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,a,o)=>{let c={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};c.relativePath.startsWith("/")&&(ki(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=ff([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(ki(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Oie(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:y_e(u,s.index),routesMeta:d})};return e.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let c of Fie(s.path))i(s,a,c)}),t}function Fie(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=Fie(r.join("/")),o=[];return o.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&o.push(...a),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function d_e(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:v_e(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const h_e=/^:[\w-]+$/,f_e=3,A_e=2,p_e=1,m_e=10,g_e=-2,J7=e=>e==="*";function y_e(e,t){let n=e.split("/"),r=n.length;return n.some(J7)&&(r+=g_e),t&&(r+=A_e),n.filter(i=>!J7(i)).reduce((i,s)=>i+(h_e.test(s)?f_e:s===""?p_e:m_e),r)}function v_e(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function x_e(e,t,n){let{routesMeta:r}=e,i={},s="/",a=[];for(let o=0;o<r.length;++o){let c=r[o],u=o===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",h=Z7({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),A=c.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=Z7({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),a.push({params:i,pathname:ff([s,h.pathname]),pathnameBase:__e(ff([s,h.pathnameBase])),route:A}),h.pathnameBase!=="/"&&(s=ff([s,h.pathnameBase]))}return a}function Z7(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=w_e(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:A,isOptional:f}=d;if(A==="*"){let m=o[h]||"";a=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const p=o[h];return f&&!p?u[A]=void 0:u[A]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:e}}function w_e(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Pie(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function b_e(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Pie(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function jU(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function C_e(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?a0(e):e;return{pathname:n?n.startsWith("/")?n:S_e(n,t):t,search:j_e(r),hash:B_e(i)}}function S_e(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function UI(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function k_e(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function BU(e,t){let n=k_e(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function NU(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=a0(e):(i=Lb({},e),ki(!i.pathname||!i.pathname.includes("?"),UI("?","pathname","search",i)),ki(!i.pathname||!i.pathname.includes("#"),UI("#","pathname","hash",i)),ki(!i.search||!i.search.includes("#"),UI("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let h=t.length-1;if(!r&&a.startsWith("..")){let A=a.split("/");for(;A[0]==="..";)A.shift(),h-=1;i.pathname=A.join("/")}o=h>=0?t[h]:"/"}let c=C_e(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ff=e=>e.join("/").replace(/\/\/+/g,"/"),__e=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j_e=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,B_e=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function N_e(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Mie=["post","put","patch","delete"];new Set(Mie);const E_e=["get",...Mie];new Set(E_e);/**
 * React Router v6.30.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function Rb(){return Rb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rb.apply(this,arguments)}const EU=C.createContext(null),T_e=C.createContext(null),zf=C.createContext(null),wE=C.createContext(null),Id=C.createContext({outlet:null,matches:[],isDataRoute:!1}),Lie=C.createContext(null);function I_e(e,t){let{relative:n}=t===void 0?{}:t;o0()||ki(!1);let{basename:r,navigator:i}=C.useContext(zf),{hash:s,pathname:a,search:o}=Die(e,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:ff([r,a])),i.createHref({pathname:c,search:o,hash:s})}function o0(){return C.useContext(wE)!=null}function co(){return o0()||ki(!1),C.useContext(wE).location}function Rie(e){C.useContext(zf).static||C.useLayoutEffect(e)}function Ll(){let{isDataRoute:e}=C.useContext(Id);return e?V_e():P_e()}function P_e(){o0()||ki(!1);let e=C.useContext(EU),{basename:t,future:n,navigator:r}=C.useContext(zf),{matches:i}=C.useContext(Id),{pathname:s}=co(),a=JSON.stringify(BU(i,n.v7_relativeSplatPath)),o=C.useRef(!1);return Rie(()=>{o.current=!0}),C.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let h=NU(u,JSON.parse(a),s,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:ff([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,a,s,e])}function gm(){let{matches:e}=C.useContext(Id),t=e[e.length-1];return t?t.params:{}}function Die(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(zf),{matches:i}=C.useContext(Id),{pathname:s}=co(),a=JSON.stringify(BU(i,r.v7_relativeSplatPath));return C.useMemo(()=>NU(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function O_e(e,t){return F_e(e,t)}function F_e(e,t,n,r){o0()||ki(!1);let{navigator:i}=C.useContext(zf),{matches:s}=C.useContext(Id),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=co(),d;if(t){var h;let g=typeof t=="string"?a0(t):t;c==="/"||(h=g.pathname)!=null&&h.startsWith(c)||ki(!1),d=g}else d=u;let A=d.pathname||"/",f=A;if(c!=="/"){let g=c.replace(/^\//,"").split("/");f="/"+A.replace(/^\//,"").split("/").slice(g.length).join("/")}let p=c_e(e,{pathname:f}),m=U_e(p&&p.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:ff([c,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:ff([c,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),s,n,r);return t&&m?C.createElement(wE.Provider,{value:{location:Rb({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Vh.Pop}},m):m}function M_e(){let e=z_e(),t=N_e(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:i},n):null,null)}const L_e=C.createElement(M_e,null);class R_e extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(Id.Provider,{value:this.props.routeContext},C.createElement(Lie.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function D_e(e){let{routeContext:t,match:n,children:r}=e,i=C.useContext(EU);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(Id.Provider,{value:t},r)}function U_e(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=a.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||ki(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let h=a[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:A,errors:f}=n,p=h.route.loader&&A[h.route.id]===void 0&&(!f||f[h.route.id]===void 0);if(h.route.lazy||p){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,A)=>{let f,p=!1,m=null,g=null;n&&(f=o&&h.route.id?o[h.route.id]:void 0,m=h.route.errorElement||L_e,c&&(u<0&&A===0?(p=!0,g=null):u===A&&(p=!0,g=h.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,A+1)),v=()=>{let x;return f?x=m:p?x=g:h.route.Component?x=C.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=d,C.createElement(D_e,{match:h,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(h.route.ErrorBoundary||h.route.errorElement||A===0)?C.createElement(R_e,{location:n.location,revalidation:n.revalidation,component:m,error:f,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var Uie=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Uie||{}),uj=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(uj||{});function H_e(e){let t=C.useContext(EU);return t||ki(!1),t}function Q_e(e){let t=C.useContext(T_e);return t||ki(!1),t}function $_e(e){let t=C.useContext(Id);return t||ki(!1),t}function Hie(e){let t=$_e(),n=t.matches[t.matches.length-1];return n.route.id||ki(!1),n.route.id}function z_e(){var e;let t=C.useContext(Lie),n=Q_e(uj.UseRouteError),r=Hie(uj.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function V_e(){let{router:e}=H_e(Uie.UseNavigateStable),t=Hie(uj.UseNavigateStable),n=C.useRef(!1);return Rie(()=>{n.current=!0}),C.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Rb({fromRouteId:t},s)))},[e,t])}function K_e(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function vy(e){let{to:t,replace:n,state:r,relative:i}=e;o0()||ki(!1);let{future:s,static:a}=C.useContext(zf),{matches:o}=C.useContext(Id),{pathname:c}=co(),u=Ll(),d=NU(t,BU(o,s.v7_relativeSplatPath),c,i==="path"),h=JSON.stringify(d);return C.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:i}),[u,h,i,n,r]),null}function Tt(e){ki(!1)}function q_e(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Vh.Pop,navigator:s,static:a=!1,future:o}=e;o0()&&ki(!1);let c=t.replace(/^\/*/,"/"),u=C.useMemo(()=>({basename:c,navigator:s,static:a,future:Rb({v7_relativeSplatPath:!1},o)}),[c,o,s,a]);typeof r=="string"&&(r=a0(r));let{pathname:d="/",search:h="",hash:A="",state:f=null,key:p="default"}=r,m=C.useMemo(()=>{let g=jU(d,c);return g==null?null:{location:{pathname:g,search:h,hash:A,state:f,key:p},navigationType:i}},[c,d,h,A,f,p,i]);return m==null?null:C.createElement(zf.Provider,{value:u},C.createElement(wE.Provider,{children:n,value:m}))}function W_e(e){let{children:t,location:n}=e;return O_e(iF(t),n)}new Promise(()=>{});function iF(e,t){t===void 0&&(t=[]);let n=[];return C.Children.forEach(e,(r,i)=>{if(!C.isValidElement(r))return;let s=[...t,i];if(r.type===C.Fragment){n.push.apply(n,iF(r.props.children,s));return}r.type!==Tt&&ki(!1),!r.props.index||!r.props.children||ki(!1);let a={id:r.props.id||s.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&&(a.children=iF(r.props.children,s)),n.push(a)}),n}/**
 * React Router DOM v6.30.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function sF(){return sF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sF.apply(this,arguments)}function G_e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Y_e(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function X_e(e,t){return e.button===0&&(!t||t==="_self")&&!Y_e(e)}function aF(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function J_e(e,t){let n=aF(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const Z_e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],eje="6";try{window.__reactRouterVersion=eje}catch{}const tje="startTransition",ez=aD[tje];function nje(e){let{basename:t,children:n,future:r,window:i}=e,s=C.useRef();s.current==null&&(s.current=a_e({window:i,v5Compat:!0}));let a=s.current,[o,c]=C.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},d=C.useCallback(h=>{u&&ez?ez(()=>c(h)):c(h)},[c,u]);return C.useLayoutEffect(()=>a.listen(d),[a,d]),C.useEffect(()=>K_e(r),[r]),C.createElement(q_e,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const rje=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ije=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,St=C.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:c,to:u,preventScrollReset:d,viewTransition:h}=t,A=G_e(t,Z_e),{basename:f}=C.useContext(zf),p,m=!1;if(typeof u=="string"&&ije.test(u)&&(p=u,rje))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),w=jU(b.pathname,f);b.origin===x.origin&&w!=null?u=w+b.search+b.hash:m=!0}catch{}let g=I_e(u,{relative:i}),y=sje(u,{replace:a,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:h});function v(x){r&&r(x),x.defaultPrevented||y(x)}return C.createElement("a",sF({},A,{href:p||g,onClick:m||s?r:v,ref:n,target:c}))});var tz;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(tz||(tz={}));var nz;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(nz||(nz={}));function sje(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=t===void 0?{}:t,c=Ll(),u=co(),d=Die(e,{relative:a});return C.useCallback(h=>{if(X_e(h,n)){h.preventDefault();let A=r!==void 0?r:cj(u)===cj(d);c(e,{replace:A,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,c,d,r,i,n,e,s,a,o])}function Qie(e){let t=C.useRef(aF(e)),n=C.useRef(!1),r=co(),i=C.useMemo(()=>J_e(r.search,n.current?null:t.current),[r.search]),s=Ll(),a=C.useCallback((o,c)=>{const u=aF(typeof o=="function"?o(i):o);n.current=!0,s("?"+u,c)},[s,i]);return[i,a]}var aje=typeof Element<"u",oje=typeof Map=="function",lje=typeof Set=="function",cje=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Zk(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Zk(e[r],t[r]))return!1;return!0}var s;if(oje&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;for(s=e.entries();!(r=s.next()).done;)if(!Zk(r.value[1],t.get(r.value[0])))return!1;return!0}if(lje&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(cje&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(aje&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!Zk(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var uje=function(t,n){try{return Zk(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const dje=Mn(uje);var hje=function(e,t,n,r,i,s,a,o){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,s,a,o],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},fje=hje;const rz=Mn(fje);var Aje=function(t,n,r,i){var s=r?r.call(i,t,n):void 0;if(s!==void 0)return!!s;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),u=0;u<a.length;u++){var d=a[u];if(!c(d))return!1;var h=t[d],A=n[d];if(s=r?r.call(i,h,A,d):void 0,s===!1||s===void 0&&h!==A)return!1}return!0};const pje=Mn(Aje);var $ie=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))($ie||{}),HI={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},iz=Object.values($ie),TU={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},mje=Object.entries(TU).reduce((e,[t,n])=>(e[n]=t,e),{}),fc="data-rh",xy={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},wy=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},gje=e=>{let t=wy(e,"title");const n=wy(e,xy.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=wy(e,xy.DEFAULT_TITLE);return t||r||void 0},yje=e=>wy(e,xy.ON_CHANGE_CLIENT_STATE)||(()=>{}),QI=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),vje=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let s=0;s<i.length;s+=1){const o=i[s].toLowerCase();if(e.indexOf(o)!==-1&&r[o])return n.concat(r)}}return n},[]),xje=e=>console&&typeof console.warn=="function"&&console.warn(e),yx=(e,t,n)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&xje(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,s)=>{const a={};s.filter(c=>{let u;const d=Object.keys(c);for(let A=0;A<d.length;A+=1){const f=d[A],p=f.toLowerCase();t.indexOf(p)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(p==="rel"&&c[p].toLowerCase()==="stylesheet")&&(u=p),t.indexOf(f)!==-1&&(f==="innerHTML"||f==="cssText"||f==="itemprop")&&(u=f)}if(!u||!c[u])return!1;const h=c[u].toLowerCase();return r[u]||(r[u]={}),a[u]||(a[u]={}),r[u][h]?!1:(a[u][h]=!0,!0)}).reverse().forEach(c=>i.push(c));const o=Object.keys(a);for(let c=0;c<o.length;c+=1){const u=o[c],d={...r[u],...a[u]};r[u]=d}return i},[]).reverse()},wje=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},bje=e=>({baseTag:vje(["href"],e),bodyAttributes:QI("bodyAttributes",e),defer:wy(e,xy.DEFER),encode:wy(e,xy.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:QI("htmlAttributes",e),linkTags:yx("link",["rel","href"],e),metaTags:yx("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:yx("noscript",["innerHTML"],e),onChangeClientState:yje(e),scriptTags:yx("script",["src","innerHTML"],e),styleTags:yx("style",["cssText"],e),title:gje(e),titleAttributes:QI("titleAttributes",e),prioritizeSeoTags:wje(e,xy.PRIORITIZE_SEO_TAGS)}),zie=e=>Array.isArray(e)?e.join(""):e,Cje=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},$I=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(Cje(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},sz=(e,t)=>({...e,[t]:void 0}),Sje=["noscript","script","style"],oF=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),Vie=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),kje=(e,t,n,r)=>{const i=Vie(n),s=zie(t);return i?`<${e} ${fc}="true" ${i}>${oF(s,r)}</${e}>`:`<${e} ${fc}="true">${oF(s,r)}</${e}>`},_je=(e,t,n=!0)=>t.reduce((r,i)=>{const s=i,a=Object.keys(s).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const h=typeof s[d]>"u"?d:`${d}="${oF(s[d],n)}"`;return u?`${u} ${h}`:h},""),o=s.innerHTML||s.cssText||"",c=Sje.indexOf(e)===-1;return`${r}<${e} ${fc}="true" ${a}${c?"/>":`>${o}</${e}>`}`},""),Kie=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=TU[r];return n[i||r]=e[r],n},t),jje=(e,t,n)=>{const r={key:t,[fc]:!0},i=Kie(n,r);return[re.createElement("title",i,t)]},e_=(e,t)=>t.map((n,r)=>{const i={key:r,[fc]:!0};return Object.keys(n).forEach(s=>{const o=TU[s]||s;if(o==="innerHTML"||o==="cssText"){const c=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:c}}else i[o]=n[s]}),re.createElement(e,i)}),sl=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>jje(e,t.title,t.titleAttributes),toString:()=>kje(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Kie(t),toString:()=>Vie(t)};default:return{toComponent:()=>e_(e,t),toString:()=>_je(e,t,n)}}},Bje=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=$I(e,HI.meta),s=$I(t,HI.link),a=$I(n,HI.script);return{priorityMethods:{toComponent:()=>[...e_("meta",i.priority),...e_("link",s.priority),...e_("script",a.priority)],toString:()=>`${sl("meta",i.priority,r)} ${sl("link",s.priority,r)} ${sl("script",a.priority,r)}`},metaTags:i.default,linkTags:s.default,scriptTags:a.default}},Nje=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:a,title:o="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:h,scriptTags:A}=e,f={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:f,linkTags:d,metaTags:h,scriptTags:A}=Bje(e)),{priority:f,base:sl("base",t,r),bodyAttributes:sl("bodyAttributes",n,r),htmlAttributes:sl("htmlAttributes",i,r),link:sl("link",d,r),meta:sl("meta",h,r),noscript:sl("noscript",s,r),script:sl("script",A,r),style:sl("style",a,r),title:sl("title",{title:o,titleAttributes:c},r)}},lF=Nje,oS=[],qie=!!(typeof window<"u"&&window.document&&window.document.createElement),cF=class{constructor(e,t){bn(this,"instances",[]);bn(this,"canUseDOM",qie);bn(this,"context");bn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?oS:this.instances,add:e=>{(this.canUseDOM?oS:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?oS:this.instances).indexOf(e);(this.canUseDOM?oS:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=lF({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Eje={},Wie=re.createContext(Eje),bp,Gie=(bp=class extends C.Component{constructor(n){super(n);bn(this,"helmetData");this.helmetData=new cF(this.props.context||{},bp.canUseDOM)}render(){return re.createElement(Wie.Provider,{value:this.helmetData.value},this.props.children)}},bn(bp,"canUseDOM",qie),bp),eg=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${fc}]`),i=[].slice.call(r),s=[];let a;return t&&t.length&&t.forEach(o=>{const c=document.createElement(e);for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u))if(u==="innerHTML")c.innerHTML=o.innerHTML;else if(u==="cssText")c.styleSheet?c.styleSheet.cssText=o.cssText:c.appendChild(document.createTextNode(o.cssText));else{const d=u,h=typeof o[d]>"u"?"":o[d];c.setAttribute(u,h)}c.setAttribute(fc,"true"),i.some((u,d)=>(a=d,c.isEqualNode(u)))?i.splice(a,1):s.push(c)}),i.forEach(o=>{var c;return(c=o.parentNode)==null?void 0:c.removeChild(o)}),s.forEach(o=>n.appendChild(o)),{oldTags:i,newTags:s}},uF=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(fc),i=r?r.split(","):[],s=[...i],a=Object.keys(t);for(const o of a){const c=t[o]||"";n.getAttribute(o)!==c&&n.setAttribute(o,c),i.indexOf(o)===-1&&i.push(o);const u=s.indexOf(o);u!==-1&&s.splice(u,1)}for(let o=s.length-1;o>=0;o-=1)n.removeAttribute(s[o]);i.length===s.length?n.removeAttribute(fc):n.getAttribute(fc)!==a.join(",")&&n.setAttribute(fc,a.join(","))},Tje=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=zie(e)),uF("title",t)},az=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:s,metaTags:a,noscriptTags:o,onChangeClientState:c,scriptTags:u,styleTags:d,title:h,titleAttributes:A}=e;uF("body",r),uF("html",i),Tje(h,A);const f={baseTag:eg("base",n),linkTags:eg("link",s),metaTags:eg("meta",a),noscriptTags:eg("noscript",o),scriptTags:eg("script",u),styleTags:eg("style",d)},p={},m={};Object.keys(f).forEach(g=>{const{newTags:y,oldTags:v}=f[g];y.length&&(p[g]=y),v.length&&(m[g]=f[g].oldTags)}),t&&t(),c(e,p,m)},vx=null,Ije=e=>{vx&&cancelAnimationFrame(vx),e.defer?vx=requestAnimationFrame(()=>{az(e,()=>{vx=null})}):(az(e),vx=null)},Pje=Ije,oz=class extends C.Component{constructor(){super(...arguments);bn(this,"rendered",!1)}shouldComponentUpdate(t){return!pje(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const i=bje(t.get().map(s=>{const a={...s.props};return delete a.context,a}));Gie.canUseDOM?Pje(i):lF&&(r=lF(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},MO,Vn=(MO=class extends C.Component{shouldComponentUpdate(e){return!dje(sz(this.props,"helmetData"),sz(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return rz(iz.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${iz.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),rz(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return re.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:i,...s}=r.props,a=Object.keys(s).reduce((c,u)=>(c[mje[u]||u]=s[u],c),{});let{type:o}=r;switch(typeof o=="symbol"?o=o.toString():this.warnOnInvalidChildren(r,i),o){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,a,i);break;default:t=this.mapObjectTypeChildren(r,t,a,i);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof cF)){const i=r;r=new cF(i.context,!0),delete n.helmetData}return r?re.createElement(oz,{...n,context:r.value}):re.createElement(Wie.Consumer,null,i=>re.createElement(oz,{...n,context:i}))}},bn(MO,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),MO);const Oje=["bot","Bot","crawler","Crawler","spider","Spider","GPT","Claude","Perplexity","Anthropic","Amazonbot","meta-externalagent","FacebookExternalHit","Bytespider","CCBot","cohere","Bingbot","bingbot","Googlebot","Google-Extended","AppleBot","DuckDuckBot","YandexBot","OAI-SearchBot"];function Fje(){const e=navigator.userAgent;if(!Oje.some(i=>e.includes(i)))return;fetch("https://khmmwvmdbhaplcfcndjx.supabase.co/functions/v1/log-crawler",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q"},body:JSON.stringify({user_agent:e,page_path:window.location.pathname,full_url:window.location.href,site_domain:window.location.hostname,status_code:200})}).catch(()=>{})}const Mje=()=>{const{pathname:e,hash:t}=co();return C.useEffect(()=>{if(t){const n=document.querySelector(t);n&&n.scrollIntoView({behavior:"smooth"})}else window.scrollTo(0,0)},[e,t]),null},IU=C.createContext({});function PU(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yie=typeof window<"u",Xie=Yie?C.useLayoutEffect:C.useEffect,bE=C.createContext(null);function OU(e,t){e.indexOf(t)===-1&&e.push(t)}function FU(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const mu=(e,t,n)=>n>t?t:n<e?e:n;let CE=()=>{},uv=()=>{};const Sd={},Jie=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Zie(e){return typeof e=="object"&&e!==null}const ese=e=>/^0[^.\s]+$/u.test(e);function MU(e){let t;return()=>(t===void 0&&(t=e()),t)}const _l=e=>e,Lje=(e,t)=>n=>t(e(n)),C2=(...e)=>e.reduce(Lje),Db=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class LU{constructor(){this.subscriptions=[]}add(t){return OU(this.subscriptions,t),()=>FU(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const cu=e=>e*1e3,yl=e=>e/1e3;function tse(e,t){return t?e*(1e3/t):0}const nse=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Rje=1e-7,Dje=12;function Uje(e,t,n,r,i){let s,a,o=0;do a=t+(n-t)/2,s=nse(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>Rje&&++o<Dje);return a}function S2(e,t,n,r){if(e===t&&n===r)return _l;const i=s=>Uje(s,0,1,e,n);return s=>s===0||s===1?s:nse(i(s),t,r)}const rse=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ise=e=>t=>1-e(1-t),sse=S2(.33,1.53,.69,.99),RU=ise(sse),ase=rse(RU),ose=e=>(e*=2)<1?.5*RU(e):.5*(2-Math.pow(2,-10*(e-1))),DU=e=>1-Math.sin(Math.acos(e)),lse=ise(DU),cse=rse(DU),Hje=S2(.42,0,1,1),Qje=S2(0,0,.58,1),use=S2(.42,0,.58,1),$je=e=>Array.isArray(e)&&typeof e[0]!="number",dse=e=>Array.isArray(e)&&typeof e[0]=="number",lz={linear:_l,easeIn:Hje,easeInOut:use,easeOut:Qje,circIn:DU,circInOut:cse,circOut:lse,backIn:RU,backInOut:ase,backOut:sse,anticipate:ose},zje=e=>typeof e=="string",cz=e=>{if(dse(e)){uv(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return S2(t,n,r,i)}else if(zje(e))return uv(lz[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),lz[e];return e},lS=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],uz={value:null,addProjectionMetrics:null};function Vje(e,t){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){a.has(h)&&(d.schedule(h),e()),c++,h(o)}const d={schedule:(h,A=!1,f=!1)=>{const m=f&&i?n:r;return A&&a.add(h),m.has(h)||m.add(h),h},cancel:h=>{r.delete(h),a.delete(h)},process:h=>{if(o=h,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),t&&uz.value&&uz.value.frameloop[t].push(c),c=0,n.clear(),i=!1,s&&(s=!1,d.process(h))}};return d}const Kje=40;function hse(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=lS.reduce((x,b)=>(x[b]=Vje(s,t?b:void 0),x),{}),{setup:o,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:A,render:f,postRender:p}=a,m=()=>{const x=Sd.useManualTiming?i.timestamp:performance.now();n=!1,Sd.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,Kje),1)),i.timestamp=x,i.isProcessing=!0,o.process(i),c.process(i),u.process(i),d.process(i),h.process(i),A.process(i),f.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},g=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:lS.reduce((x,b)=>{const w=a[b];return x[b]=(k,j=!1,B=!1)=>(n||g(),w.schedule(k,j,B)),x},{}),cancel:x=>{for(let b=0;b<lS.length;b++)a[lS[b]].cancel(x)},state:i,steps:a}}const{schedule:Dr,cancel:Tf,state:_s,steps:zI}=hse(typeof requestAnimationFrame<"u"?requestAnimationFrame:_l,!0);let t_;function qje(){t_=void 0}const ba={now:()=>(t_===void 0&&ba.set(_s.isProcessing||Sd.useManualTiming?_s.timestamp:performance.now()),t_),set:e=>{t_=e,queueMicrotask(qje)}},fse=e=>t=>typeof t=="string"&&t.startsWith(e),Ase=fse("--"),Wje=fse("var(--"),UU=e=>Wje(e)?Gje.test(e.split("/*")[0].trim()):!1,Gje=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function dz(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const l0={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ub={...l0,transform:e=>mu(0,1,e)},cS={...l0,default:1},Tw=e=>Math.round(e*1e5)/1e5,HU=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Yje(e){return e==null}const Xje=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,QU=(e,t)=>n=>!!(typeof n=="string"&&Xje.test(n)&&n.startsWith(e)||t&&!Yje(n)&&Object.prototype.hasOwnProperty.call(n,t)),pse=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,o]=r.match(HU);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},Jje=e=>mu(0,255,e),VI={...l0,transform:e=>Math.round(Jje(e))},JA={test:QU("rgb","red"),parse:pse("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+VI.transform(e)+", "+VI.transform(t)+", "+VI.transform(n)+", "+Tw(Ub.transform(r))+")"};function Zje(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const dF={test:QU("#"),parse:Zje,transform:JA.transform},k2=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),hh=k2("deg"),uu=k2("%"),bt=k2("px"),eBe=k2("vh"),tBe=k2("vw"),hz={...uu,parse:e=>uu.parse(e)/100,transform:e=>uu.transform(e*100)},ey={test:QU("hsl","hue"),parse:pse("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+uu.transform(Tw(t))+", "+uu.transform(Tw(n))+", "+Tw(Ub.transform(r))+")"},Pi={test:e=>JA.test(e)||dF.test(e)||ey.test(e),parse:e=>JA.test(e)?JA.parse(e):ey.test(e)?ey.parse(e):dF.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?JA.transform(e):ey.transform(e),getAnimatableNone:e=>{const t=Pi.parse(e);return t.alpha=0,Pi.transform(t)}},nBe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rBe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(HU))==null?void 0:t.length)||0)+(((n=e.match(nBe))==null?void 0:n.length)||0)>0}const mse="number",gse="color",iBe="var",sBe="var(",fz="${}",aBe=/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;function Hb(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(aBe,c=>(Pi.test(c)?(r.color.push(s),i.push(gse),n.push(Pi.parse(c))):c.startsWith(sBe)?(r.var.push(s),i.push(iBe),n.push(c)):(r.number.push(s),i.push(mse),n.push(parseFloat(c))),++s,fz)).split(fz);return{values:n,split:o,indexes:r,types:i}}function yse(e){return Hb(e).values}function vse(e){const{split:t,types:n}=Hb(e),r=t.length;return i=>{let s="";for(let a=0;a<r;a++)if(s+=t[a],i[a]!==void 0){const o=n[a];o===mse?s+=Tw(i[a]):o===gse?s+=Pi.transform(i[a]):s+=i[a]}return s}}const oBe=e=>typeof e=="number"?0:Pi.test(e)?Pi.getAnimatableNone(e):e;function lBe(e){const t=yse(e);return vse(e)(t.map(oBe))}const If={test:rBe,parse:yse,createTransformer:vse,getAnimatableNone:lBe};function KI(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function cBe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,c=2*n-o;i=KI(c,o,e+1/3),s=KI(c,o,e),a=KI(c,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function dj(e,t){return n=>n>0?t:e}const Jr=(e,t,n)=>e+(t-e)*n,qI=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},uBe=[dF,JA,ey],dBe=e=>uBe.find(t=>t.test(e));function Az(e){const t=dBe(e);if(CE(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ey&&(n=cBe(n)),n}const pz=(e,t)=>{const n=Az(e),r=Az(t);if(!n||!r)return dj(e,t);const i={...n};return s=>(i.red=qI(n.red,r.red,s),i.green=qI(n.green,r.green,s),i.blue=qI(n.blue,r.blue,s),i.alpha=Jr(n.alpha,r.alpha,s),JA.transform(i))},hF=new Set(["none","hidden"]);function hBe(e,t){return hF.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function fBe(e,t){return n=>Jr(e,t,n)}function $U(e){return typeof e=="number"?fBe:typeof e=="string"?UU(e)?dj:Pi.test(e)?pz:mBe:Array.isArray(e)?xse:typeof e=="object"?Pi.test(e)?pz:ABe:dj}function xse(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>$U(s)(s,t[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function ABe(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=$U(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function pBe(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][r[s]],o=e.values[a]??0;n[i]=o,r[s]++}return n}const mBe=(e,t)=>{const n=If.createTransformer(t),r=Hb(e),i=Hb(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?hF.has(e)&&!i.values.length||hF.has(t)&&!r.values.length?hBe(e,t):C2(xse(pBe(r,i),i.values),n):(CE(!0,`Complex values '${e}' and '${t}' 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"),dj(e,t))};function wse(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Jr(e,t,n):$U(e)(e,t)}const gBe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Dr.update(t,n),stop:()=>Tf(t),now:()=>_s.isProcessing?_s.timestamp:ba.now()}},bse=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},hj=2e4;function zU(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<hj;)t+=n,r=e.next(t);return t>=hj?1/0:t}function yBe(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(zU(r),hj);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:yl(i)}}const vBe=5;function Cse(e,t,n){const r=Math.max(t-vBe,0);return tse(n-e(r),t-r)}const Gr={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},WI=.001;function xBe({duration:e=Gr.duration,bounce:t=Gr.bounce,velocity:n=Gr.velocity,mass:r=Gr.mass}){let i,s;CE(e<=cu(Gr.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=mu(Gr.minDamping,Gr.maxDamping,a),e=mu(Gr.minDuration,Gr.maxDuration,yl(e)),a<1?(i=u=>{const d=u*a,h=d*e,A=d-n,f=fF(u,a),p=Math.exp(-h);return WI-A/f*p},s=u=>{const h=u*a*e,A=h*n+n,f=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-h),m=fF(Math.pow(u,2),a);return(-i(u)+WI>0?-1:1)*((A-f)*p)/m}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-WI+d*h},s=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const o=5/e,c=bBe(i,s,o);if(e=cu(e),isNaN(c))return{stiffness:Gr.stiffness,damping:Gr.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const wBe=12;function bBe(e,t,n){let r=n;for(let i=1;i<wBe;i++)r=r-e(r)/t(r);return r}function fF(e,t){return e*Math.sqrt(1-t*t)}const CBe=["duration","bounce"],SBe=["stiffness","damping","mass"];function mz(e,t){return t.some(n=>e[n]!==void 0)}function kBe(e){let t={velocity:Gr.velocity,stiffness:Gr.stiffness,damping:Gr.damping,mass:Gr.mass,isResolvedFromDuration:!1,...e};if(!mz(e,SBe)&&mz(e,CBe))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*mu(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Gr.mass,stiffness:i,damping:s}}else{const n=xBe(e);t={...t,...n,mass:Gr.mass},t.isResolvedFromDuration=!0}return t}function fj(e=Gr.visualDuration,t=Gr.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:h,velocity:A,isResolvedFromDuration:f}=kBe({...n,velocity:-yl(n.velocity||0)}),p=A||0,m=u/(2*Math.sqrt(c*d)),g=a-s,y=yl(Math.sqrt(c/d)),v=Math.abs(g)<5;r||(r=v?Gr.restSpeed.granular:Gr.restSpeed.default),i||(i=v?Gr.restDelta.granular:Gr.restDelta.default);let x;if(m<1){const w=fF(y,m);x=k=>{const j=Math.exp(-m*y*k);return a-j*((p+m*y*g)/w*Math.sin(w*k)+g*Math.cos(w*k))}}else if(m===1)x=w=>a-Math.exp(-y*w)*(g+(p+y*g)*w);else{const w=y*Math.sqrt(m*m-1);x=k=>{const j=Math.exp(-m*y*k),B=Math.min(w*k,300);return a-j*((p+m*y*g)*Math.sinh(B)+w*g*Math.cosh(B))/w}}const b={calculatedDuration:f&&h||null,next:w=>{const k=x(w);if(f)o.done=w>=h;else{let j=w===0?p:0;m<1&&(j=w===0?cu(p):Cse(x,w,k));const B=Math.abs(j)<=r,E=Math.abs(a-k)<=i;o.done=B&&E}return o.value=o.done?a:k,o},toString:()=>{const w=Math.min(zU(b),hj),k=bse(j=>b.next(w*j).value,w,30);return w+"ms "+k},toTransition:()=>{}};return b}fj.applyToOptions=e=>{const t=yBe(e,100,fj);return e.ease=t.ease,e.duration=cu(t.duration),e.type="keyframes",e};function AF({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],A={done:!1,value:h},f=B=>o!==void 0&&B<o||c!==void 0&&B>c,p=B=>o===void 0?c:c===void 0||Math.abs(o-B)<Math.abs(c-B)?o:c;let m=n*t;const g=h+m,y=a===void 0?g:a(g);y!==g&&(m=y-h);const v=B=>-m*Math.exp(-B/r),x=B=>y+v(B),b=B=>{const E=v(B),P=x(B);A.done=Math.abs(E)<=u,A.value=A.done?y:P};let w,k;const j=B=>{f(A.value)&&(w=B,k=fj({keyframes:[A.value,p(A.value)],velocity:Cse(x,B,A.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return j(0),{calculatedDuration:null,next:B=>{let E=!1;return!k&&w===void 0&&(E=!0,b(B),j(B)),w!==void 0&&B>=w?k.next(B-w):(!E&&b(B),A)}}}function _Be(e,t,n){const r=[],i=n||Sd.mix||wse,s=e.length-1;for(let a=0;a<s;a++){let o=i(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||_l:t;o=C2(c,o)}r.push(o)}return r}function jBe(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(uv(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=_Be(t,r,i),c=o.length,u=d=>{if(a&&d<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const A=Db(e[h],e[h+1],d);return o[h](A)};return n?d=>u(mu(e[0],e[s-1],d)):u}function BBe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Db(0,t,r);e.push(Jr(n,1,i))}}function NBe(e){const t=[0];return BBe(t,e.length-1),t}function EBe(e,t){return e.map(n=>n*t)}function TBe(e,t){return e.map(()=>t||use).splice(0,e.length-1)}function Iw({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=$je(r)?r.map(cz):cz(r),s={done:!1,value:t[0]},a=EBe(n&&n.length===t.length?n:NBe(t),e),o=jBe(a,t,{ease:Array.isArray(i)?i:TBe(t,i)});return{calculatedDuration:e,next:c=>(s.value=o(c),s.done=c>=e,s)}}const IBe=e=>e!==null;function VU(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(IBe),o=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const PBe={decay:AF,inertia:AF,tween:Iw,keyframes:Iw,spring:fj};function Sse(e){typeof e.type=="string"&&(e.type=PBe[e.type])}class KU{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const OBe=e=>e/100;class qU extends KU{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==ba.now()&&this.tick(ba.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Sse(t);const{type:n=Iw,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:o}=t;const c=n||Iw;c!==Iw&&typeof o[0]!="number"&&(this.mixKeyframes=C2(OBe,wse(o[0],o[1])),o=[0,100]);const u=c({...t,keyframes:o});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=zU(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:A,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,b=r;if(h){const B=Math.min(this.currentTime,i)/o;let E=Math.floor(B),P=B%1;!P&&B>=1&&(P=1),P===1&&E--,E=Math.min(E,h+1),!!(E%2)&&(A==="reverse"?(P=1-P,f&&(P-=f/o)):A==="mirror"&&(b=a)),x=mu(0,1,P)*o}const w=v?{done:!1,value:d[0]}:b.next(x);s&&(w.value=s(w.value));let{done:k}=w;!v&&c!==null&&(k=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return j&&p!==AF&&(w.value=VU(d,this.options,g,this.speed)),m&&m(w.value),j&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return yl(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+yl(t)}get time(){return yl(this.currentTime)}set time(t){var n;t=cu(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ba.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=yl(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=gBe,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(s=(i=this.options).onPlay)==null||s.call(i);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(ba.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function FBe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ZA=e=>e*180/Math.PI,pF=e=>{const t=ZA(Math.atan2(e[1],e[0]));return mF(t)},MBe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:pF,rotateZ:pF,skewX:e=>ZA(Math.atan(e[1])),skewY:e=>ZA(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},mF=e=>(e=e%360,e<0&&(e+=360),e),gz=pF,yz=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),vz=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),LBe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yz,scaleY:vz,scale:e=>(yz(e)+vz(e))/2,rotateX:e=>mF(ZA(Math.atan2(e[6],e[5]))),rotateY:e=>mF(ZA(Math.atan2(-e[2],e[0]))),rotateZ:gz,rotate:gz,skewX:e=>ZA(Math.atan(e[4])),skewY:e=>ZA(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function gF(e){return e.includes("scale")?1:0}function yF(e,t){if(!e||e==="none")return gF(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=LBe,i=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=MBe,i=o}if(!i)return gF(t);const s=r[t],a=i[1].split(",").map(DBe);return typeof s=="function"?s(a):a[s]}const RBe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return yF(n,t)};function DBe(e){return parseFloat(e.trim())}const c0=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],u0=new Set(c0),xz=e=>e===l0||e===bt,UBe=new Set(["x","y","z"]),HBe=c0.filter(e=>!UBe.has(e));function QBe(e){const t=[];return HBe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Kh={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>yF(t,"x"),y:(e,{transform:t})=>yF(t,"y")};Kh.translateX=Kh.x;Kh.translateY=Kh.y;const _p=new Set;let vF=!1,xF=!1,wF=!1;function kse(){if(xF){const e=Array.from(_p).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=QBe(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var o;(o=r.getValue(s))==null||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}xF=!1,vF=!1,_p.forEach(e=>e.complete(wF)),_p.clear()}function _se(){_p.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xF=!0)})}function $Be(){wF=!0,_se(),kse(),wF=!1}class WU{constructor(t,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(_p.add(this),vF||(vF=!0,Dr.read(_se),Dr.resolveKeyframes(kse))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const o=r.readValue(n,a);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}FBe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_p.delete(this)}cancel(){this.state==="scheduled"&&(_p.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zBe=e=>e.startsWith("--");function VBe(e,t,n){zBe(t)?e.style.setProperty(t,n):e.style[t]=n}const KBe=MU(()=>window.ScrollTimeline!==void 0),qBe={};function WBe(e,t){const n=MU(e);return()=>qBe[t]??n()}const jse=WBe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ew=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,wz={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ew([0,.65,.55,1]),circOut:ew([.55,0,1,.45]),backIn:ew([.31,.01,.66,-.59]),backOut:ew([.33,1.53,.69,.99])};function Bse(e,t){if(e)return typeof e=="function"?jse()?bse(e,t):"ease-out":dse(e)?ew(e):Array.isArray(e)?e.map(n=>Bse(n,t)||wz.easeOut):wz[e]}function GBe(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const h=Bse(o,i);Array.isArray(h)&&(d.easing=h);const A={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return u&&(A.pseudoElement=u),e.animate(d,A)}function Nse(e){return typeof e=="function"&&"applyToOptions"in e}function YBe({type:e,...t}){return Nse(e)&&jse()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class XBe extends KU{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:o,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,uv(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=YBe(t);this.animation=GBe(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=VU(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):VBe(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return yl(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+yl(t)}get time(){return yl(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=cu(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&KBe()?(this.animation.timeline=t,_l):n(this)}}const Ese={anticipate:ose,backInOut:ase,circInOut:cse};function JBe(e){return e in Ese}function ZBe(e){typeof e.ease=="string"&&JBe(e.ease)&&(e.ease=Ese[e.ease])}const GI=10;class eNe extends XBe{constructor(t){ZBe(t),Sse(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const o=new qU({...a,autoplay:!1}),c=Math.max(GI,ba.now()-this.startTime),u=mu(0,GI,c-GI);n.setWithVelocity(o.sample(Math.max(0,c-u)).value,o.sample(c).value,u),o.stop()}}const bz=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(If.test(e)||e==="0")&&!e.startsWith("url("));function tNe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function nNe(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],a=bz(i,t),o=bz(s,t);return CE(a===o,`You are trying to animate ${t} from "${i}" to "${s}". "${a?s:i}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:tNe(e)||(n==="spring"||Nse(n))&&r}function bF(e){e.duration=0,e.type="keyframes"}const rNe=new Set(["opacity","clipPath","filter","transform"]),iNe=MU(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function sNe(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return iNe()&&n&&rNe.has(n)&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const aNe=40;class oNe extends KU{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:o,name:c,motionValue:u,element:d,...h}){var p;super(),this.stop=()=>{var m,g;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=ba.now();const A={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:c,motionValue:u,element:d,...h},f=(d==null?void 0:d.KeyframeResolver)||WU;this.keyframeResolver=new f(o,(m,g,y)=>this.onKeyframesResolved(m,g,A,!y),c,u,d),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,n,r,i){var g,y;this.keyframeResolver=void 0;const{name:s,type:a,velocity:o,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=ba.now(),nNe(t,s,a,o)||((Sd.instantAnimations||!c)&&(d==null||d(VU(t,r,n))),t[0]=t[t.length-1],bF(r),r.repeat=0);const A={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>aNe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},f=!u&&sNe(A),p=(y=(g=A.motionValue)==null?void 0:g.owner)==null?void 0:y.current,m=f?new eNe({...A,element:p}):new qU(A);m.finished.then(()=>{this.notifyFinished()}).catch(_l),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),$Be()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Tse(e,t,n,r=0,i=1){const s=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),a=e.size,o=(a-1)*r;return typeof n=="function"?n(s,a):i===1?s*r:o-s*r}const lNe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cNe(e){const t=lNe.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const uNe=4;function Ise(e,t,n=1){uv(n<=uNe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=cNe(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return Jie(a)?parseFloat(a):a}return UU(i)?Ise(i,t,n+1):i}const dNe={type:"spring",stiffness:500,damping:25,restSpeed:10},hNe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fNe={type:"keyframes",duration:.8},ANe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pNe=(e,{keyframes:t})=>t.length>2?fNe:u0.has(e)?e.startsWith("scale")?hNe(t[1]):dNe:ANe,mNe=e=>e!==null;function gNe(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(mNe),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}function GU(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}function yNe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const YU=(e,t,n,r={},i,s)=>a=>{const o=GU(r,e)||{},c=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-cu(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:A=>{t.set(A),o.onUpdate&&o.onUpdate(A)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:s?void 0:i};yNe(o)||Object.assign(d,pNe(e,d)),d.duration&&(d.duration=cu(d.duration)),d.repeatDelay&&(d.repeatDelay=cu(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(bF(d),d.delay===0&&(h=!0)),(Sd.instantAnimations||Sd.skipAnimations)&&(h=!0,bF(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,h&&!s&&t.get()!==void 0){const A=gNe(d.keyframes,o);if(A!==void 0){Dr.update(()=>{d.onUpdate(A),d.onComplete()});return}}return o.isSync?new qU(d):new oNe(d)};function Cz(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function XU(e,t,n,r){if(typeof t=="function"){const[i,s]=Cz(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Cz(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function by(e,t,n){const r=e.getProps();return XU(r,t,n!==void 0?n:r.custom,e)}const Pse=new Set(["width","height","top","left","right","bottom",...c0]),Sz=30,vNe=e=>!isNaN(parseFloat(e));class xNe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=ba.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ba.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vNe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new LU);const r=this.events[t].add(n);return t==="change"?()=>{r(),Dr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ba.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sz)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sz);return tse(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function dv(e,t){return new xNe(e,t)}const CF=e=>Array.isArray(e);function wNe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,dv(n))}function bNe(e){return CF(e)?e[e.length-1]||0:e}function CNe(e,t){const n=by(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const o=bNe(s[a]);wNe(e,a,o)}}const ta=e=>!!(e&&e.getVelocity);function SNe(e){return!!(ta(e)&&e.add)}function SF(e,t){const n=e.getValue("willChange");if(SNe(n))return n.add(t);if(!n&&Sd.WillChange){const r=new Sd.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function JU(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const kNe="framerAppearId",Ose="data-"+JU(kNe);function Fse(e){return e.props[Ose]}function _Ne({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Mse(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...o}=t;r&&(s=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in o){const h=e.getValue(d,e.latestValues[d]??null),A=o[d];if(A===void 0||u&&_Ne(u,d))continue;const f={delay:n,...GU(s||{},d)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(A)&&A===p&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Fse(e);if(y){const v=window.MotionHandoffAnimation(y,d,Dr);v!==null&&(f.startTime=v,m=!0)}}SF(e,d),h.start(YU(d,h,A,e.shouldReduceMotion&&Pse.has(d)?{type:!1}:f,e,m));const g=h.animation;g&&c.push(g)}return a&&Promise.all(c).then(()=>{Dr.update(()=>{a&&CNe(e,a)})}),c}function kF(e,t,n={}){var c;const r=by(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Mse(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:A}=i;return jNe(e,t,u,d,h,A,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[u,d]=o==="beforeChildren"?[s,a]:[a,s];return u().then(()=>d())}else return Promise.all([s(),a(n.delay)])}function jNe(e,t,n=0,r=0,i=0,s=1,a){const o=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),o.push(kF(c,t,{...a,delay:n+(typeof r=="function"?0:r)+Tse(e.variantChildren,c,r,i,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(o)}function BNe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>kF(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=kF(e,t,n);else{const i=typeof t=="function"?by(e,t,n.custom):t;r=Promise.all(Mse(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const NNe={test:e=>e==="auto",parse:e=>e},Lse=e=>t=>t.test(e),Rse=[l0,bt,uu,hh,tBe,eBe,NNe],kz=e=>Rse.find(Lse(e));function ENe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ese(e):!0}const TNe=new Set(["brightness","contrast","saturate","opacity"]);function INe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(HU)||[];if(!r)return e;const i=n.replace(r,"");let s=TNe.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const PNe=/\b([a-z-]*)\(.*?\)/gu,_F={...If,getAnimatableNone:e=>{const t=e.match(PNe);return t?t.map(INe).join(" "):e}},_z={...l0,transform:Math.round},ONe={rotate:hh,rotateX:hh,rotateY:hh,rotateZ:hh,scale:cS,scaleX:cS,scaleY:cS,scaleZ:cS,skew:hh,skewX:hh,skewY:hh,distance:bt,translateX:bt,translateY:bt,translateZ:bt,x:bt,y:bt,z:bt,perspective:bt,transformPerspective:bt,opacity:Ub,originX:hz,originY:hz,originZ:bt},ZU={borderWidth:bt,borderTopWidth:bt,borderRightWidth:bt,borderBottomWidth:bt,borderLeftWidth:bt,borderRadius:bt,borderTopLeftRadius:bt,borderTopRightRadius:bt,borderBottomRightRadius:bt,borderBottomLeftRadius:bt,width:bt,maxWidth:bt,height:bt,maxHeight:bt,top:bt,right:bt,bottom:bt,left:bt,inset:bt,insetBlock:bt,insetBlockStart:bt,insetBlockEnd:bt,insetInline:bt,insetInlineStart:bt,insetInlineEnd:bt,padding:bt,paddingTop:bt,paddingRight:bt,paddingBottom:bt,paddingLeft:bt,paddingBlock:bt,paddingBlockStart:bt,paddingBlockEnd:bt,paddingInline:bt,paddingInlineStart:bt,paddingInlineEnd:bt,margin:bt,marginTop:bt,marginRight:bt,marginBottom:bt,marginLeft:bt,marginBlock:bt,marginBlockStart:bt,marginBlockEnd:bt,marginInline:bt,marginInlineStart:bt,marginInlineEnd:bt,fontSize:bt,backgroundPositionX:bt,backgroundPositionY:bt,...ONe,zIndex:_z,fillOpacity:Ub,strokeOpacity:Ub,numOctaves:_z},FNe={...ZU,color:Pi,backgroundColor:Pi,outlineColor:Pi,fill:Pi,stroke:Pi,borderColor:Pi,borderTopColor:Pi,borderRightColor:Pi,borderBottomColor:Pi,borderLeftColor:Pi,filter:_F,WebkitFilter:_F},Dse=e=>FNe[e];function Use(e,t){let n=Dse(e);return n!==_F&&(n=If),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const MNe=new Set(["auto","none","0"]);function LNe(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!MNe.has(s)&&Hb(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Use(n,i)}class RNe extends WU{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let h=t[d];if(typeof h=="string"&&(h=h.trim(),UU(h))){const A=Ise(h,n.current);A!==void 0&&(t[d]=A),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Pse.has(r)||t.length!==2)return;const[i,s]=t,a=kz(i),o=kz(s),c=dz(i),u=dz(s);if(c!==u&&Kh[r]){this.needsMeasurement=!0;return}if(a!==o)if(xz(a)&&xz(o))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else Kh[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||ENe(t[i]))&&r.push(i);r.length&&LNe(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Kh[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var o;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,a=r[s];r[s]=Kh[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Hse(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const Qse=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function jF(e){return Zie(e)&&"offsetHeight"in e}const{schedule:e6,cancel:TTt}=hse(queueMicrotask,!1),ec={x:!1,y:!1};function $se(){return ec.x||ec.y}function DNe(e){return e==="x"||e==="y"?ec[e]?null:(ec[e]=!0,()=>{ec[e]=!1}):ec.x||ec.y?null:(ec.x=ec.y=!0,()=>{ec.x=ec.y=!1})}function zse(e,t){const n=Hse(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function jz(e){return!(e.pointerType==="touch"||$se())}function UNe(e,t,n={}){const[r,i,s]=zse(e,n),a=o=>{if(!jz(o))return;const{target:c}=o,u=t(c,o);if(typeof u!="function"||!c)return;const d=h=>{jz(h)&&(u(h),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,i)};return r.forEach(o=>{o.addEventListener("pointerenter",a,i)}),s}const Vse=(e,t)=>t?e===t?!0:Vse(e,t.parentElement):!1,t6=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,HNe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Kse(e){return HNe.has(e.tagName)||e.isContentEditable===!0}const n_=new WeakSet;function Bz(e){return t=>{t.key==="Enter"&&e(t)}}function YI(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const QNe=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Bz(()=>{if(n_.has(n))return;YI(n,"down");const i=Bz(()=>{YI(n,"up")}),s=()=>YI(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Nz(e){return t6(e)&&!$se()}function $Ne(e,t,n={}){const[r,i,s]=zse(e,n),a=o=>{const c=o.currentTarget;if(!Nz(o))return;n_.add(c);const u=t(c,o),d=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",A),n_.has(c)&&n_.delete(c),Nz(f)&&typeof u=="function"&&u(f,{success:p})},h=f=>{d(f,c===window||c===document||n.useGlobalTarget||Vse(c,f.target))},A=f=>{d(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",A,i)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),jF(o)&&(o.addEventListener("focus",u=>QNe(u,i)),!Kse(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function qse(e){return Zie(e)&&"ownerSVGElement"in e}function zNe(e){return qse(e)&&e.tagName==="svg"}const VNe=[...Rse,Pi,If],KNe=e=>VNe.find(Lse(e)),Ez=()=>({translate:0,scale:1,origin:0,originPoint:0}),ty=()=>({x:Ez(),y:Ez()}),Tz=()=>({min:0,max:0}),Ki=()=>({x:Tz(),y:Tz()}),BF={current:null},Wse={current:!1},qNe=typeof window<"u";function WNe(){if(Wse.current=!0,!!qNe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>BF.current=e.matches;e.addEventListener("change",t),t()}else BF.current=!1}const GNe=new WeakMap;function SE(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Qb(e){return typeof e=="string"||Array.isArray(e)}const n6=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],r6=["initial",...n6];function kE(e){return SE(e.animate)||r6.some(t=>Qb(e[t]))}function Gse(e){return!!(kE(e)||e.variants)}function YNe(e,t,n){for(const r in t){const i=t[r],s=n[r];if(ta(i))e.addValue(r,i);else if(ta(s))e.addValue(r,dv(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,dv(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Iz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Aj={};function Yse(e){Aj=e}function XNe(){return Aj}class JNe{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=WU,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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 A=ba.now();this.renderScheduledAt<A&&(this.renderScheduledAt=A,Dr.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!s,this.isControllingVariants=kE(n),this.isVariantNode=Gse(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const A in h){const f=h[A];c[A]!==void 0&&ta(f)&&f.set(c[A])}}mount(t){var n;this.current=t,GNe.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Wse.current||WNe(),this.shouldReduceMotion=BF.current),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Tf(this.notifyUpdate),Tf(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.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(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=u0.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Dr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Aj){const n=Aj[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ki()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Iz.length;r++){const i=Iz[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=t[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=YNe(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=dv(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Jie(r)||ese(r))?r=parseFloat(r):!KNe(r)&&If.test(n)&&(r=Use(t,n)),this.setBaseTarget(t,ta(r)?r.get():r)),ta(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=XU(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ta(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new LU),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){e6.render(this.render)}}class Xse extends JNe{constructor(){super(...arguments),this.KeyframeResolver=RNe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ta(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Vf{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Jse({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ZNe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function eEe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function XI(e){return e===void 0||e===1}function NF({scale:e,scaleX:t,scaleY:n}){return!XI(e)||!XI(t)||!XI(n)}function MA(e){return NF(e)||Zse(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Zse(e){return Pz(e.x)||Pz(e.y)}function Pz(e){return e&&e!=="0%"}function pj(e,t,n){const r=e-n,i=t*r;return n+i}function Oz(e,t,n,r,i){return i!==void 0&&(e=pj(e,i,r)),pj(e,n,r)+t}function EF(e,t=0,n=1,r,i){e.min=Oz(e.min,t,n,r,i),e.max=Oz(e.max,t,n,r,i)}function eae(e,{x:t,y:n}){EF(e.x,t.translate,t.scale,t.originPoint),EF(e.y,n.translate,n.scale,n.originPoint)}const Fz=.999999999999,Mz=1.0000000000001;function tEe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let o=0;o<i;o++){s=n[o],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ry(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,eae(e,a)),r&&MA(s.latestValues)&&ry(e,s.latestValues))}t.x<Mz&&t.x>Fz&&(t.x=1),t.y<Mz&&t.y>Fz&&(t.y=1)}function ny(e,t){e.min=e.min+t,e.max=e.max+t}function Lz(e,t,n,r,i=.5){const s=Jr(e.min,e.max,i);EF(e,t,n,s,r)}function ry(e,t){Lz(e.x,t.x,t.scaleX,t.scale,t.originX),Lz(e.y,t.y,t.scaleY,t.scale,t.originY)}function tae(e,t){return Jse(eEe(e.getBoundingClientRect(),t))}function nEe(e,t,n){const r=tae(e,n),{scroll:i}=t;return i&&(ny(r.x,i.offset.x),ny(r.y,i.offset.y)),r}const rEe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iEe=c0.length;function sEe(e,t,n){let r="",i=!0;for(let s=0;s<iEe;s++){const a=c0[s],o=e[a];if(o===void 0)continue;let c=!0;if(typeof o=="number")c=o===(a.startsWith("scale")?1:0);else{const u=parseFloat(o);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Qse(o,ZU[a]);if(!c){i=!1;const d=rEe[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function i6(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let a=!1,o=!1;for(const c in t){const u=t[c];if(u0.has(c)){a=!0;continue}else if(Ase(c)){i[c]=u;continue}else{const d=Qse(u,ZU[c]);c.startsWith("origin")?(o=!0,s[c]=d):r[c]=d}}if(t.transform||(a||n?r.transform=sEe(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function nae(e,{style:t,vars:n},r,i){const s=e.style;let a;for(a in t)s[a]=t[a];i==null||i.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function Rz(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const xx={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(bt.test(e))e=parseFloat(e);else return e;const n=Rz(e,t.target.x),r=Rz(e,t.target.y);return`${n}% ${r}%`}},aEe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=If.parse(e);if(i.length>5)return r;const s=If.createTransformer(e),a=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,c=n.y.scale*t.y;i[0+a]/=o,i[1+a]/=c;const u=Jr(o,c,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),s(i)}},TF={borderRadius:{...xx,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xx,borderTopRightRadius:xx,borderBottomLeftRadius:xx,borderBottomRightRadius:xx,boxShadow:aEe};function rae(e,{layout:t,layoutId:n}){return u0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!TF[e]||e==="opacity")}function s6(e,t,n){var a;const r=e.style,i=t==null?void 0:t.style,s={};if(!r)return s;for(const o in r)(ta(r[o])||i&&ta(i[o])||rae(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function oEe(e){return window.getComputedStyle(e)}class lEe extends Xse{constructor(){super(...arguments),this.type="html",this.renderInstance=nae}readValueFromInstance(t,n){var r;if(u0.has(n))return(r=this.projection)!=null&&r.isProjecting?gF(n):RBe(t,n);{const i=oEe(t),s=(Ase(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tae(t,n)}build(t,n,r){i6(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return s6(t,n,r)}}const cEe={offset:"stroke-dashoffset",array:"stroke-dasharray"},uEe={offset:"strokeDashoffset",array:"strokeDasharray"};function dEe(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?cEe:uEe;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const hEe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function iae(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...o},c,u,d){if(i6(e,o,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:A}=e;h.transform&&(A.transform=h.transform,delete h.transform),(A.transform||h.transformOrigin)&&(A.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),A.transform&&(A.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const f of hEe)h[f]!==void 0&&(A[f]=h[f],delete h[f]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&dEe(h,i,s,a,!1)}const sae=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"]),aae=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fEe(e,t,n,r){nae(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(sae.has(i)?i:JU(i),t.attrs[i])}function oae(e,t,n){const r=s6(e,t,n);for(const i in e)if(ta(e[i])||ta(t[i])){const s=c0.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class AEe extends Xse{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ki}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(u0.has(n)){const r=Dse(n);return r&&r.default||0}return n=sae.has(n)?n:JU(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return oae(t,n,r)}build(t,n,r){iae(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){fEe(t,n,r,i)}mount(t){this.isSVGTag=aae(t.tagName),super.mount(t)}}const pEe=r6.length;function lae(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?lae(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<pEe;n++){const r=r6[n],i=e.props[r];(Qb(i)||i===!1)&&(t[r]=i)}return t}function cae(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const mEe=[...n6].reverse(),gEe=n6.length;function yEe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>BNe(e,n,r)))}function vEe(e){let t=yEe(e),n=Dz(),r=!0;const i=c=>(u,d)=>{var A;const h=by(e,d,c==="exit"?(A=e.presenceContext)==null?void 0:A.custom:void 0);if(h){const{transition:f,transitionEnd:p,...m}=h;u={...u,...m,...p}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=lae(e.parent)||{},h=[],A=new Set;let f={},p=1/0;for(let g=0;g<gEe;g++){const y=mEe[g],v=n[y],x=u[y]!==void 0?u[y]:d[y],b=Qb(x),w=y===c?v.isActive:null;w===!1&&(p=g);let k=x===d[y]&&x!==u[y]&&b;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...f},!v.isActive&&w===null||!x&&!v.prevProp||SE(x)||typeof x=="boolean")continue;const j=xEe(v.prevProp,x);let B=j||y===c&&v.isActive&&!k&&b||g>p&&b,E=!1;const P=Array.isArray(x)?x:[x];let T=P.reduce(i(y),{});w===!1&&(T={});const{prevResolvedValues:N={}}=v,F={...N,...T},L=W=>{B=!0,A.has(W)&&(E=!0,A.delete(W)),v.needsAnimating[W]=!0;const $=e.getValue(W);$&&($.liveStyle=!1)};for(const W in F){const $=T[W],z=N[W];if(f.hasOwnProperty(W))continue;let Q=!1;CF($)&&CF(z)?Q=!cae($,z):Q=$!==z,Q?$!=null?L(W):A.add(W):$!==void 0&&A.has(W)?L(W):v.protectedKeys[W]=!0}v.prevProp=x,v.prevResolvedValues=T,v.isActive&&(f={...f,...T}),r&&e.blockInitialAnimation&&(B=!1);const U=k&&j;B&&(!U||E)&&h.push(...P.map(W=>{const $={type:y};if(typeof W=="string"&&r&&!U&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,Q=by(z,W);if(z.enteringChildren&&Q){const{delayChildren:ce}=Q.transition||{};$.delay=Tse(z.enteringChildren,e,ce)}}return{animation:W,options:$}}))}if(A.size){const g={};if(typeof u.initial!="boolean"){const y=by(e,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(g.transition=y.transition)}A.forEach(y=>{const v=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),g[y]=v??null}),h.push({animation:g})}let m=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(h):Promise.resolve()}function o(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(A=>{var f;return(f=A.animationState)==null?void 0:f.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const A in n)n[A].protectedKeys={};return d}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Dz()}}}function xEe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!cae(t,e):!1}function kA(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dz(){return{animate:kA(!0),whileInView:kA(),whileHover:kA(),whileTap:kA(),whileDrag:kA(),whileFocus:kA(),exit:kA()}}function Uz(e,t){e.min=t.min,e.max=t.max}function Gl(e,t){Uz(e.x,t.x),Uz(e.y,t.y)}function Hz(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const uae=1e-4,wEe=1-uae,bEe=1+uae,dae=.01,CEe=0-dae,SEe=0+dae;function Ca(e){return e.max-e.min}function kEe(e,t,n){return Math.abs(e-t)<=n}function Qz(e,t,n,r=.5){e.origin=r,e.originPoint=Jr(t.min,t.max,e.origin),e.scale=Ca(n)/Ca(t),e.translate=Jr(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wEe&&e.scale<=bEe||isNaN(e.scale))&&(e.scale=1),(e.translate>=CEe&&e.translate<=SEe||isNaN(e.translate))&&(e.translate=0)}function Pw(e,t,n,r){Qz(e.x,t.x,n.x,r?r.originX:void 0),Qz(e.y,t.y,n.y,r?r.originY:void 0)}function $z(e,t,n){e.min=n.min+t.min,e.max=e.min+Ca(t)}function _Ee(e,t,n){$z(e.x,t.x,n.x),$z(e.y,t.y,n.y)}function zz(e,t,n){e.min=t.min-n.min,e.max=e.min+Ca(t)}function mj(e,t,n){zz(e.x,t.x,n.x),zz(e.y,t.y,n.y)}function Vz(e,t,n,r,i){return e-=t,e=pj(e,1/n,r),i!==void 0&&(e=pj(e,1/i,r)),e}function jEe(e,t=0,n=1,r=.5,i,s=e,a=e){if(uu.test(t)&&(t=parseFloat(t),t=Jr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=Jr(s.min,s.max,r);e===s&&(o-=t),e.min=Vz(e.min,t,n,o,i),e.max=Vz(e.max,t,n,o,i)}function Kz(e,t,[n,r,i],s,a){jEe(e,t[n],t[r],t[i],t.scale,s,a)}const BEe=["x","scaleX","originX"],NEe=["y","scaleY","originY"];function qz(e,t,n,r){Kz(e.x,t,BEe,n?n.x:void 0,r?r.x:void 0),Kz(e.y,t,NEe,n?n.y:void 0,r?r.y:void 0)}function Wz(e){return e.translate===0&&e.scale===1}function hae(e){return Wz(e.x)&&Wz(e.y)}function Gz(e,t){return e.min===t.min&&e.max===t.max}function EEe(e,t){return Gz(e.x,t.x)&&Gz(e.y,t.y)}function Yz(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fae(e,t){return Yz(e.x,t.x)&&Yz(e.y,t.y)}function Xz(e){return Ca(e.x)/Ca(e.y)}function Jz(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function rl(e){return[e("x"),e("y")]}function TEe(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:A,skewX:f,skewY:p}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),A&&(r+=`rotateY(${A}deg) `),f&&(r+=`skewX(${f}deg) `),p&&(r+=`skewY(${p}deg) `)}const o=e.x.scale*t.x,c=e.y.scale*t.y;return(o!==1||c!==1)&&(r+=`scale(${o}, ${c})`),r||"none"}const Aae=["TopLeft","TopRight","BottomLeft","BottomRight"],IEe=Aae.length,Zz=e=>typeof e=="string"?parseFloat(e):e,e9=e=>typeof e=="number"||bt.test(e);function PEe(e,t,n,r,i,s){i?(e.opacity=Jr(0,n.opacity??1,OEe(r)),e.opacityExit=Jr(t.opacity??1,0,FEe(r))):s&&(e.opacity=Jr(t.opacity??1,n.opacity??1,r));for(let a=0;a<IEe;a++){const o=`border${Aae[a]}Radius`;let c=t9(t,o),u=t9(n,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||e9(c)===e9(u)?(e[o]=Math.max(Jr(Zz(c),Zz(u),r),0),(uu.test(u)||uu.test(c))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=Jr(t.rotate||0,n.rotate||0,r))}function t9(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const OEe=pae(0,.5,lse),FEe=pae(.5,.95,_l);function pae(e,t,n){return r=>r<e?0:r>t?1:n(Db(e,t,r))}function MEe(e,t,n){const r=ta(e)?e:dv(e);return r.start(YU("",r,t,n)),r.animation}function $b(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const LEe=(e,t)=>e.depth-t.depth;class REe{constructor(){this.children=[],this.isDirty=!1}add(t){OU(this.children,t),this.isDirty=!0}remove(t){FU(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(LEe),this.isDirty=!1,this.children.forEach(t)}}function DEe(e,t){const n=ba.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Tf(r),e(s-t))};return Dr.setup(r,!0),()=>Tf(r)}function r_(e){return ta(e)?e.get():e}class UEe{constructor(){this.members=[]}add(t){OU(this.members,t),t.scheduleRender()}remove(t){if(FU(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const i=r.options.layoutDependency,s=t.options.layoutDependency;i!==void 0&&s!==void 0&&i===s||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const i_={hasAnimatedSinceResize:!0,hasEverUpdated:!1},JI=["","X","Y","Z"],HEe=1e3;let QEe=0;function ZI(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function mae(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Fse(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Dr,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&mae(r)}function gae({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},o=t==null?void 0:t()){this.id=QEe++,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=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(VEe),this.nodes.forEach(GEe),this.nodes.forEach(YEe),this.nodes.forEach(KEe)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new REe)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new LU),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const c=this.eventHandlers.get(a);c&&c.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=qse(a)&&!zNe(a),this.instance=a;const{layoutId:o,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||o)&&(this.isLayoutDirty=!0),e){let d,h=0;const A=()=>this.root.updateBlockedByResize=!1;Dr.read(()=>{h=window.innerWidth}),e(a,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,d&&d(),d=DEe(A,250),i_.hasAnimatedSinceResize&&(i_.hasAnimatedSinceResize=!1,this.nodes.forEach(i9)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:A,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||t5e,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!fae(this.targetLayout,f),v=!h&&A;if(this.options.layoutRoot||this.resumeFrom||v||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...GU(p,"layout"),onPlay:m,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,v)}else h||i9(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Tf(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(XEe),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&mae(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:o,layout:c}=this.options;if(o===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(n9);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(r9);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(WEe),this.nodes.forEach($Ee),this.nodes.forEach(zEe)):this.nodes.forEach(r9),this.clearAllSnapshots();const o=ba.now();_s.delta=mu(0,1e3/60,o-_s.timestamp),_s.timestamp=o,_s.isProcessing=!0,zI.update.process(_s),zI.preRender.process(_s),zI.render.process(_s),_s.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,e6.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qEe),this.sharedNodes.forEach(JEe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Dr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Dr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ca(this.snapshot.measuredBox.x)&&!Ca(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Ki(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!hae(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||MA(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let c=this.removeElementScroll(o);return a&&(c=this.removeTransform(c)),n5e(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Ki();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(r5e))){const{scroll:d}=this.root;d&&(ny(o.x,d.offset.x),ny(o.y,d.offset.y))}return o}removeElementScroll(a){var c;const o=Ki();if(Gl(o,a),(c=this.scroll)!=null&&c.wasRoot)return o;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:A}=d;d!==this.root&&h&&A.layoutScroll&&(h.wasRoot&&Gl(o,a),ny(o.x,h.offset.x),ny(o.y,h.offset.y))}return o}applyTransform(a,o=!1){const c=Ki();Gl(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&ry(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),MA(d.latestValues)&&ry(c,d.latestValues)}return MA(this.latestValues)&&ry(c,this.latestValues),c}removeTransform(a){const o=Ki();Gl(o,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!MA(u.latestValues))continue;NF(u.latestValues)&&u.updateSnapshot();const d=Ki(),h=u.measurePageBox();Gl(d,h),qz(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return MA(this.latestValues)&&qz(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==_s.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var f;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==o;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=_s.timestamp;const A=this.getClosestProjectingParent();A&&this.linkedParentVersion!==A.layoutVersion&&!A.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(A&&A.layout?this.createRelativeTarget(A,this.layout.layoutBox,A.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ki(),this.targetWithTransforms=Ki()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_Ee(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gl(this.target,this.layout.layoutBox),eae(this.target,this.targetDelta)):Gl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,A&&!!A.resumingFrom==!!this.resumingFrom&&!A.options.layoutScroll&&A.target&&this.animationProgress!==1?this.createRelativeTarget(A,this.target,A.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||NF(this.parent.latestValues)||Zse(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ki(),this.relativeTargetOrigin=Ki(),mj(this.relativeTargetOrigin,o,c),Gl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(c=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===_s.timestamp&&(c=!1),c)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;Gl(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,A=this.treeScale.y;tEe(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Ki());const{target:f}=a;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Hz(this.prevProjectionDelta.x,this.projectionDelta.x),Hz(this.prevProjectionDelta.y,this.projectionDelta.y)),Pw(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==A||!Jz(this.projectionDelta.x,this.prevProjectionDelta.x)||!Jz(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ty(),this.projectionDelta=ty(),this.projectionDeltaWithTransform=ty()}setAnimationOrigin(a,o=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=ty();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const A=Ki(),f=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,g=this.getStack(),y=!g||g.members.length<=1,v=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(e5e));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const w=b/1e3;s9(h.x,a.x,w),s9(h.y,a.y,w),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mj(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ZEe(this.relativeTarget,this.relativeTargetOrigin,A,w),x&&EEe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Ki()),Gl(x,this.relativeTarget)),m&&(this.animationValues=d,PEe(d,u,this.latestValues,w,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,c,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Tf(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dr.update(()=>{i_.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=dv(0)),this.currentAnimation=MEe(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(HEe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:d}=a;if(!(!o||!c||!u)){if(this!==a&&this.layout&&u&&yae(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ki();const h=Ca(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+h;const A=Ca(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+A}Gl(o,c),ry(o,d),Pw(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new UEe),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&ZI("z",a,u,this.animationValues);for(let d=0;d<JI.length;d++)ZI(`rotate${JI[d]}`,a,u,this.animationValues),ZI(`skew${JI[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=r_(o==null?void 0:o.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=r_(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!MA(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=TEe(this.projectionDeltaWithTransform,this.treeScale,d);c&&(h=c(d,h)),a.transform=h;const{x:A,y:f}=this.projectionDelta;a.transformOrigin=`${A.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const p in TF){if(d[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=TF[p],v=h==="none"?d[p]:m(d[p],u);if(g){const x=g.length;for(let b=0;b<x;b++)a[g[b]]=v}else y?this.options.visualElement.renderState.vars[p]=v:a[p]=v}this.options.layoutId&&(a.pointerEvents=u===this?r_(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(n9),this.root.sharedNodes.clear()}}}function $Ee(e){e.updateLayout()}function zEe(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;s==="size"?rl(h=>{const A=a?t.measuredBox[h]:t.layoutBox[h],f=Ca(A);A.min=r[h].min,A.max=A.min+f}):yae(s,t.layoutBox,r)&&rl(h=>{const A=a?t.measuredBox[h]:t.layoutBox[h],f=Ca(r[h]);A.max=A.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+f)});const o=ty();Pw(o,r,t.layoutBox);const c=ty();a?Pw(c,e.applyTransform(i,!0),t.measuredBox):Pw(c,r,t.layoutBox);const u=!hae(o);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:A,layout:f}=h;if(A&&f){const p=Ki();mj(p,t.layoutBox,A.layoutBox);const m=Ki();mj(m,r,f.layoutBox),fae(p,m)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function VEe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function KEe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qEe(e){e.clearSnapshot()}function n9(e){e.clearMeasurements()}function r9(e){e.isLayoutDirty=!1}function WEe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function i9(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GEe(e){e.resolveTargetDelta()}function YEe(e){e.calcProjection()}function XEe(e){e.resetSkewAndRotation()}function JEe(e){e.removeLeadSnapshot()}function s9(e,t,n){e.translate=Jr(t.translate,0,n),e.scale=Jr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function a9(e,t,n,r){e.min=Jr(t.min,n.min,r),e.max=Jr(t.max,n.max,r)}function ZEe(e,t,n,r){a9(e.x,t.x,n.x,r),a9(e.y,t.y,n.y,r)}function e5e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const t5e={duration:.45,ease:[.4,0,.1,1]},o9=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),l9=o9("applewebkit/")&&!o9("chrome/")?Math.round:_l;function c9(e){e.min=l9(e.min),e.max=l9(e.max)}function n5e(e){c9(e.x),c9(e.y)}function yae(e,t,n){return e==="position"||e==="preserve-aspect"&&!kEe(Xz(t),Xz(n),.2)}function r5e(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const i5e=gae({attachResizeListener:(e,t)=>$b(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),eP={current:void 0},vae=gae({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!eP.current){const e=new i5e({});e.mount(window),e.setOptions({layoutScroll:!0}),eP.current=e}return eP.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),a6=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function u9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function s5e(...e){return t=>{let n=!1;const r=e.map(i=>{const s=u9(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():u9(e[i],null)}}}}function a5e(...e){return C.useCallback(s5e(...e),e)}class o5e extends C.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=jF(r)&&r.offsetWidth||0,s=jF(r)&&r.offsetHeight||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function l5e({children:e,isPresent:t,anchorX:n,anchorY:r,root:i}){var h;const s=C.useId(),a=C.useRef(null),o=C.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=C.useContext(a6),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=a5e(a,u);return C.useInsertionEffect(()=>{const{width:A,height:f,top:p,left:m,right:g,bottom:y}=o.current;if(t||!a.current||!A||!f)return;const v=n==="left"?`left: ${m}`:`right: ${g}`,x=r==="bottom"?`bottom: ${y}`:`top: ${p}`;a.current.dataset.motionPopId=s;const b=document.createElement("style");c&&(b.nonce=c);const w=i??document.head;return w.appendChild(b),b.sheet&&b.sheet.insertRule(`
          [data-motion-pop-id="${s}"] {
            position: absolute !important;
            width: ${A}px !important;
            height: ${f}px !important;
            ${v}px !important;
            ${x}px !important;
          }
        `),()=>{w.contains(b)&&w.removeChild(b)}},[t]),l.jsx(o5e,{isPresent:t,childRef:a,sizeRef:o,children:C.cloneElement(e,{ref:d})})}const c5e=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:o,anchorY:c,root:u})=>{const d=PU(u5e),h=C.useId();let A=!0,f=C.useMemo(()=>(A=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:p=>{d.set(p,!0);for(const m of d.values())if(!m)return;r&&r()},register:p=>(d.set(p,!1),()=>d.delete(p))}),[n,d,r]);return s&&A&&(f={...f}),C.useMemo(()=>{d.forEach((p,m)=>d.set(m,!1))},[n]),C.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),a==="popLayout"&&(e=l.jsx(l5e,{isPresent:n,anchorX:o,anchorY:c,root:u,children:e})),l.jsx(bE.Provider,{value:f,children:e})};function u5e(){return new Map}function xae(e=!0){const t=C.useContext(bE);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=C.useId();C.useEffect(()=>{if(e)return i(s)},[e]);const a=C.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const uS=e=>e.key||"";function d9(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const Cy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:o="left",anchorY:c="top",root:u})=>{const[d,h]=xae(a),A=C.useMemo(()=>d9(e),[e]),f=a&&!d?[]:A.map(uS),p=C.useRef(!0),m=C.useRef(A),g=PU(()=>new Map),y=C.useRef(new Set),[v,x]=C.useState(A),[b,w]=C.useState(A);Xie(()=>{p.current=!1,m.current=A;for(let B=0;B<b.length;B++){const E=uS(b[B]);f.includes(E)?(g.delete(E),y.current.delete(E)):g.get(E)!==!0&&g.set(E,!1)}},[b,f.length,f.join("-")]);const k=[];if(A!==v){let B=[...A];for(let E=0;E<b.length;E++){const P=b[E],T=uS(P);f.includes(T)||(B.splice(E,0,P),k.push(P))}return s==="wait"&&k.length&&(B=k),w(d9(B)),x(A),null}const{forceRender:j}=C.useContext(IU);return l.jsx(l.Fragment,{children:b.map(B=>{const E=uS(B),P=a&&!d?!1:A===b||f.includes(E),T=()=>{if(y.current.has(E))return;if(y.current.add(E),g.has(E))g.set(E,!0);else return;let N=!0;g.forEach(F=>{F||(N=!1)}),N&&(j==null||j(),w(m.current),a&&(h==null||h()),r&&r())};return l.jsx(c5e,{isPresent:P,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:u,onExitComplete:P?void 0:T,anchorX:o,anchorY:c,children:B},E)})})},wae=C.createContext({strict:!1}),h9={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 f9=!1;function d5e(){if(f9)return;const e={};for(const t in h9)e[t]={isEnabled:n=>h9[t].some(r=>!!n[r])};Yse(e),f9=!0}function bae(){return d5e(),XNe()}function h5e(e){const t=bae();for(const n in e)t[n]={...t[n],...e[n]};Yse(t)}const f5e=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","ignoreStrict","viewport"]);function gj(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||f5e.has(e)}let Cae=e=>!gj(e);function A5e(e){typeof e=="function"&&(Cae=t=>t.startsWith("on")?!gj(t):e(t))}try{A5e(require("@emotion/is-prop-valid").default)}catch{}function p5e(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Cae(i)||n===!0&&gj(i)||!t&&!gj(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const _E=C.createContext({});function m5e(e,t){if(kE(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qb(n)?n:void 0,animate:Qb(r)?r:void 0}}return e.inherit!==!1?t:{}}function g5e(e){const{initial:t,animate:n}=m5e(e,C.useContext(_E));return C.useMemo(()=>({initial:t,animate:n}),[A9(t),A9(n)])}function A9(e){return Array.isArray(e)?e.join(" "):e}const o6=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sae(e,t,n){for(const r in t)!ta(t[r])&&!rae(r,n)&&(e[r]=t[r])}function y5e({transformTemplate:e},t){return C.useMemo(()=>{const n=o6();return i6(n,t,e),Object.assign({},n.vars,n.style)},[t])}function v5e(e,t){const n=e.style||{},r={};return Sae(r,n,e),Object.assign(r,y5e(e,t)),r}function x5e(e,t){const n={},r=v5e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const kae=()=>({...o6(),attrs:{}});function w5e(e,t,n,r){const i=C.useMemo(()=>{const s=kae();return iae(s,t,aae(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Sae(s,e.style,e),i.style={...s,...i.style}}return i}const b5e=["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 l6(e){return typeof e!="string"||e.includes("-")?!1:!!(b5e.indexOf(e)>-1||/[A-Z]/u.test(e))}function C5e(e,t,n,{latestValues:r},i,s=!1,a){const c=(a??l6(e)?w5e:x5e)(t,r,i,e),u=p5e(t,typeof e=="string",s),d=e!==C.Fragment?{...u,...c,ref:n}:{},{children:h}=t,A=C.useMemo(()=>ta(h)?h.get():h,[h]);return C.createElement(e,{...d,children:A})}function S5e({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:k5e(n,r,i,e),renderState:t()}}function k5e(e,t,n,r){const i={},s=r(e,{});for(const A in s)i[A]=r_(s[A]);let{initial:a,animate:o}=e;const c=kE(e),u=Gse(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?o:a;if(h&&typeof h!="boolean"&&!SE(h)){const A=Array.isArray(h)?h:[h];for(let f=0;f<A.length;f++){const p=XU(e,A[f]);if(p){const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let x=y[v];if(Array.isArray(x)){const b=d?x.length-1:0;x=x[b]}x!==null&&(i[v]=x)}for(const v in m)i[v]=m[v]}}}return i}const _ae=e=>(t,n)=>{const r=C.useContext(_E),i=C.useContext(bE),s=()=>S5e(e,t,r,i);return n?s():PU(s)},_5e=_ae({scrapeMotionValuesFromProps:s6,createRenderState:o6}),j5e=_ae({scrapeMotionValuesFromProps:oae,createRenderState:kae}),B5e=Symbol.for("motionComponentSymbol");function N5e(e,t,n){const r=C.useRef(n);C.useInsertionEffect(()=>{r.current=n});const i=C.useRef(null);return C.useCallback(s=>{var o;s&&((o=e.onMount)==null||o.call(e,s)),t&&(s?t.mount(s):t.unmount());const a=r.current;if(typeof a=="function")if(s){const c=a(s);typeof c=="function"&&(i.current=c)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s)},[t])}const jae=C.createContext({});function tw(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function E5e(e,t,n,r,i,s){var y,v;const{visualElement:a}=C.useContext(_E),o=C.useContext(wae),c=C.useContext(bE),u=C.useContext(a6).reducedMotion,d=C.useRef(null),h=C.useRef(!1);r=r||o.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,isSVG:s}),h.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const A=d.current,f=C.useContext(jae);A&&!A.projection&&i&&(A.type==="html"||A.type==="svg")&&T5e(d.current,n,i,f);const p=C.useRef(!1);C.useInsertionEffect(()=>{A&&p.current&&A.update(n,c)});const m=n[Ose],g=C.useRef(!!m&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,m))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,m)));return Xie(()=>{h.current=!0,A&&(p.current=!0,window.MotionIsMounted=!0,A.updateFeatures(),A.scheduleRenderMicrotask(),g.current&&A.animationState&&A.animationState.animateChanges())}),C.useEffect(()=>{A&&(!g.current&&A.animationState&&A.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,m)}),g.current=!1),A.enteringChildren=void 0)}),A}function T5e(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Bae(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&tw(o),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Bae(e){if(e)return e.options.allowProjection!==!1?e.projection:Bae(e.parent)}function tP(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&h5e(r);const s=n?n==="svg":l6(e),a=s?j5e:_5e;function o(u,d){let h;const A={...C.useContext(a6),...u,layoutId:I5e(u)},{isStatic:f}=A,p=g5e(u),m=a(u,f);if(!f&&Yie){P5e();const g=O5e(A);h=g.MeasureLayout,p.visualElement=E5e(e,m,A,i,g.ProjectionNode,s)}return l.jsxs(_E.Provider,{value:p,children:[h&&p.visualElement?l.jsx(h,{visualElement:p.visualElement,...A}):null,C5e(e,u,N5e(m,p.visualElement,d),m,f,t,s)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=C.forwardRef(o);return c[B5e]=e,c}function I5e({layoutId:e}){const t=C.useContext(IU).id;return t&&e!==void 0?t+"-"+e:e}function P5e(e,t){C.useContext(wae).strict}function O5e(e){const t=bae(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function F5e(e,t){if(typeof Proxy>"u")return tP;const n=new Map,r=(s,a)=>tP(s,a,e,t),i=(s,a)=>r(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,tP(a,void 0,e,t)),n.get(a))})}const M5e=(e,t)=>t.isSVG??l6(e)?new AEe(t):new lEe(t,{allowProjection:e!==C.Fragment});class L5e extends Vf{constructor(t){super(t),t.animationState||(t.animationState=vEe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();SE(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let R5e=0;class D5e extends Vf{constructor(){super(...arguments),this.id=R5e++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const U5e={animation:{Feature:L5e},exit:{Feature:D5e}};function _2(e){return{point:{x:e.pageX,y:e.pageY}}}const H5e=e=>t=>t6(t)&&e(t,_2(t));function Ow(e,t,n,r){return $b(e,t,H5e(n),r)}const Nae=({current:e})=>e?e.ownerDocument.defaultView:null,p9=(e,t)=>Math.abs(e-t);function Q5e(e,t){const n=p9(e.x,t.x),r=p9(e.y,t.y);return Math.sqrt(n**2+r**2)}const m9=new Set(["auto","scroll"]);class Eae{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=f=>{this.handleScroll(f.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=rP(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Q5e(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=f,{timestamp:y}=_s;this.history.push({...g,timestamp:y});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=nP(p,this.transformPagePoint),Dr.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=rP(f.type==="pointercancel"?this.lastMoveEventInfo:nP(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!t6(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const c=_2(t),u=nP(c,this.transformPagePoint),{point:d}=u,{timestamp:h}=_s;this.history=[{...d,timestamp:h}];const{onSessionStart:A}=n;A&&A(t,rP(u,this.history)),this.removeListeners=C2(Ow(this.contextWindow,"pointermove",this.handlePointerMove),Ow(this.contextWindow,"pointerup",this.handlePointerUp),Ow(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(m9.has(r.overflowX)||m9.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,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),Dr.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Tf(this.updatePoint)}}function nP(e,t){return t?{point:t(e.point)}:e}function g9(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rP({point:e},t){return{point:e,delta:g9(e,Tae(t)),offset:g9(e,$5e(t)),velocity:z5e(t,.1)}}function $5e(e){return e[0]}function Tae(e){return e[e.length-1]}function z5e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Tae(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>cu(t)));)n--;if(!r)return{x:0,y:0};const s=yl(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function V5e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Jr(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Jr(n,e,r.max):Math.min(e,n)),e}function y9(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function K5e(e,{top:t,left:n,bottom:r,right:i}){return{x:y9(e.x,n,i),y:y9(e.y,t,r)}}function v9(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function q5e(e,t){return{x:v9(e.x,t.x),y:v9(e.y,t.y)}}function W5e(e,t){let n=.5;const r=Ca(e),i=Ca(t);return i>r?n=Db(t.min,t.max-r,e.min):r>i&&(n=Db(e.min,e.max-i,t.min)),mu(0,1,n)}function G5e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const IF=.35;function Y5e(e=IF){return e===!1?e=0:e===!0&&(e=IF),{x:x9(e,"left","right"),y:x9(e,"top","bottom")}}function x9(e,t,n){return{min:w9(e,t),max:w9(e,n)}}function w9(e,t){return typeof e=="number"?e:e[t]||0}const X5e=new WeakMap;class J5e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ki(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n?(this.stopAnimation(),this.snapToCursor(_2(h).point)):this.pauseAnimation()},a=(h,A)=>{this.stopAnimation();const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=DNe(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=A,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rl(y=>{let v=this.getAxisMotionValue(y).get()||0;if(uu.test(v)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[y];b&&(v=Ca(b)*(parseFloat(v)/100))}}this.originPoint[y]=v}),m&&Dr.postRender(()=>m(h,A)),SF(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(h,A)=>{this.latestPointerEvent=h,this.latestPanInfo=A;const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=A;if(p&&this.currentDirection===null){this.currentDirection=Z5e(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",A.point,y),this.updateAxis("y",A.point,y),this.visualElement.render(),g&&g(h,A)},c=(h,A)=>{this.latestPointerEvent=h,this.latestPanInfo=A,this.stop(h,A),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>rl(h=>{var A;return this.getAnimationState(h)==="paused"&&((A=this.getAxisMotionValue(h).animation)==null?void 0:A.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Eae(t,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Nae(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&Dr.postRender(()=>o(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:i}=this.getProps();if(!r||!dS(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=V5e(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&tw(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=K5e(r.layoutBox,t):this.constraints=!1,this.elastic=Y5e(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&rl(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=G5e(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!tw(t))return!1;const r=t.current;uv(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:i}=this.visualElement;if(!i||!i.layout)return!1;const s=nEe(r,i.root,this.visualElement.getTransformPagePoint());let a=q5e(i.layout.layoutBox,s);if(n){const o=n(ZNe(a));this.hasMutatedConstraints=!!o,o&&(a=Jse(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=rl(d=>{if(!dS(d,n,this.currentDirection))return;let h=c&&c[d]||{};a&&(h={min:0,max:0});const A=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:r?t[d]:0,bounceStiffness:A,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(d,p)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return SF(this.visualElement,t),r.start(YU(t,r,0,n,this.visualElement,!1))}stopAnimation(){rl(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rl(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){rl(n=>{const{drag:r}=this.getProps();if(!dS(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-Jr(a,o,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!tw(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};rl(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const c=o.get();i[a]=W5e({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rl(a=>{if(!dS(a,t,null))return;const o=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];o.set(Jr(c,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;X5e.set(this.visualElement,this);const t=this.visualElement.current,n=Ow(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),h=c.target,A=h!==t&&Kse(h);u&&d&&!A&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();tw(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Dr.read(r);const a=$b(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(rl(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=IF,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function dS(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Z5e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class eTe extends Vf{constructor(t){super(t),this.removeGroupControls=_l,this.removeListeners=_l,this.controls=new J5e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_l}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const b9=e=>(t,n)=>{e&&Dr.postRender(()=>e(t,n))};class tTe extends Vf{constructor(){super(...arguments),this.removePointerDownListener=_l}onPointerDown(t){this.session=new Eae(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Nae(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:b9(t),onStart:b9(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&Dr.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Ow(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let iP=!1;class nTe extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),iP&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),i_.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),iP=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Dr.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),e6.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;iP=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Iae(e){const[t,n]=xae(),r=C.useContext(IU);return l.jsx(nTe,{...e,layoutGroup:r,switchLayoutGroup:C.useContext(jae),isPresent:t,safeToRemove:n})}const rTe={pan:{Feature:tTe},drag:{Feature:eTe,ProjectionNode:vae,MeasureLayout:Iae}};function C9(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Dr.postRender(()=>s(t,_2(t)))}class iTe extends Vf{mount(){const{current:t}=this.node;t&&(this.unmount=UNe(t,(n,r)=>(C9(this.node,r,"Start"),i=>C9(this.node,i,"End"))))}unmount(){}}class sTe extends Vf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=C2($b(this.node.current,"focus",()=>this.onFocus()),$b(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function S9(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Dr.postRender(()=>s(t,_2(t)))}class aTe extends Vf{mount(){const{current:t}=this.node;t&&(this.unmount=$Ne(t,(n,r)=>(S9(this.node,r,"Start"),(i,{success:s})=>S9(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const PF=new WeakMap,sP=new WeakMap,oTe=e=>{const t=PF.get(e.target);t&&t(e)},lTe=e=>{e.forEach(oTe)};function cTe({root:e,...t}){const n=e||document;sP.has(n)||sP.set(n,{});const r=sP.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(lTe,{root:e,...t})),r[i]}function uTe(e,t,n){const r=cTe(t);return PF.set(e,n),r.observe(e),()=>{PF.delete(e),r.unobserve(e)}}const dTe={some:0,all:1};class hTe extends Vf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:dTe[i]},o=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),A=u?d:h;A&&A(c)};return uTe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(fTe(t,n))&&this.startObserver()}unmount(){}}function fTe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ATe={inView:{Feature:hTe},tap:{Feature:aTe},focus:{Feature:sTe},hover:{Feature:iTe}},pTe={layout:{ProjectionNode:vae,MeasureLayout:Iae}},mTe={...U5e,...ATe,...rTe,...pTe},vi=F5e(mTe,M5e),gTe={some:0,all:1};function yTe(e,t,{root:n,margin:r,amount:i="some"}={}){const s=Hse(e),a=new WeakMap,o=u=>{u.forEach(d=>{const h=a.get(d.target);if(d.isIntersecting!==!!h)if(d.isIntersecting){const A=t(d.target,d);typeof A=="function"?a.set(d.target,A):c.unobserve(d.target)}else typeof h=="function"&&(h(d),a.delete(d.target))})},c=new IntersectionObserver(o,{root:n,rootMargin:r,threshold:typeof i=="number"?i:gTe[i]});return s.forEach(u=>c.observe(u)),()=>c.disconnect()}function vTe(e,{root:t,margin:n,amount:r,once:i=!1,initial:s=!1}={}){const[a,o]=C.useState(s);return C.useEffect(()=>{if(!e.current||i&&a)return;const c=()=>(o(!0),i?void 0:()=>o(!1)),u={root:t&&t.current||void 0,margin:n,amount:r};return yTe(e.current,c,u)},[t,e,n,i,r]),a}var eu=function(){return eu=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},eu.apply(this,arguments)};function d0(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function xTe(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?s(d.value):i(d.value).then(o,c)}u((r=r.apply(e,t||[])).next())})}function wTe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}const bTe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class c6 extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class CTe extends c6{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class k9 extends c6{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class _9 extends c6{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var OF;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(OF||(OF={}));class STe{constructor(t,{headers:n={},customFetch:r,region:i=OF.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=bTe(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return xTe(this,arguments,void 0,function*(n,r={}){var i;let s,a;try{const{headers:o,method:c,body:u,signal:d,timeout:h}=r;let A={},{region:f}=r;f||(f=this.region);const p=new URL(`${this.url}/${n}`);f&&f!=="any"&&(A["x-region"]=f,p.searchParams.set("forceFunctionRegion",f));let m;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(A["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(A["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(A["Content-Type"]="application/json",m=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?m=JSON.stringify(u):m=u;let g=d;h&&(a=new AbortController,s=setTimeout(()=>a.abort(),h),d?(g=a.signal,d.addEventListener("abort",()=>a.abort())):g=a.signal);const y=yield this.fetch(p.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},A),this.headers),o),body:m,signal:g}).catch(w=>{throw new CTe(w)}),v=y.headers.get("x-relay-error");if(v&&v==="true")throw new k9(y);if(!y.ok)throw new _9(y);let x=((i=y.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),b;return x==="application/json"?b=yield y.json():x==="application/octet-stream"||x==="application/pdf"?b=yield y.blob():x==="text/event-stream"?b=y:x==="multipart/form-data"?b=yield y.formData():b=yield y.text(),{data:b,error:null,response:y}}catch(o){return{data:null,error:o,response:o instanceof _9||o instanceof k9?o.context:void 0}}finally{s&&clearTimeout(s)}})}}var kTe=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},_Te=class{constructor(e){var t,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;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");const r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{let a=null,o=null,c=null,u=s.status,d=s.statusText;if(s.ok){var h,A;if(n.method!=="HEAD"){var f;const y=await s.text();y===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((f=n.headers.get("Accept"))===null||f===void 0)&&f.includes("application/vnd.pgrst.plan+text"))?o=y:o=JSON.parse(y))}const m=(h=n.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),g=(A=s.headers.get("content-range"))===null||A===void 0?void 0:A.split("/");m&&g&&g.length>1&&(c=parseInt(g[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(o)&&(o.length>1?(a={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,c=null,u=406,d="Not Acceptable"):o.length===1?o=o[0]:o=null)}else{var p;const m=await s.text();try{a=JSON.parse(m),Array.isArray(a)&&s.status===404&&(o=[],a=null,u=200,d="OK")}catch{s.status===404&&m===""?(u=204,d="No Content"):a={message:m}}if(a&&n.isMaybeSingle&&(!(a==null||(p=a.details)===null||p===void 0)&&p.includes("0 rows"))&&(a=null,u=200,d="OK"),a&&n.shouldThrowOnError)throw new kTe(a)}return{error:a,data:o,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(i=i.catch(s=>{var a;let o="";const c=s==null?void 0:s.cause;if(c){var u,d,h,A;const p=(u=c==null?void 0:c.message)!==null&&u!==void 0?u:"",m=(d=c==null?void 0:c.code)!==null&&d!==void 0?d:"";o=`${(h=s==null?void 0:s.name)!==null&&h!==void 0?h:"FetchError"}: ${s==null?void 0:s.message}`,o+=`

Caused by: ${(A=c==null?void 0:c.name)!==null&&A!==void 0?A:"Error"}: ${p}`,m&&(o+=` (${m})`),c!=null&&c.stack&&(o+=`
${c.stack}`)}else{var f;o=(f=s==null?void 0:s.stack)!==null&&f!==void 0?f:""}return{error:{message:`${(a=s==null?void 0:s.name)!==null&&a!==void 0?a:"FetchError"}: ${s==null?void 0:s.message}`,details:o,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),i.then(e,t)}returns(){return this}overrideTypes(){return this}},jTe=class extends _Te{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const s=i?`${i}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(s,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),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:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:s="text"}={}){var a;const o=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${c}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const j9=new RegExp("[,()]");var Tg=class extends jTe{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&j9.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&j9.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let i="";r==="plain"?i="pl":r==="phrase"?i="ph":r==="websearch"&&(i="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${s}.${t}`),this}match(e){return Object.entries(e).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},BTe=class{constructor(e,{headers:t={},schema:n,fetch:r}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},i=n?"HEAD":"GET";let s=!1;const a=(e??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join(""),{url:o,headers:c}=this.cloneRequestState();return o.searchParams.set("select",a),r&&c.append("Prefer",`count=${r}`),new Tg({method:i,url:o,headers:c,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const i="POST",{url:s,headers:a}=this.cloneRequestState();if(t&&a.append("Prefer",`count=${t}`),n||a.append("Prefer","missing=default"),Array.isArray(e)){const o=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(o.length>0){const c=[...new Set(o)].map(u=>`"${u}"`);s.searchParams.set("columns",c.join(","))}}return new Tg({method:i,url:s,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var s;const a="POST",{url:o,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&o.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),i||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);o.searchParams.set("columns",d.join(","))}}return new Tg({method:a,url:o,headers:c,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}update(e,{count:t}={}){var n;const r="PATCH",{url:i,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Tg({method:r,url:i,headers:s,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Tg({method:n,url:r,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},NTe=class Pae{constructor(t,{headers:n={},schema:r,fetch:i}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.fetch=i}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new BTe(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Pae(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:i=!1,count:s}={}){var a;let o;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(d)),h=r&&Object.values(n).some(d);h?(o="POST",u=n):r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([f,p])=>p!==void 0).map(([f,p])=>[f,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([f,p])=>{c.searchParams.append(f,p)})):(o="POST",u=n);const A=new Headers(this.headers);return h?A.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&A.set("Prefer",`count=${s}`),new Tg({method:o,url:c,headers:A,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};class ETe{constructor(){}static detectEnvironment(){var t;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"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.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 i=r.node,s=parseInt(i.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new 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 t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`

Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const TTe="2.93.2",ITe=`realtime-js/${TTe}`,PTe="1.0.0",Oae="2.0.0",B9=Oae,FF=1e4,OTe=1e3,FTe=100;var vh;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(vh||(vh={}));var Vi;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Vi||(Vi={}));var ac;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(ac||(ac={}));var MF;(function(e){e.websocket="websocket"})(MF||(MF={}));var $A;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})($A||($A={}));class MTe{constructor(t){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=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const i=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(t){var n,r;const i=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,n,r){var i,s;const a=t.topic,o=(i=t.ref)!==null&&i!==void 0?i:"",c=(s=t.join_ref)!==null&&s!==void 0?s:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const A=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+o.length+a.length+u.length+h.length,f=new ArrayBuffer(this.HEADER_LENGTH+A);let p=new DataView(f),m=0;p.setUint8(m++,this.KINDS.userBroadcastPush),p.setUint8(m++,c.length),p.setUint8(m++,o.length),p.setUint8(m++,a.length),p.setUint8(m++,u.length),p.setUint8(m++,h.length),p.setUint8(m++,n),Array.from(c,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(o,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(a,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(u,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(h,y=>p.setUint8(m++,y.charCodeAt(0)));var g=new Uint8Array(f.byteLength+r.byteLength);return g.set(new Uint8Array(f),0),g.set(new Uint8Array(r),f.byteLength),g.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[i,s,a,o,c]=r;return n({join_ref:i,ref:s,topic:a,event:o,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,i)}}_decodeUserBroadcast(t,n,r){const i=n.getUint8(1),s=n.getUint8(2),a=n.getUint8(3),o=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+i));c=c+i;const d=r.decode(t.slice(c,c+s));c=c+s;const h=r.decode(t.slice(c,c+a));c=c+a;const A=t.slice(c,t.byteLength),f=o===this.JSON_ENCODING?JSON.parse(r.decode(A)):A,p={type:this.BROADCAST_EVENT,event:d,payload:f};return a>0&&(p.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}class Fae{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var wr;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(wr||(wr={}));const N9=(e,t,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((s,a)=>(s[a]=LTe(a,e,t,i),s),{}):{}},LTe=(e,t,n,r)=>{const i=t.find(o=>o.name===e),s=i==null?void 0:i.type,a=n[e];return s&&!r.includes(s)?Mae(s,a):LF(a)},Mae=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return HTe(t,n)}switch(e){case wr.bool:return RTe(t);case wr.float4:case wr.float8:case wr.int2:case wr.int4:case wr.int8:case wr.numeric:case wr.oid:return DTe(t);case wr.json:case wr.jsonb:return UTe(t);case wr.timestamp:return QTe(t);case wr.abstime:case wr.date:case wr.daterange:case wr.int4range:case wr.int8range:case wr.money:case wr.reltime:case wr.text:case wr.time:case wr.timestamptz:case wr.timetz:case wr.tsrange:case wr.tstzrange:return LF(t);default:return LF(t)}},LF=e=>e,RTe=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},DTe=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},UTe=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},HTe=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let s;const a=e.slice(1,n);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>Mae(t,o))}return e},QTe=e=>typeof e=="string"?e.replace(" ","T"):e,Lae=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class aP{constructor(t,n,r={},i=FF){this.channel=t,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var E9;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(E9||(E9={}));class Fw{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Fw.syncState(this.state,i,s,a),this.pendingDiffs.forEach(c=>{this.state=Fw.syncDiff(this.state,c,s,a)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Fw.syncDiff(this.state,i,s,a),o())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,i){const s=this.cloneDeep(t),a=this.transformState(n),o={},c={};return this.map(s,(u,d)=>{a[u]||(c[u]=d)}),this.map(a,(u,d)=>{const h=s[u];if(h){const A=d.map(g=>g.presence_ref),f=h.map(g=>g.presence_ref),p=d.filter(g=>f.indexOf(g.presence_ref)<0),m=h.filter(g=>A.indexOf(g.presence_ref)<0);p.length>0&&(o[u]=p),m.length>0&&(c[u]=m)}else o[u]=d}),this.syncDiff(s,{joins:o,leaves:c},r,i)}static syncDiff(t,n,r,i){const{joins:s,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(o,c)=>{var u;const d=(u=t[o])!==null&&u!==void 0?u:[];if(t[o]=this.cloneDeep(c),d.length>0){const h=t[o].map(f=>f.presence_ref),A=d.filter(f=>h.indexOf(f.presence_ref)<0);t[o].unshift(...A)}r(o,d,c)}),this.map(a,(o,c)=>{let u=t[o];if(!u)return;const d=c.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),t[o]=u,i(o,u,c),u.length===0&&delete t[o]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const i=t[r];return"metas"in i?n[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=i,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var T9;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(T9||(T9={}));var Mw;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Mw||(Mw={}));var Xu;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Xu||(Xu={}));class iy{constructor(t,n={config:{}},r){var i,s;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Vi.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new aP(this,ac.join,this.params,this.timeout),this.rejoinTimer=new Fae(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Vi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Vi.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Vi.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Vi.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Vi.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ac.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new Fw(this),this.broadcastEndpointURL=Lae(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||s===void 0)&&s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,i,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Vi.closed){const{config:{broadcast:a,presence:o,private:c}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(f=>f.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[Mw.PRESENCE]&&this.bindings[Mw.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,h={},A={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(f=>t==null?void 0:t(Xu.CHANNEL_ERROR,f)),this._onClose(()=>t==null?void 0:t(Xu.CLOSED)),this.updateJoinPayload(Object.assign({config:A},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:f})=>{var p;if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){t==null||t(Xu.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,g=(p=m==null?void 0:m.length)!==null&&p!==void 0?p:0,y=[];for(let v=0;v<g;v++){const x=m[v],{filter:{event:b,schema:w,table:k,filter:j}}=x,B=f&&f[v];if(B&&B.event===b&&iy.isFilterValueEqual(B.schema,w)&&iy.isFilterValueEqual(B.table,k)&&iy.isFilterValueEqual(B.filter,j))y.push(Object.assign(Object.assign({},x),{id:B.id}));else{this.unsubscribe(),this.state=Vi.errored,t==null||t(Xu.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,t&&t(Xu.SUBSCRIBED);return}}).receive("error",f=>{this.state=Vi.errored,t==null||t(Xu.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Xu.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this.state===Vi.joined&&t===Mw.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,n,r)}async httpSend(t,n,r={}){var i;if(n==null)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let c=o.statusText;try{const u=await o.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,i;if(!this._canPush()&&t.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:s,payload:a}=t,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,c;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Vi.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ac.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new aP(this,ac.leave,{},t),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Vi.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),a=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),a}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new aP(this,t,n,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>FTe){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var i,s;const a=t.toLocaleLowerCase(),{close:o,error:c,leave:u,join:d}=ac;if(r&&[o,c,u,d].indexOf(a)>=0&&r!==this._joinRef())return;let A=this._onMessage(a,n,r);if(n&&!A)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(f=>{var p,m,g;return((p=f.filter)===null||p===void 0?void 0:p.event)==="*"||((g=(m=f.filter)===null||m===void 0?void 0:m.event)===null||g===void 0?void 0:g.toLocaleLowerCase())===a}).map(f=>f.callback(A,r)):(s=this.bindings[a])===null||s===void 0||s.filter(f=>{var p,m,g,y,v,x;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in f){const b=f.id,w=(p=f.filter)===null||p===void 0?void 0:p.event;return b&&((m=n.ids)===null||m===void 0?void 0:m.includes(b))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((g=n.data)===null||g===void 0?void 0:g.type.toLocaleLowerCase()))}else{const b=(v=(y=f==null?void 0:f.filter)===null||y===void 0?void 0:y.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return b==="*"||b===((x=n==null?void 0:n.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===a}).map(f=>{if(typeof A=="object"&&"ids"in A){const p=A.data,{schema:m,table:g,commit_timestamp:y,type:v,errors:x}=p;A=Object.assign(Object.assign({},{schema:m,table:g,commit_timestamp:y,eventType:v,new:{},old:{},errors:x}),this._getPayloadRecords(p))}f.callback(A,r)})}_isClosed(){return this.state===Vi.closed}_isJoined(){return this.state===Vi.joined}_isJoining(){return this.state===Vi.joining}_isLeaving(){return this.state===Vi.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const i=t.toLocaleLowerCase(),s={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&iy.isEqual(i.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(ac.close,{},t)}_onError(t){this._on(ac.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Vi.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=N9(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=N9(t.columns,t.old_record)),n}}const oP=()=>{},hS={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},$Te=[1e3,2e3,5e3,1e4],zTe=1e4,VTe=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class KTe{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=FF,this.transport=null,this.heartbeatIntervalMs=hS.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=oP,this.ref=0,this.reconnectTimer=null,this.vsn=B9,this.logger=oP,this.conn=null,this.sendBuffer=[],this.serializer=new MTe,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=i=>i?(...s)=>i(...s):(...s)=>fetch(...s),!(!((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,this.endPoint=`${t}/${MF.websocket}`,this.httpEndpoint=Lae(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=ETe.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}

To use Realtime in Node.js, you need to provide a WebSocket implementation:

Option 1: Use Node.js 22+ which has native WebSocket support
Option 2: Install and provide the "ws" package:

  npm install ws

  import ws from "ws"
  const client = new RealtimeClient(url, {
    ...options,
    transport: ws
  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case vh.connecting:return $A.Connecting;case vh.open:return $A.Open;case vh.closing:return $A.Closing;default:return $A.Closed}}isConnected(){return this.connectionState()===$A.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new iy(`realtime:${t}`,n,this);return this.channels.push(s),s}}push(t){const{topic:n,event:r,payload:i,ref:s}=t,a=()=>{this.encode(t,o=>{var c;(c=this.conn)===null||c===void 0||c.send(o)})};this.log("push",`${n} ${r} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(OTe,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},hS.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",u)}catch(d){this.log("error","error in heartbeat callback",d)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:i,payload:s,ref:a}=n,o=a?`(${a})`:"",c=s.status||"";this.log("receive",`${c} ${r} ${i} ${o}`.trim(),s),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(i,s,a)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===vh.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===vh.open||this.conn.readyState===vh.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},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)}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}_triggerChanError(){this.channels.forEach(t=>t._trigger(ac.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${t}${r}${i}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([VTe],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),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(i=>{const s={access_token:n,version:ITe};n&&i.updateJoinPayload(s),i.joinedOnce&&i._isJoined()&&i._push(ac.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new Fae(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},hS.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,i,s,a,o,c,u,d,h,A,f;switch(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.timeout)!==null&&r!==void 0?r:FF,this.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:hS.HEARTBEAT_INTERVAL,this.worker=(s=t==null?void 0:t.worker)!==null&&s!==void 0?s:!1,this.accessToken=(a=t==null?void 0:t.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=t==null?void 0:t.heartbeatCallback)!==null&&o!==void 0?o:oP,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:B9,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:p=>$Te[p-1]||zTe,this.vsn){case PTe:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(p,m)=>m(JSON.stringify(p)),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:(p,m)=>m(JSON.parse(p));break;case Oae:this.encode=(A=t==null?void 0:t.encode)!==null&&A!==void 0?A:this.serializer.encode.bind(this.serializer),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var zb=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function qTe(e,t,n){const r=new URL(t,e);if(n)for(const[i,s]of Object.entries(n))s!==void 0&&r.searchParams.set(i,s);return r.toString()}async function WTe(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function GTe(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:s,headers:a}){const o=qTe(e.baseUrl,r,i),c=await WTe(e.auth),u=await t(o,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...c,...a},body:s?JSON.stringify(s):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),A=h&&d?JSON.parse(d):d;if(!u.ok){const f=h?A:void 0,p=f==null?void 0:f.error;throw new zb((p==null?void 0:p.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:p==null?void 0:p.type,icebergCode:p==null?void 0:p.code,details:f})}return{status:u.status,headers:u.headers,data:A}}}}function fS(e){return e.join("")}var YTe=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:fS(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${fS(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${fS(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${fS(e.namespace)}`}),!0}catch(t){if(t instanceof zb&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof zb&&n.status===409)return;throw n}}};function tg(e){return e.join("")}var XTe=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof zb&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof zb&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},JTe=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=GTe({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new YTe(this.client,t),this.tableOps=new XTe(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},jE=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function BE(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var AS=class extends jE{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Rae=class extends jE{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const ZTe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),eIe=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},RF=e=>{if(Array.isArray(e))return e.map(n=>RF(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));t[i]=RF(r)}),t},tIe=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Vb(e){"@babel/helpers - typeof";return Vb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vb(e)}function nIe(e,t){if(Vb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rIe(e){var t=nIe(e,"string");return Vb(t)=="symbol"?t:t+""}function iIe(e,t,n){return(t=rIe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I9(Object(n),!0).forEach(function(r){iIe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const P9=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},sIe=async(e,t,n,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(n!=null&&n.noResolveJson)){const i=e,s=i.status||500;if(typeof i.json=="function")i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";t(new AS(P9(a),s,o,r))}).catch(()=>{if(r==="vectors"){const a=s+"";t(new AS(i.statusText||`HTTP ${s} error`,s,a,r))}else{const a=s+"";t(new AS(i.statusText||`HTTP ${s} error`,s,a,r))}});else{const a=s+"";t(new AS(i.statusText||`HTTP ${s} error`,s,a,r))}}else t(new Rae(P9(e),e,r))},aIe=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!r?Gt(Gt({},i),n):(eIe(r)?(i.headers=Gt({"Content-Type":"application/json"},t==null?void 0:t.headers),i.body=JSON.stringify(r)):i.body=r,t!=null&&t.duplex&&(i.duplex=t.duplex),Gt(Gt({},i),n))};async function wx(e,t,n,r,i,s,a){return new Promise((o,c)=>{e(n,aIe(t,r,i,s)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(a==="vectors"){const d=u.headers.get("content-type");if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>o(u)).catch(u=>sIe(u,c,r,a))})}function oIe(e="storage"){return{get:async(t,n,r,i)=>wx(t,"GET",n,r,i,void 0,e),post:async(t,n,r,i,s)=>wx(t,"POST",n,i,s,r,e),put:async(t,n,r,i,s)=>wx(t,"PUT",n,i,s,r,e),head:async(t,n,r,i)=>wx(t,"HEAD",n,Gt(Gt({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,s)=>wx(t,"DELETE",n,i,s,r,e)}}const lIe=oIe("storage"),{get:Kb,post:$r,put:DF,head:cIe,remove:u6}=lIe;var h0=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=ZTe(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(BE(n))return{data:null,error:n};throw n}}},uIe=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(BE(t))return{data:null,error:t};throw t}}};let Dae;Dae=Symbol.toStringTag;var dIe=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Dae]="BlobDownloadBuilder",this.promise=null}asStream(){return new uIe(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(BE(t))return{data:null,error:t};throw t}}};const hIe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},O9={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var fIe=class extends h0{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let s;const a=Gt(Gt({},O9),r);let o=Gt(Gt({},i.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),c&&s.append("metadata",i.encodeMetadata(c)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),c&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(c))):(s=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,c&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),r!=null&&r.headers&&(o=Gt(Gt({},o),r.headers));const u=i._removeEmptyFolders(t),d=i._getFinalPath(u),h=await(e=="PUT"?DF:$r)(i.fetch,`${i.url}/object/${d}`,s,Gt({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;const s=i._removeEmptyFolders(e),a=i._getFinalPath(s),o=new URL(i.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",t),i.handleOperation(async()=>{let c;const u=Gt({upsert:O9.upsert},r),d=Gt(Gt({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:s,fullPath:(await DF(i.fetch,o.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const i=Gt({},n.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const s=await $r(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),a=new URL(n.url+s.url),o=a.searchParams.get("token");if(!o)throw new jE("No token returned by API");return{signedUrl:a.toString(),path:e,token:o}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await $r(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await $r(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),s=await $r(r.fetch,`${r.url}/object/sign/${i}`,Gt({expiresIn:t},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{signedUrl:encodeURI(`${r.url}${s.signedURL}${a}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const i=await $r(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),s=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i.map(a=>Gt(Gt({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${s}`):null}))})}download(e,t){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",r=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),i=r?`?${r}`:"",s=this._getFinalPath(e),a=()=>Kb(this.fetch,`${this.url}/${n}/${s}${i}`,{headers:this.headers,noResolveJson:!0});return new dIe(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>RF(await Kb(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await cIe(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(BE(r)&&r instanceof Rae){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&r.push(i);const s=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});a!==""&&r.push(a);let o=r.join("&");return o!==""&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${o}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await u6(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const i=Gt(Gt(Gt({},hIe),t),{},{prefix:e||""});return await $r(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Gt({},e);return await $r(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const AIe="2.93.2",j2={"X-Client-Info":`storage-js/${AIe}`};var pIe=class extends h0{constructor(e,t={},n,r){const i=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const s=i.href.replace(/\/$/,""),a=Gt(Gt({},j2),t);super(s,a,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Kb(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Kb(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await $r(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await DF(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await u6(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},mIe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Gt(Gt({},j2),t);super(r,i,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Kb(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await u6(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!tIe(e))throw new jE("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 JTe({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(i,s){const a=i[s];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(i,o),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},gIe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Gt(Gt({},j2),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await $r(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await $r(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},yIe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Gt(Gt({},j2),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},vIe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Gt(Gt({},j2),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await $r(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},xIe=class extends vIe{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new wIe(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},wIe=class extends gIe{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,Gt(Gt({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,Gt(Gt({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new bIe(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},bIe=class extends yIe{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,Gt(Gt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,Gt(Gt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,Gt(Gt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,Gt(Gt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,Gt(Gt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},CIe=class extends pIe{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new fIe(this.url,this.headers,e,this.fetch)}get vectors(){return new xIe(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new mIe(this.url+"/iceberg",this.headers,this.fetch)}};const Uae="2.93.2",Ig=30*1e3,UF=3,lP=UF*Ig,SIe="http://localhost:9999",kIe="supabase.auth.token",_Ie={"X-Client-Info":`gotrue-js/${Uae}`},HF="X-Supabase-Api-Version",Hae={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},jIe=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,BIe=10*60*1e3;class qb extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function It(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class NIe extends qb{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function EIe(e){return It(e)&&e.name==="AuthApiError"}class zA extends qb{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Pd extends qb{constructor(t,n,r,i){super(t,r,i),this.name=n,this.status=r}}class Co extends Pd{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function cP(e){return It(e)&&e.name==="AuthSessionMissingError"}class ng extends Pd{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class pS extends Pd{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class mS extends Pd{constructor(t,n=null){super(t,"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 TIe(e){return It(e)&&e.name==="AuthImplicitGrantRedirectError"}class F9 extends Pd{constructor(t,n=null){super(t,"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 IIe extends Pd{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 QF extends Pd{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function uP(e){return It(e)&&e.name==="AuthRetryableFetchError"}class M9 extends Pd{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class $F extends Pd{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const yj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),L9=` 	
\r=`.split(""),PIe=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<L9.length;t+=1)e[L9[t].charCodeAt(0)]=-2;for(let t=0;t<yj.length;t+=1)e[yj[t].charCodeAt(0)]=t;return e})();function R9(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(yj[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(yj[r]),t.queuedBits-=6}}function Qae(e,t,n){const r=PIe[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function D9(e){const t=[],n=a=>{t.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{MIe(a,r,n)};for(let a=0;a<e.length;a+=1)Qae(e.charCodeAt(a),i,s);return t.join("")}function OIe(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function FIe(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}OIe(r,t)}}function MIe(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Sy(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)Qae(e.charCodeAt(i),n,r);return new Uint8Array(t)}function LIe(e){const t=[];return FIe(e,n=>t.push(n)),new Uint8Array(t)}function ep(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};return e.forEach(i=>R9(i,n,r)),R9(null,n,r),t.join("")}function RIe(e){return Math.round(Date.now()/1e3)+e}function DIe(){return Symbol("auth-callback")}const ws=()=>typeof window<"u"&&typeof document<"u",_A={tested:!1,writable:!1},$ae=()=>{if(!ws())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_A.tested)return _A.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),_A.tested=!0,_A.writable=!0}catch{_A.tested=!0,_A.writable=!1}return _A.writable};function UIe(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,s)=>{t[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{t[i]=r}),t}const zae=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),HIe=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Pg=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},jA=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},xs=async(e,t)=>{await e.removeItem(t)};class NE{constructor(){this.promise=new NE.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}NE.promiseConstructor=Promise;function gS(e){const t=e.split(".");if(t.length!==3)throw new $F("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!jIe.test(t[r]))throw new $F("JWT not in base64url format");return{header:JSON.parse(D9(t[0])),payload:JSON.parse(D9(t[1])),signature:Sy(t[2]),raw:{header:t[0],payload:t[1]}}}async function QIe(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function $Ie(e,t){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await e(s);if(!t(s,null,a)){r(a);return}}catch(a){if(!t(s,a)){i(a);return}}})()})}function zIe(e){return("0"+e.toString(16)).substr(-2)}function VIe(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(t),Array.from(t,zIe).join("")}async function KIe(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function qIe(e){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."),e;const n=await KIe(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function rg(e,t,n=!1){const r=VIe();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await Pg(e,`${t}-code-verifier`,i);const s=await qIe(r);return[s,r===s?"plain":"s256"]}const WIe=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function GIe(e){const t=e.headers.get(HF);if(!t||!t.match(WIe))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function YIe(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function XIe(e){switch(e){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 JIe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ig(e){if(!JIe.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function dP(){const e={};return new Proxy(e,{get:(t,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:(t,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:(t,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 ZIe(e,t){return new Proxy(e,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,i)}return!t.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."),t.value=!0),Reflect.get(n,r,i)}})}function U9(e){return JSON.parse(JSON.stringify(e))}const LA=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ePe=[502,503,504];async function H9(e){var t;if(!HIe(e))throw new QF(LA(e),0);if(ePe.includes(e.status))throw new QF(LA(e),e.status);let n;try{n=await e.json()}catch(s){throw new zA(LA(s),s)}let r;const i=GIe(e);if(i&&i.getTime()>=Hae["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 M9(LA(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Co}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((s,a)=>s&&typeof a=="string",!0))throw new M9(LA(n),e.status,n.weak_password.reasons);throw new NIe(LA(n),e.status||500,r)}const tPe=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Kt(e,t,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[HF]||(s[HF]=Hae["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const a=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await nPe(e,t,n+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function nPe(e,t,n,r,i,s){const a=tPe(t,r,i,s);let o;try{o=await e(n,Object.assign({},a))}catch(c){throw console.error(c),new QF(LA(c),0)}if(o.ok||await H9(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(c){await H9(c)}}function Jl(e){var t;let n=null;sPe(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=RIe(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function Q9(e){const t=Jl(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function jh(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function rPe(e){return{data:e,error:null}}function iPe(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=e,a=d0(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},c=Object.assign({},a);return{data:{properties:o,user:c},error:null}}function $9(e){return e}function sPe(e){return e.access_token&&e.refresh_token&&e.expires_in}const hP=["global","local","others"];class aPe{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=zae(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)}}async signOut(t,n=hP[0]){if(hP.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${hP.join(", ")}`);try{return await Kt(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(It(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Kt(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:jh})}catch(r){if(It(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=d0(t,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await Kt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:iPe,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(It(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Kt(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:jh})}catch(n){if(It(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,i,s,a,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Kt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:$9});if(d.error)throw d.error;const h=await d.json(),A=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,f=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(A)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(It(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){ig(t);try{return await Kt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:jh})}catch(n){if(It(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){ig(t);try{return await Kt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:jh})}catch(r){if(It(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){ig(t);try{return await Kt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:jh})}catch(r){if(It(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){ig(t.userId);try{const{data:n,error:r}=await Kt(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(It(n))return{data:null,error:n};throw n}}async _deleteFactor(t){ig(t.userId),ig(t.id);try{return{data:await Kt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(It(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,i,s,a,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Kt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:$9});if(d.error)throw d.error;const h=await d.json(),A=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,f=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(A)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(It(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Kt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(It(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Kt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(It(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Kt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(It(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Kt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(It(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Kt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(It(n))return{data:null,error:n};throw n}}}function z9(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const sg={debug:!!(globalThis&&$ae()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Vae extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class oPe extends Vae{}async function lPe(e,t,n){sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),sg.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new oPe(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(sg.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null,"  "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}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"),await n()}}))}function cPe(){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 Kae(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function uPe(e){return parseInt(e,16)}function dPe(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function hPe(e){var t;const{chainId:n,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:c,resources:u,scheme:d,uri:h,version:A}=e;{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(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(A!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${A}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const f=Kae(e.address),p=d?`${d}://${r}`:r,m=e.statement?`${e.statement}
`:"",g=`${p} wants you to sign in with your Ethereum account:
${f}

${m}`;let y=`URI: ${h}
Version: ${A}
Chain ID: ${n}${a?`
Nonce: ${a}`:""}
Issued At: ${s.toISOString()}`;if(i&&(y+=`
Expiration Time: ${i.toISOString()}`),o&&(y+=`
Not Before: ${o.toISOString()}`),c&&(y+=`
Request ID: ${c}`),u){let v=`
Resources:`;for(const x of u){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);v+=`
- ${x}`}y+=v}return`${g}
${y}`}class Ii extends Error{constructor({message:t,code:n,cause:r,name:i}){var s;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=i??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}}class vj extends Ii{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function fPe({error:e,options:t}){var n,r,i;const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ii({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Ii({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Ii({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Ii({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Ii({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ii({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Ii({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ii({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(qae(a)){if(s.rp.id!==a)return new Ii({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ii({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new Ii({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Ii({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ii({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function APe({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ii({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ii({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(qae(r)){if(n.rpId!==r)return new Ii({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ii({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ii({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ii({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class pPe{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const mPe=new pPe;function gPe(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,i=d0(e,["challenge","user","excludeCredentials"]),s=Sy(t).buffer,a=Object.assign(Object.assign({},n),{id:Sy(n.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:s,user:a});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];o.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Sy(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function yPe(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=d0(e,["challenge","allowCredentials"]),i=Sy(t).buffer,s=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const o=n[a];s.allowCredentials[a]=Object.assign(Object.assign({},o),{id:Sy(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function vPe(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:ep(new Uint8Array(e.response.attestationObject)),clientDataJSON:ep(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function xPe(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ep(new Uint8Array(i.authenticatorData)),clientDataJSON:ep(new Uint8Array(i.clientDataJSON)),signature:ep(new Uint8Array(i.signature)),userHandle:i.userHandle?ep(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function qae(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function V9(){var e,t;return!!(ws()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function wPe(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new vj("Browser returned unexpected credential type",t)}:{data:null,error:new vj("Empty credential response",t)}}catch(t){return{data:null,error:fPe({error:t,options:e})}}}async function bPe(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new vj("Browser returned unexpected credential type",t)}:{data:null,error:new vj("Empty credential response",t)}}catch(t){return{data:null,error:APe({error:t,options:e})}}}const CPe={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},SPe={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function xj(...e){const t=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of e)if(i)for(const s in i){const a=i[s];if(a!==void 0)if(Array.isArray(a))r[s]=a;else if(n(a))r[s]=a;else if(t(a)){const o=r[s];t(o)?r[s]=xj(o,a):r[s]=xj(a)}else r[s]=a}return r}function kPe(e,t){return xj(CPe,e,t||{})}function _Pe(e,t){return xj(SPe,e,t||{})}class jPe{constructor(t){this.client=t,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(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:i},s){try{const{data:a,error:o}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!a)return{data:null,error:o};const c=i??mPe.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${r}`),u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=kPe(a.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:h}=await wPe({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const u=_Pe(a.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:h}=await bPe(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(a){return It(a)?{data:null,error:a}:{data:null,error:new zA("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new qb("rpId is required for WebAuthn authentication")};try{if(!V9())return{data:null,error:new zA("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:s});if(!a)return{data:null,error:o};const{webauthn:c}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(a){return It(a)?{data:null,error:a}:{data:null,error:new zA("Unexpected error in authenticate",a)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new qb("rpId is required for WebAuthn registration")};try{if(!V9())return{data:null,error:new zA("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:t});if(!a)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(A=>A.factor_type==="webauthn"&&A.friendly_name===t&&A.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:c,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:s});return c?this._verify({factorId:a.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(a){return It(a)?{data:null,error:a}:{data:null,error:new zA("Unexpected error in register",a)}}}}cPe();const BPe={url:SIe,storageKey:kIe,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:_Ie,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function K9(e,t,n){return await n()}const ag={};class Wb{get jwks(){var t,n;return(n=(t=ag[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){ag[this.storageKey]=Object.assign(Object.assign({},ag[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=ag[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){ag[this.storageKey]=Object.assign(Object.assign({},ag[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,i;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 s=Object.assign(Object.assign({},BPe),t);if(this.storageKey=s.storageKey,this.instanceID=(n=Wb.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Wb.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&ws()){const a=`${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(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new aPe({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=zae(s.fetch),this.lock=s.lock||K9,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&ws()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=lPe:this.lock=K9,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 jPe(this)},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?(s.storage?this.storage=s.storage:$ae()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=z9(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=z9(this.memoryStorage)),ws()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Uae}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),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 t;try{let n={},r="none";if(ws()&&(n=UIe(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),ws()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),TIe(s)){const c=(t=s.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:a,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return It(n)?this._returnResult({error:n}):this._returnResult({error:new zA("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,i;try{const s=await Kt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:Jl}),{data:a,error:o}=s;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(It(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(t){var n,r,i;try{let s;if("email"in t){const{email:d,password:h,options:A}=t;let f=null,p=null;this.flowType==="pkce"&&([f,p]=await rg(this.storage,this.storageKey)),s=await Kt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:A==null?void 0:A.emailRedirectTo,body:{email:d,password:h,data:(n=A==null?void 0:A.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken},code_challenge:f,code_challenge_method:p},xform:Jl})}else if("phone"in t){const{phone:d,password:h,options:A}=t;s=await Kt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=A==null?void 0:A.data)!==null&&r!==void 0?r:{},channel:(i=A==null?void 0:A.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken}},xform:Jl})}else throw new pS("You must provide either an email or phone number and a password");const{data:a,error:o}=s;if(o||!a)return await xs(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(await xs(this.storage,`${this.storageKey}-code-verifier`),It(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(t){try{let n;if("email"in t){const{email:s,password:a,options:o}=t;n=await Kt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Q9})}else if("phone"in t){const{phone:s,password:a,options:o}=t;n=await Kt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Q9})}else throw new pS("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const s=new ng;return this._returnResult({data:{user:null,session:null},error:s})}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:i})}catch(n){if(It(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,i,s;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,i,s,a,o,c,u,d,h,A;let f,p;if("message"in t)f=t.message,p=t.signature;else{const{chain:m,wallet:g,statement:y,options:v}=t;let x;if(ws())if(typeof g=="object")x=g;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")x=E.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 g!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=g}const b=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href),w=await x.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!w||w.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=Kae(w[0]);let j=(r=v==null?void 0:v.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!j){const E=await x.request({method:"eth_chainId"});j=uPe(E)}const B={domain:b.host,address:k,statement:y,uri:b.href,version:"1",chainId:j,nonce:(i=v==null?void 0:v.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(a=(s=v==null?void 0:v.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=v==null?void 0:v.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=v==null?void 0:v.signInWithEthereum)===null||d===void 0?void 0:d.resources};f=hPe(B),p=await x.request({method:"personal_sign",params:[dPe(f),k]})}try{const{data:m,error:g}=await Kt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:p},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(A=t.options)===null||A===void 0?void 0:A.captchaToken}}:null),xform:Jl});if(g)throw g;if(!m||!m.session||!m.user){const y=new ng;return this._returnResult({data:{user:null,session:null},error:y})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:g})}catch(m){if(It(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var n,r,i,s,a,o,c,u,d,h,A,f;let p,m;if("message"in t)p=t.message,m=t.signature;else{const{chain:g,wallet:y,statement:v,options:x}=t;let b;if(ws())if(typeof y=="object")b=y;else{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"))b=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 y!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=y}const w=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in b&&b.signIn){const k=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:w.host,uri:w.href}),v?{statement:v}:null));let j;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")j=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)j=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in j&&"signature"in j&&(typeof j.signedMessage=="string"||j.signedMessage instanceof Uint8Array)&&j.signature instanceof Uint8Array)p=typeof j.signedMessage=="string"?j.signedMessage:new TextDecoder().decode(j.signedMessage),m=j.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${w.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${w.href}`,`Issued At: ${(i=(r=x==null?void 0:x.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=x==null?void 0:x.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x==null?void 0:x.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((h=(d=x==null?void 0:x.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...x.signInWithSolana.resources.map(j=>`- ${j}`)]:[]].join(`
`);const k=await b.signMessage(new TextEncoder().encode(p),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=k}}try{const{data:g,error:y}=await Kt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:ep(m)},!((A=t.options)===null||A===void 0)&&A.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Jl});if(y)throw y;if(!g||!g.session||!g.user){const v=new ng;return this._returnResult({data:{user:null,session:null},error:v})}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(It(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async _exchangeCodeForSession(t){const n=await jA(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new IIe;const{data:s,error:a}=await Kt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Jl});if(await xs(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new ng;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(await xs(this.storage,`${this.storageKey}-code-verifier`),It(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(t){try{const{options:n,provider:r,token:i,access_token:s,nonce:a}=t,o=await Kt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Jl}),{data:c,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new ng;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(It(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,i,s,a;try{if("email"in t){const{email:o,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await rg(this.storage,this.storageKey));const{error:h}=await Kt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:o,options:c}=t,{data:u,error:d}=await Kt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new pS("You must provide either an email or phone number.")}catch(o){if(await xs(this.storage,`${this.storageKey}-code-verifier`),It(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(t){var n,r;try{let i,s;"options"in t&&(i=(n=t.options)===null||n===void 0?void 0:n.redirectTo,s=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:o}=await Kt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Jl});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,u=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(It(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var n,r,i,s,a;try{let o=null,c=null;this.flowType==="pkce"&&([o,c]=await rg(this.storage,this.storageKey));const u=await Kt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:c}),headers:this.headers,xform:rPe});return!((s=u.data)===null||s===void 0)&&s.url&&ws()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await xs(this.storage,`${this.storageKey}-code-verifier`),It(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new Co;const{error:i}=await Kt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(It(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:i,options:s}=t,{error:a}=await Kt(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in t){const{phone:r,type:i,options:s}=t,{data:a,error:o}=await Kt(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new pS("You must provide either an email or phone number and a type")}catch(n){if(It(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(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,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 i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.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(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(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 t=null;const n=await jA(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<lP:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const a=await jA(this.userStorage,this.storageKey+"-user");a!=null&&a.user?t.user=a.user:t.user=dP()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=ZIe(t.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await Kt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:jh}):await this._useSession(async n=>{var r,i,s;const{data:a,error:o}=n;if(o)throw o;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Co}:await Kt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:jh})})}catch(n){if(It(n))return cP(n)&&(await this._removeSession(),await xs(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new Co;const a=i.session;let o=null,c=null;this.flowType==="pkce"&&t.email!=null&&([o,c]=await rg(this.storage,this.storageKey));const{data:u,error:d}=await Kt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:o,code_challenge_method:c}),jwt:a.access_token,xform:jh});if(d)throw d;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await xs(this.storage,`${this.storageKey}-code-verifier`),It(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Co;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:a}=gS(t.access_token);if(a.exp&&(r=a.exp,i=r<=n),i){const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});s={access_token:t.access_token,refresh_token:t.refresh_token,user:o.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(It(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:a,error:o}=n;if(o)throw o;t=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Co;const{data:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(It(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!ws())throw new mS("No browser detected.");if(t.error||t.error_description||t.error_code)throw new mS(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new F9("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new mS("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new F9("No code detected.");const{data:v,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:o,expires_at:c,token_type:u}=t;if(!s||!o||!a||!u)throw new mS("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(o);let A=d+h;c&&(A=parseInt(c));const f=A-d;f*1e3<=Ig&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${h}s`);const p=A-h;d-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,A,d):d-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,A,d);const{data:m,error:g}=await this._getUser(s);if(g)throw g;const y={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:h,expires_at:A,refresh_token:a,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(r){if(It(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await jA(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s&&!cP(s))return this._returnResult({error:s});const a=(r=i.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:o}=await this.admin.signOut(a,t);if(o&&!(EIe(o)&&(o.status===404||o.status===401||o.status===403)||cP(o)))return this._returnResult({error:o})}return t!=="others"&&(await this._removeSession(),await xs(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=DIe(),r={id:n,callback:t,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(t){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),console.error(s)}})}async resetPasswordForEmail(t,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await rg(this.storage,this.storageKey,!0));try{return await Kt(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await xs(this.storage,`${this.storageKey}-code-verifier`),It(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var a,o,c,u,d;const{data:h,error:A}=s;if(A)throw A;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=t.options)===null||o===void 0?void 0:o.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Kt(this.fetch,"GET",f,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return ws()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(It(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:i,data:{session:s}}=n;if(i)throw i;const{options:a,provider:o,token:c,access_token:u,nonce:d}=t,h=await Kt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Jl}),{data:A,error:f}=h;return f?this._returnResult({data:{user:null,session:null},error:f}):!A||!A.session||!A.user?this._returnResult({data:{user:null,session:null},error:new ng}):(A.session&&(await this._saveSession(A.session),await this._notifyAllSubscribers("USER_UPDATED",A.session)),this._returnResult({data:A,error:f}))}catch(i){if(await xs(this.storage,`${this.storageKey}-code-verifier`),It(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)throw a;return await Kt(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await $Ie(async i=>(i>0&&await QIe(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Kt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Jl})),(i,s)=>{const a=200*Math.pow(2,i);return s&&uP(s)&&Date.now()+a-r<Ig})}catch(r){if(this._debug(n,"error",r),It(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),ws()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await jA(this.storage,this.storageKey);if(i&&this.userStorage){let a=await jA(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await Pg(this.userStorage,this.storageKey+"-user",a)),i.user=(t=a==null?void 0:a.user)!==null&&t!==void 0?t:dP()}else if(i&&!i.user&&!i.user){const a=await jA(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await xs(this.storage,this.storageKey+"-user"),await Pg(this.storage,this.storageKey,i)):i.user=dP()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const s=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<lP;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${lP}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),uP(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(i.access_token);!o&&(a!=null&&a.user)?(i.user=a.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Co;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new NE;const{data:s,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!s.session)throw new Co;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const o={data:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(i,"error",s),It(s)){const a={data:null,error:s};return uP(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,n,r=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(t,n)}catch(c){s.push(c)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await xs(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Pg(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const s=U9(i);await Pg(this.storage,this.storageKey,s)}else{const i=U9(n);await Pg(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await xs(this.storage,this.storageKey),await xs(this.storage,this.storageKey+"-code-verifier"),await xs(this.storage,this.storageKey+"-user"),this.userStorage&&await xs(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ws()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Ig);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);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 t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);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 t=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 i=Math.floor((r.expires_at*1e3-t)/Ig);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ig}ms, refresh threshold is ${UF} ticks`),i<=UF&&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(t){if(t.isAcquireTimeout||t instanceof Vae)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ws()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(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(t,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,a]=await rg(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?this._returnResult({data:null,error:s}):await Kt(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await Kt(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?vPe(t.webauthn.credential_response):xPe(t.webauthn.credential_response)})}:{code:t.code}),{data:o,error:c}=await Kt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:c}))})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=await Kt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(a.error)return a;const{data:o}=a;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:gPe(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:yPe(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const s of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,i,s;if(t)try{const{payload:f}=gS(t);let p=null;f.aal&&(p=f.aal);let m=p;const{data:{user:g},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((r=(n=g==null?void 0:g.factors)===null||n===void 0?void 0:n.filter(b=>b.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(m="aal2");const x=f.amr||[];return{data:{currentLevel:p,nextLevel:m,currentAuthenticationMethods:x},error:null}}catch(f){if(It(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:a},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=gS(a.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((s=(i=a.user.factors)===null||i===void 0?void 0:i.filter(f=>f.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(d="aal2");const A=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:A},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await Kt(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Co})})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new Co});const a=await Kt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&ws()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(It(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new Co});const a=await Kt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&ws()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(It(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Kt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Co})})}catch(t){if(It(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?(await Kt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Co})})}catch(n){if(It(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(o=>o.kid===t);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(o=>o.kid===t),r&&this.jwks_cached_at+BIe>i)return r;const{data:s,error:a}=await Kt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,r=s.keys.find(o=>o.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:f,error:p}=await this.getSession();if(p||!f.session)return this._returnResult({data:null,error:p});r=f.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:c}}=gS(r);n!=null&&n.allowExpired||YIe(s.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:f}=await this.getUser(r);if(f)throw f;return{data:{claims:s,header:i,signature:a},error:null}}const d=XIe(i.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,a,LIe(`${o}.${c}`)))throw new $F("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(It(r))return this._returnResult({data:null,error:r});throw r}}}Wb.nextInstanceID={};const NPe=Wb,EPe="2.93.2";let nw="";typeof Deno<"u"?nw="deno":typeof document<"u"?nw="web":typeof navigator<"u"&&navigator.product==="ReactNative"?nw="react-native":nw="node";const TPe={"X-Client-Info":`supabase-js-${nw}/${EPe}`},IPe={headers:TPe},PPe={schema:"public"},OPe={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},FPe={};function Gb(e){"@babel/helpers - typeof";return Gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gb(e)}function MPe(e,t){if(Gb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LPe(e){var t=MPe(e,"string");return Gb(t)=="symbol"?t:t+""}function RPe(e,t,n){return(t=LPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q9(Object(n),!0).forEach(function(r){RPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const DPe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),UPe=()=>Headers,HPe=(e,t,n)=>{const r=DPe(n),i=UPe();return async(s,a)=>{var o;const c=(o=await t())!==null&&o!==void 0?o:e;let u=new i(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(s,li(li({},a),{},{headers:u}))}};function QPe(e){return e.endsWith("/")?e:e+"/"}function $Pe(e,t){var n,r;const{db:i,auth:s,realtime:a,global:o}=e,{db:c,auth:u,realtime:d,global:h}=t,A={db:li(li({},c),i),auth:li(li({},u),s),realtime:li(li({},d),a),storage:{},global:li(li(li({},h),o),{},{headers:li(li({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?A.accessToken=e.accessToken:delete A.accessToken,A}function zPe(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(QPe(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var VPe=class extends NPe{constructor(e){super(e)}},KPe=class{constructor(e,t,n){var r,i;this.supabaseUrl=e,this.supabaseKey=t;const s=zPe(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const a=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:PPe,realtime:FPe,auth:li(li({},OPe),{},{storageKey:a}),global:IPe},c=$Pe(n??{},o);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=HPe(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(li({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.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 NTe(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new CIe(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new STe(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:s,flowType:a,lock:o,debug:c,throwOnError:u},d,h){const A={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new VPe({url:this.authUrl.href,headers:li(li({},A),d),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:a,lock:o,debug:c,throwOnError:u,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new KTe(this.realtimeUrl.href,li(li({},e),{},{params:li(li({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const qPe=(e,t,n)=>new KPe(e,t,n);function WPe(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}WPe()&&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 GPe="https://khmmwvmdbhaplcfcndjx.supabase.co",YPe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",Me=qPe(GPe,YPe,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function Wae(){return Br({queryKey:["nav-categories"],queryFn:async()=>{const{data:e,error:t}=await Me.from("aeo_categories").select("id, name, slug, icon, display_order").eq("enabled",!0).is("parent_id",null).order("display_order");if(t)throw t;const n=new Set(["buyers","sellers","about"]);return e.filter(i=>!n.has(i.slug.toLowerCase().trim()))},staleTime:1e3*60*5})}const W9="/wordmark-compact-on-dark-transparent.svg",XPe=new Set(["buyers","sellers","about"]),yS=({label:e,items:t,align:n="center",widthClassName:r="min-w-[250px]",isActive:i,onNavigate:s})=>{const[a,o]=C.useState(!1),c=C.useRef(),u=C.useRef(null),d=n==="start"?"left-0":n==="end"?"right-0":"left-1/2 -translate-x-1/2",h=()=>{clearTimeout(c.current),o(!0)},A=()=>{c.current=setTimeout(()=>o(!1),150)};return l.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:A,children:[l.jsxs("button",{className:"flex h-10 items-center gap-1.5 px-3 text-[11px] font-medium uppercase tracking-[0.2em] text-primary-foreground/75 transition-all duration-300 hover:bg-primary-foreground/[0.06] hover:text-primary-foreground",onClick:()=>o(f=>!f),children:[e,l.jsx(yc,{size:11,className:`text-primary-foreground/40 transition-transform duration-200 ${a?"rotate-180":""}`})]}),l.jsx(Cy,{children:a&&l.jsxs(vi.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{duration:.2,ease:[.22,1,.36,1]},className:`absolute top-full z-[70] ${d} ${r}`,children:[l.jsx("div",{className:"h-3"}),l.jsxs("div",{className:"overflow-hidden border border-primary-foreground/[0.08]",style:{background:"hsl(var(--primary) / 0.96)",backdropFilter:"blur(40px) saturate(1.4)",WebkitBackdropFilter:"blur(40px) saturate(1.4)",boxShadow:"0 8px 32px hsl(var(--primary) / 0.45), inset 0 1px 0 hsl(var(--primary-foreground) / 0.06)"},children:[l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gold/60 to-transparent"}),l.jsx("div",{className:"p-2",children:t.map(f=>l.jsx(St,{to:f.href,onClick:()=>{o(!1),s()},className:`flex min-h-[40px] items-center px-3.5 py-2.5 text-[11px] font-medium uppercase tracking-[0.18em] transition-colors duration-150 ${i(f.href)?"text-gold bg-primary-foreground/[0.04]":"text-primary-foreground/80 hover:bg-primary-foreground/[0.06] hover:text-primary-foreground"}`,children:f.name},f.href))})]})]})})]})},EE=()=>{const[e,t]=C.useState(!1),[n,r]=C.useState(null),[i,s]=C.useState(!1),a=C.useRef(null),o=co(),{data:c}=Wae(),u=c==null?void 0:c.find(b=>b.slug.toLowerCase()==="neighborhoods"),{data:d}=Br({queryKey:["nav-neighborhood-pages",u==null?void 0:u.id],enabled:!!u,queryFn:async()=>{const{data:b,error:w}=await Me.from("aeo_pages").select("id, title, slug, h1, display_order").eq("category_id",u.id).eq("status","published").eq("is_parent",!0).order("display_order");if(w)throw w;return b},staleTime:1e3*60*5}),h=C.useMemo(()=>(c||[]).filter(b=>!XPe.has(b.slug.toLowerCase().trim())).filter(b=>b.slug.toLowerCase()!=="neighborhoods").map(b=>({name:b.name,href:`/${b.slug}`})),[c]),A=C.useMemo(()=>{if(!u)return null;const b=(d||[]).map(w=>({name:w.h1||w.title,href:`/neighborhoods/${w.slug}`}));return{name:"Neighborhoods",href:"/neighborhoods",children:b.length>0?b:void 0}},[u,d]),f=C.useMemo(()=>[{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},...h],[h]),p=C.useMemo(()=>[...A?[{name:"Neighborhoods",href:"/neighborhoods"}]:[],{name:"Search Homes",href:"/idx"},{name:"Market Pulse",href:"/market-pulse"}],[A]),m=[{name:"About Holden",href:"/about"},{name:"Testimonials",href:"/about/testimonials"},{name:"Contact",href:"/contact"}],g=[{name:"Blog",href:"/blog"},{name:"News & Press",href:"/news"},{name:"Ask Holden (FAQ)",href:"/faq"}],y=C.useMemo(()=>[{label:"Home",items:[{name:"Home",href:"/"}]},{label:"Buying & Selling",items:[{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},...h]},{label:"Explore",items:[...A?[A]:[],{name:"Search Homes",href:"/idx"},{name:"Market Pulse",href:"/market-pulse"}]},{label:"Insights",items:[{name:"Blog",href:"/blog"},{name:"News & Press",href:"/news"},{name:"Ask Holden (FAQ)",href:"/faq"}]},{label:"About",items:[{name:"About Holden",href:"/about"},{name:"Testimonials",href:"/about/testimonials"},{name:"Contact",href:"/contact"}]}],[h,A]);C.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),C.useEffect(()=>{const b=()=>s(window.scrollY>40);return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),C.useEffect(()=>{t(!1),r(null)},[o.pathname]);const v=b=>o.pathname===b,x=b=>{r(w=>w===b?null:b)};return l.jsxs(l.Fragment,{children:[l.jsxs("header",{ref:a,className:"fixed top-0 left-0 right-0 z-50 transition-all duration-500",style:{background:i?"hsl(var(--primary) / 0.94)":"hsl(var(--primary) / 0.78)",backdropFilter:"blur(28px) saturate(1.3)",WebkitBackdropFilter:"blur(28px) saturate(1.3)",boxShadow:i?"0 8px 32px hsl(var(--primary) / 0.4)":"none",borderBottom:`1px solid hsl(var(--primary-foreground) / ${i?"0.08":"0.04"})`},children:[l.jsx("nav",{className:"w-full px-3 md:px-6",children:l.jsxs("div",{className:"flex items-center justify-between h-20",children:[l.jsx(St,{to:"/",className:"shrink-0 relative z-[60] group",children:l.jsx("img",{src:W9,alt:"HoldenGR — Grand Rapids Area Real Estate",className:"h-8 lg:h-10 w-auto max-w-[220px] lg:max-w-[280px] object-contain transition-all duration-500 group-hover:opacity-90"})}),l.jsxs("div",{className:"hidden lg:flex items-center gap-6 xl:gap-8",children:[l.jsx(yS,{label:"Buying & Selling",items:f,align:"start",widthClassName:"w-[280px]",isActive:v,onNavigate:()=>{}}),l.jsx(yS,{label:"Explore",items:p,align:"center",widthClassName:"w-[230px]",isActive:v,onNavigate:()=>{}}),l.jsx(yS,{label:"Insights",items:g,align:"center",widthClassName:"w-[230px]",isActive:v,onNavigate:()=>{}}),l.jsx(yS,{label:"About",items:m,align:"end",widthClassName:"w-[240px]",isActive:v,onNavigate:()=>{}}),l.jsxs("a",{href:"sms:6164036393",className:"flex items-center gap-2 ml-2 px-4 py-2 border border-gold/60 text-gold hover:bg-gold hover:text-primary transition-all duration-300 group",children:[l.jsx(nj,{size:14,className:"group-hover:scale-110 transition-transform"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] font-medium",children:"Text Holden"})]}),l.jsx("button",{onClick:()=>t(!e),className:"relative z-[60] p-2 text-primary-foreground/80 hover:text-gold transition-colors duration-300","aria-label":"Toggle menu",children:e?l.jsx(ra,{size:24}):l.jsx(C7,{size:24})})]}),l.jsxs("div",{className:"flex lg:hidden items-center gap-3",children:[l.jsxs("a",{href:"sms:6164036393",className:"flex items-center gap-1.5 px-3 py-1.5 border border-gold/60 text-gold",children:[l.jsx(nj,{size:12}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.15em] font-medium",children:"Text Holden"})]}),l.jsx("button",{onClick:()=>t(!e),className:"relative z-[60] p-2 text-primary-foreground/80 hover:text-gold transition-colors duration-300","aria-label":"Toggle menu",children:e?l.jsx(ra,{size:24}):l.jsx(C7,{size:24})})]})]})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-gold/70 to-transparent"})]}),Qf.createPortal(l.jsx(Cy,{children:e&&l.jsxs(vi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"fixed inset-0 z-[9999] flex flex-col",children:[l.jsxs(vi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.4},className:"absolute inset-0",style:{background:"hsl(var(--primary) / 0.86)",backdropFilter:"blur(32px) saturate(1.5)",WebkitBackdropFilter:"blur(32px) saturate(1.5)"},children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-white/[0.04] via-transparent to-black/25"}),l.jsx("div",{className:"absolute inset-[1px] border border-white/[0.06] pointer-events-none"}),l.jsx("div",{className:"absolute top-0 left-0 right-0 h-32 bg-gradient-to-b from-gold/[0.04] to-transparent pointer-events-none"})]}),l.jsx("button",{onClick:()=>t(!1),className:"absolute top-6 right-6 md:top-8 md:right-12 lg:right-16 text-white/50 hover:text-white p-2 transition-colors duration-300 z-10",children:l.jsx(ra,{size:22})}),l.jsx("div",{className:"relative w-full h-20 md:h-24 flex items-center px-6 md:px-12 shrink-0",children:l.jsx(St,{to:"/",onClick:()=>t(!1),className:"flex items-center",children:l.jsx("img",{src:W9,alt:"HoldenGR",className:"h-12 md:h-14 w-auto"})})}),l.jsx("div",{className:"relative px-6 md:px-12",children:l.jsx("div",{className:"h-px bg-gradient-to-r from-gold/40 via-gold/20 to-transparent"})}),l.jsx("div",{className:"relative flex-1 overflow-y-auto min-h-0",children:l.jsxs("div",{className:"max-w-7xl mx-auto w-full px-6 md:px-12 py-6 md:py-10",children:[l.jsxs("div",{className:"hidden lg:flex gap-16",children:[l.jsx("nav",{className:"flex-1 flex flex-col gap-8",children:y.map((b,w)=>l.jsxs("div",{children:[l.jsx(vi.p,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.1+w*.06,duration:.4},className:"text-[9px] uppercase tracking-[0.35em] font-semibold text-gold/60 mb-4",children:b.label}),l.jsx("div",{className:"flex flex-col gap-0.5",children:b.items.map((k,j)=>l.jsx(vi.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.15+w*.06+j*.03,duration:.4,ease:[.22,1,.36,1]},children:k.children?l.jsxs("button",{onClick:()=>x(k.name),className:`group flex items-center gap-2 py-2.5 transition-colors duration-300 w-full text-left ${n===k.name?"text-gold":"text-white/70 hover:text-white"}`,children:[l.jsx("span",{className:"text-[13px] uppercase tracking-[0.25em] font-medium",children:k.name}),l.jsx(vc,{size:14,className:`transition-transform duration-300 text-gold/50 ${n===k.name?"rotate-90":""}`})]}):l.jsx(St,{to:k.href,onClick:()=>t(!1),className:`group flex items-center py-2.5 transition-colors duration-300 ${v(k.href)?"text-gold":"text-white/70 hover:text-white"}`,children:l.jsx("span",{className:"text-[13px] uppercase tracking-[0.25em] font-medium",children:k.name})})},k.name+k.href))}),w<y.length-1&&l.jsx("div",{className:"mt-5 h-px bg-gradient-to-r from-white/[0.06] via-white/[0.03] to-transparent"})]},b.label))}),l.jsx(Cy,{mode:"wait",children:n&&l.jsxs(vi.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.3,ease:[.22,1,.36,1]},className:"w-72 pt-8",children:[l.jsx("p",{className:"text-[9px] uppercase tracking-[0.35em] font-semibold text-gold/50 mb-4",children:n}),l.jsx("div",{className:"flex flex-col gap-0.5",children:y.flatMap(b=>b.items).filter(b=>b.name===n&&b.children).map(b=>l.jsxs("div",{children:[l.jsx(St,{to:b.href,onClick:()=>t(!1),className:`flex items-center py-2 transition-colors duration-300 ${v(b.href)?"text-gold":"text-white/50 hover:text-white/80"}`,children:l.jsxs("span",{className:"text-[11px] uppercase tracking-[0.2em] font-medium",children:["View All ",b.name]})}),l.jsx("div",{className:"h-px bg-white/[0.04] my-2"}),b.children.map((w,k)=>l.jsx(vi.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:k*.03,duration:.3},children:l.jsx(St,{to:w.href,onClick:()=>t(!1),className:`flex items-center py-2 transition-colors duration-300 ${v(w.href)?"text-gold":"text-white/60 hover:text-white"}`,children:l.jsx("span",{className:"text-[12px] uppercase tracking-[0.15em] font-medium",children:w.name})})},w.href))]},b.href))})]},n)})]}),l.jsx("nav",{className:"lg:hidden flex flex-col gap-6",children:y.map((b,w)=>l.jsxs("div",{children:[l.jsx(vi.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1+w*.06,duration:.4},className:"text-[9px] uppercase tracking-[0.35em] font-semibold text-gold/60 mb-3",children:b.label}),l.jsx("div",{className:"flex flex-col",children:b.items.map((k,j)=>l.jsx(vi.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.12+w*.06+j*.03,duration:.4,ease:[.22,1,.36,1]},children:k.children?l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>x(k.name),className:`group flex items-center gap-2 py-2 transition-colors duration-300 w-full text-left ${n===k.name?"text-gold":"text-white/70 hover:text-white"}`,children:[l.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-medium",children:k.name}),l.jsx(vc,{size:13,className:`transition-transform duration-300 text-gold/50 ${n===k.name?"rotate-90":""}`})]}),l.jsx(Cy,{children:n===k.name&&l.jsxs(vi.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25},className:"overflow-hidden pl-4 border-l border-gold/20",children:[l.jsx(St,{to:k.href,onClick:()=>t(!1),className:"flex items-center py-1.5 text-white/40 hover:text-white/70 transition-colors",children:l.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] font-medium",children:"View All"})}),k.children.map(B=>l.jsx(St,{to:B.href,onClick:()=>t(!1),className:`flex items-center py-1.5 transition-colors duration-300 ${v(B.href)?"text-gold":"text-white/55 hover:text-white"}`,children:l.jsx("span",{className:"text-[10px] uppercase tracking-[0.15em] font-medium",children:B.name})},B.href))]})})]}):l.jsx(St,{to:k.href,onClick:()=>t(!1),className:`group flex items-center py-2 transition-colors duration-300 ${v(k.href)?"text-gold":"text-white/70 hover:text-white"}`,children:l.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-medium",children:k.name})})},k.name+k.href))}),w<y.length-1&&l.jsx("div",{className:"mt-4 h-px bg-gradient-to-r from-white/[0.06] via-white/[0.03] to-transparent"})]},b.label))})]})}),l.jsx(vi.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6,duration:.5},className:"relative shrink-0 border-t border-white/[0.08]",children:l.jsx("div",{className:"max-w-7xl mx-auto w-full px-6 md:px-12 py-5",children:l.jsxs("div",{className:"flex flex-row items-center gap-8 md:gap-12",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] uppercase tracking-[0.3em] font-medium text-white/25 mb-1",children:"Phone"}),l.jsx("a",{href:"tel:6164036393",className:"text-white/50 hover:text-white text-sm font-light tracking-wide transition-colors",children:"(616) 403-6393"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] uppercase tracking-[0.3em] font-medium text-white/25 mb-1",children:"Email"}),l.jsx("a",{href:"mailto:holden@holdengr.com",className:"text-white/50 hover:text-white text-sm font-light tracking-wide transition-colors",children:"holden@holdengr.com"})]})]})})})]})}),document.body)]})},Gae="/assets/agent-portrait-DcetkHNl.jpg",JPe="/assets/eho-realtor-logo-NaFA1neB.jpg";function ZPe(){return Br({queryKey:["site-config"],queryFn:async()=>{const{data:e,error:t}=await Me.from("site_config").select("*").order("key");if(t)throw t;return e}})}function oa(){const e=ZPe(),t=(e.data||[]).reduce((n,r)=>(n[r.key]=r.value||"",n),{});return{...e,configMap:t}}function Yae(){const e=As();return Ms({mutationFn:async t=>{const{error:n}=await Me.from("site_config").upsert(t,{onConflict:"key"});if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["site-config"]})})}const e4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.34-6.34V8.73a8.19 8.19 0 0 0 4.76 1.52V6.81a4.83 4.83 0 0 1-1-.12z"})}),t4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),n4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M12 1.5C6.202 1.5 1.5 6.202 1.5 12S6.202 22.5 12 22.5 22.5 17.798 22.5 12 17.798 1.5 12 1.5zm5.836 11.1l-5.54 5.232a.45.45 0 0 1-.592 0L6.164 12.6a.45.45 0 0 1 .296-.792h3.24V7.5a.45.45 0 0 1 .45-.45h3.7a.45.45 0 0 1 .45.45v4.308h3.24a.45.45 0 0 1 .296.792z"})}),r4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M12 2L3 9v12a1 1 0 001 1h5a1 1 0 001-1v-5a2 2 0 014 0v5a1 1 0 001 1h5a1 1 0 001-1V9l-9-7z"})}),i4e=[{key:"about_website",label:"Website",icon:l.jsx(w2,{className:"w-[22px] h-[22px]"}),hoverColor:"#D4AF37"},{key:"about_google_business",label:"Google",icon:l.jsx(ov,{className:"w-[22px] h-[22px]"}),hoverColor:"#4285F4"},{key:"about_facebook",label:"Facebook",icon:l.jsx(n2e,{className:"w-[22px] h-[22px]"}),hoverColor:"#1877F2"},{key:"about_instagram",label:"Instagram",icon:l.jsx(O3,{className:"w-[22px] h-[22px]"}),hoverColor:"#E1306C",hoverStyle:{background:"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}},{key:"about_linkedin",label:"LinkedIn",icon:l.jsx(h2e,{className:"w-[22px] h-[22px]"}),hoverColor:"#0A66C2"},{key:"about_youtube",label:"YouTube",icon:l.jsx(Ore,{className:"w-[22px] h-[22px]"}),hoverColor:"#FF0000"},{key:"about_x",label:"X",icon:l.jsx(t4e,{}),hoverColor:"#FFFFFF"},{key:"about_tiktok",label:"TikTok",icon:l.jsx(e4e,{}),hoverColor:"#00F2EA"},{key:"about_zillow",label:"Zillow",icon:l.jsx(n4e,{}),hoverColor:"#006AFF"},{key:"about_realtor",label:"Realtor",icon:l.jsx(r4e,{}),hoverColor:"#D92228"}],s4e=()=>{const{configMap:e,isLoading:t}=oa(),[n,r]=C.useState(null);if(t)return null;const i=i4e.filter(s=>e[s.key]);return i.length===0?null:l.jsxs("div",{className:"relative bg-primary-foreground/[0.03]",children:[l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/60 to-transparent"}),l.jsx("div",{className:"py-10 md:py-14",children:l.jsxs("div",{className:"container-page flex flex-col items-center gap-7 md:gap-8",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"w-12 h-px bg-accent/40"}),l.jsx("span",{className:"text-[10px] tracking-[0.35em] uppercase text-accent/80 font-semibold",children:"Connect With Holden"}),l.jsx("div",{className:"w-12 h-px bg-accent/40"})]}),l.jsx("p",{className:"text-[13px] md:text-sm text-primary-foreground/55 max-w-md leading-relaxed",children:"Follow along for Grand Rapids market updates, listings, and behind-the-scenes from the field."})]}),l.jsx("div",{className:"flex items-center gap-2 md:gap-4 flex-wrap justify-center",children:i.map(s=>{const a=n===s.key;return l.jsxs("a",{href:e[s.key],target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col items-center gap-2.5 transition-all duration-300","aria-label":s.label,onMouseEnter:()=>r(s.key),onMouseLeave:()=>r(null),children:[l.jsx("span",{className:"flex items-center justify-center w-14 h-14 md:w-16 md:h-16 border border-primary-foreground/15 transition-all duration-300",style:{color:a?s.hoverColor:"hsl(var(--primary-foreground) / 0.7)",backgroundColor:a?`${s.hoverColor}1F`:"hsl(var(--primary-foreground) / 0.04)",borderColor:a?`${s.hoverColor}66`:"hsl(var(--primary-foreground) / 0.15)",transform:a?"translateY(-3px)":"translateY(0)",...a&&s.hoverStyle?s.hoverStyle:{}},children:s.icon}),l.jsx("span",{className:"text-[9px] md:text-[10px] tracking-[0.2em] uppercase font-medium transition-all duration-300",style:{color:a?s.hoverColor:"hsl(var(--primary-foreground) / 0.45)"},children:s.label})]},s.key)})})]})}),l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/60 to-transparent"})]})},a4e="/wordmark-on-dark-transparent.svg",o4e=[{name:"Search Homes",href:"/idx"},{name:"Market Pulse",href:"/market-pulse"},{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},{name:"About",href:"/about"},{name:"Contact",href:"/contact"}],l4e=new Set(["buyers","sellers","about"]),d6=()=>{const{data:e}=Wae(),t=(e||[]).filter(r=>!l4e.has(r.slug.toLowerCase().trim())).map(r=>({name:r.name,href:`/${r.slug}`})),n=[...o4e,...t];return l.jsxs("footer",{className:"bg-primary text-primary-foreground",children:[l.jsx(s4e,{}),l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/20 to-transparent"}),l.jsx("div",{className:"py-12 md:py-16",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-8 md:gap-6",children:[l.jsxs("div",{className:"md:col-span-4",children:[l.jsxs("div",{className:"flex items-center gap-4 mb-5",children:[l.jsx("img",{src:Gae,alt:"Holden Richardson",className:"w-14 h-14 rounded-full object-cover object-top border-2 border-accent/30 shrink-0"}),l.jsx("img",{src:a4e,alt:"@HoldenGR",className:"h-8 w-auto"})]}),l.jsx("p",{className:"text-primary-foreground/45 text-[13px] leading-[1.7] max-w-sm",children:"Holden Richardson of 616 Realty LLC specializes in residential properties across the Grand Rapids area's most sought-after communities."})]}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mb-4 font-medium",children:"Quick Links"}),l.jsx("ul",{className:"space-y-2",children:n.map(r=>l.jsx("li",{children:l.jsx(St,{to:r.href,className:"text-[13px] text-primary-foreground/45 hover:text-accent transition-colors duration-300",children:r.name})},r.href))})]}),l.jsxs("div",{className:"md:col-span-3",children:[l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mb-4 font-medium",children:"Contact"}),l.jsxs("ul",{className:"space-y-1.5 text-[13px] text-primary-foreground/45",children:[l.jsx("li",{children:l.jsx("a",{href:"tel:+16164036393",className:"hover:text-accent transition-colors",children:"(616) 403-6393"})}),l.jsx("li",{children:l.jsx("a",{href:"mailto:holden@holdengr.com",className:"hover:text-accent transition-colors",children:"holden@holdengr.com"})}),l.jsx("li",{className:"text-primary-foreground/30 text-[11px] pt-1",children:"License #6501392389"})]}),l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mt-6 mb-3 font-medium",children:"Brokerage"}),l.jsxs("ul",{className:"space-y-1 text-[13px] text-primary-foreground/45",children:[l.jsx("li",{className:"font-medium text-primary-foreground/55",children:"616 Realty LLC"}),l.jsx("li",{children:"1171 Plainfield Ave NE"}),l.jsx("li",{children:"Grand Rapids, MI 49503"}),l.jsx("li",{children:"(616) 272-3707"})]})]}),l.jsxs("div",{className:"md:col-span-3",children:[l.jsx("div",{className:"bg-primary-foreground/10 rounded p-2 w-fit mb-4",children:l.jsx("img",{src:JPe,alt:"Equal Housing Opportunity & Realtor",className:"h-10 w-auto"})}),l.jsx("p",{className:"text-[11px] text-primary-foreground/30 leading-relaxed mb-4",children:"We are committed to the letter and spirit of U.S. policy for equal housing opportunity. We support an affirmative marketing program with no barriers to housing because of race, color, religion, sex, handicap, familial status, or national origin."}),l.jsx("p",{className:"text-[11px] text-primary-foreground/30 leading-relaxed",children:"Information provided is for general purposes only. Listing data is sourced from third parties and may not reflect real-time availability or pricing. Always verify details independently."})]})]}),l.jsxs("div",{className:"border-t border-primary-foreground/[0.06] mt-10 pt-6 flex flex-col md:flex-row justify-between items-center gap-3",children:[l.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 md:gap-3",children:[l.jsxs("p",{className:"text-[11px] text-primary-foreground/25",children:["© ",new Date().getFullYear()," Holden Richardson | 616 Realty LLC. All rights reserved."]}),l.jsx("span",{className:"hidden md:inline text-primary-foreground/15",children:"•"}),l.jsx("a",{href:"https://realsavvy.com",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Site built by RealSavvy"})]}),l.jsxs("div",{className:"flex gap-5",children:[l.jsx(St,{to:"/privacy-policy",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Privacy Policy"}),l.jsx(St,{to:"/terms-of-service",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Terms of Service"}),l.jsx(St,{to:"/accessibility",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Accessibility"})]})]})]})})]})},c4e=()=>{const{configMap:e}=oa(),[t,n]=C.useState(!1),r=e.booking_url,i=e.agent_phone,s=i?`sms:${i.replace(/[^+\d]/g,"")}`:null;return!r&&!s?null:l.jsxs("div",{className:"fixed right-0 bottom-24 z-50 flex flex-col gap-3",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onClick:()=>n(a=>!a),children:[r&&l.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-foreground text-background border-l border-y border-gold/40 shadow-xl rounded-none overflow-hidden transition-all duration-300 hover:bg-foreground/90",children:[l.jsx("div",{className:"flex items-center justify-center w-12 h-12 shrink-0",children:l.jsx(Cl,{className:"w-5 h-5"})}),l.jsx(Cy,{children:t&&l.jsx(vi.span,{initial:{width:0,opacity:0},animate:{width:"auto",opacity:1},exit:{width:0,opacity:0},transition:{duration:.3,ease:[.25,.1,.25,1]},className:"whitespace-nowrap text-sm font-semibold tracking-wide pr-5 overflow-hidden",children:"Book Virtual Meeting With Holden"})})]}),s&&l.jsxs("a",{href:s,className:"flex items-center bg-foreground text-background border-l border-y border-gold/40 shadow-xl rounded-none overflow-hidden transition-all duration-300 hover:bg-foreground/90",children:[l.jsx("div",{className:"flex items-center justify-center w-12 h-12 shrink-0",children:l.jsx(kp,{className:"w-5 h-5"})}),l.jsx(Cy,{children:t&&l.jsx(vi.span,{initial:{width:0,opacity:0},animate:{width:"auto",opacity:1},exit:{width:0,opacity:0},transition:{duration:.3,ease:[.25,.1,.25,1],delay:.05},className:"whitespace-nowrap text-sm font-semibold tracking-wide pr-5 overflow-hidden",children:"Text Holden — Instant Answers"})})]})]})},un=({children:e})=>l.jsxs("div",{className:"min-h-screen flex flex-col",children:[l.jsx(EE,{}),l.jsx("main",{className:"flex-1 pt-20",children:e}),l.jsx(d6,{}),l.jsx(c4e,{})]}),u4e={49503:{city:"Grand Rapids",area:"Heritage Hill / Downtown / Eastown edge",county:"Kent",state:"MI"},49504:{city:"Grand Rapids",area:"West Side / John Ball Park",county:"Kent",state:"MI"},49505:{city:"Grand Rapids",area:"Creston / Northeast",county:"Kent",state:"MI"},49506:{city:"East Grand Rapids",area:"EGR / Eastown / Ottawa Hills",county:"Kent",state:"MI"},49507:{city:"Grand Rapids",area:"Garfield Park / Alger Heights",county:"Kent",state:"MI"},49508:{city:"Grand Rapids",area:"South / Kentwood border",county:"Kent",state:"MI"},49509:{city:"Wyoming",area:"Wyoming",county:"Kent",state:"MI"},49512:{city:"Kentwood",area:"Kentwood / SE",county:"Kent",state:"MI"},49519:{city:"Wyoming",area:"Wyoming SW",county:"Kent",state:"MI"},49525:{city:"Grand Rapids",area:"Northview / North Park",county:"Kent",state:"MI"},49544:{city:"Grand Rapids",area:"Walker / NW",county:"Kent",state:"MI"},49546:{city:"Grand Rapids",area:"Cascade / Forest Hills",county:"Kent",state:"MI"},49548:{city:"Wyoming",area:"Wyoming SE",county:"Kent",state:"MI"},49301:{city:"Ada",area:"Ada / Forest Hills",county:"Kent",state:"MI"},49302:{city:"Alto",area:"Alto",county:"Kent",state:"MI"},49306:{city:"Belmont",area:"Belmont / Rockford edge",county:"Kent",state:"MI"},49315:{city:"Byron Center",area:"Byron Center",county:"Kent",state:"MI"},49316:{city:"Caledonia",area:"Caledonia",county:"Kent",state:"MI"},49321:{city:"Comstock Park",area:"Comstock Park",county:"Kent",state:"MI"},49326:{city:"Cedar Springs",area:"Cedar Springs",county:"Kent",state:"MI"},49331:{city:"Lowell",area:"Lowell",county:"Kent",state:"MI"},49341:{city:"Rockford",area:"Rockford",county:"Kent",state:"MI"},49345:{city:"Sparta",area:"Sparta",county:"Kent",state:"MI"},49351:{city:"Rockford",area:"Rockford",county:"Kent",state:"MI"},49355:{city:"Grand Rapids",area:"Amway HQ area",county:"Kent",state:"MI"},49401:{city:"Allendale",area:"Allendale / GVSU",county:"Ottawa",state:"MI"},49417:{city:"Grand Haven",area:"Grand Haven",county:"Ottawa",state:"MI"},49418:{city:"Allendale Charter Twp",area:"Hudsonville / Allendale",county:"Ottawa",state:"MI"},49423:{city:"Holland",area:"Holland South",county:"Ottawa/Allegan",state:"MI"},49424:{city:"Holland",area:"Holland North",county:"Ottawa",state:"MI"},49426:{city:"Hudsonville",area:"Hudsonville / Jamestown",county:"Ottawa",state:"MI"},49428:{city:"Jenison",area:"Jenison / Georgetown Twp",county:"Ottawa",state:"MI"},49431:{city:"Ludington",area:"Ludington",county:"Mason",state:"MI"},49435:{city:"Marne",area:"Marne",county:"Ottawa",state:"MI"},49441:{city:"Muskegon",area:"Muskegon South",county:"Muskegon",state:"MI"},49442:{city:"Muskegon",area:"Muskegon East",county:"Muskegon",state:"MI"},49445:{city:"North Muskegon",area:"North Muskegon",county:"Muskegon",state:"MI"},49456:{city:"Spring Lake",area:"Spring Lake / Ferrysburg",county:"Ottawa",state:"MI"},49460:{city:"West Olive",area:"West Olive",county:"Ottawa",state:"MI"},49464:{city:"Zeeland",area:"Zeeland",county:"Ottawa",state:"MI"},49010:{city:"Allegan",area:"Allegan",county:"Allegan",state:"MI"},49348:{city:"Shelbyville",area:"Shelbyville / Wayland edge",county:"Allegan",state:"MI"},49323:{city:"Dorr",area:"Dorr",county:"Allegan",state:"MI"},49328:{city:"Hopkins",area:"Hopkins",county:"Allegan",state:"MI"},49344:{city:"Plainwell",area:"Plainwell / Otsego",county:"Allegan",state:"MI"}};function d4e(e){return u4e[e.trim()]??null}function Xae(e){return/^\d{5}$/.test(e.trim())}function h6({compact:e=!1}){const[t,n]=C.useState(""),[r,i]=C.useState("seller"),[s,a]=C.useState(""),o=Ll(),c=u=>{if(u.preventDefault(),!Xae(t)){a("Enter a valid 5-digit ZIP");return}a(""),o(`/market-pulse/${t}?lens=${r}&run=1&t=${Date.now()}`)};return l.jsxs("form",{onSubmit:c,className:`bg-background/95 backdrop-blur-xl border border-border ${e?"p-4":"p-5 md:p-6"} text-foreground shadow-2xl`,children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(tj,{size:14,className:"text-primary"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-primary",children:"Market Pulse"})]}),l.jsx("div",{className:"text-sm text-foreground/80 mb-4",children:"Your ZIP. My take. Real numbers — instant."}),l.jsxs("div",{className:"flex border border-border mb-3",children:[l.jsx("button",{type:"button",onClick:()=>i("seller"),className:`flex-1 px-3 py-2 text-[10px] uppercase tracking-[0.2em] font-medium transition-colors ${r==="seller"?"bg-foreground text-background":"text-foreground/70 hover:bg-muted"}`,children:"I'm a Seller"}),l.jsx("button",{type:"button",onClick:()=>i("buyer"),className:`flex-1 px-3 py-2 text-[10px] uppercase tracking-[0.2em] font-medium transition-colors ${r==="buyer"?"bg-foreground text-background":"text-foreground/70 hover:bg-muted"}`,children:"I'm a Buyer"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",inputMode:"numeric",pattern:"\\d{5}",maxLength:5,value:t,onChange:u=>n(u.target.value.replace(/\D/g,"")),placeholder:"49506",className:"flex-1 bg-background border border-border px-3 py-2.5 text-base tabular-nums focus:outline-none focus:ring-1 focus:ring-primary","aria-label":"ZIP code"}),l.jsxs("button",{type:"submit",className:"inline-flex items-center gap-2 px-4 py-2.5 bg-primary text-primary-foreground text-[10px] uppercase tracking-[0.2em] font-medium hover:bg-primary/90 transition-colors",children:["Get Report ",l.jsx(Xa,{size:14})]})]}),s&&l.jsx("p",{className:"text-[11px] text-destructive mt-2",children:s}),l.jsx("p",{className:"text-[10px] text-muted-foreground mt-3",children:"Free · No login · Instant report with calculator + AI chat"})]})}const h4e=()=>{const[e,t]=C.useState(!1);return l.jsxs("section",{className:"relative w-full overflow-hidden bg-secondary",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-secondary via-background to-secondary"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,hsl(var(--gold)/0.08),transparent_60%)]"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_bottom_left,hsl(var(--foreground)/0.04),transparent_55%)]"}),l.jsx("div",{className:"relative z-10 mx-auto max-w-[1400px] px-6 md:px-10 lg:px-14 py-16 md:py-20 lg:py-24",children:l.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 lg:gap-12 items-center",children:[l.jsxs("div",{className:"lg:col-span-7",children:[l.jsxs(vi.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.7,ease:[.5,0,0,1]},children:[l.jsx("div",{className:"text-[10px] md:text-[11px] uppercase tracking-[0.35em] text-accent font-medium mb-5",children:"Grand Rapids Realtor®"}),l.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl xl:text-[5rem] font-bold text-foreground leading-[1.05] mb-6 tracking-tight",children:"Holden Richardson"}),l.jsx("p",{className:"text-base md:text-lg text-muted-foreground font-light max-w-xl mb-8 leading-relaxed",children:"Buyer & seller guides · dynamic home search · personal market reports for every Grand Rapids ZIP."})]}),l.jsx(vi.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.7,delay:.15,ease:[.5,0,0,1]},className:"max-w-md",children:l.jsx(h6,{})}),l.jsxs(vi.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.6,delay:.3,ease:[.5,0,0,1]},className:"flex flex-wrap gap-3 mt-6",children:[l.jsxs(St,{to:"/idx",className:"inline-flex items-center justify-center gap-2 px-5 py-3 border border-foreground/25 text-foreground text-[10px] uppercase tracking-[0.25em] font-medium hover:bg-foreground hover:text-background transition-colors",children:[l.jsx(cE,{size:14})," Search Homes"]}),l.jsxs(St,{to:"/home-valuation",className:"inline-flex items-center justify-center gap-2 px-5 py-3 border border-foreground/25 text-foreground text-[10px] uppercase tracking-[0.25em] font-medium hover:bg-foreground hover:text-background transition-colors",children:[l.jsx(l2e,{size:14})," Home Valuation"]})]})]}),l.jsx("div",{className:"lg:col-span-5",children:l.jsxs(vi.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.9,ease:[.5,0,0,1]},className:"relative",children:[l.jsx("div",{className:"absolute -top-2 -right-2 w-16 h-16 border-t-2 border-r-2 border-accent/60 z-10 pointer-events-none"}),l.jsx("div",{className:"absolute -bottom-2 -left-2 w-16 h-16 border-b-2 border-l-2 border-accent/60 z-10 pointer-events-none"}),l.jsxs("div",{className:"relative aspect-[4/5] lg:aspect-[3/4] w-full overflow-hidden bg-primary border border-border shadow-2xl",children:[l.jsx("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",onCanPlay:()=>t(!0),className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-1000 ${e?"opacity-100":"opacity-0"}`,children:l.jsx("source",{src:"/videos/hero-video.mp4",type:"video/mp4"})}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/40 via-transparent to-transparent pointer-events-none"})]}),l.jsxs("div",{className:"mt-3 flex items-center justify-between text-[10px] uppercase tracking-[0.25em] text-muted-foreground",children:[l.jsx("span",{children:"Grand Rapids · Michigan"}),l.jsx("span",{className:"text-accent",children:"— On the ground"})]})]})})]})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-accent/50 to-transparent"})]})},f4e={up:{y:50,x:0},down:{y:-50,x:0},left:{x:60,y:0},right:{x:-60,y:0}},A4e=(e,t)=>{const n=f4e[t];switch(e){case"slide":return{hidden:{opacity:0,...n,scale:.97},visible:{opacity:1,x:0,y:0,scale:1}};case"scale":return{hidden:{opacity:0,scale:.88},visible:{opacity:1,scale:1}};case"blur":return{hidden:{opacity:0,filter:"blur(10px)",y:30},visible:{opacity:1,filter:"blur(0px)",y:0}};case"lift":return{hidden:{opacity:0,y:60,rotateX:8},visible:{opacity:1,y:0,rotateX:0}};case"fade":default:return{hidden:{opacity:0,...n},visible:{opacity:1,x:0,y:0}}}},_e=({children:e,className:t="",delay:n=0,direction:r="up",variant:i="fade"})=>{const s=C.useRef(null),a=vTe(s,{once:!0,margin:"-80px"}),o=A4e(i,r);return l.jsx(vi.div,{ref:s,initial:"hidden",animate:a?"visible":"hidden",variants:o,transition:{duration:.8,delay:n,ease:[.25,.1,.25,1]},className:t,children:e})},Jae=[{quote:"Holden is a go getter and very responsive. He found us our home in a competitive market. Very knowledgeable and helped us negotiate a home that fit our needs and wants. I recommend Holden to anyone that is selling or wanting to buy a home because of his knowledge and determination to get the job done!",author:"Elvis Hadzalic",role:"Home Buyer"},{quote:"My partner and I were advised by one of our old neighbors to go to 616 Realty when we were ready to purchase a home, and I am so glad that we listened. Holden, Jayda and Beth were all so helpful during the entire process and were always there when we had questions. I am happy to say we have purchased our home and we couldn't have done that without their help!",author:"Idaris Cruz",role:"Home Buyer"},{quote:"Working with Holden was incredibly seamless and efficient. Wonderful advice and feedback to help me reach my ultimate goal! Would easily recommend to anyone who is anxious going into the housing market.",author:"Aleatha Ostrander",role:"Home Buyer"},{quote:"Holden was a pleasure working with on this transaction, his communication was prompt and professional, and they handled every detail with expertise and integrity. A true team player who kept the process smooth from start to finish — I look forward to working together again.",author:"Tristan Seeley",role:"Transaction Partner"},{quote:"This is the first transaction that I have worked with Holden on and I really appreciate his commitment to communication throughout the process. He was very open to what his clients goals were as buyers and allowed me to do the same for the sellers. Together we were able to work through some weather related issues to get to the closing table with minimal fuss. This is what real estate is all about. No ego. No flex. Just being good stewards for our clients.",author:"Julie Reisner",role:"Collaborating Agent"},{quote:"Holden is so helpful and knowledgeable. He really knows how to get stuff done!",author:"Katie T.",role:"Client"}],s_=3,vS=Math.ceil(Jae.length/s_),p4e=()=>{const[e,t]=C.useState(0),n=Jae.slice(e*s_,e*s_+s_);return l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between mb-12 md:mb-16",children:[l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption mb-4 text-xl font-semibold text-accent",children:"Client Stories"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-5xl",children:"What Clients Say"})})]}),vS>1&&l.jsxs("div",{className:"flex gap-2 mt-6 md:mt-0",children:[l.jsx("button",{onClick:()=>t(r=>r-1),disabled:e===0,className:"w-10 h-10 flex items-center justify-center border border-border hover:border-accent hover:text-accent transition-colors disabled:opacity-25 disabled:cursor-not-allowed","aria-label":"Previous reviews",children:l.jsx(vre,{size:20})}),l.jsx("button",{onClick:()=>t(r=>r+1),disabled:e>=vS-1,className:"w-10 h-10 flex items-center justify-center border border-border hover:border-accent hover:text-accent transition-colors disabled:opacity-25 disabled:cursor-not-allowed","aria-label":"Next reviews",children:l.jsx(vc,{size:20})})]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:n.map((r,i)=>l.jsx(_e,{delay:i*.1,children:l.jsxs("div",{className:"bg-background p-8 md:p-10 h-full flex flex-col",children:[l.jsx("div",{className:"flex gap-1 mb-6",children:[...Array(5)].map((s,a)=>l.jsx(M3,{size:16,className:"fill-gold text-gold"},a))}),l.jsxs("blockquote",{className:"text-lg font-serif text-foreground mb-8 flex-1",children:['"',r.quote,'"']}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-foreground",children:r.author}),l.jsx("p",{className:"text-sm text-muted-foreground",children:r.role})]})]})},r.author))}),l.jsxs("div",{className:"flex flex-col items-center gap-6 mt-10",children:[vS>1&&l.jsx("div",{className:"flex justify-center gap-2",children:Array.from({length:vS}).map((r,i)=>l.jsx("button",{onClick:()=>t(i),className:`w-2 h-2 rounded-full transition-colors ${i===e?"bg-accent":"bg-border"}`,"aria-label":`Go to page ${i+1}`},i))}),l.jsx(_e,{delay:.3,children:l.jsxs("a",{href:"https://www.google.com/maps?cid=17099657301143231027",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2",children:["See All Reviews on Google ",l.jsx(ao,{className:"w-4 h-4"})]})})]})]})})};function ht({className:e,...t}){return l.jsx("div",{className:ot("animate-pulse rounded-md bg-muted",e),...t})}const m4e=async()=>{const{data:e,error:t}=await Me.functions.invoke("instagram-feed",{body:{limit:12}});if(t)throw t;return e.media||[]},g4e=()=>{const{data:e,isLoading:t,error:n}=Br({queryKey:["instagram-feed"],queryFn:m4e,staleTime:6e5,retry:0,enabled:!0});return n?(console.error("Instagram feed error:",n),null):l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between mb-12",children:[l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Follow Along"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section",children:"On Instagram"})})]}),l.jsx(_e,{delay:.2,children:l.jsxs("a",{href:"https://instagram.com/holdengr.re",target:"_blank",rel:"noopener noreferrer",className:"mt-6 md:mt-0 inline-flex items-center gap-2 text-caption text-foreground hover:text-gold transition-colors",children:[l.jsx(O3,{size:18}),"@holdengr.re"]})})]}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:t?Array.from({length:12}).map((r,i)=>l.jsx(ht,{className:"aspect-square w-full"},i)):e==null?void 0:e.map((r,i)=>{var s;return l.jsx(_e,{delay:i*.05,children:l.jsxs("a",{href:r.permalink,target:"_blank",rel:"noopener noreferrer",className:"block aspect-square overflow-hidden group relative",children:[r.media_type==="VIDEO"&&l.jsx("div",{className:"absolute top-3 right-3 z-10 bg-background/80 backdrop-blur-sm rounded-full p-2",children:l.jsx(F3,{size:16,className:"text-foreground fill-foreground"})}),r.media_type==="VIDEO"?l.jsx("video",{src:r.media_url,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",muted:!0,playsInline:!0}):l.jsx("img",{src:r.media_url,alt:((s=r.caption)==null?void 0:s.slice(0,100))||"Instagram post",className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy"}),l.jsx("div",{className:"absolute inset-0 bg-foreground/0 group-hover:bg-foreground/20 transition-colors duration-300 flex items-center justify-center",children:l.jsx(O3,{size:28,className:"text-background opacity-0 group-hover:opacity-100 transition-opacity duration-300"})})]})},r.id)})})]})})},y4e="https://khmmwvmdbhaplcfcndjx.supabase.co",TE=`${y4e}/functions/v1/blog-api`;async function IE(){const{data:{session:e}}=await Me.auth.getSession(),t={"Content-Type":"application/json"};return e!=null&&e.access_token&&(t.Authorization=`Bearer ${e.access_token}`),t}function Zae(e){return Br({queryKey:["blog-posts","published",e],queryFn:async()=>{let t=Me.from("blog_posts").select("*").eq("published",!0).order("published_at",{ascending:!1});e&&(t=t.limit(e));const{data:n,error:r}=await t;if(r)throw r;return n}})}function v4e(e){return Br({queryKey:["blog-post",e],queryFn:async()=>{const{data:t,error:n}=await Me.from("blog_posts").select("*").eq("slug",e).eq("published",!0).maybeSingle();if(n)throw n;return t},enabled:!!e})}function x4e(){return Br({queryKey:["blog-posts","all"],queryFn:async()=>{const e=await IE(),t=await fetch(TE,{headers:e});if(!t.ok)throw new Error("Failed to fetch posts");return t.json()}})}function w4e(){const e=As();return Ms({mutationFn:async t=>{const n=await IE(),r=await fetch(TE,{method:"POST",headers:n,body:JSON.stringify(t)});if(!r.ok){const i=await r.json();throw new Error(i.error||"Failed to create post")}return r.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["blog-posts"]})}})}function b4e(){const e=As();return Ms({mutationFn:async({slug:t,data:n})=>{const r=await IE(),i=await fetch(`${TE}/${t}`,{method:"PUT",headers:r,body:JSON.stringify(n)});if(!i.ok){const s=await i.json();throw new Error(s.error||"Failed to update post")}return i.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["blog-posts"]}),e.invalidateQueries({queryKey:["blog-post"]})}})}function C4e(){const e=As();return Ms({mutationFn:async t=>{const n=await IE(),r=await fetch(`${TE}/${t}`,{method:"DELETE",headers:n});if(!r.ok){const i=await r.json();throw new Error(i.error||"Failed to delete post")}return r.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["blog-posts"]})}})}const S4e=()=>{const{data:e,isLoading:t}=Zae(3);return t?l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"text-center mb-12",children:[l.jsx(ht,{className:"h-4 w-32 mx-auto mb-4"}),l.jsx(ht,{className:"h-12 w-64 mx-auto"})]}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[...Array(3)].map((n,r)=>l.jsxs("div",{className:"bg-card border border-border",children:[l.jsx(ht,{className:"aspect-[16/10] w-full"}),l.jsxs("div",{className:"p-6 space-y-3",children:[l.jsx(ht,{className:"h-4 w-24"}),l.jsx(ht,{className:"h-6 w-3/4"}),l.jsx(ht,{className:"h-16 w-full"})]})]},r))})]})}):!e||e.length===0?null:l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-12 md:mb-16",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Latest Insights"}),l.jsx("h2",{className:"heading-section",children:"From the Blog"})]})}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:e.map((n,r)=>{const i=n.published_at?new Date(n.published_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"";return l.jsx(_e,{delay:r*.1,children:l.jsx(St,{to:`/blog/${n.slug}`,className:"group block h-full",children:l.jsxs("article",{className:"bg-card border border-border h-full flex flex-col transition-all duration-500 hover:shadow-lg",children:[n.featured_image&&l.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:l.jsx("img",{src:n.featured_image,alt:n.title,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"})}),l.jsxs("div",{className:"p-6 flex flex-col flex-1",children:[i&&l.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mb-3",children:[l.jsx(Cl,{className:"w-3 h-3"}),i]}),l.jsx("h3",{className:"heading-card text-lg mb-3 group-hover:text-accent transition-colors line-clamp-2",children:n.title}),n.excerpt&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 flex-1",children:n.excerpt}),l.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:l.jsxs("span",{className:"inline-flex items-center gap-2 text-xs uppercase tracking-wider font-medium text-foreground group-hover:text-accent transition-colors",children:["Read More",l.jsx(Xa,{className:"w-3 h-3 transition-transform group-hover:translate-x-1"})]})})]})]})})},n.id)})}),l.jsx(_e,{children:l.jsx("div",{className:"text-center mt-12",children:l.jsx(St,{to:"/blog",className:"btn-outline-primary",children:"View All Posts"})})})]})})},k4e=["EfQb_jBmqmA","tiZKi3zaFLQ","HMci7juGyhQ"],_4e=()=>l.jsx("section",{className:"py-16 md:py-24 bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{variant:"blur",children:l.jsx("p",{className:"text-caption mb-4 text-center text-accent text-xl font-semibold",children:"Video"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-center mb-4 text-5xl",children:"Holden's Youtube Content"})}),l.jsx(_e,{delay:.15,children:l.jsx("p",{className:"text-body text-muted-foreground text-center max-w-2xl mx-auto mb-10",children:"Quick, straight-to-the-point videos covering real estate tips, market updates, home-buying advice, and everything you need to know about making your next move in Grand Rapids."})}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6 max-w-5xl mx-auto",children:k4e.map((e,t)=>l.jsx(_e,{delay:.15+t*.1,variant:"scale",children:l.jsx("div",{className:"aspect-[9/16] w-full overflow-hidden rounded-md",children:l.jsx("iframe",{src:`https://www.youtube.com/embed/${e}`,title:`YouTube Short ${t+1}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full border-0",loading:"lazy"})})},e))}),l.jsx(_e,{delay:.5,children:l.jsx("div",{className:"text-center mt-10",children:l.jsxs("a",{href:"https://www.youtube.com/@HoldenGR.Michigan/shorts",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2",children:["See More on YouTube ",l.jsx(ao,{className:"w-4 h-4"})]})})})]})}),j4e="/assets/agent-portrait-DcetkHNl.jpg";var PE="Collapsible",[B4e,eoe]=fs(PE),[N4e,f6]=B4e(PE),toe=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...o}=e,[c,u]=lo({prop:r,defaultProp:i??!1,onChange:a,caller:PE});return l.jsx(N4e,{scope:n,disabled:s,contentId:kl(),open:c,onOpenToggle:C.useCallback(()=>u(d=>!d),[u]),children:l.jsx(_t.div,{"data-state":g6(c),"data-disabled":s?"":void 0,...o,ref:t})})});toe.displayName=PE;var noe="CollapsibleTrigger",A6=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=f6(noe,n);return l.jsx(_t.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":g6(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:at(e.onClick,i.onOpenToggle)})});A6.displayName=noe;var p6="CollapsibleContent",m6=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=f6(p6,e.__scopeCollapsible);return l.jsx(aa,{present:n||i.open,children:({present:s})=>l.jsx(E4e,{...r,ref:t,present:s})})});m6.displayName=p6;var E4e=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,a=f6(p6,n),[o,c]=C.useState(r),u=C.useRef(null),d=sn(t,u),h=C.useRef(0),A=h.current,f=C.useRef(0),p=f.current,m=a.open||o,g=C.useRef(m),y=C.useRef(void 0);return C.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),Zi(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();h.current=x.height,f.current=x.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),c(r)}},[a.open,r]),l.jsx(_t.div,{"data-state":g6(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":A?`${A}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:m&&i})});function g6(e){return e?"open":"closed"}var roe=toe,T4e=A6,I4e=m6,P4e=C.createContext(void 0);function f0(e){const t=C.useContext(P4e);return e||t||"ltr"}var jc="Accordion",O4e=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[y6,F4e,M4e]=aE(jc),[OE,PTt]=fs(jc,[M4e,eoe]),v6=eoe(),ioe=re.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,s=r;return l.jsx(y6.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(U4e,{...s,ref:t}):l.jsx(D4e,{...i,ref:t})})});ioe.displayName=jc;var[soe,L4e]=OE(jc),[aoe,R4e]=OE(jc,{collapsible:!1}),D4e=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:s=!1,...a}=e,[o,c]=lo({prop:n,defaultProp:r??"",onChange:i,caller:jc});return l.jsx(soe,{scope:e.__scopeAccordion,value:re.useMemo(()=>o?[o]:[],[o]),onItemOpen:c,onItemClose:re.useCallback(()=>s&&c(""),[s,c]),children:l.jsx(aoe,{scope:e.__scopeAccordion,collapsible:s,children:l.jsx(ooe,{...a,ref:t})})})}),U4e=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=e,[a,o]=lo({prop:n,defaultProp:r??[],onChange:i,caller:jc}),c=re.useCallback(d=>o((h=[])=>[...h,d]),[o]),u=re.useCallback(d=>o((h=[])=>h.filter(A=>A!==d)),[o]);return l.jsx(soe,{scope:e.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:l.jsx(aoe,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(ooe,{...s,ref:t})})})}),[H4e,FE]=OE(jc),ooe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:s="vertical",...a}=e,o=re.useRef(null),c=sn(o,t),u=F4e(n),h=f0(i)==="ltr",A=at(e.onKeyDown,f=>{var B;if(!O4e.includes(f.key))return;const p=f.target,m=u().filter(E=>{var P;return!((P=E.ref.current)!=null&&P.disabled)}),g=m.findIndex(E=>E.ref.current===p),y=m.length;if(g===-1)return;f.preventDefault();let v=g;const x=0,b=y-1,w=()=>{v=g+1,v>b&&(v=x)},k=()=>{v=g-1,v<x&&(v=b)};switch(f.key){case"Home":v=x;break;case"End":v=b;break;case"ArrowRight":s==="horizontal"&&(h?w():k());break;case"ArrowDown":s==="vertical"&&w();break;case"ArrowLeft":s==="horizontal"&&(h?k():w());break;case"ArrowUp":s==="vertical"&&k();break}const j=v%y;(B=m[j].ref.current)==null||B.focus()});return l.jsx(H4e,{scope:n,disabled:r,direction:i,orientation:s,children:l.jsx(y6.Slot,{scope:n,children:l.jsx(_t.div,{...a,"data-orientation":s,ref:c,onKeyDown:r?void 0:A})})})}),wj="AccordionItem",[Q4e,x6]=OE(wj),loe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,s=FE(wj,n),a=L4e(wj,n),o=v6(n),c=kl(),u=r&&a.value.includes(r)||!1,d=s.disabled||e.disabled;return l.jsx(Q4e,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(roe,{"data-orientation":s.orientation,"data-state":Aoe(u),...o,...i,ref:t,disabled:d,open:u,onOpenChange:h=>{h?a.onItemOpen(r):a.onItemClose(r)}})})});loe.displayName=wj;var coe="AccordionHeader",uoe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=FE(jc,n),s=x6(coe,n);return l.jsx(_t.h3,{"data-orientation":i.orientation,"data-state":Aoe(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});uoe.displayName=coe;var zF="AccordionTrigger",doe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=FE(jc,n),s=x6(zF,n),a=R4e(zF,n),o=v6(n);return l.jsx(y6.ItemSlot,{scope:n,children:l.jsx(T4e,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...o,...r,ref:t})})});doe.displayName=zF;var hoe="AccordionContent",foe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=FE(jc,n),s=x6(hoe,n),a=v6(n);return l.jsx(I4e,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});foe.displayName=hoe;function Aoe(e){return e?"open":"closed"}var $4e=ioe,z4e=loe,V4e=uoe,poe=doe,moe=foe;const Pf=$4e,Ka=C.forwardRef(({className:e,...t},n)=>l.jsx(z4e,{ref:n,className:ot("border-b",e),...t}));Ka.displayName="AccordionItem";const qa=C.forwardRef(({className:e,children:t,...n},r)=>l.jsx(V4e,{className:"flex",children:l.jsxs(poe,{ref:r,className:ot("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,l.jsx(yc,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));qa.displayName=poe.displayName;const Wa=C.forwardRef(({className:e,children:t,...n},r)=>l.jsx(moe,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:l.jsx("div",{className:ot("pb-4 pt-0",e),children:t})}));Wa.displayName=moe.displayName;const G9=[{question:"Who is Holden Richardson?",answer:"Holden Richardson is a licensed Realtor® with 616 Realty LLC, serving the Grand Rapids area. With over 11 years in the business and more than 150 homes sold, Holden is known for his honest, direct approach and deep knowledge of the local market."},{question:"What areas does Holden serve?",answer:"Holden primarily serves the greater Grand Rapids area, including East Grand Rapids, Ada, Cascade, Forest Hills, Rockford, Kentwood, Wyoming, and the surrounding West Michigan communities."},{question:"Does Holden work with both buyers and sellers?",answer:"Yes. Whether you're buying your first home, upgrading to a larger space, downsizing, or selling a property, Holden provides full-service representation tailored to your situation and goals."},{question:"What makes Holden different from other real estate agents?",answer:"Holden takes an education-first approach. He focuses on giving clients the information and market knowledge they need to make confident decisions — without pressure or sales tactics. His deep local expertise means he can often identify the right fit for a client even before they fully see it themselves."},{question:"How can I get a free home valuation?",answer:"You can get a complimentary, AI-powered home valuation through Holden's Homebot portal. Just enter your address on the Home Valuation page, and you'll receive an instant estimate plus ongoing monthly updates on your home's value, equity, and local market trends."},{question:"Does Holden offer virtual consultations?",answer:"Absolutely. You can book a virtual meeting directly through Holden's website. He also offers phone consultations, email support, and in-person meetings — whichever works best for you."},{question:"What should I expect when working with Holden?",answer:"Expect straightforward communication, market insights backed by real data, and a hands-on approach from start to close. Holden keeps his clients informed at every step and is known for being highly responsive and easy to reach."},{question:"How do I get started?",answer:"The easiest way to get started is to reach out through the Contact page, book a virtual meeting, or give Holden a call at (616) 403-6393. There's no pressure — even if you're just exploring your options, Holden is happy to help."}],K4e=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Holden Richardson | Grand Rapids Real Estate Agent"}),l.jsx("meta",{name:"description",content:"Holden Richardson — Grand Rapids area real estate agent. Buy or sell homes in Grand Rapids, East Grand Rapids, Ada, and beyond."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/"}),l.jsx("meta",{property:"og:title",content:"Holden Richardson | Grand Rapids Real Estate Agent"}),l.jsx("meta",{property:"og:description",content:"Grand Rapids area real estate — buy or sell homes with Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Holden Richardson | Grand Rapids Real Estate Agent"}),l.jsx("meta",{name:"twitter:description",content:"Grand Rapids area real estate — buy or sell homes with Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage","@id":"https://www.holdengr.com/#faq",mainEntityOfPage:{"@type":"WebPage","@id":"https://www.holdengr.com/"},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:G9.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))})})]}),l.jsxs("div",{children:[l.jsx("div",{className:"-mt-20",children:l.jsx(h4e,{})}),l.jsx("section",{className:"py-12 md:py-16 bg-background border-b border-border",children:l.jsx("div",{className:"container-page",children:l.jsx(_e,{children:l.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[l.jsxs("div",{className:"max-w-2xl",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-2 text-xs font-semibold",children:"Members Only"}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-semibold text-foreground mb-2",children:"The Off-Market List"}),l.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"An invite-only network for buyers and sellers who want first look at off-market opportunities in Grand Rapids — before they ever hit the MLS."})]}),l.jsxs("div",{className:"flex gap-3 shrink-0",children:[l.jsx(St,{to:"/list/benefits",className:"btn-outline-primary",children:"Learn More"}),l.jsx(St,{to:"/list",className:"inline-flex items-center justify-center px-6 py-3 bg-accent text-accent-foreground text-sm font-medium uppercase tracking-widest hover:opacity-90 transition-opacity",children:"Join the List"})]})]})})})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_auto] gap-8 lg:gap-12 items-center",children:[l.jsxs("div",{className:"text-left lg:max-w-xl",children:[l.jsx(_e,{variant:"blur",children:l.jsx("p",{className:"text-caption mb-6 text-xl text-accent text-left font-semibold",children:"GRAND RAPIDS AREA REAL ESTATE"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-8 text-5xl",children:"Helping You Make Your Next Move in Grand Rapids"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-muted-foreground mb-4",children:"Grand Rapids is a city of neighborhoods — each with its own character, charm, and sense of community. Whether you've outgrown your first home and are ready for more space, or you're looking to simplify and find the perfect fit for your next chapter, Holden Richardson is here to help you navigate the move with confidence."})}),l.jsx(_e,{delay:.25,children:l.jsx("p",{className:"text-body text-muted-foreground mb-10",children:"With deep knowledge of communities across the greater Grand Rapids area — from established city neighborhoods to growing suburbs — Holden understands that the right home isn't just about square footage. It's about finding the neighborhood, the lifestyle, and the future that fits you. That personal, hands-on approach is what sets him apart."})}),l.jsx(_e,{delay:.3,children:l.jsx(St,{to:"/about",className:"btn-outline-primary",children:"Learn More About Holden"})})]}),l.jsx(_e,{delay:.2,variant:"blur",children:l.jsx("div",{className:"hidden lg:block",children:l.jsx("img",{alt:"Grand Rapids cityscape",className:"w-80 h-80 xl:w-96 xl:h-96 rounded-full shadow-lg border-4 border-accent/20 object-cover",loading:"lazy",src:"/lovable-uploads/8cc794d4-fc62-47ec-a9e1-a66c0728adf0.png"})})})]})})}),l.jsx(_4e,{}),l.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-10",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3 text-xl font-semibold",children:"Common Questions"}),l.jsx("h2",{className:"font-serif text-2xl text-foreground md:text-5xl font-semibold",children:"What You Need to Know"})]})}),l.jsx(_e,{delay:.1,children:l.jsx(Pf,{type:"single",collapsible:!0,className:"space-y-4 max-w-4xl mx-auto",children:G9.map((e,t)=>l.jsxs(Ka,{value:`faq-${t}`,className:"border border-border/60 px-6 md:px-8 transition-all duration-300 bg-background shadow-md shadow-foreground/[0.06] hover:shadow-lg hover:shadow-foreground/[0.08]",children:[l.jsx(qa,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:e.question}),l.jsx(Wa,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:e.answer})]},t))})})]})}),l.jsx(p4e,{}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-center",children:[l.jsx(_e,{direction:"left",variant:"slide",children:l.jsx("div",{className:"relative",children:l.jsx("img",{src:j4e,alt:"Holden Richardson",className:"w-full aspect-[3/4] object-cover",loading:"lazy"})})}),l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption mb-4 text-xl font-semibold text-accent",children:"Meet Holden Richardson"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-6 text-5xl",children:"Local Roots. Personal Approach. Real Results."})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-muted-foreground mb-6",children:"Holden Richardson isn't just a Realtor® — he's someone who genuinely knows Grand Rapids. Born and raised in the area, he brings a firsthand understanding of what makes each community unique, from the energy of downtown to the quiet streets of the surrounding suburbs. That local perspective means he doesn't just help you find a house — he helps you find your neighborhood."})}),l.jsx(_e,{delay:.3,children:l.jsx("p",{className:"text-body text-muted-foreground mb-8",children:"Licensed with 616 Realty LLC, Holden is known for his responsiveness, straightforward communication, and a hands-on approach that keeps clients informed and confident at every step. Whether you're a first-time buyer stepping up, a growing family looking for more space, or ready to downsize into something that fits your next chapter — Holden makes the process feel simple, personal, and stress-free."})}),l.jsx(_e,{delay:.4,children:l.jsx(St,{to:"/about",className:"btn-outline-primary",children:"Read Full Bio"})})]})]})})}),l.jsx(S4e,{}),l.jsx(g4e,{}),l.jsx("section",{className:"py-24 md:py-32 bg-foreground text-background",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx(_e,{variant:"lift",children:l.jsx("p",{className:"text-caption text-background/60 mb-4",children:"Ready to Find Your Dream Home?"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-background mb-8 text-5xl",children:"Let's Start the Conversation"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-background/70 max-w-2xl mx-auto mb-10",children:"Whether you're buying, selling, or simply exploring the market, Holden is here to guide you every step of the way."})}),l.jsx(_e,{delay:.3,children:l.jsx(St,{to:"/contact",className:"btn-outline-inverse",children:"Contact Holden"})})]})})]})]}),q4e=({image:e,title:t,location:n,price:r,status:i="For Sale",beds:s,baths:a,sqft:o,index:c=0,listingId:u,photos:d,description:h})=>{const A=u?`/properties/${u}`:"/properties",f={image:e,title:t,location:n,price:r,status:i,beds:s,baths:a,sqft:o,photos:d,description:h};return l.jsx(vi.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.8,delay:c*.1,ease:[.5,0,0,1]},children:l.jsxs(St,{to:A,state:f,className:"property-card block",children:[l.jsxs("div",{className:"relative overflow-hidden aspect-[4/3]",children:[l.jsx(vi.img,{src:e,alt:t,className:"w-full h-full object-cover",whileHover:{scale:1.05},transition:{duration:.6,ease:[.5,0,0,1]}}),l.jsx("div",{className:"property-card-overlay"}),l.jsx("div",{className:"absolute top-4 left-4",children:l.jsx("span",{className:"text-caption px-3 py-1.5 bg-background/90 text-foreground text-xs",children:i})})]}),l.jsxs("div",{className:"pt-5",children:[l.jsx("p",{className:"text-gold text-lg md:text-xl font-serif mb-1",children:r}),l.jsx("h3",{className:"heading-card text-foreground mb-1",children:t}),l.jsx("p",{className:"text-muted-foreground text-sm",children:n}),(s>0||a>0||o)&&l.jsxs("div",{className:"flex gap-4 mt-3 text-sm text-muted-foreground",children:[s>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(pre,{className:"w-4 h-4"}),s," Beds"]}),a>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(tU,{className:"w-4 h-4"}),a," Baths"]}),o&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Ere,{className:"w-4 h-4"}),o," Sq Ft"]})]})]})]})})};var fP="rovingFocusGroup.onEntryFocus",W4e={bubbles:!1,cancelable:!0},B2="RovingFocusGroup",[VF,goe,G4e]=aE(B2),[Y4e,ME]=fs(B2,[G4e]),[X4e,J4e]=Y4e(B2),yoe=C.forwardRef((e,t)=>l.jsx(VF.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(VF.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Z4e,{...e,ref:t})})}));yoe.displayName=B2;var Z4e=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,A=C.useRef(null),f=sn(t,A),p=f0(s),[m,g]=lo({prop:a,defaultProp:o??null,onChange:c,caller:B2}),[y,v]=C.useState(!1),x=Yi(u),b=goe(n),w=C.useRef(!1),[k,j]=C.useState(0);return C.useEffect(()=>{const B=A.current;if(B)return B.addEventListener(fP,x),()=>B.removeEventListener(fP,x)},[x]),l.jsx(X4e,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:m,onItemFocus:C.useCallback(B=>g(B),[g]),onItemShiftTab:C.useCallback(()=>v(!0),[]),onFocusableItemAdd:C.useCallback(()=>j(B=>B+1),[]),onFocusableItemRemove:C.useCallback(()=>j(B=>B-1),[]),children:l.jsx(_t.div,{tabIndex:y||k===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:at(e.onMouseDown,()=>{w.current=!0}),onFocus:at(e.onFocus,B=>{const E=!w.current;if(B.target===B.currentTarget&&E&&!y){const P=new CustomEvent(fP,W4e);if(B.currentTarget.dispatchEvent(P),!P.defaultPrevented){const T=b().filter(H=>H.focusable),N=T.find(H=>H.active),F=T.find(H=>H.id===m),U=[N,F,...T].filter(Boolean).map(H=>H.ref.current);woe(U,d)}}w.current=!1}),onBlur:at(e.onBlur,()=>v(!1))})})}),voe="RovingFocusGroupItem",xoe=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...o}=e,c=kl(),u=s||c,d=J4e(voe,n),h=d.currentTabStopId===u,A=goe(n),{onFocusableItemAdd:f,onFocusableItemRemove:p,currentTabStopId:m}=d;return C.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),l.jsx(VF.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:l.jsx(_t.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...o,ref:t,onMouseDown:at(e.onMouseDown,g=>{r?d.onItemFocus(u):g.preventDefault()}),onFocus:at(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:at(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=nOe(g,d.orientation,d.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=A().filter(b=>b.focusable).map(b=>b.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const b=x.indexOf(g.currentTarget);x=d.loop?rOe(x,b+1):x.slice(b+1)}setTimeout(()=>woe(x))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:m!=null}):a})})});xoe.displayName=voe;var eOe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tOe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nOe(e,t,n){const r=tOe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return eOe[r]}function woe(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rOe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var boe=yoe,Coe=xoe,LE="Tabs",[iOe,OTt]=fs(LE,[ME]),Soe=ME(),[sOe,w6]=iOe(LE),koe=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:c="automatic",...u}=e,d=f0(o),[h,A]=lo({prop:r,onChange:i,defaultProp:s??"",caller:LE});return l.jsx(sOe,{scope:n,baseId:kl(),value:h,onValueChange:A,orientation:a,dir:d,activationMode:c,children:l.jsx(_t.div,{dir:d,"data-orientation":a,...u,ref:t})})});koe.displayName=LE;var _oe="TabsList",joe=C.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=w6(_oe,n),a=Soe(n);return l.jsx(boe,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(_t.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});joe.displayName=_oe;var Boe="TabsTrigger",Noe=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=w6(Boe,n),o=Soe(n),c=Ioe(a.baseId,r),u=Poe(a.baseId,r),d=r===a.value;return l.jsx(Coe,{asChild:!0,...o,focusable:!i,active:d,children:l.jsx(_t.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:t,onMouseDown:at(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:at(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:at(e.onFocus,()=>{const h=a.activationMode!=="manual";!d&&!i&&h&&a.onValueChange(r)})})})});Noe.displayName=Boe;var Eoe="TabsContent",Toe=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=w6(Eoe,n),c=Ioe(o.baseId,r),u=Poe(o.baseId,r),d=r===o.value,h=C.useRef(d);return C.useEffect(()=>{const A=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(A)},[]),l.jsx(aa,{present:i||d,children:({present:A})=>l.jsx(_t.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!A,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:A&&s})})});Toe.displayName=Eoe;function Ioe(e,t){return`${e}-trigger-${t}`}function Poe(e,t){return`${e}-content-${t}`}var aOe=koe,Ooe=joe,Foe=Noe,Moe=Toe;const ym=aOe,Kf=C.forwardRef(({className:e,...t},n)=>l.jsx(Ooe,{ref:n,className:ot("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Kf.displayName=Ooe.displayName;const $n=C.forwardRef(({className:e,...t},n)=>l.jsx(Foe,{ref:n,className:ot("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",e),...t}));$n.displayName=Foe.displayName;const zn=C.forwardRef(({className:e,...t},n)=>l.jsx(Moe,{ref:n,className:ot("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));zn.displayName=Moe.displayName;const oOe="https://api.realsavvy.com/api/v3/listings/search",lOe="https://api.realsavvy.com/api/v3/suggestions",b6="eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",cOe=async e=>{const t=await fetch(`${lOe}?ids[]=${e}`,{method:"GET",headers:{Authorization:`Bearer ${b6}`,"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`Failed to fetch suggestion data: ${t.status}`),null)},uOe=e=>{if(!(e!=null&&e.data)||e.data.length===0)return null;const t=e.data[0],n=t.attributes||{};return[{resource_type:t.type||"areas",resource_id:t.id,resource_label:n.name||n.label||"",resource_sub_type:n.sub_type||"place",type:"geo_shape",value:{suggestion_id:t.id,geometry:n.geometry,bounding_box:n.bounding_box}}]},dOe=async e=>{const t=await fetch(oOe,{method:"POST",headers:{Authorization:`Bearer ${b6}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()},hOe=async(e,t)=>{if(t){const n=await cOe(t),r=uOe(n);r&&(e={...e,filter:{...e.filter,suggestion:{value:r}}})}return dOe(e)},fOe=(e,t=1,n=12,r)=>{const i={filter:e,market_id:null,page:{number:t,size:n},sort:"+price_in_dollars"};return Br({queryKey:["listings",JSON.stringify(e),t,n,r],queryFn:()=>hOe(i,r),staleTime:5*60*1e3})},AOe=async e=>{const t=await fetch(`https://api.realsavvy.com/api/v3/listings/${e}`,{method:"GET",headers:{Authorization:`Bearer ${b6}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()},pOe=e=>Br({queryKey:["listing",e],queryFn:()=>AOe(e),enabled:!!e,staleTime:5*60*1e3}),Loe=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e),bj=e=>new Intl.NumberFormat("en-US").format(e),Y9=({filter:e,suggestionId:t})=>{var s;const{data:n,isLoading:r,error:i}=fOe(e,1,12,t);return r?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 md:gap-10",children:Array.from({length:6}).map((a,o)=>l.jsxs("div",{className:"space-y-4",children:[l.jsx(ht,{className:"aspect-[4/3] w-full"}),l.jsx(ht,{className:"h-6 w-3/4"}),l.jsx(ht,{className:"h-4 w-1/2"})]},o))}):i?l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"Failed to load properties. Please try again later."})}):(s=n==null?void 0:n.data)!=null&&s.length?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 md:gap-10",children:n.data.map((a,o)=>{const c=a.attributes,u=c.square_feet?bj(c.square_feet):c.lot_square_feet?bj(parseFloat(c.lot_square_feet)):void 0;return l.jsx(q4e,{listingId:a.id,image:c.photo_urls[0]||"/placeholder.svg",title:c.title,location:c.subtitle,price:Loe(c.price_in_dollars),status:c.listing_status,beds:c.bedrooms,baths:c.bathrooms,sqft:u,index:o,photos:c.photo_urls,description:c.description||void 0},a.id)})}):l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"No properties found."})})},mOe=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Properties | Grand Rapids Homes for Sale | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Browse exclusive Grand Rapids area properties — homes for sale in East Grand Rapids, Ada, Cascade, and beyond with Holden Richardson."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/properties"}),l.jsx("meta",{property:"og:title",content:"Properties | Grand Rapids Homes for Sale"}),l.jsx("meta",{property:"og:description",content:"Browse Grand Rapids area properties with Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/properties"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Properties | Grand Rapids Homes for Sale"}),l.jsx("meta",{name:"twitter:description",content:"Browse Grand Rapids area properties with Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"-mt-20 pt-32 md:pt-40 pb-20 md:pb-28 bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Exclusive Portfolio"})}),l.jsx(_e,{delay:.1,children:l.jsx("h1",{className:"heading-display max-w-4xl",children:"Properties"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-muted-foreground max-w-2xl mt-6",children:"Explore our curated collection of the finest properties in the Grand Rapids area's most desirable neighborhoods."})})]})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs(ym,{defaultValue:"active",className:"w-full",children:[l.jsx(_e,{children:l.jsxs(Kf,{className:"bg-transparent h-auto p-0 border-b border-border rounded-none w-full justify-start gap-8 mb-12 md:mb-16",children:[l.jsx($n,{value:"active",className:"text-caption text-muted-foreground data-[state=active]:text-foreground data-[state=active]:border-b-2 data-[state=active]:border-foreground bg-transparent rounded-none pb-4 px-0 data-[state=active]:shadow-none",children:"Current"}),l.jsx($n,{value:"sold",className:"text-caption text-muted-foreground data-[state=active]:text-foreground data-[state=active]:border-b-2 data-[state=active]:border-foreground bg-transparent rounded-none pb-4 px-0 data-[state=active]:shadow-none",children:"Past Transactions"})]})}),l.jsx(zn,{value:"active",className:"mt-0",children:l.jsx(Y9,{filter:{listing_status:{value:["Active"]},agent_profile:{"michigan-regional-information-center-llc":{key:["grich2990"],relationships:["listing"]}}}})}),l.jsx(zn,{value:"sold",className:"mt-0",children:l.jsx(Y9,{filter:{listing_status:{value:["Sold"]},agent_profile:{"michigan-regional-information-center-llc":{key:["grich2990"],relationships:["listing"]}}}})})]})})}),l.jsx("section",{className:"py-20 md:py-28 bg-secondary",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx(_e,{children:l.jsx("h2",{className:"heading-section mb-6",children:"Looking for Something Specific?"})}),l.jsx(_e,{delay:.1,children:l.jsx("p",{className:"text-body text-muted-foreground max-w-2xl mx-auto mb-8",children:"Many of our finest properties are sold privately. Contact Holden to discuss your specific requirements and gain access to exclusive off-market listings."})}),l.jsx(_e,{delay:.2,children:l.jsx("a",{href:"/contact",className:"btn-outline-primary",children:"Contact Holden"})})]})})]}),C6=v2("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"}}),xe=C.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?e1e:"button";return l.jsx(a,{className:ot(C6({variant:t,size:n,className:e})),ref:s,...i})});xe.displayName="Button";const gOe=()=>{var A,f;const{id:e}=gm(),n=co().state,{data:r,isLoading:i,error:s}=pOe(e),{configMap:a}=oa(),o=a.booking_url;if(i)return l.jsxs(un,{children:[l.jsx("section",{className:"pt-8 pb-4 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsx(ht,{className:"h-6 w-32"})})}),l.jsx("section",{className:"pb-8 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(ht,{className:"aspect-[4/3]"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(ht,{className:"aspect-[4/3]"}),l.jsx(ht,{className:"aspect-[4/3]"}),l.jsx(ht,{className:"aspect-[4/3]"}),l.jsx(ht,{className:"aspect-[4/3]"})]})]})})}),l.jsx("section",{className:"py-12 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[l.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[l.jsx(ht,{className:"h-8 w-24"}),l.jsx(ht,{className:"h-10 w-3/4"}),l.jsx(ht,{className:"h-6 w-1/2"}),l.jsx(ht,{className:"h-12 w-48"}),l.jsx(ht,{className:"h-40 w-full"})]}),l.jsx("div",{children:l.jsx(ht,{className:"h-64 w-full"})})]})})})]});const c=(A=r==null?void 0:r.data)==null?void 0:A.attributes,u=c?{id:r.data.id,title:c.title,subtitle:c.subtitle,price:Loe(c.price_in_dollars),status:c.listing_status,bedrooms:c.bedrooms,bathrooms:c.bathrooms,squareFeet:c.square_feet?bj(c.square_feet):null,lotSize:c.lot_acre?`${c.lot_acre} acres`:c.lot_square_feet?`${bj(Number(c.lot_square_feet))} sq ft`:null,yearBuilt:c.year_built,propertyType:c.type?c.type.charAt(0).toUpperCase()+c.type.slice(1):"Residential",mlsNumber:c.mls_number,description:c.description,images:c.photo_urls||[],agent:{name:c.listing_agent||"Holden Richardson",phone:c.office_phone||"(616) 403-6393",broker:c.listing_broker||"616 Realty LLC"},realstaqSections:((f=c.realstaq_details)==null?void 0:f.sections)||[],fromState:!1}:n?{id:e||"",title:n.title,subtitle:n.location,price:n.price,status:n.status,bedrooms:n.beds||0,bathrooms:n.baths||0,squareFeet:n.sqft||null,lotSize:null,yearBuilt:null,propertyType:"Residential",mlsNumber:null,description:n.description||null,images:n.photos||(n.image?[n.image]:[]),agent:{name:"Holden Richardson",phone:"(616) 403-6393",broker:"616 Realty LLC"},realstaqSections:[],fromState:!0}:null;if(!u)return l.jsx(un,{children:l.jsx("section",{className:"py-20 bg-background",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Listing Not Found"}),l.jsx("p",{className:"text-muted-foreground mb-8",children:"The property you're looking for could not be found."}),l.jsx(St,{to:"/properties",children:l.jsx(xe,{className:"btn-outline-primary",children:"Back to Properties"})})]})})});const d=`${u.title} | Holden Richardson — Grand Rapids Real Estate`,h=u.description?u.description.slice(0,160):`${u.title} — ${u.price}, ${u.bedrooms} bed, ${u.bathrooms} bath in Grand Rapids area.`;return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:d}),l.jsx("meta",{name:"description",content:h}),l.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/properties/${e}`}),l.jsx("meta",{property:"og:title",content:d}),l.jsx("meta",{property:"og:description",content:h}),l.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/properties/${e}`}),l.jsx("meta",{property:"og:image",content:u.images[0]||"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:d}),l.jsx("meta",{name:"twitter:description",content:h}),l.jsx("meta",{name:"twitter:image",content:u.images[0]||"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"pt-8 pb-4 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs(St,{to:"/properties",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(mm,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm",children:"Back to Properties"})]})})}),l.jsx("section",{className:"pb-8 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:u.images[0]&&l.jsx("img",{src:u.images[0],alt:u.title,className:"w-full h-full object-cover"})}),l.jsx("div",{className:"grid grid-cols-2 gap-4",children:u.images.slice(1,5).map((p,m)=>l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:l.jsx("img",{src:p,alt:`${u.title} - ${m+2}`,className:"w-full h-full object-cover"})},m))})]})})}),l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[l.jsxs("div",{className:"lg:col-span-2",children:[l.jsx(_e,{children:l.jsxs("div",{className:"flex items-start justify-between mb-6",children:[l.jsxs("div",{children:[l.jsx("span",{className:"inline-block text-caption px-3 py-1.5 bg-secondary text-foreground text-xs mb-4",children:u.status}),l.jsx("h1",{className:"heading-section mb-2",children:u.title}),l.jsxs("p",{className:"text-muted-foreground flex items-center gap-2",children:[l.jsx(ov,{className:"w-4 h-4"}),u.subtitle]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{variant:"outline",size:"icon",children:l.jsx(b2e,{className:"w-4 h-4"})}),l.jsx(xe,{variant:"outline",size:"icon",children:l.jsx(Cre,{className:"w-4 h-4"})})]})]})}),l.jsx(_e,{delay:.1,children:l.jsx("p",{className:"text-gold text-3xl md:text-4xl font-serif mb-8",children:u.price})}),l.jsx(_e,{delay:.2,children:l.jsxs("div",{className:"flex flex-wrap gap-6 py-6 border-y border-border mb-8",children:[u.bedrooms>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pre,{className:"w-5 h-5 text-muted-foreground"}),l.jsx("span",{className:"text-foreground font-medium",children:u.bedrooms}),l.jsx("span",{className:"text-muted-foreground",children:"Beds"})]}),u.bathrooms>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(tU,{className:"w-5 h-5 text-muted-foreground"}),l.jsx("span",{className:"text-foreground font-medium",children:u.bathrooms}),l.jsx("span",{className:"text-muted-foreground",children:"Baths"})]}),u.squareFeet&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ere,{className:"w-5 h-5 text-muted-foreground"}),l.jsx("span",{className:"text-foreground font-medium",children:u.squareFeet}),l.jsx("span",{className:"text-muted-foreground",children:"Sq Ft"})]})]})}),u.description&&l.jsx(_e,{delay:.3,children:l.jsxs("div",{className:"mb-10",children:[l.jsx("h2",{className:"heading-card mb-4",children:"Description"}),l.jsx("p",{className:"text-muted-foreground whitespace-pre-line leading-relaxed",children:u.description})]})}),u.fromState&&l.jsx(_e,{delay:.3,children:l.jsx("div",{className:"p-4 bg-secondary rounded-sm mb-10",children:l.jsx("p",{className:"text-muted-foreground text-sm",children:"This listing has been sold. Limited details are available from the original search results."})})}),u.realstaqSections.map((p,m)=>l.jsx(_e,{delay:.4+m*.1,children:l.jsxs("div",{className:"mb-10",children:[l.jsx("h2",{className:"heading-card mb-4",children:p.title}),l.jsx("div",{className:`grid gap-4 ${p.style==="third"?"grid-cols-2 md:grid-cols-3":"grid-cols-1 md:grid-cols-2"}`,children:p.fields.map((g,y)=>l.jsxs("div",{className:"p-4 bg-secondary rounded-sm",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-1",children:g.label}),l.jsx("p",{className:"text-foreground font-medium",children:g.value!==null&&g.value!==void 0?String(g.value):"N/A"})]},`${p.title}-${y}`))})]})},p.title))]}),l.jsx("div",{className:"lg:col-span-1",children:l.jsx(_e,{delay:.2,children:l.jsxs("div",{className:"sticky top-24 p-6 bg-secondary rounded-sm",children:[l.jsx("h3",{className:"heading-card mb-4",children:"Contact Agent"}),l.jsxs("div",{className:"mb-6",children:[l.jsx("p",{className:"text-foreground font-medium",children:u.agent.name}),l.jsx("p",{className:"text-muted-foreground text-sm",children:u.agent.broker}),l.jsx("p",{className:"text-muted-foreground text-sm",children:u.agent.phone})]}),l.jsxs("div",{className:"space-y-3",children:[o?l.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"block",children:l.jsx(xe,{className:"w-full btn-outline-primary",children:"Schedule a Showing"})}):l.jsx(xe,{className:"w-full btn-outline-primary",disabled:!0,children:"Schedule a Showing"}),l.jsx(St,{to:"/contact",className:"block",children:l.jsx(xe,{variant:"outline",className:"w-full",children:"Request More Info"})})]})]})})})]})})})]})},yOe="/assets/holden-about-BFemenAp.jpg",A0=e=>Br({queryKey:["site-media",e],queryFn:async()=>{let t=Me.from("site_media").select("*").order("created_at",{ascending:!1});e&&(t=t.eq("media_type",e));const{data:n,error:r}=await t;if(r)throw r;return n||[]}}),vOe=()=>{const e=As();return Ms({mutationFn:async({file:t,tags:n,mediaType:r,altText:i})=>{const s=t.name.split(".").pop(),a=`${r}/${Date.now()}-${Math.random().toString(36).slice(2)}.${s}`,{error:o}=await Me.storage.from("site-media").upload(a,t);if(o)throw o;const{error:c}=await Me.from("site_media").insert({file_path:a,file_name:t.name,tags:n,media_type:r,alt_text:i||null,file_size:t.size});if(c)throw c},onSuccess:()=>e.invalidateQueries({queryKey:["site-media"]})})},xOe=()=>{const e=As();return Ms({mutationFn:async({id:t,...n})=>{const{error:r}=await Me.from("site_media").update(n).eq("id",t);if(r)throw r},onSuccess:()=>e.invalidateQueries({queryKey:["site-media"]})})},wOe=()=>{const e=As();return Ms({mutationFn:async({id:t,filePath:n})=>{await Me.storage.from("site-media").remove([n]);const{error:r}=await Me.from("site_media").delete().eq("id",t);if(r)throw r},onSuccess:()=>e.invalidateQueries({queryKey:["site-media"]})})},kc=e=>{if(e.startsWith("http"))return e;const{data:t}=Me.storage.from("site-media").getPublicUrl(e);return t.publicUrl},bOe="https://res.cloudinary.com/dofjjlc6d/image/upload/v1769540628/user-uploads/2160/wrbvjojilgzlvn1u2hnw.jpg",COe=[{value:"$50M+",label:"Real Estate Sold"},{value:"150+",label:"Homes Sold"},{value:"11+",label:"Years in the Business"}],SOe=()=>{const{data:e}=Br({queryKey:["about-pages"],queryFn:async()=>{const{data:t}=await Me.from("aeo_categories").select("id").eq("slug","about").maybeSingle();if(!t)return[];const{data:n,error:r}=await Me.from("aeo_pages").select("id, title, slug, h1, subheadline, intro_text, display_order").eq("category_id",t.id).eq("status","published").eq("is_parent",!0).order("display_order");if(r)throw r;return n||[]}});return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"About Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent. Deep local expertise, client-first approach."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/about"}),l.jsx("meta",{property:"og:title",content:"About Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{property:"og:description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/about"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"profile"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"About Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"twitter:description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"AboutPage",url:"https://www.holdengr.com/about",name:"About Holden Richardson",description:"About page for Grand Rapids Realtor Holden Richardson.",isPartOf:{"@id":"https://www.holdengr.com/#website"},mainEntity:{"@id":"https://www.holdengr.com/#agent"},about:{"@id":"https://www.holdengr.com/#agent"}})}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"About",item:"https://www.holdengr.com/about"}]})})]}),l.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-20 md:pb-28 overflow-hidden",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:kc("stock_photo/1772747249479-34tk12ax6yg.jpeg"),alt:"Grand Rapids area real estate",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/40"})]}),l.jsxs("div",{className:"container-page relative z-10",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-white/60 mb-4",children:"About"})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"heading-display max-w-4xl text-white",children:"Holden Richardson"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-6 mb-6"})]}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-white/80 max-w-2xl",children:"Setting the standard for real estate in the Grand Rapids area."})})]})]}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-start",children:[l.jsx(_e,{direction:"left",variant:"slide",children:l.jsx("div",{className:"relative sticky top-32",children:l.jsx("img",{src:yOe,alt:"Holden Richardson",className:"w-full aspect-[3/4] object-cover",loading:"lazy"})})}),l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("h2",{className:"heading-section mb-8",children:"A Reputation Built on Results"})}),l.jsxs("div",{className:"space-y-6 text-body text-muted-foreground",children:[l.jsx(_e,{delay:.1,children:l.jsx("p",{children:"Holden Richardson is a Grand Rapids area Realtor® with 616 Realty LLC who believes real estate doesn't have to be complicated. His approach is straightforward — give people the information they need, cut through the noise, and let them make confident decisions without the pressure."})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{children:"That philosophy shows up in everything he does. From short-form videos breaking down market updates and buyer tips to comprehensive guides on his website, Holden is focused on making real estate knowledge accessible — not gatekept. He'd rather educate a client who isn't ready to buy for another two years than push someone into a deal that doesn't make sense."})}),l.jsx(_e,{delay:.3,children:l.jsx("p",{children:"Holden's deep familiarity with the Grand Rapids market — from East Grand Rapids and Ada to Cascade and the surrounding communities — means his clients get hyper-local insight backed by real data, not generic advice. He stays plugged into pricing trends, neighborhood shifts, and inventory changes so his clients don't have to."})}),l.jsx(_e,{delay:.4,children:l.jsx("p",{children:"Whether you're buying your first home, selling a property, or just trying to understand what your home is worth, Holden's goal is simple: be the most useful resource you have in Grand Rapids real estate."})})]}),l.jsx(_e,{delay:.5,children:l.jsx("div",{className:"mt-10",children:l.jsx(St,{to:"/contact",className:"btn-outline-primary",children:"Get in Touch"})})})]})]})})}),l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Track Record"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-12 md:mb-16",children:"By the Numbers"})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 md:gap-12",children:COe.map((t,n)=>l.jsx(_e,{delay:n*.1,children:l.jsxs("div",{className:"text-center md:text-left",children:[l.jsx("span",{className:"text-gold font-serif text-5xl md:text-6xl font-light",children:t.value}),l.jsx("p",{className:"text-muted-foreground mt-3 text-sm uppercase tracking-widest",children:t.label})]})},t.label))})]})}),e&&e.length>0&&l.jsx("section",{className:"section-padding bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Learn More"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-12 md:mb-16",children:"Common Questions"})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:e.map((t,n)=>l.jsx(_e,{delay:n*.1,children:l.jsxs(St,{to:`/about/${t.slug}`,className:"group block p-8 border border-border hover:border-accent bg-secondary/30 hover:bg-secondary/60 transition-all duration-300",children:[l.jsx("h3",{className:"font-serif text-xl md:text-2xl mb-3 group-hover:text-accent transition-colors leading-snug",children:t.h1||t.title}),t.subheadline&&l.jsx("p",{className:"text-sm text-muted-foreground mb-4 line-clamp-2",children:t.subheadline}),t.intro_text&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:t.intro_text}),l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-caption text-foreground group-hover:text-accent transition-colors",children:["Read More ",l.jsx(Xa,{size:14})]})]})},t.id))})]})}),l.jsxs("section",{className:"relative",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:bOe,alt:"Grand Rapids area property",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/70"})]}),l.jsx("div",{className:"relative section-padding",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"max-w-3xl",children:[l.jsx(_e,{variant:"blur",children:l.jsx("p",{className:"text-caption text-gold mb-4",children:"Philosophy"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-background mb-8",children:`"I'd rather be honest about what I see than tell you what you want to hear. That's how the right deal actually happens."`})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-lg text-background/80",children:"Most people know what they want — but sometimes they haven't found the words for it yet. My job is to listen closely enough to understand what you're really looking for, even when it's a feeling more than a checklist. That deep understanding, paired with honest, direct advice, is what turns a house hunt into finding home."})})]})})})]})]})},kOe="/assets/testimonials-hero-D_OW3dCz.jpg",RE=[{quote:"Holden is a go getter and very responsive. He found us our home in a competitive market. Very knowledgeable and helped us negotiate a home that fit our needs and wants. I recommend Holden to anyone that is selling or wanting to buy a home because of his knowledge and determination to get the job done!",author:"Elvis Hadzalic",role:"Home Buyer",date:"2025",rating:5,source:"google"},{quote:"My partner and I were advised by one of our old neighbors to go to 616 Realty when we were ready to purchase a home, and I am so glad that we listened. Holden, Jayda and Beth were all so helpful during the entire process and were always there when we had questions. I am happy to say we have purchased our home and we couldn't have done that without their help!",author:"Idaris Cruz",role:"Home Buyer",date:"2025",rating:5,source:"google"},{quote:"Working with Holden was incredibly seamless and efficient. Wonderful advice and feedback to help me reach my ultimate goal! Would easily recommend to anyone who is anxious going into the housing market.",author:"Aleatha Ostrander",role:"Home Buyer",date:"2025",rating:5,source:"google"},{quote:"Holden was a pleasure working with on this transaction, his communication was prompt and professional, and they handled every detail with expertise and integrity. A true team player who kept the process smooth from start to finish — I look forward to working together again.",author:"Tristan Seeley",role:"Transaction Partner",date:"2025",rating:5,source:"google"},{quote:"This is the first transaction that I have worked with Holden on and I really appreciate his commitment to communication throughout the process. He was very open to what his clients goals were as buyers and allowed me to do the same for the sellers. Together we were able to work through some weather related issues to get to the closing table with minimal fuss. This is what real estate is all about. No ego. No flex. Just being good stewards for our clients. Thanks for working with me on this sale! I look forward to a few more!",author:"Julie Reisner",role:"Collaborating Agent",date:"2025",rating:5,source:"google"},{quote:"Holden is so helpful and knowledgeable. He really knows how to get stuff done!",author:"Katie T.",role:"Client",date:"2025",rating:5,source:"google"},{quote:"I've used Holden as my listing and buying agent 3 times and each experience has been amazing! He is a responsive and effective communicator and will go to the mat for you!",author:"Lisa Menezes",role:"Repeat Client",date:"2025",rating:5,source:"google"},{quote:"Working with HoldenGR was a really positive experience. From start to finish, everything was handled with professionalism, transparency, and attention to detail. Questions were answered quickly, the process was explained clearly, and nothing felt rushed or overlooked. It's easy to see how much pride is taken in the work and the level of service provided. Highly recommend!",author:"Brittany Richardson",role:"Client",date:"2025",rating:5,source:"google"},{quote:"Holden is a very capable to work through issues and solve problems. You need someone that can help you when surprises and challenges take place in the process. Most people don't have the experience to work through those so that everyone is aligned to get the deal done. I think that is a unique skill set he has to close deals.",author:"Russ Richardson",role:"Client",date:"2025",rating:5,source:"google"},{quote:"Very knowledgeable about the housing market and works hard for his clients.",author:"Marian Richardson",role:"Client",date:"2025",rating:5,source:"google"},{quote:"Holden made my first home buying experience seamless and easy!!",author:"Daphne Shears",role:"First-Time Home Buyer",date:"2025",rating:5,source:"google"},{quote:"The best!",author:"Tyler Hayek",role:"Client",date:"2025",rating:5,source:"google"},{quote:"We recently bought our dream home, and we couldn't have done it without Holden. From day one, he was incredibly patient, understanding, and committed to helping us find the right place — not just any place. What we appreciated the most was that he was never pushy. He let us take our time, answered every question honestly, and always looked out for our best interest rather than trying to rush a decision. Holden really listened to what we wanted and refined the search based on our needs, our priorities, and even the things we didn't say out loud. Throughout the process, he guided us with knowledge, confidence, and absolute professionalism. When things got stressful, he stayed calm and steady, making sure we felt supported at every step. If you're looking for a realtor who is trustworthy, thoughtful, and genuinely invested in helping you find the right home, Holden is the person you want by your side.",author:"Anu & Sam",role:"Home Buyer",date:"November 2025",rating:5,source:"zillow",location:"Grandville, MI"},{quote:"Holden helped us buy our retirement home. He went above and beyond to help us examine different possibilities and then to guide us from offer to closing on the house we chose. We couldn't be more pleased with his responsiveness and his knowledge of the market and the process. We would turn to him again in a heartbeat and wish him every continued success as a real estate professional.",author:"lwhall449",role:"Home Buyer",date:"June 2022",rating:5,source:"zillow",location:"San Marcos, TX"},{quote:"Sweet, smart and great. Recommended highly. Helped me through an entire deal that was incredibly stressful. Educated me on homes, gave advise, even gave me a ride home after closing lol, great guy.",author:"pennysleith",role:"Home Buyer",date:"October 2019",rating:5,source:"zillow",location:"Plainwell, MI"},{quote:"Holden did an outstanding job helping secure the perfect home for me. He put a great deal of effort into searching places that I might like. The end result was that I found a home that is perfect for me.",author:"Robert Teszlewicz",role:"Home Buyer",date:"June 2019",rating:5,source:"zillow",location:"MI"},{quote:"Holden was by far the most helpful realtor I could have asked for. I was able to call and text anytime of the day and always had a very quick response. He jumped on every home I wanted to view and was very knowledgable of the entire process. He even set me up with an amazing mortgage company. I will absolutely recommend him to my family, friends and all others!",author:"kmatthews6693",role:"Home Buyer",date:"April 2019",rating:5,source:"zillow",location:"Bellevue, MI"},{quote:"Holden is a very friendly, knowledgeable real estate agent. I would definitely refer him to anyone looking for a home. He helped us buy a new house and at the same time sell our existing home. Thanks",author:"Rita Lopez",role:"Buyer & Seller",date:"February 2019",rating:4,source:"zillow",location:"Holland, MI"},{quote:"Holden is very professional and I wouldn't hesitate to work with him again or refer him to others. I spoke to a few realtors prior to listing my condo and I went with Holden because he was organized and provided me everything I needed to know the first meeting. He made me feel comfortable with the process of selling my first home. Within a few days, I had a stylist and a photographer at my house. Just over a week after meeting Holden, my house was listed and sold. Do not overlook him due to him being younger and limited years of experience. He knows what he is doing and he will work hard to get you the sale.",author:"vlwalli88",role:"Home Seller",date:"July 2018",rating:5,source:"zillow",location:"Grand Rapids, MI"},{quote:"Holden is great. He worked with us to find the right home for us. He was easy to communicate with and always available. Very helpful in working through the process from beginning to end. We would recommend Holden to anyone looking for a new home.",author:"zuser20160707063703253",role:"Home Buyer",date:"June 2018",rating:5,source:"zillow",location:"Kent City, MI"},{quote:"Holden was very quick to respond. I actually just liked his status on facebook, so I could find him later when I was interested in starting to look for a house. He contacted me and gave me some references for a mortgage broker. He apparently works closely with the loan officers because he was told before I was officially told that I was approved. It's nice that everyone is working as a team to help my wife, myself, and our new born baby our first home.",author:"Eric Wheeler",role:"Home Buyer",date:"November 2017",rating:5,source:"zillow",location:"Caledonia, MI"},{quote:"Holden was extremely helpful and listened to our needs. He put us first and kept us updated through the offer process and was very prompt on his responses. Would recommend him to everyone I know.",author:"John Pasquinelli",role:"Home Buyer",date:"November 2017",rating:5,source:"zillow",location:"Holland, MI"},{quote:"Goes above and beyond to find the right fit. Willing to work around anyones schedule night or day. Very professional and invested in each client. Would highly recommend to anyone looking to both buy or sell.",author:"Dylan Bouchie",role:"Home Buyer",date:"August 2017",rating:5,source:"zillow",location:"NE"},{quote:"When deciding to buy a home my husband and I had a certain vision and were very particular in our wants and needs. Holden Richardson was able to work with us and assist us in finding our dream home. Buying a house while living in a different part of the state has its challenges but Holden made the process very easy and enjoyable. There were challenges but he was always available to help and did so in a professional manner.",author:"user7690907",role:"Home Buyer",date:"December 2016",rating:5,source:"zillow",location:"Holland, MI"},{quote:"Holden was very professional, personable, and punctual while helping us search for, and secure our home. Being first time homebuyers, we weren't sure how to navigate the real estate world, but Holden diligently explained every step of the way (sometimes multiple times when necessary). He made us feel comfortable and confident in our decisions and made sure we were aware of our options. Holden made sure we saw every house on our lists. He was diligent in answering all of our questions, regardless of the time of day or night and consulted other professionals when necessary. He helped us secure a home that fit everything we were looking for and more. We will be referring our friends and family to Holden for their real estate needs.",author:"Breanna Bellingar",role:"First-Time Home Buyer",date:"October 2016",rating:5,source:"zillow"}],Cj=RE.length,_Oe=RE.reduce((e,t)=>e+t.rating,0)/Cj,Roe=+_Oe.toFixed(2),jOe={january:"01",february:"02",march:"03",april:"04",may:"05",june:"06",july:"07",august:"08",september:"09",october:"10",november:"11",december:"12"};function BOe(e){const t=e.trim();if(/^\d{4}$/.test(t))return t;const n=t.match(/^([A-Za-z]+)\s+(\d{4})$/);if(n){const r=jOe[n[1].toLowerCase()];return r?`${n[2]}-${r}`:t}return t}const NOe={"@context":"https://schema.org","@type":"RealEstateAgent","@id":"https://www.holdengr.com/#agent",name:"Holden Richardson",url:"https://www.holdengr.com",telephone:"+1-616-403-6393",email:"holden@holdengr.com",address:{"@type":"PostalAddress",streetAddress:"1171 Plainfield Ave NE",addressLocality:"Grand Rapids",addressRegion:"MI",postalCode:"49503",addressCountry:"US"},sameAs:["https://www.instagram.com/holdengr.re","https://www.facebook.com/holden.m.richardson","https://www.google.com/maps?cid=17099657301143231027","https://www.linkedin.com/in/holdenrichardson","https://www.youtube.com/@holdengr.michigan","https://x.com/realholdengr","https://www.tiktok.com/@realholdengr.re","https://www.zillow.com/profile/Holden%20Richardson","https://www.realtor.com/realestateagents/59939fae1bb6a60010b0b9c6"],aggregateRating:{"@type":"AggregateRating",ratingValue:Roe,bestRating:5,worstRating:1,reviewCount:Cj},review:RE.map(e=>({"@type":"Review",itemReviewed:{"@id":"https://www.holdengr.com/#agent"},author:{"@type":"Person",name:e.author},datePublished:BOe(e.date),reviewBody:e.quote,reviewRating:{"@type":"Rating",ratingValue:e.rating,bestRating:5,worstRating:1},...e.source&&{publisher:{"@type":"Organization",name:e.source==="google"?"Google":"Zillow"}}}))},EOe=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Client Testimonials | Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"description",content:`Read real reviews from Holden Richardson's clients across Google and Zillow. ${Cj} reviews from buyers, sellers, and industry partners in the Grand Rapids area.`}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/about/testimonials"}),l.jsx("meta",{property:"og:title",content:"Client Testimonials | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Real reviews from real clients — see why Grand Rapids homeowners trust Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/about/testimonials"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Client Testimonials | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Real reviews from real clients — see why Grand Rapids homeowners trust Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify(NOe)})]}),l.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-20 md:pb-28 overflow-hidden",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:kOe,alt:"Elegant living space",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/50"})]}),l.jsxs("div",{className:"container-page relative z-10",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-white/60 mb-4",children:"About"})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"heading-display max-w-4xl text-white",children:"Client Testimonials"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-6 mb-6"})]}),l.jsx(_e,{delay:.2,children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex gap-0.5",children:[...Array(5)].map((e,t)=>l.jsx(M3,{size:20,className:"fill-gold text-gold"},t))}),l.jsxs("span",{className:"text-white/80 text-lg font-light",children:[Roe," average · ",Cj," reviews"]})]})})]})]}),l.jsx("section",{className:"section-padding bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"flex flex-wrap gap-4 mb-12",children:[l.jsxs("a",{href:"https://www.google.com/maps?cid=17099657301143231027",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2 text-sm",children:["Google Reviews ",l.jsx(ao,{className:"w-3.5 h-3.5"})]}),l.jsxs("a",{href:"https://www.zillow.com/profile/Holden%20Richardson",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2 text-sm",children:["Zillow Reviews ",l.jsx(ao,{className:"w-3.5 h-3.5"})]})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:RE.map((e,t)=>l.jsx(_e,{delay:t%3*.1,children:l.jsxs("div",{className:"bg-secondary p-8 h-full flex flex-col border border-border",children:[l.jsx("div",{className:"flex gap-0.5 mb-4",children:[...Array(5)].map((n,r)=>l.jsx(M3,{size:14,className:r<e.rating?"fill-gold text-gold":"text-border"},r))}),l.jsxs("blockquote",{className:"text-sm font-serif text-foreground mb-6 flex-1 leading-relaxed",children:['"',e.quote,'"']}),l.jsxs("div",{className:"border-t border-border pt-4 mt-auto",children:[l.jsx("p",{className:"font-medium text-foreground text-sm",children:e.author}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.role,e.location?` · ${e.location}`:""," · ",e.date]}),l.jsx("span",{className:`inline-block mt-2 text-[10px] uppercase tracking-widest font-medium ${e.source==="google"?"text-accent":"text-muted-foreground"}`,children:e.source==="google"?"Google":"Zillow"})]})]})},e.author))})]})}),l.jsx("section",{className:"section-padding bg-primary text-center",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("h2",{className:"heading-section text-white mb-6",children:"Ready to Write Your Own Story?"})}),l.jsx(_e,{delay:.1,children:l.jsx("p",{className:"text-white/70 max-w-xl mx-auto mb-8",children:"Whether you're buying, selling, or just exploring — Holden is here to help you make a confident move."})}),l.jsx(_e,{delay:.2,children:l.jsx("a",{href:"/contact",className:"inline-block px-8 py-4 bg-accent text-accent-foreground font-medium text-sm uppercase tracking-widest hover:bg-accent/90 transition-colors duration-300",children:"Get in Touch"})})]})})]}),Je=C.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ot("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 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Je.displayName="Input";const hi=C.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ot("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));hi.displayName="Textarea";const TOe="https://crm.realsavvy.com/api/form_submissions",IOe="eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",POe="3qgHnU6N5RTJVQ";async function OOe(e){var s;const t=crypto.randomUUID(),n=new FormData;n.append("cyclum_vid",POe),n.append("cyclum_submission_id",t),n.append("form_name",e.formName||"contact-form-with-image"),n.append("first_name",e.firstName.trim()),n.append("last_name",e.lastName.trim()),n.append("email",e.email.trim()),e.phone&&n.append("phone",e.phone.trim()),e.message&&n.append("message",e.message.trim());const r=(s=e.tags)!=null&&s.length?e.tags:["website-lead"];for(const a of r)n.append("tag[]",a);const i=await fetch(TOe,{method:"POST",headers:{Authorization:`Bearer ${IOe}`},body:n});if(!i.ok)throw new Error(`RealSavvy submission failed (${i.status})`)}const FOe="/assets/holden-brittany-BNfOpbGb.jpg",MOe=()=>{const{toast:e}=$f(),{configMap:t}=oa(),[n,r]=C.useState(!1),[i,s]=C.useState({firstName:"",lastName:"",email:"",phone:"",message:"",interest:"buying"}),a=t.agent_phone,o=t.booking_url,c=async h=>{h.preventDefault(),r(!0);try{await OOe({firstName:i.firstName,lastName:i.lastName,email:i.email,phone:i.phone,message:i.message||i.interest,tags:["contact-us-form"],formName:"contact-form-with-image"}),e({title:"Message Sent",description:"Thank you for reaching out. Holden will be in touch shortly."}),s({firstName:"",lastName:"",email:"",phone:"",message:"",interest:"buying"})}catch(A){console.error("Form submission error:",A),e({title:"Error",description:"There was a problem sending your message. Please try again.",variant:"destructive"})}finally{r(!1)}},u=h=>{s({...i,[h.target.name]:h.target.value})},d=a?`sms:${a.replace(/[^+\d]/g,"")}`:null;return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Contact Holden Richardson | Grand Rapids Real Estate"}),l.jsx("meta",{name:"description",content:"Get in touch with Holden Richardson for buying, selling, or real estate consultation in the Grand Rapids area."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/contact"}),l.jsx("meta",{property:"og:title",content:"Contact Holden Richardson | Grand Rapids Real Estate"}),l.jsx("meta",{property:"og:description",content:"Get in touch with Holden Richardson for buying, selling, or real estate consultation in Grand Rapids."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/contact"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Contact Holden Richardson | Grand Rapids Real Estate"}),l.jsx("meta",{name:"twitter:description",content:"Get in touch with Holden Richardson for real estate in Grand Rapids."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"ContactPage",url:"https://www.holdengr.com/contact",name:"Contact Holden Richardson",description:"Contact form, phone, text, and virtual meeting options for Grand Rapids Realtor Holden Richardson.",isPartOf:{"@id":"https://www.holdengr.com/#website"},mainEntity:{"@type":"RealEstateAgent","@id":"https://www.holdengr.com/#agent",name:"Holden Richardson",url:"https://www.holdengr.com",contactPoint:[{"@type":"ContactPoint",contactType:"sales",telephone:"+1-616-403-6393",email:"holden@holdengr.com",areaServed:"US-MI",availableLanguage:["English"]},{"@type":"ContactPoint",contactType:"customer support",email:"holden@holdengr.com",areaServed:"US-MI",availableLanguage:["English"]}]}})}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"Contact",item:"https://www.holdengr.com/contact"}]})})]}),l.jsx("section",{className:"bg-secondary pt-28 md:pt-32 pb-10 md:pb-14",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"mb-8 md:mb-10",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-2",children:"Get in Touch"}),l.jsx("h1",{className:"font-serif text-2xl md:text-3xl font-light text-foreground",children:"Let's Start the Conversation"})]})}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-stretch",children:[l.jsx("div",{className:"flex items-center justify-center order-2 lg:order-1",children:l.jsx(_e,{variant:"scale",children:l.jsx("img",{src:FOe,alt:"Holden and Brittany Richardson",className:"w-full h-auto object-cover"})})}),l.jsx(_e,{delay:.1,className:"order-1 lg:order-2",children:l.jsxs("form",{onSubmit:c,className:"space-y-5 border border-border/60 p-6 md:p-8 bg-background shadow-sm",children:[l.jsx("h3",{className:"font-serif text-xl font-light mb-2",children:"Send a Message"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"firstName",className:"text-caption text-muted-foreground mb-1.5 block",children:"First Name *"}),l.jsx(Je,{id:"firstName",name:"firstName",value:i.firstName,onChange:u,required:!0,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"lastName",className:"text-caption text-muted-foreground mb-1.5 block",children:"Last Name *"}),l.jsx(Je,{id:"lastName",name:"lastName",value:i.lastName,onChange:u,required:!0,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"text-caption text-muted-foreground mb-1.5 block",children:"Email *"}),l.jsx(Je,{id:"email",name:"email",type:"email",value:i.email,onChange:u,required:!0,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"phone",className:"text-caption text-muted-foreground mb-1.5 block",children:"Phone"}),l.jsx(Je,{id:"phone",name:"phone",type:"tel",value:i.phone,onChange:u,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"interest",className:"text-caption text-muted-foreground mb-1.5 block",children:"I'm Interested In"}),l.jsxs("select",{id:"interest",name:"interest",value:i.interest,onChange:u,className:"w-full bg-secondary border-0 h-11 px-4 text-foreground focus:ring-1 focus:ring-accent appearance-none cursor-pointer",children:[l.jsx("option",{value:"buying",children:"Buying a Property"}),l.jsx("option",{value:"selling",children:"Selling a Property"}),l.jsx("option",{value:"both",children:"Both Buying and Selling"}),l.jsx("option",{value:"consultation",children:"General Consultation"})]})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"message",className:"text-caption text-muted-foreground mb-1.5 block",children:"Message"}),l.jsx(hi,{id:"message",name:"message",value:i.message,onChange:u,rows:4,className:"bg-secondary border-0 rounded-none focus:ring-1 focus:ring-accent resize-none",placeholder:"Tell me about your real estate goals..."})]}),l.jsx("button",{type:"submit",className:"btn-outline-primary w-full disabled:opacity-50",disabled:n,children:n?"Sending...":"Send Message"})]})})]})]})}),l.jsx("section",{className:"py-10 md:py-14 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsx(_e,{children:l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-3xl mx-auto",children:[a&&l.jsx("a",{href:`tel:${a}`,children:l.jsxs(xe,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(kp,{className:"w-5 h-5 mr-2"}),"Call"]})}),d&&l.jsx("a",{href:d,children:l.jsxs(xe,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(df,{className:"w-5 h-5 mr-2"}),"Text"]})}),o&&l.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(Cl,{className:"w-5 h-5 mr-2"}),"Book Virtual Meeting"]})})]})})})})]})},LOe=[{icon:Tre,title:"Real-Time Home Value",description:"Receive a personalized, data-driven estimate of your home's current market value — updated monthly so you always know where you stand."},{icon:K1e,title:"Monthly Market Updates",description:"Get a detailed digest delivered straight to your inbox with local market trends, comparable sales, and how your home's value is changing over time."},{icon:y2e,title:"Equity & Financial Insights",description:"See how much equity you've built, explore cash-out refinance scenarios, and understand your home's role in your overall financial picture."},{icon:gre,title:"Neighborhood Intelligence",description:"Track what's selling in your neighborhood, average days on market, and pricing trends — the same data agents use to advise their clients."}],ROe=()=>(C.useEffect(()=>{const e=window;e.__hb_namespace="Homebot",e.Homebot=e.Homebot||function(){(e.Homebot.q=e.Homebot.q||[]).push(arguments)};const t=document.createElement("script");return t.async=!0,t.src="https://embed.homebotapp.com/lgw/v1/widget.js",document.head.appendChild(t),t.onload=()=>{e.Homebot("#homebot_homeowner","52a1cb8f2e41fb10e76903941d59cb3e4cb15eb38090f697")},()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]),l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Home Valuation | What's Your Home Worth? | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Get a free, AI-powered home valuation plus monthly updates on your home's value, equity, and Grand Rapids market trends."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/home-valuation"}),l.jsx("meta",{property:"og:title",content:"Home Valuation | What's Your Home Worth?"}),l.jsx("meta",{property:"og:description",content:"Get a free home valuation plus monthly market updates from Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/home-valuation"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Home Valuation | What's Your Home Worth?"}),l.jsx("meta",{name:"twitter:description",content:"Get a free home valuation plus monthly market updates from Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-14 md:pb-20 bg-secondary overflow-hidden",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:kc("stock_photo/1772747048679-xrqvfil905k.jpeg"),alt:"Grand Rapids home exterior",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/40"})]}),l.jsxs("div",{className:"container-page text-center relative z-10",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-white/70 mb-3",children:"Powered by Homebot"})}),l.jsx(_e,{delay:.1,children:l.jsx("h1",{className:"heading-section max-w-4xl mx-auto text-white",children:"What's Your Home Worth?"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-white/80 max-w-2xl mx-auto mt-4",children:"Enter your address below for a complimentary home valuation — plus ongoing monthly updates on your home's value, equity, and local market trends."})})]})]}),l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl",children:l.jsx("div",{id:"homebot_homeowner",className:"w-full min-h-[200px]"})})}),l.jsx("section",{className:"py-12 md:py-16 bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-10",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Why Homebot?"}),l.jsx("h2",{className:"heading-section max-w-3xl mx-auto",children:"Your Home's Financial Dashboard — Free, Forever"}),l.jsx("p",{className:"text-body text-muted-foreground max-w-2xl mx-auto mt-6",children:"When you sign up through my Homebot portal, you don't just get a one-time estimate. You get a powerful, ongoing tool that keeps you informed and in control of your biggest investment."})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 md:gap-8",children:LOe.map((e,t)=>l.jsx(_e,{delay:t*.1,children:l.jsxs(vi.div,{className:"flex gap-5",whileHover:{x:4},transition:{duration:.3},children:[l.jsx("div",{className:"w-12 h-12 bg-accent/10 flex items-center justify-center shrink-0",children:l.jsx(e.icon,{size:22,className:"text-accent"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:e.title}),l.jsx("p",{className:"text-body text-muted-foreground text-sm leading-relaxed",children:e.description})]})]})},e.title))})]})})]}));var Doe={exports:{}};/*! pym.js - v1.3.2 - 2018-02-13 */(function(e){(function(t){e.exports?e.exports=t():window.pym=t.call(this)})(function(){var t="xPYMx",n={},r=function(A){var f=document.createEvent("Event");f.initEvent("pym:"+A,!0,!0),document.dispatchEvent(f)},i=function(A){var f=new RegExp("[\\?&]"+A.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]")+"=([^&#]*)"),p=f.exec(location.search);return p===null?"":decodeURIComponent(p[1].replace(/\+/g," "))},s=function(A,f){if(!(f.xdomain!=="*"&&!A.origin.match(new RegExp(f.xdomain+"$")))&&typeof A.data=="string")return!0},a=function(A){var f=/^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/gi;if(A.match(f))return!0},o=function(A,f,p){var m=["pym",A,f,p];return m.join(t)},c=function(A){var f=["pym",A,"(\\S+)","(.*)"];return new RegExp("^"+f.join(t)+"$")},u=Date.now||function(){return new Date().getTime()},d=function(A,f,p){var m,g,y,v=null,x=0;p||(p={});var b=function(){x=p.leading===!1?0:u(),v=null,y=A.apply(m,g),v||(m=g=null)};return function(){var w=u();!x&&p.leading===!1&&(x=w);var k=f-(w-x);return m=this,g=arguments,k<=0||k>f?(v&&(clearTimeout(v),v=null),x=w,y=A.apply(m,g),v||(m=g=null)):!v&&p.trailing!==!1&&(v=setTimeout(b,k)),y}},h=function(){for(var A=n.autoInitInstances.length,f=A-1;f>=0;f--){var p=n.autoInitInstances[f];p.el.getElementsByTagName("iframe").length&&p.el.getElementsByTagName("iframe")[0].contentWindow||n.autoInitInstances.splice(f,1)}};return n.autoInitInstances=[],n.autoInit=function(A){var f=document.querySelectorAll("[data-pym-src]:not([data-pym-auto-initialized])"),p=f.length;h();for(var m=0;m<p;++m){var g=f[m];g.setAttribute("data-pym-auto-initialized",""),g.id===""&&(g.id="pym-"+m+"-"+Math.random().toString(36).substr(2,5));var y=g.getAttribute("data-pym-src"),v={xdomain:"string",title:"string",name:"string",id:"string",sandbox:"string",allowfullscreen:"boolean",parenturlparam:"string",parenturlvalue:"string",optionalparams:"boolean",trackscroll:"boolean",scrollwait:"number"},x={};for(var b in v)if(g.getAttribute("data-pym-"+b)!==null)switch(v[b]){case"boolean":x[b]=g.getAttribute("data-pym-"+b)!=="false";break;case"string":x[b]=g.getAttribute("data-pym-"+b);break;case"number":var w=Number(g.getAttribute("data-pym-"+b));isNaN(w)||(x[b]=w);break;default:console.err("unrecognized attribute type")}var k=new n.Parent(g.id,y,x);n.autoInitInstances.push(k)}return A||r("pym-initialized"),n.autoInitInstances},n.Parent=function(A,f,p){this.id=A,this.url=f,this.el=document.getElementById(A),this.iframe=null,this.settings={xdomain:"*",optionalparams:!0,parenturlparam:"parentUrl",parenturlvalue:window.location.href,trackscroll:!1,scrollwait:100},this.messageRegex=c(this.id),this.messageHandlers={},p=p||{},this._constructIframe=function(){var g=this.el.offsetWidth.toString();this.iframe=document.createElement("iframe");var y="",v=this.url.indexOf("#");for(v>-1&&(y=this.url.substring(v,this.url.length),this.url=this.url.substring(0,v)),this.url.indexOf("?")<0?this.url+="?":this.url+="&",this.iframe.src=this.url+"initialWidth="+g+"&childId="+this.id,this.settings.optionalparams&&(this.iframe.src+="&parentTitle="+encodeURIComponent(document.title),this.iframe.src+="&"+this.settings.parenturlparam+"="+encodeURIComponent(this.settings.parenturlvalue)),this.iframe.src+=y,this.iframe.setAttribute("width","100%"),this.iframe.setAttribute("scrolling","no"),this.iframe.setAttribute("marginheight","0"),this.iframe.setAttribute("frameborder","0"),this.settings.title&&this.iframe.setAttribute("title",this.settings.title),this.settings.allowfullscreen!==void 0&&this.settings.allowfullscreen!==!1&&this.iframe.setAttribute("allowfullscreen",""),this.settings.sandbox!==void 0&&typeof this.settings.sandbox=="string"&&this.iframe.setAttribute("sandbox",this.settings.sandbox),this.settings.id&&(document.getElementById(this.settings.id)||this.iframe.setAttribute("id",this.settings.id)),this.settings.name&&this.iframe.setAttribute("name",this.settings.name);this.el.firstChild;)this.el.removeChild(this.el.firstChild);this.el.appendChild(this.iframe),window.addEventListener("resize",this._onResize),this.settings.trackscroll&&window.addEventListener("scroll",this._throttleOnScroll)},this._onResize=(function(){this.sendWidth(),this.settings.trackscroll&&this.sendViewportAndIFramePosition()}).bind(this),this._onScroll=(function(){this.sendViewportAndIFramePosition()}).bind(this),this._fire=function(g,y){if(g in this.messageHandlers)for(var v=0;v<this.messageHandlers[g].length;v++)this.messageHandlers[g][v].call(this,y)},this.remove=function(){window.removeEventListener("message",this._processMessage),window.removeEventListener("resize",this._onResize),this.el.removeChild(this.iframe),h()},this._processMessage=(function(g){if(s(g,this.settings)&&typeof g.data=="string"){var y=g.data.match(this.messageRegex);if(!y||y.length!==3)return!1;var v=y[1],x=y[2];this._fire(v,x)}}).bind(this),this._onHeightMessage=function(g){var y=parseInt(g);this.iframe.setAttribute("height",y+"px")},this._onNavigateToMessage=function(g){a(g)&&(document.location.href=g)},this._onScrollToChildPosMessage=function(g){var y=document.getElementById(this.id).getBoundingClientRect().top+window.pageYOffset,v=y+parseInt(g);window.scrollTo(0,v)},this.onMessage=function(g,y){g in this.messageHandlers||(this.messageHandlers[g]=[]),this.messageHandlers[g].push(y)},this.sendMessage=function(g,y){this.el.getElementsByTagName("iframe").length&&(this.el.getElementsByTagName("iframe")[0].contentWindow?this.el.getElementsByTagName("iframe")[0].contentWindow.postMessage(o(this.id,g,y),"*"):this.remove())},this.sendWidth=function(){var g=this.el.offsetWidth.toString();this.sendMessage("width",g)},this.sendViewportAndIFramePosition=function(){var g=this.iframe.getBoundingClientRect(),y=window.innerWidth||document.documentElement.clientWidth,v=window.innerHeight||document.documentElement.clientHeight,x=y+" "+v;x+=" "+g.top+" "+g.left,x+=" "+g.bottom+" "+g.right,this.sendMessage("viewport-iframe-position",x)};for(var m in p)this.settings[m]=p[m];return this._throttleOnScroll=d(this._onScroll.bind(this),this.settings.scrollwait),this.onMessage("height",this._onHeightMessage),this.onMessage("navigateTo",this._onNavigateToMessage),this.onMessage("scrollToChildPos",this._onScrollToChildPosMessage),this.onMessage("parentPositionInfo",this.sendViewportAndIFramePosition),window.addEventListener("message",this._processMessage,!1),this._constructIframe(),this},n.Child=function(A){this.parentWidth=null,this.id=null,this.parentTitle=null,this.parentUrl=null,this.settings={renderCallback:null,xdomain:"*",polling:0,parenturlparam:"parentUrl"},this.timerId=null,this.messageRegex=null,this.messageHandlers={},A=A||{},this.onMessage=function(g,y){g in this.messageHandlers||(this.messageHandlers[g]=[]),this.messageHandlers[g].push(y)},this._fire=function(g,y){if(g in this.messageHandlers)for(var v=0;v<this.messageHandlers[g].length;v++)this.messageHandlers[g][v].call(this,y)},this._processMessage=(function(g){if(s(g,this.settings)&&typeof g.data=="string"){var y=g.data.match(this.messageRegex);if(!(!y||y.length!==3)){var v=y[1],x=y[2];this._fire(v,x)}}}).bind(this),this._onWidthMessage=function(g){var y=parseInt(g);y!==this.parentWidth&&(this.parentWidth=y,this.settings.renderCallback&&this.settings.renderCallback(y),this.sendHeight())},this.sendMessage=function(g,y){window.parent.postMessage(o(this.id,g,y),"*")},this.sendHeight=(function(){var g=document.getElementsByTagName("body")[0].offsetHeight.toString();return this.sendMessage("height",g),g}).bind(this),this.getParentPositionInfo=function(){this.sendMessage("parentPositionInfo")},this.scrollParentTo=function(g){this.sendMessage("navigateTo","#"+g)},this.navigateParentTo=function(g){this.sendMessage("navigateTo",g)},this.scrollParentToChildEl=function(g){var y=document.getElementById(g).getBoundingClientRect().top+window.pageYOffset;this.scrollParentToChildPos(y)},this.scrollParentToChildPos=function(g){this.sendMessage("scrollToChildPos",g.toString())};var f=function(g){var y=document.getElementsByTagName("html")[0],v,x=y.className;try{window.self!==window.top?v="embedded":v="not-embedded"}catch{v="embedded"}x.indexOf(v)<0&&(y.className=x?x+" "+v:v,g&&g(v),r("marked-embedded"))};this.remove=function(){window.removeEventListener("message",this._processMessage),this.timerId&&clearInterval(this.timerId)};for(var p in A)this.settings[p]=A[p];this.id=i("childId")||A.id,this.messageRegex=new RegExp("^pym"+t+this.id+t+"(\\S+)"+t+"(.*)$");var m=parseInt(i("initialWidth"));return this.parentUrl=i(this.settings.parenturlparam),this.parentTitle=i("parentTitle"),this.onMessage("width",this._onWidthMessage),window.addEventListener("message",this._processMessage,!1),this.settings.renderCallback&&this.settings.renderCallback(m),this.sendHeight(),this.settings.polling&&(this.timerId=window.setInterval(this.sendHeight,this.settings.polling)),f(A.onMarkedEmbeddedStatus),this},typeof document<"u"&&n.autoInit(!0),n})})(Doe);var DOe=Doe.exports;const UOe=Mn(DOe),rw={iframeDomain:"https://holdenrichardson-realsavvy.realsavvy.co",idxRedirectPath:"/idx",idxPrefix:"/app",siteId:null,clientId:"eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",style:{mainFont:"Inter"}},X9={idxPath:"/",marketId:"2319",map:!0,query:{},suggestions:[],height:"100vh",idxRedirect:!0},Uoe=(e,t)=>{const n=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=t?`${t}[${r}]`:r,s=e[r];s!=null&&n.push(s!==null&&typeof s=="object"?Uoe(s,i):`${encodeURIComponent(i)}=${encodeURIComponent(s)}`)}return n.join("&")},HOe=(e={})=>{const{path:t="/",marketId:n=X9.marketId,map:r=X9.map,query:i={},cycagt:s=null,vid:a=null,magicLink:o=null,magicAuth:c=null}=e;let u=n;const d=localStorage.getItem("_market_v3");if(d)try{u=JSON.parse(d).id}catch{}const h={market_id:u,map:r,...i};h.client_id=rw.clientId,h.font=rw.style.mainFont,s&&(h._cycagt=s),a&&(h._vid=a),o&&(h.magic_link=o),c&&(h.magic_auth=c.replace(/ /g,"+")),typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches&&(h.map=!1);let A=rw.iframeDomain;/^https?:\/\//i.test(A)||(A=`https://${A}`),A=A.replace(/\/+$/,"");const f=Uoe(h);return`${A}${rw.idxPrefix}${t}${f?`?${f}`:""}`},QOe=e=>{const t=n=>{var s;if(!n.origin.includes("realsavvy"))return;const r=n.data;if(!r||!r.postal)return;const i=r.packingSlip;if(i){if(i.type==="federation.ping"){(s=n.source)==null||s.postMessage({postal:!0,packingSlip:{type:"federation.pong"}},{targetOrigin:n.origin});return}if(i.type==="federation.message"){const a=i.envelope;if(!a)return;if(a.channel==="idx"&&a.topic==="router.didTransition"){const o=a.data;if(!o||!o.currentURL)return;const c=o.currentURL.split("?"),u=c[0],d=new URLSearchParams(c[1]||"");e&&d.set("_cycagt",e);const h=d.toString(),A=h===""?u:`${u}?${h}`;window.history.replaceState(o,document.title,`${rw.idxRedirectPath}${A}`)}}}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},$Oe=(e,t)=>{const n=e.startsWith("?")?e.slice(1):e;for(const r of n.split("&")){if(!r)continue;const[i,...s]=r.split("=");if(decodeURIComponent(i)===t)return s.join("=")}return null},Wr=()=>{const e=C.useRef(null),t=co();return C.useEffect(()=>{const n=new URLSearchParams(t.search),r=n.get("_cycagt"),i=n.get("_vid"),s=n.get("magic_link"),a=$Oe(t.search,"magic_auth")??n.get("magic_auth");r&&localStorage.setItem("cycagt",r),i&&localStorage.setItem("_vid",i);const o=localStorage.getItem("cycagt"),c=localStorage.getItem("_vid"),u=QOe(o),d=t.pathname.startsWith("/idx")?t.pathname.replace(/^\/idx/,"")||"/":t.pathname,h=HOe({path:d,cycagt:o,vid:c,magicLink:s,magicAuth:a});e.current=new UOe.Parent("idx-frame",h,{});const A=()=>{var g;const f=document.querySelector("header"),p=(f==null?void 0:f.offsetHeight)||80,m=window.innerHeight-p;(g=e.current)!=null&&g.iframe&&(e.current.iframe.setAttribute("height",`${m}px`),e.current.iframe.style.height=`${m}px`)};return A(),window.addEventListener("resize",A),()=>{u(),window.removeEventListener("resize",A)}},[t.pathname,t.search]),l.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Home Search | Grand Rapids Homes | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Search homes for sale in Grand Rapids, East Grand Rapids, Ada, and West Michigan with Holden Richardson."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/idx"}),l.jsx("meta",{property:"og:title",content:"Home Search | Grand Rapids Homes for Sale"}),l.jsx("meta",{property:"og:description",content:"Search homes for sale in Grand Rapids and West Michigan with Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/idx"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Home Search | Grand Rapids Homes for Sale"}),l.jsx("meta",{name:"twitter:description",content:"Search homes for sale in Grand Rapids and West Michigan with Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx(EE,{}),l.jsxs("main",{className:"flex-1 pt-[80px]",children:[l.jsx("div",{id:"idx-frame",className:"w-full [&>iframe]:w-full [&>iframe]:border-0"}),l.jsxs("div",{className:"text-center py-3 text-xs text-muted-foreground",children:["Powered by"," ",l.jsx("a",{href:"https://www.realsavvy.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"RealSavvy"})]})]})]})};var zOe="Label",Hoe=C.forwardRef((e,t)=>l.jsx(_t.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Hoe.displayName=zOe;var Qoe=Hoe;const VOe=v2("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),qe=C.forwardRef(({className:e,...t},n)=>l.jsx(Qoe,{ref:n,className:ot(VOe(),e),...t}));qe.displayName=Qoe.displayName;const Zt=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ot("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Zt.displayName="Card";const Sa=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ot("flex flex-col space-y-1.5 p-6",e),...t}));Sa.displayName="CardHeader";const ka=C.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:ot("text-2xl font-semibold leading-none tracking-tight",e),...t}));ka.displayName="CardTitle";const jp=C.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:ot("text-sm text-muted-foreground",e),...t}));jp.displayName="CardDescription";const en=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ot("p-6 pt-0",e),...t}));en.displayName="CardContent";const KOe=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ot("flex items-center p-6 pt-0",e),...t}));KOe.displayName="CardFooter";function p0(){const[e,t]=C.useState(null),[n,r]=C.useState(null),[i,s]=C.useState(!0),[a,o]=C.useState(!1);return C.useEffect(()=>{const h=async f=>{const{data:p}=await Me.from("user_roles").select("role").eq("user_id",f).eq("role","admin").maybeSingle();o(!!p)},{data:{subscription:A}}=Me.auth.onAuthStateChange((f,p)=>{r(p),t((p==null?void 0:p.user)??null),p!=null&&p.user?setTimeout(()=>h(p.user.id).then(()=>s(!1)),0):(o(!1),s(!1))});return Me.auth.getSession().then(({data:{session:f}})=>{r(f),t((f==null?void 0:f.user)??null),f!=null&&f.user?h(f.user.id).then(()=>s(!1)):s(!1)}),()=>A.unsubscribe()},[]),{user:e,session:n,isLoading:i,isAdmin:a,signIn:async(h,A)=>{const{error:f}=await Me.auth.signInWithPassword({email:h,password:A});return{error:f}},signUp:async(h,A)=>{const{error:f}=await Me.auth.signUp({email:h,password:A,options:{emailRedirectTo:window.location.origin}});return{error:f}},signOut:async()=>{await Me.auth.signOut(),t(null),r(null),o(!1)}}}const qOe=()=>{const e=Ll(),{toast:t}=$f(),{user:n,isLoading:r,isAdmin:i,signIn:s,signUp:a}=p0(),[o,c]=C.useState("signin"),[u,d]=C.useState(""),[h,A]=C.useState(""),[f,p]=C.useState(""),[m,g]=C.useState(""),[y,v]=C.useState(""),[x,b]=C.useState(""),[w,k]=C.useState(!1),[j,B]=C.useState(!1);C.useEffect(()=>{!r&&n&&i&&e("/admin")},[n,r,i,e]);const E=async N=>{N.preventDefault(),k(!0);const{error:F}=await s(u,h);t(F?{variant:"destructive",title:"Login failed",description:F.message}:{title:"Welcome back!",description:"You have successfully logged in."}),k(!1)},P=async N=>{if(N.preventDefault(),m!==y){t({variant:"destructive",title:"Passwords don't match",description:"Please make sure your passwords match."});return}if(m.length<6){t({variant:"destructive",title:"Password too short",description:"Password must be at least 6 characters."});return}k(!0);const{error:F}=await a(f,m);t(F?{variant:"destructive",title:"Registration failed",description:F.message}:{title:"Registration successful!",description:"Please check your email to verify your account."}),k(!1)},T=async N=>{N.preventDefault(),k(!0);const{error:F}=await Me.auth.resetPasswordForEmail(x,{redirectTo:`${window.location.origin}/reset-password`});F?t({variant:"destructive",title:"Failed to send reset link",description:F.message}):(B(!0),t({title:"Check your email",description:"A password reset link has been sent to your email."})),k(!1)};return r?l.jsx(un,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Sign In | Holden Richardson | 616 Realty"}),l.jsx("meta",{name:"description",content:"Sign in to access your account."}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsx("div",{className:"container-page max-w-md",children:l.jsxs(Zt,{className:"border-border",children:[l.jsxs(Sa,{className:"text-center",children:[l.jsx(ka,{className:"heading-card",children:"Welcome"}),l.jsx(jp,{children:o==="forgot"?"Reset your password":"Sign in to access the admin dashboard"})]}),l.jsx(en,{children:o==="forgot"?l.jsx("div",{className:"space-y-4",children:j?l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("p",{className:"text-muted-foreground",children:"Check your email for a password reset link."}),l.jsx(xe,{variant:"outline",className:"w-full",onClick:()=>{c("signin"),B(!1)},children:"Back to Sign In"})]}):l.jsxs("form",{onSubmit:T,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"forgot-email",children:"Email"}),l.jsx(Je,{id:"forgot-email",type:"email",placeholder:"you@example.com",value:x,onChange:N=>b(N.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:w,children:w?"Sending…":"Send Reset Link"}),l.jsx(xe,{type:"button",variant:"ghost",className:"w-full",onClick:()=>c("signin"),children:"Back to Sign In"})]})}):l.jsxs(ym,{value:o,onValueChange:N=>c(N),className:"w-full",children:[l.jsxs(Kf,{className:"grid w-full grid-cols-2",children:[l.jsx($n,{value:"signin",children:"Sign In"}),l.jsx($n,{value:"signup",children:"Sign Up"})]}),l.jsx(zn,{value:"signin",className:"mt-6",children:l.jsxs("form",{onSubmit:E,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"login-email",children:"Email"}),l.jsx(Je,{id:"login-email",type:"email",placeholder:"you@example.com",value:u,onChange:N=>d(N.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"login-password",children:"Password"}),l.jsx(Je,{id:"login-password",type:"password",placeholder:"••••••••",value:h,onChange:N=>A(N.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:w,children:w?"Signing in…":"Sign In"}),l.jsx(xe,{type:"button",variant:"link",className:"w-full text-sm",onClick:()=>c("forgot"),children:"Forgot password?"})]})}),l.jsx(zn,{value:"signup",className:"mt-6",children:l.jsxs("form",{onSubmit:P,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"register-email",children:"Email"}),l.jsx(Je,{id:"register-email",type:"email",placeholder:"you@example.com",value:f,onChange:N=>p(N.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"register-password",children:"Password"}),l.jsx(Je,{id:"register-password",type:"password",placeholder:"••••••••",value:m,onChange:N=>g(N.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"confirm-password",children:"Confirm Password"}),l.jsx(Je,{id:"confirm-password",type:"password",placeholder:"••••••••",value:y,onChange:N=>v(N.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:w,children:w?"Creating account…":"Create Account"})]})})]})})]})})})]})};function WOe(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function $oe(){return Br({queryKey:["fallback-image-pool"],queryFn:async()=>{const{data:e,error:t}=await Me.from("site_media").select("file_path, alt_text, file_name").in("media_type",["stock_photo","photo"]).order("created_at",{ascending:!1});if(t)throw t;return(e||[]).map(n=>{const{data:r}=Me.storage.from("site-media").getPublicUrl(n.file_path);return{url:r.publicUrl,alt:n.alt_text||n.file_name||"Photo"}})},staleTime:1e3*60*30})}function zoe(e,t){if(!e||e.length===0)return null;const n=WOe(t)%e.length;return e[n]}const GOe=({post:e,fallbackPool:t})=>{const n=zoe(t,e.slug),r=e.featured_image||(n==null?void 0:n.url),i=e.title||(n==null?void 0:n.alt)||"Featured post",s=e.published_at?new Date(e.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsx(St,{to:`/blog/${e.slug}`,className:"group block mb-16",children:l.jsxs("article",{className:"grid md:grid-cols-2 gap-0 border border-border bg-card overflow-hidden hover:shadow-lg transition-all duration-500",children:[r&&l.jsx("div",{className:"aspect-[16/10] md:aspect-auto md:h-full overflow-hidden bg-secondary",children:l.jsx("img",{src:r,alt:i,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",loading:"eager"})}),l.jsxs("div",{className:"p-6 md:p-10 flex flex-col justify-center",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-[0.25em] text-gold mb-4 font-medium",children:"Featured"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs uppercase tracking-wider text-muted-foreground mb-4",children:[e.category&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(uE,{className:"w-3 h-3"}),e.category]}),s&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Cl,{className:"w-3 h-3"}),s]})]}),l.jsx("h2",{className:"heading-section mb-4 group-hover:text-accent transition-colors",children:e.title}),e.excerpt&&l.jsx("p",{className:"text-body text-muted-foreground line-clamp-3 mb-6",children:e.excerpt}),l.jsxs("div",{className:"flex items-center gap-2 text-sm uppercase tracking-wider text-foreground group-hover:text-accent transition-colors font-medium",children:["Read article",l.jsx(Xa,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})]})})},YOe=({categories:e,active:t,onChange:n})=>{const r=C.useMemo(()=>[...e].sort((i,s)=>i.localeCompare(s)),[e]);return r.length===0?null:l.jsxs("div",{className:"flex flex-wrap gap-2 mb-10",children:[l.jsx("button",{onClick:()=>n(null),className:`px-4 py-2 text-xs uppercase tracking-[0.18em] font-medium border transition-colors ${t===null?"border-gold text-gold bg-gold/5":"border-border text-muted-foreground hover:border-gold/50 hover:text-foreground"}`,children:"All"}),r.map(i=>l.jsx("button",{onClick:()=>n(i),className:`px-4 py-2 text-xs uppercase tracking-[0.18em] font-medium border transition-colors ${t===i?"border-gold text-gold bg-gold/5":"border-border text-muted-foreground hover:border-gold/50 hover:text-foreground"}`,children:i},i))]})},XOe=({post:e,fallbackPool:t})=>{const n=zoe(t,e.slug),r=e.featured_image||(n==null?void 0:n.url),i=e.title||(n==null?void 0:n.alt)||"Blog post",s=e.published_at?new Date(e.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsx(_e,{children:l.jsx(St,{to:`/blog/${e.slug}`,className:"group block h-full",children:l.jsxs("article",{className:"border border-border bg-card overflow-hidden transition-all duration-500 hover:shadow-lg h-full flex flex-col",children:[r&&l.jsx("div",{className:"aspect-[16/10] overflow-hidden bg-secondary",children:l.jsx("img",{src:r,alt:i,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",loading:"lazy"})}),l.jsxs("div",{className:"p-6 md:p-7 flex-1 flex flex-col",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs uppercase tracking-wider text-muted-foreground mb-3",children:[e.category&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(uE,{className:"w-3 h-3"}),e.category]}),s&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Cl,{className:"w-3 h-3"}),s]}),e.author&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(dE,{className:"w-3 h-3"}),e.author]})]}),l.jsx("h2",{className:"heading-card mb-3 group-hover:text-accent transition-colors",children:e.title}),e.excerpt&&l.jsx("p",{className:"text-body text-muted-foreground line-clamp-3",children:e.excerpt}),l.jsx("div",{className:"mt-auto pt-5",children:l.jsx("span",{className:"text-caption text-foreground group-hover:text-accent transition-colors",children:"Read More →"})})]})]})})})},JOe=()=>l.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[l.jsx(ht,{className:"aspect-[16/10] w-full"}),l.jsxs("div",{className:"p-6 md:p-7 space-y-4",children:[l.jsxs("div",{className:"flex gap-4",children:[l.jsx(ht,{className:"h-4 w-20"}),l.jsx(ht,{className:"h-4 w-24"})]}),l.jsx(ht,{className:"h-8 w-3/4"}),l.jsx(ht,{className:"h-16 w-full"}),l.jsx(ht,{className:"h-4 w-24"})]})]}),ZOe=()=>{const{data:e,isLoading:t,error:n}=Zae(),{data:r}=$oe(),[i,s]=C.useState(null),a=C.useMemo(()=>{if(!e)return[];const h=new Set;return e.forEach(A=>A.category&&h.add(A.category)),Array.from(h)},[e]),o=e==null?void 0:e[0],c=(e==null?void 0:e.slice(1))||[],u=i?c.filter(h=>h.category===i):c,d=i?(e==null?void 0:e.filter(h=>h.category===i))||[]:u;return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Blog | Grand Rapids Real Estate Insights | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Real estate insights, market trends, and expert tips from Holden Richardson — Grand Rapids Realtor at 616 Realty LLC."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/blog"}),l.jsx("meta",{property:"og:title",content:"Blog | Grand Rapids Real Estate Insights"}),l.jsx("meta",{property:"og:description",content:"Real estate insights, market trends, and tips from Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/blog"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Blog | Grand Rapids Real Estate Insights"}),l.jsx("meta",{name:"twitter:description",content:"Real estate insights, market trends, and tips from Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"Blog",item:"https://www.holdengr.com/blog"}]})}),e&&e.length>0&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"CollectionPage","@id":"https://www.holdengr.com/blog",url:"https://www.holdengr.com/blog",name:"Blog | Grand Rapids Real Estate Insights",description:"Insights, market trends, and real estate tips from Holden Richardson.",isPartOf:{"@id":"https://www.holdengr.com/#website"},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:{"@type":"ItemList",numberOfItems:e.length,itemListElement:e.map((h,A)=>({"@type":"ListItem",position:A+1,url:`https://www.holdengr.com/blog/${h.slug}`,name:h.title}))}})})]}),l.jsx("section",{className:"bg-background -mt-20 pt-28 md:pt-32 pb-6 md:pb-8 border-b border-border",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 pb-4 border-b border-border/60",children:[l.jsx("p",{className:"text-[10px] md:text-[11px] uppercase tracking-[0.3em] text-muted-foreground font-medium",children:"The Journal"}),l.jsx("p",{className:"hidden sm:block text-[10px] md:text-[11px] uppercase tracking-[0.3em] text-muted-foreground font-medium",children:e&&e.length>0?`Vol. 01 · ${e.length} ${e.length===1?"Story":"Stories"}`:"Vol. 01"})]}),l.jsxs("div",{className:"pt-6 md:pt-8 pb-2 md:pb-3 grid md:grid-cols-12 gap-6 md:gap-10 items-end",children:[l.jsxs("h1",{className:"md:col-span-7 heading-display leading-[0.95] tracking-tight",children:["Insights from",l.jsx("br",{className:"hidden md:block"})," the field."]}),l.jsx("p",{className:"md:col-span-5 text-body text-muted-foreground md:text-right md:border-l md:border-border md:pl-6",children:"Market reports, neighborhood breakdowns, and the lessons we keep learning from selling Grand Rapids real estate."})]})]})})}),l.jsx("section",{className:"pt-10 md:pt-14 pb-16 md:pb-20 bg-background",children:l.jsxs("div",{className:"container-page",children:[n&&l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-destructive",children:"Failed to load posts. Please try again later."})}),t&&l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:[...Array(6)].map((h,A)=>l.jsx(JOe,{},A))}),!t&&e&&e.length===0&&l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"No posts published yet. Check back soon!"})}),!t&&e&&e.length>0&&l.jsxs(l.Fragment,{children:[!i&&o&&l.jsx(GOe,{post:o,fallbackPool:r}),a.length>0&&l.jsx(YOe,{categories:a,active:i,onChange:s}),d.length===0&&l.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No posts in this category yet."}),l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:d.map(h=>l.jsx(XOe,{post:h,fallbackPool:r},h.id))})]})]})})]})},e3e=()=>{const{slug:e}=gm(),{data:t,isLoading:n,error:r}=v4e(e||"");if($oe(),n)return l.jsx(un,{children:l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-4xl",children:[l.jsx(ht,{className:"h-8 w-32 mb-8"}),l.jsx(ht,{className:"h-12 w-3/4 mb-4"}),l.jsxs("div",{className:"flex gap-4 mb-8",children:[l.jsx(ht,{className:"h-4 w-24"}),l.jsx(ht,{className:"h-4 w-24"})]}),l.jsx(ht,{className:"aspect-[16/9] w-full mb-8"}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(ht,{className:"h-4 w-full"}),l.jsx(ht,{className:"h-4 w-full"}),l.jsx(ht,{className:"h-4 w-3/4"})]})]})})});if(r||!t)return l.jsxs(un,{children:[l.jsx(Vn,{children:l.jsx("title",{children:"Post Not Found | Holden Richardson"})}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Post Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground mb-8",children:"The blog post you're looking for doesn't exist or has been removed."}),l.jsx(St,{to:"/blog",className:"btn-outline-primary",children:"Back to Blog"})]})})]});const i=t.published_at?new Date(t.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsxs("title",{children:[t.meta_title||t.title," | Holden Richardson"]}),l.jsx("meta",{name:"description",content:t.meta_description||t.excerpt||""}),l.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/blog/${e}`}),l.jsx("meta",{property:"og:image",content:t.featured_image||"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:title",content:t.meta_title||t.title}),l.jsx("meta",{property:"og:description",content:t.meta_description||t.excerpt||""}),l.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/blog/${e}`}),l.jsx("meta",{property:"og:type",content:"article"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:t.meta_title||t.title}),l.jsx("meta",{name:"twitter:description",content:t.meta_description||t.excerpt||""}),l.jsx("meta",{name:"twitter:image",content:t.featured_image||"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,...t.featured_image&&{image:[t.featured_image]},author:{"@type":"Person",name:t.author||"Holden Richardson",url:"https://www.holdengr.com/about"},publisher:{"@id":"https://www.holdengr.com/#agent"},datePublished:t.published_at,dateModified:t.updated_at||t.published_at,description:t.excerpt||t.meta_description||"",url:`https://www.holdengr.com/blog/${e}`,mainEntityOfPage:{"@type":"WebPage","@id":`https://www.holdengr.com/blog/${e}`},isPartOf:{"@id":"https://www.holdengr.com/#website"},inLanguage:"en-US"})}),t.faq_json&&Array.isArray(t.faq_json)&&t.faq_json.length>0&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntityOfPage:{"@id":`https://www.holdengr.com/blog/${e}`},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:t.faq_json.map(s=>({"@type":"Question",name:s.question,acceptedAnswer:{"@type":"Answer",text:s.answer}}))})})]}),l.jsx("article",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-4xl",children:[l.jsx(_e,{children:l.jsxs(St,{to:"/blog",className:"inline-flex items-center gap-2 text-caption text-muted-foreground hover:text-foreground transition-colors mb-8",children:[l.jsx(mm,{className:"w-4 h-4"}),"Back to Blog"]})}),l.jsx(_e,{children:l.jsxs("header",{className:"mb-8",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs uppercase tracking-wider text-muted-foreground mb-4",children:[t.category&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(uE,{className:"w-3 h-3"}),t.category]}),i&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Cl,{className:"w-3 h-3"}),i]}),t.author&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(dE,{className:"w-3 h-3"}),t.author]})]}),l.jsx("h1",{className:"heading-section",children:t.title})]})}),t.featured_image&&l.jsx(_e,{children:l.jsx("div",{className:"aspect-[16/9] overflow-hidden mb-8",children:l.jsx("img",{src:t.featured_image,alt:t.title,className:"w-full h-full object-cover",loading:"lazy"})})}),l.jsx(_e,{children:l.jsx("div",{className:`prose prose-lg max-w-none 
                         prose-headings:font-serif prose-headings:font-medium
                         prose-p:text-body prose-p:text-muted-foreground
                         prose-a:text-accent prose-a:no-underline hover:prose-a:underline
                         prose-strong:text-foreground
                         prose-blockquote:border-l-accent prose-blockquote:text-muted-foreground
                         prose-ul:text-muted-foreground prose-ol:text-muted-foreground`,dangerouslySetInnerHTML:{__html:t.content}})}),t.tags&&t.tags.length>0&&l.jsx(_e,{children:l.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:l.jsx("div",{className:"flex flex-wrap gap-2",children:t.tags.map(s=>l.jsx("span",{className:"px-3 py-1 text-xs uppercase tracking-wider bg-secondary text-muted-foreground",children:s},s))})})})]})})]})};function t3e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const n3e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r3e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i3e={};function J9(e,t){return(i3e.jsx?r3e:n3e).test(e)}const s3e=/[ \t\n\f\r]/g;function a3e(e){return typeof e=="object"?e.type==="text"?Z9(e.value):!1:Z9(e)}function Z9(e){return e.replace(s3e,"")===""}let N2=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};N2.prototype.normal={};N2.prototype.property={};N2.prototype.space=void 0;function Voe(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new N2(n,r,t)}function KF(e){return e.toLowerCase()}class uo{constructor(t,n){this.attribute=n,this.property=t}}uo.prototype.attribute="";uo.prototype.booleanish=!1;uo.prototype.boolean=!1;uo.prototype.commaOrSpaceSeparated=!1;uo.prototype.commaSeparated=!1;uo.prototype.defined=!1;uo.prototype.mustUseProperty=!1;uo.prototype.number=!1;uo.prototype.overloadedBoolean=!1;uo.prototype.property="";uo.prototype.spaceSeparated=!1;uo.prototype.space=void 0;let o3e=0;const An=vm(),Ei=vm(),qF=vm(),Xe=vm(),br=vm(),ky=vm(),So=vm();function vm(){return 2**++o3e}const WF=Object.freeze(Object.defineProperty({__proto__:null,boolean:An,booleanish:Ei,commaOrSpaceSeparated:So,commaSeparated:ky,number:Xe,overloadedBoolean:qF,spaceSeparated:br},Symbol.toStringTag,{value:"Module"})),AP=Object.keys(WF);class S6 extends uo{constructor(t,n,r,i){let s=-1;if(super(t,n),eV(this,"space",i),typeof r=="number")for(;++s<AP.length;){const a=AP[s];eV(this,AP[s],(r&WF[a])===WF[a])}}}S6.prototype.defined=!0;function eV(e,t,n){n&&(e[t]=n)}function m0(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new S6(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[KF(r)]=r,n[KF(s.attribute)]=r}return new N2(t,n,e.space)}const Koe=m0({properties:{ariaActiveDescendant:null,ariaAtomic:Ei,ariaAutoComplete:null,ariaBusy:Ei,ariaChecked:Ei,ariaColCount:Xe,ariaColIndex:Xe,ariaColSpan:Xe,ariaControls:br,ariaCurrent:null,ariaDescribedBy:br,ariaDetails:null,ariaDisabled:Ei,ariaDropEffect:br,ariaErrorMessage:null,ariaExpanded:Ei,ariaFlowTo:br,ariaGrabbed:Ei,ariaHasPopup:null,ariaHidden:Ei,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:br,ariaLevel:Xe,ariaLive:null,ariaModal:Ei,ariaMultiLine:Ei,ariaMultiSelectable:Ei,ariaOrientation:null,ariaOwns:br,ariaPlaceholder:null,ariaPosInSet:Xe,ariaPressed:Ei,ariaReadOnly:Ei,ariaRelevant:null,ariaRequired:Ei,ariaRoleDescription:br,ariaRowCount:Xe,ariaRowIndex:Xe,ariaRowSpan:Xe,ariaSelected:Ei,ariaSetSize:Xe,ariaSort:null,ariaValueMax:Xe,ariaValueMin:Xe,ariaValueNow:Xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function qoe(e,t){return t in e?e[t]:t}function Woe(e,t){return qoe(e,t.toLowerCase())}const l3e=m0({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ky,acceptCharset:br,accessKey:br,action:null,allow:null,allowFullScreen:An,allowPaymentRequest:An,allowUserMedia:An,alt:null,as:null,async:An,autoCapitalize:null,autoComplete:br,autoFocus:An,autoPlay:An,blocking:br,capture:null,charSet:null,checked:An,cite:null,className:br,cols:Xe,colSpan:null,content:null,contentEditable:Ei,controls:An,controlsList:br,coords:Xe|ky,crossOrigin:null,data:null,dateTime:null,decoding:null,default:An,defer:An,dir:null,dirName:null,disabled:An,download:qF,draggable:Ei,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:An,formTarget:null,headers:br,height:Xe,hidden:qF,high:Xe,href:null,hrefLang:null,htmlFor:br,httpEquiv:br,id:null,imageSizes:null,imageSrcSet:null,inert:An,inputMode:null,integrity:null,is:null,isMap:An,itemId:null,itemProp:br,itemRef:br,itemScope:An,itemType:br,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:An,low:Xe,manifest:null,max:null,maxLength:Xe,media:null,method:null,min:null,minLength:Xe,multiple:An,muted:An,name:null,nonce:null,noModule:An,noValidate:An,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:An,optimum:Xe,pattern:null,ping:br,placeholder:null,playsInline:An,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:An,referrerPolicy:null,rel:br,required:An,reversed:An,rows:Xe,rowSpan:Xe,sandbox:br,scope:null,scoped:An,seamless:An,selected:An,shadowRootClonable:An,shadowRootDelegatesFocus:An,shadowRootMode:null,shape:null,size:Xe,sizes:null,slot:null,span:Xe,spellCheck:Ei,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Xe,step:null,style:null,tabIndex:Xe,target:null,title:null,translate:null,type:null,typeMustMatch:An,useMap:null,value:Ei,width:Xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:br,axis:null,background:null,bgColor:null,border:Xe,borderColor:null,bottomMargin:Xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:An,declare:An,event:null,face:null,frame:null,frameBorder:null,hSpace:Xe,leftMargin:Xe,link:null,longDesc:null,lowSrc:null,marginHeight:Xe,marginWidth:Xe,noResize:An,noHref:An,noShade:An,noWrap:An,object:null,profile:null,prompt:null,rev:null,rightMargin:Xe,rules:null,scheme:null,scrolling:Ei,standby:null,summary:null,text:null,topMargin:Xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:An,disableRemotePlayback:An,prefix:null,property:null,results:Xe,security:null,unselectable:null},space:"html",transform:Woe}),c3e=m0({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:So,accentHeight:Xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Xe,amplitude:Xe,arabicForm:null,ascent:Xe,attributeName:null,attributeType:null,azimuth:Xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Xe,by:null,calcMode:null,capHeight:Xe,className:br,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Xe,diffuseConstant:Xe,direction:null,display:null,dur:null,divisor:Xe,dominantBaseline:null,download:An,dx:null,dy:null,edgeMode:null,editable:null,elevation:Xe,enableBackground:null,end:null,event:null,exponent:Xe,externalResourcesRequired:null,fill:null,fillOpacity:Xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ky,g2:ky,glyphName:ky,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Xe,horizOriginX:Xe,horizOriginY:Xe,id:null,ideographic:Xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Xe,k:Xe,k1:Xe,k2:Xe,k3:Xe,k4:Xe,kernelMatrix:So,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Xe,overlineThickness:Xe,paintOrder:null,panose1:null,path:null,pathLength:Xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:br,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Xe,pointsAtY:Xe,pointsAtZ:Xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:So,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:So,rev:So,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:So,requiredFeatures:So,requiredFonts:So,requiredFormats:So,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Xe,specularExponent:Xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Xe,strikethroughThickness:Xe,string:null,stroke:null,strokeDashArray:So,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Xe,strokeOpacity:Xe,strokeWidth:null,style:null,surfaceScale:Xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:So,tabIndex:Xe,tableValues:null,target:null,targetX:Xe,targetY:Xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:So,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Xe,underlineThickness:Xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Xe,values:null,vAlphabetic:Xe,vMathematical:Xe,vectorEffect:null,vHanging:Xe,vIdeographic:Xe,version:null,vertAdvY:Xe,vertOriginX:Xe,vertOriginY:Xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qoe}),Goe=m0({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Yoe=m0({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Woe}),Xoe=m0({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),u3e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},d3e=/[A-Z]/g,tV=/-[a-z]/g,h3e=/^data[-\w.:]+$/i;function f3e(e,t){const n=KF(t);let r=t,i=uo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&h3e.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(tV,p3e);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!tV.test(s)){let a=s.replace(d3e,A3e);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=S6}return new i(r,t)}function A3e(e){return"-"+e.toLowerCase()}function p3e(e){return e.charAt(1).toUpperCase()}const m3e=Voe([Koe,l3e,Goe,Yoe,Xoe],"html"),k6=Voe([Koe,c3e,Goe,Yoe,Xoe],"svg");function g3e(e){return e.join(" ").trim()}var _6={},nV=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,y3e=/\n/g,v3e=/^\s*/,x3e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,w3e=/^:\s*/,b3e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,C3e=/^[;\s]*/,S3e=/^\s+|\s+$/g,k3e=`
`,rV="/",iV="*",VA="",_3e="comment",j3e="declaration";function B3e(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(y3e);m&&(n+=m.length);var g=p.lastIndexOf(k3e);r=~g?p.length-g:r+p.length}function s(){var p={line:n,column:r};return function(m){return m.position=new a(p),u(),m}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(p){var m=p.exec(e);if(m){var g=m[0];return i(g),e=e.slice(g.length),m}}function u(){c(v3e)}function d(p){var m;for(p=p||[];m=h();)m!==!1&&p.push(m);return p}function h(){var p=s();if(!(rV!=e.charAt(0)||iV!=e.charAt(1))){for(var m=2;VA!=e.charAt(m)&&(iV!=e.charAt(m)||rV!=e.charAt(m+1));)++m;if(m+=2,VA===e.charAt(m-1))return o("End of comment missing");var g=e.slice(2,m-2);return r+=2,i(g),e=e.slice(m),r+=2,p({type:_3e,comment:g})}}function A(){var p=s(),m=c(x3e);if(m){if(h(),!c(w3e))return o("property missing ':'");var g=c(b3e),y=p({type:j3e,property:sV(m[0].replace(nV,VA)),value:g?sV(g[0].replace(nV,VA)):VA});return c(C3e),y}}function f(){var p=[];d(p);for(var m;m=A();)m!==!1&&(p.push(m),d(p));return p}return u(),f()}function sV(e){return e?e.replace(S3e,VA):VA}var N3e=B3e,E3e=Qh&&Qh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_6,"__esModule",{value:!0});_6.default=I3e;const T3e=E3e(N3e);function I3e(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,T3e.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var DE={};Object.defineProperty(DE,"__esModule",{value:!0});DE.camelCase=void 0;var P3e=/^--[a-zA-Z0-9_-]+$/,O3e=/-([a-z])/g,F3e=/^[^-]+$/,M3e=/^-(webkit|moz|ms|o|khtml)-/,L3e=/^-(ms)-/,R3e=function(e){return!e||F3e.test(e)||P3e.test(e)},D3e=function(e,t){return t.toUpperCase()},aV=function(e,t){return"".concat(t,"-")},U3e=function(e,t){return t===void 0&&(t={}),R3e(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(L3e,aV):e=e.replace(M3e,aV),e.replace(O3e,D3e))};DE.camelCase=U3e;var H3e=Qh&&Qh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Q3e=H3e(_6),$3e=DE;function GF(e,t){var n={};return!e||typeof e!="string"||(0,Q3e.default)(e,function(r,i){r&&i&&(n[(0,$3e.camelCase)(r,t)]=i)}),n}GF.default=GF;var z3e=GF;const V3e=Mn(z3e),Joe=Zoe("end"),j6=Zoe("start");function Zoe(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function K3e(e){const t=j6(e),n=Joe(e);if(t&&n)return{start:t,end:n}}function Lw(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?oV(e.position):"start"in e||"end"in e?oV(e):"line"in e||"column"in e?YF(e):""}function YF(e){return lV(e&&e.line)+":"+lV(e&&e.column)}function oV(e){return YF(e&&e.start)+"-"+YF(e&&e.end)}function lV(e){return e&&typeof e=="number"?e:1}class la extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Lw(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}la.prototype.file="";la.prototype.name="";la.prototype.reason="";la.prototype.message="";la.prototype.stack="";la.prototype.column=void 0;la.prototype.line=void 0;la.prototype.ancestors=void 0;la.prototype.cause=void 0;la.prototype.fatal=void 0;la.prototype.place=void 0;la.prototype.ruleId=void 0;la.prototype.source=void 0;const B6={}.hasOwnProperty,q3e=new Map,W3e=/[A-Z]/g,G3e=new Set(["table","tbody","thead","tfoot","tr"]),Y3e=new Set(["td","th"]),ele="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function X3e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=sFe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=iFe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?k6:m3e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=tle(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function tle(e,t,n){if(t.type==="element")return J3e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Z3e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return tFe(e,t,n);if(t.type==="mdxjsEsm")return eFe(e,t);if(t.type==="root")return nFe(e,t,n);if(t.type==="text")return rFe(e,t)}function J3e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=k6,e.schema=i),e.ancestors.push(t);const s=rle(e,t.tagName,!1),a=aFe(e,t);let o=E6(e,t);return G3e.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!a3e(c):!0})),nle(e,a,s,t),N6(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Z3e(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Yb(e,t.position)}function eFe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yb(e,t.position)}function tFe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=k6,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:rle(e,t.name,!0),a=oFe(e,t),o=E6(e,t);return nle(e,a,s,t),N6(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function nFe(e,t,n){const r={};return N6(r,E6(e,t)),e.create(t,e.Fragment,r,n)}function rFe(e,t){return t.value}function nle(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function N6(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function iFe(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function sFe(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),c=j6(r);return t(i,s,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function aFe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&B6.call(t.properties,i)){const s=lFe(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Y3e.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function oFe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Yb(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Yb(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function E6(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:q3e;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=i.get(c)||0;a=c+"-"+u,i.set(c,u+1)}}const o=tle(e,s,a);o!==void 0&&n.push(o)}return n}function lFe(e,t,n){const r=f3e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?t3e(n):g3e(n)),r.property==="style"){let i=typeof n=="object"?n:cFe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=uFe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?u3e[r.property]||r.property:r.attribute,n]}}function cFe(e,t){try{return V3e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new la("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ele+"#cannot-parse-style-attribute",i}}function rle(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=J9(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=J9(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return B6.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yb(e)}function Yb(e,t){const n=new la("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ele+"#cannot-handle-mdx-estrees-without-createevaluater",n}function uFe(e){const t={};let n;for(n in e)B6.call(e,n)&&(t[dFe(n)]=e[n]);return t}function dFe(e){let t=e.replace(W3e,hFe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function hFe(e){return"-"+e.toLowerCase()}const pP={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fFe={};function T6(e,t){const n=fFe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ile(e,r,i)}function ile(e,t,n){if(AFe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return cV(e.children,t,n)}return Array.isArray(e)?cV(e,t,n):""}function cV(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ile(e[i],t,n);return r.join("")}function AFe(e){return!!(e&&typeof e=="object")}const uV=document.createElement("i");function I6(e){const t="&"+e+";";uV.innerHTML=t;const n=uV.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ho(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function fl(e,t){return e.length>0?(Ho(e,e.length,0,t),e):t}const dV={}.hasOwnProperty;function sle(e){const t={};let n=-1;for(;++n<e.length;)pFe(t,e[n]);return t}function pFe(e,t){let n;for(n in t){const i=(dV.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){dV.call(i,a)||(i[a]=[]);const o=s[a];mFe(i[a],Array.isArray(o)?o:o?[o]:[])}}}function mFe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ho(e,0,0,r)}function ale(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function xc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const wa=qf(/[A-Za-z]/),na=qf(/[\dA-Za-z]/),gFe=qf(/[#-'*+\--9=?A-Z^-~]/);function Sj(e){return e!==null&&(e<32||e===127)}const XF=qf(/\d/),yFe=qf(/[\dA-Fa-f]/),vFe=qf(/[!-/:-@[-`{-~]/);function $t(e){return e!==null&&e<-2}function mr(e){return e!==null&&(e<0||e===32)}function Cn(e){return e===-2||e===-1||e===32}const UE=qf(new RegExp("\\p{P}|\\p{S}","u")),Xp=qf(/\s/);function qf(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function g0(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&na(e.charCodeAt(n+1))&&na(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function On(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return Cn(c)?(e.enter(n),o(c)):t(c)}function o(c){return Cn(c)&&s++<i?(e.consume(c),o):(e.exit(n),t(c))}}const xFe={tokenize:wFe};function wFe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),On(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return $t(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const bFe={tokenize:CFe},hV={tokenize:SFe};function CFe(e){const t=this,n=[];let r=0,i,s,a;return o;function o(x){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,c,u)(x)}return u(x)}function c(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const b=t.events.length;let w=b,k;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){k=t.events[w][1].end;break}y(r);let j=b;for(;j<t.events.length;)t.events[j][1].end={...k},j++;return Ho(t.events,w+1,0,t.events.slice(b)),t.events.length=j,u(x)}return o(x)}function u(x){if(r===n.length){if(!i)return A(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hV,d,h)(x)}function d(x){return i&&v(),y(r),A(x)}function h(x){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(x)}function A(x){return t.containerState={},e.attempt(hV,f,p)(x)}function f(x){return r++,n.push([t.currentConstruct,t.containerState]),A(x)}function p(x){if(x===null){i&&v(),y(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),m(x)}function m(x){if(x===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return $t(x)?(e.consume(x),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(x),m)}function g(x,b){const w=t.sliceStream(x);if(b&&w.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(w),t.parser.lazy[x.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const j=t.events.length;let B=j,E,P;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(E){P=t.events[B][1].end;break}E=!0}for(y(r),k=j;k<t.events.length;)t.events[k][1].end={...P},k++;Ho(t.events,B+1,0,t.events.slice(j)),t.events.length=k}}function y(x){let b=n.length;for(;b-- >x;){const w=n[b];t.containerState=w[1],w[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function SFe(e,t,n){return On(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hv(e){if(e===null||mr(e)||Xp(e))return 1;if(UE(e))return 2}function HE(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const JF={name:"attention",resolveAll:kFe,tokenize:_Fe};function kFe(e,t){let n=-1,r,i,s,a,o,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},A={...e[n][1].start};fV(h,-c),fV(A,c),a={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:A},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=fl(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=fl(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=fl(u,HE(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=fl(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=fl(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Ho(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _Fe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=hv(r);let s;return a;function a(c){return s=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===s)return e.consume(c),o;const u=e.exit("attentionSequence"),d=hv(c),h=!d||d===2&&i||n.includes(c),A=!i||i===2&&d||n.includes(r);return u._open=!!(s===42?h:h&&(i||!A)),u._close=!!(s===42?A:A&&(d||!h)),t(c)}}function fV(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jFe={name:"autolink",tokenize:BFe};function BFe(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return wa(f)?(e.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||na(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||na(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Sj(f)?n(f):(e.consume(f),c)}function u(f){return f===64?(e.consume(f),d):gFe(f)?(e.consume(f),u):n(f)}function d(f){return na(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):A(f)}function A(f){if((f===45||na(f))&&r++<63){const p=f===45?A:h;return e.consume(f),p}return n(f)}}const E2={partial:!0,tokenize:NFe};function NFe(e,t,n){return r;function r(s){return Cn(s)?On(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||$t(s)?t(s):n(s)}}const ole={continuation:{tokenize:TFe},exit:IFe,name:"blockQuote",tokenize:EFe};function EFe(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return Cn(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function TFe(e,t,n){const r=this;return i;function i(a){return Cn(a)?On(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(ole,t,n)(a)}}function IFe(e){e.exit("blockQuote")}const lle={name:"characterEscape",tokenize:PFe};function PFe(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return vFe(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const cle={name:"characterReference",tokenize:OFe};function OFe(e,t,n){const r=this;let i=0,s,a;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=na,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=yFe,d):(e.enter("characterReferenceValue"),s=7,a=XF,d(h))}function d(h){if(h===59&&i){const A=e.exit("characterReferenceValue");return a===na&&!I6(r.sliceSerialize(A))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<s?(e.consume(h),d):n(h)}}const AV={partial:!0,tokenize:MFe},pV={concrete:!0,name:"codeFenced",tokenize:FFe};function FFe(e,t,n){const r=this,i={partial:!0,tokenize:w};let s=0,a=0,o;return c;function c(k){return u(k)}function u(k){const j=r.events[r.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===o?(a++,e.consume(k),d):a<3?n(k):(e.exit("codeFencedFenceSequence"),Cn(k)?On(e,h,"whitespace")(k):h(k))}function h(k){return k===null||$t(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(AV,m,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),A(k))}function A(k){return k===null||$t(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(k)):Cn(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),On(e,f,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),A)}function f(k){return k===null||$t(k)?h(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||$t(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(k)):k===96&&k===o?n(k):(e.consume(k),p)}function m(k){return e.attempt(i,b,g)(k)}function g(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return s>0&&Cn(k)?On(e,v,"linePrefix",s+1)(k):v(k)}function v(k){return k===null||$t(k)?e.check(AV,m,b)(k):(e.enter("codeFlowValue"),x(k))}function x(k){return k===null||$t(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),x)}function b(k){return e.exit("codeFenced"),t(k)}function w(k,j,B){let E=0;return P;function P(U){return k.enter("lineEnding"),k.consume(U),k.exit("lineEnding"),T}function T(U){return k.enter("codeFencedFence"),Cn(U)?On(k,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):N(U)}function N(U){return U===o?(k.enter("codeFencedFenceSequence"),F(U)):B(U)}function F(U){return U===o?(E++,k.consume(U),F):E>=a?(k.exit("codeFencedFenceSequence"),Cn(U)?On(k,L,"whitespace")(U):L(U)):B(U)}function L(U){return U===null||$t(U)?(k.exit("codeFencedFence"),j(U)):B(U)}}}function MFe(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const mP={name:"codeIndented",tokenize:RFe},LFe={partial:!0,tokenize:DFe};function RFe(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),On(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):$t(u)?e.attempt(LFe,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||$t(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function DFe(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):$t(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):On(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):$t(a)?i(a):n(a)}}const UFe={name:"codeText",previous:QFe,resolve:HFe,tokenize:$Fe};function HFe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function QFe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $Fe(e,t,n){let r=0,i,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):$t(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||$t(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",u(h))}}class zFe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&bx(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),bx(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bx(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);bx(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bx(this.left,n.reverse())}}}function bx(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ule(e){const t={};let n=-1,r,i,s,a,o,c,u;const d=new zFe(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,VFe(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return Ho(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function VFe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,c=[],u={};let d,h,A=-1,f=n,p=0,m=0;const g=[m];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++A<o.length;)o[A][0]==="exit"&&o[A-1][0]==="enter"&&o[A][1].type===o[A-1][1].type&&o[A][1].start.line!==o[A][1].end.line&&(m=A+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),A=g.length;A--;){const y=o.slice(g[A],g[A+1]),v=s.pop();c.push([v,v+y.length-1]),e.splice(v,2,y)}for(c.reverse(),A=-1;++A<c.length;)u[p+c[A][0]]=p+c[A][1],p+=c[A][1]-c[A][0]-1;return u}const KFe={resolve:WFe,tokenize:GFe},qFe={partial:!0,tokenize:YFe};function WFe(e){return ule(e),e}function GFe(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):$t(o)?e.check(qFe,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function YFe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),On(e,s,"linePrefix")}function s(a){if(a===null||$t(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function dle(e,t,n,r,i,s,a,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),A):y===null||y===32||y===41||Sj(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function A(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(o),A(y)):y===null||y===60||$t(y)?n(y):(e.consume(y),y===92?p:f)}function p(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function m(y){return!d&&(y===null||y===41||mr(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,m):y===41?(e.consume(y),d--,m):y===null||y===32||y===40||Sj(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function hle(e,t,n,r,i,s){const a=this;let o=0,c;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),d}function d(f){return o>999||f===null||f===91||f===93&&!c||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):$t(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||$t(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),c||(c=!Cn(f)),f===92?A:h)}function A(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function fle(e,t,n,r,i,s){let a;return o;function o(A){return A===34||A===39||A===40?(e.enter(r),e.enter(i),e.consume(A),e.exit(i),a=A===40?41:A,c):n(A)}function c(A){return A===a?(e.enter(i),e.consume(A),e.exit(i),e.exit(r),t):(e.enter(s),u(A))}function u(A){return A===a?(e.exit(s),c(a)):A===null?n(A):$t(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),On(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(A))}function d(A){return A===a||A===null||$t(A)?(e.exit("chunkString"),u(A)):(e.consume(A),A===92?h:d)}function h(A){return A===a||A===92?(e.consume(A),d):d(A)}}function Rw(e,t){let n;return r;function r(i){return $t(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Cn(i)?On(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const XFe={name:"definition",tokenize:ZFe},JFe={partial:!0,tokenize:eMe};function ZFe(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return hle.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=xc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return mr(f)?Rw(e,u)(f):u(f)}function u(f){return dle(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(JFe,h,h)(f)}function h(f){return Cn(f)?On(e,A,"whitespace")(f):A(f)}function A(f){return f===null||$t(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function eMe(e,t,n){return r;function r(o){return mr(o)?Rw(e,i)(o):n(o)}function i(o){return fle(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Cn(o)?On(e,a,"whitespace")(o):a(o)}function a(o){return o===null||$t(o)?t(o):n(o)}}const tMe={name:"hardBreakEscape",tokenize:nMe};function nMe(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return $t(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const rMe={name:"headingAtx",resolve:iMe,tokenize:sMe};function iMe(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ho(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function sMe(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||mr(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||$t(d)?(e.exit("atxHeading"),t(d)):Cn(d)?On(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||mr(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const aMe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mV=["pre","script","style","textarea"],oMe={concrete:!0,name:"htmlFlow",resolveTo:uMe,tokenize:dMe},lMe={partial:!0,tokenize:fMe},cMe={partial:!0,tokenize:hMe};function uMe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function dMe(e,t,n){const r=this;let i,s,a,o,c;return u;function u(M){return d(M)}function d(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),A):M===47?(e.consume(M),s=!0,m):M===63?(e.consume(M),i=3,r.interrupt?t:Q):wa(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function A(M){return M===45?(e.consume(M),i=2,f):M===91?(e.consume(M),i=5,o=0,p):wa(M)?(e.consume(M),i=4,r.interrupt?t:Q):n(M)}function f(M){return M===45?(e.consume(M),r.interrupt?t:Q):n(M)}function p(M){const Y="CDATA[";return M===Y.charCodeAt(o++)?(e.consume(M),o===Y.length?r.interrupt?t:N:p):n(M)}function m(M){return wa(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function g(M){if(M===null||M===47||M===62||mr(M)){const Y=M===47,X=a.toLowerCase();return!Y&&!s&&mV.includes(X)?(i=1,r.interrupt?t(M):N(M)):aMe.includes(a.toLowerCase())?(i=6,Y?(e.consume(M),y):r.interrupt?t(M):N(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):s?v(M):x(M))}return M===45||na(M)?(e.consume(M),a+=String.fromCharCode(M),g):n(M)}function y(M){return M===62?(e.consume(M),r.interrupt?t:N):n(M)}function v(M){return Cn(M)?(e.consume(M),v):P(M)}function x(M){return M===47?(e.consume(M),P):M===58||M===95||wa(M)?(e.consume(M),b):Cn(M)?(e.consume(M),x):P(M)}function b(M){return M===45||M===46||M===58||M===95||na(M)?(e.consume(M),b):w(M)}function w(M){return M===61?(e.consume(M),k):Cn(M)?(e.consume(M),w):x(M)}function k(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),c=M,j):Cn(M)?(e.consume(M),k):B(M)}function j(M){return M===c?(e.consume(M),c=null,E):M===null||$t(M)?n(M):(e.consume(M),j)}function B(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||mr(M)?w(M):(e.consume(M),B)}function E(M){return M===47||M===62||Cn(M)?x(M):n(M)}function P(M){return M===62?(e.consume(M),T):n(M)}function T(M){return M===null||$t(M)?N(M):Cn(M)?(e.consume(M),T):n(M)}function N(M){return M===45&&i===2?(e.consume(M),H):M===60&&i===1?(e.consume(M),W):M===62&&i===4?(e.consume(M),ce):M===63&&i===3?(e.consume(M),Q):M===93&&i===5?(e.consume(M),z):$t(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(lMe,R,F)(M)):M===null||$t(M)?(e.exit("htmlFlowData"),F(M)):(e.consume(M),N)}function F(M){return e.check(cMe,L,R)(M)}function L(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),U}function U(M){return M===null||$t(M)?F(M):(e.enter("htmlFlowData"),N(M))}function H(M){return M===45?(e.consume(M),Q):N(M)}function W(M){return M===47?(e.consume(M),a="",$):N(M)}function $(M){if(M===62){const Y=a.toLowerCase();return mV.includes(Y)?(e.consume(M),ce):N(M)}return wa(M)&&a.length<8?(e.consume(M),a+=String.fromCharCode(M),$):N(M)}function z(M){return M===93?(e.consume(M),Q):N(M)}function Q(M){return M===62?(e.consume(M),ce):M===45&&i===2?(e.consume(M),Q):N(M)}function ce(M){return M===null||$t(M)?(e.exit("htmlFlowData"),R(M)):(e.consume(M),ce)}function R(M){return e.exit("htmlFlow"),t(M)}}function hMe(e,t,n){const r=this;return i;function i(a){return $t(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function fMe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(E2,t,n)}}const AMe={name:"htmlText",tokenize:pMe};function pMe(e,t,n){const r=this;let i,s,a;return o;function o(Q){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(Q),c}function c(Q){return Q===33?(e.consume(Q),u):Q===47?(e.consume(Q),w):Q===63?(e.consume(Q),x):wa(Q)?(e.consume(Q),B):n(Q)}function u(Q){return Q===45?(e.consume(Q),d):Q===91?(e.consume(Q),s=0,p):wa(Q)?(e.consume(Q),v):n(Q)}function d(Q){return Q===45?(e.consume(Q),f):n(Q)}function h(Q){return Q===null?n(Q):Q===45?(e.consume(Q),A):$t(Q)?(a=h,W(Q)):(e.consume(Q),h)}function A(Q){return Q===45?(e.consume(Q),f):h(Q)}function f(Q){return Q===62?H(Q):Q===45?A(Q):h(Q)}function p(Q){const ce="CDATA[";return Q===ce.charCodeAt(s++)?(e.consume(Q),s===ce.length?m:p):n(Q)}function m(Q){return Q===null?n(Q):Q===93?(e.consume(Q),g):$t(Q)?(a=m,W(Q)):(e.consume(Q),m)}function g(Q){return Q===93?(e.consume(Q),y):m(Q)}function y(Q){return Q===62?H(Q):Q===93?(e.consume(Q),y):m(Q)}function v(Q){return Q===null||Q===62?H(Q):$t(Q)?(a=v,W(Q)):(e.consume(Q),v)}function x(Q){return Q===null?n(Q):Q===63?(e.consume(Q),b):$t(Q)?(a=x,W(Q)):(e.consume(Q),x)}function b(Q){return Q===62?H(Q):x(Q)}function w(Q){return wa(Q)?(e.consume(Q),k):n(Q)}function k(Q){return Q===45||na(Q)?(e.consume(Q),k):j(Q)}function j(Q){return $t(Q)?(a=j,W(Q)):Cn(Q)?(e.consume(Q),j):H(Q)}function B(Q){return Q===45||na(Q)?(e.consume(Q),B):Q===47||Q===62||mr(Q)?E(Q):n(Q)}function E(Q){return Q===47?(e.consume(Q),H):Q===58||Q===95||wa(Q)?(e.consume(Q),P):$t(Q)?(a=E,W(Q)):Cn(Q)?(e.consume(Q),E):H(Q)}function P(Q){return Q===45||Q===46||Q===58||Q===95||na(Q)?(e.consume(Q),P):T(Q)}function T(Q){return Q===61?(e.consume(Q),N):$t(Q)?(a=T,W(Q)):Cn(Q)?(e.consume(Q),T):E(Q)}function N(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?n(Q):Q===34||Q===39?(e.consume(Q),i=Q,F):$t(Q)?(a=N,W(Q)):Cn(Q)?(e.consume(Q),N):(e.consume(Q),L)}function F(Q){return Q===i?(e.consume(Q),i=void 0,U):Q===null?n(Q):$t(Q)?(a=F,W(Q)):(e.consume(Q),F)}function L(Q){return Q===null||Q===34||Q===39||Q===60||Q===61||Q===96?n(Q):Q===47||Q===62||mr(Q)?E(Q):(e.consume(Q),L)}function U(Q){return Q===47||Q===62||mr(Q)?E(Q):n(Q)}function H(Q){return Q===62?(e.consume(Q),e.exit("htmlTextData"),e.exit("htmlText"),t):n(Q)}function W(Q){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),$}function $(Q){return Cn(Q)?On(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):z(Q)}function z(Q){return e.enter("htmlTextData"),a(Q)}}const P6={name:"labelEnd",resolveAll:vMe,resolveTo:xMe,tokenize:wMe},mMe={tokenize:bMe},gMe={tokenize:CMe},yMe={tokenize:SMe};function vMe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ho(e,0,e.length,n),e}function xMe(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=fl(o,e.slice(s+1,s+r+3)),o=fl(o,[["enter",d,t]]),o=fl(o,HE(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=fl(o,[["exit",d,t],e[a-2],e[a-1],["exit",u,t]]),o=fl(o,e.slice(a+1)),o=fl(o,[["exit",c,t]]),Ho(e,s,e.length,o),e}function wMe(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(A){return s?s._inactive?h(A):(a=r.parser.defined.includes(xc(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(A),e.exit("labelMarker"),e.exit("labelEnd"),c):n(A)}function c(A){return A===40?e.attempt(mMe,d,a?d:h)(A):A===91?e.attempt(gMe,d,a?u:h)(A):a?d(A):h(A)}function u(A){return e.attempt(yMe,d,h)(A)}function d(A){return t(A)}function h(A){return s._balanced=!0,n(A)}}function bMe(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return mr(h)?Rw(e,s)(h):s(h)}function s(h){return h===41?d(h):dle(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return mr(h)?Rw(e,c)(h):d(h)}function o(h){return n(h)}function c(h){return h===34||h===39||h===40?fle(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return mr(h)?Rw(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function CMe(e,t,n){const r=this;return i;function i(o){return hle.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(xc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function SMe(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const kMe={name:"labelStartImage",resolveAll:P6.resolveAll,tokenize:_Me};function _Me(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const jMe={name:"labelStartLink",resolveAll:P6.resolveAll,tokenize:BMe};function BMe(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const gP={name:"lineEnding",tokenize:NMe};function NMe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),On(e,t,"linePrefix")}}const a_={name:"thematicBreak",tokenize:EMe};function EMe(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||$t(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Cn(u)?On(e,o,"whitespace")(u):o(u))}}const Ua={continuation:{tokenize:OMe},exit:MMe,name:"list",tokenize:PMe},TMe={partial:!0,tokenize:LMe},IMe={partial:!0,tokenize:FMe};function PMe(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:XF(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(a_,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return XF(f)&&++a<10?(e.consume(f),c):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(E2,r.interrupt?n:d,e.attempt(TMe,A,h))}function d(f){return r.containerState.initialBlankLine=!0,s++,A(f)}function h(f){return Cn(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),A):n(f)}function A(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function OMe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(E2,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,On(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!Cn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(IMe,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,On(e,e.attempt(Ua,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function FMe(e,t,n){const r=this;return On(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function MMe(e){e.exit(this.containerState.type)}function LMe(e,t,n){const r=this;return On(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!Cn(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const gV={name:"setextUnderline",resolveTo:RMe,tokenize:DMe};function RMe(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function DMe(e,t,n){const r=this;let i;return s;function s(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Cn(u)?On(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||$t(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const UMe={tokenize:HMe};function HMe(e){const t=this,n=e.attempt(E2,r,e.attempt(this.parser.constructs.flowInitial,i,On(e,e.attempt(this.parser.constructs.flow,i,e.attempt(KFe,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const QMe={resolveAll:ple()},$Me=Ale("string"),zMe=Ale("text");function Ale(e){return{resolveAll:ple(e==="text"?VMe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(d){return u(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const h=i[d];let A=-1;if(h)for(;++A<h.length;){const f=h[A];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function ple(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function VMe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,c;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)c=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const KMe={42:Ua,43:Ua,45:Ua,48:Ua,49:Ua,50:Ua,51:Ua,52:Ua,53:Ua,54:Ua,55:Ua,56:Ua,57:Ua,62:ole},qMe={91:XFe},WMe={[-2]:mP,[-1]:mP,32:mP},GMe={35:rMe,42:a_,45:[gV,a_],60:oMe,61:gV,95:a_,96:pV,126:pV},YMe={38:cle,92:lle},XMe={[-5]:gP,[-4]:gP,[-3]:gP,33:kMe,38:cle,42:JF,60:[jFe,AMe],91:jMe,92:[tMe,lle],93:P6,95:JF,96:UFe},JMe={null:[JF,QMe]},ZMe={null:[42,95]},eLe={null:[]},tLe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZMe,contentInitial:qMe,disable:eLe,document:KMe,flow:GMe,flowInitial:WMe,insideSpan:JMe,string:YMe,text:XMe},Symbol.toStringTag,{value:"Module"}));function nLe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const c={attempt:j(w),check:j(k),consume:v,enter:x,exit:b,interrupt:j(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:e,previous:null,sliceSerialize:A,sliceStream:f,write:h};let d=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function h(T){return a=fl(a,T),g(),a[a.length-1]!==null?[]:(B(t,0),u.events=HE(s,u.events,u),u.events)}function A(T,N){return iLe(f(T),N)}function f(T){return rLe(a,T)}function p(){const{_bufferIndex:T,_index:N,line:F,column:L,offset:U}=r;return{_bufferIndex:T,_index:N,line:F,column:L,offset:U}}function m(T){i[T.line]=T.column,P()}function g(){let T;for(;r._index<a.length;){const N=a[r._index];if(typeof N=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<N.length;)y(N.charCodeAt(r._bufferIndex));else y(N)}}function y(T){d=d(T)}function v(T){$t(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,P()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=T}function x(T,N){const F=N||{};return F.type=T,F.start=p(),u.events.push(["enter",F,u]),o.push(F),F}function b(T){const N=o.pop();return N.end=p(),u.events.push(["exit",N,u]),N}function w(T,N){B(T,N.from)}function k(T,N){N.restore()}function j(T,N){return F;function F(L,U,H){let W,$,z,Q;return Array.isArray(L)?R(L):"tokenize"in L?R([L]):ce(L);function ce(V){return Z;function Z(de){const ue=de!==null&&V[de],se=de!==null&&V.null,he=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(se)?se:se?[se]:[]];return R(he)(de)}}function R(V){return W=V,$=0,V.length===0?H:M(V[$])}function M(V){return Z;function Z(de){return Q=E(),z=V,V.partial||(u.currentConstruct=V),V.name&&u.parser.constructs.disable.null.includes(V.name)?X():V.tokenize.call(N?Object.assign(Object.create(u),N):u,c,Y,X)(de)}}function Y(V){return T(z,Q),U}function X(V){return Q.restore(),++$<W.length?M(W[$]):H}}}function B(T,N){T.resolveAll&&!s.includes(T)&&s.push(T),T.resolve&&Ho(u.events,N,u.events.length-N,T.resolve(u.events.slice(N),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function E(){const T=p(),N=u.previous,F=u.currentConstruct,L=u.events.length,U=Array.from(o);return{from:L,restore:H};function H(){r=T,u.previous=N,u.currentConstruct=F,u.events.length=L,o=U,P()}}function P(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function rLe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function iLe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=t?" ":"	";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function sLe(e){const r={constructs:sle([tLe,...(e||{}).extensions||[]]),content:i(xFe),defined:[],document:i(bFe),flow:i(UMe),lazy:{},string:i($Me),text:i(zMe)};return r;function i(s){return a;function a(o){return nLe(r,s,o)}}}function aLe(e){for(;!ule(e););return e}const yV=/[\0\t\n\r]/g;function oLe(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const c=[];let u,d,h,A,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(yV.lastIndex=h,u=yV.exec(s),A=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(A),!u){t=s.slice(h);break}if(f===10&&h===A&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<A&&(c.push(s.slice(h,A)),e+=A-h),f){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=A+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const lLe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cLe(e){return e.replace(lLe,uLe)}function uLe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return ale(n.slice(s?2:1),s?16:10)}return I6(n)||e}const mle={}.hasOwnProperty;function dLe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),hLe(n)(aLe(sLe(n).document().write(oLe()(e,t,!0))))}function hLe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ne),autolinkProtocol:E,autolinkEmail:E,atxHeading:s(te),blockQuote:s(se),characterEscape:E,characterReference:E,codeFenced:s(he),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(he,a),codeText:s(ie,a),codeTextData:E,data:E,codeFlowValue:E,definition:s(Ce),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Ie),hardBreakEscape:s(je),hardBreakTrailing:s(je),htmlFlow:s(nt,a),htmlFlowData:E,htmlText:s(nt,a),htmlTextData:E,image:s(rt),label:a,link:s(Ne),listItem:s(we),listItemValue:A,listOrdered:s(st,h),listUnordered:s(st),paragraph:s(He),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(te),strong:s(Ve),thematicBreak:s(pt)},exit:{atxHeading:c(),atxHeadingSequence:w,autolink:c(),autolinkEmail:ue,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:V,characterReference:Z,codeFenced:c(g),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:P,codeIndented:c(y),codeText:c(U),codeTextData:P,data:P,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(N),hardBreakTrailing:c(N),htmlFlow:c(F),htmlFlowData:P,htmlText:c(L),htmlTextData:P,image:c(W),label:z,labelText:$,lineEnding:T,link:c(H),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Y,resourceDestinationString:Q,resourceTitleString:ce,resource:R,setextHeading:c(B),setextHeadingLineSequence:j,setextHeadingText:k,strong:c(),thematicBreak:c()}};gle(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ye){let Be={type:"root",children:[]};const Ge={stack:[Be],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:d,data:n},Ue=[];let Ze=-1;for(;++Ze<ye.length;)if(ye[Ze][1].type==="listOrdered"||ye[Ze][1].type==="listUnordered")if(ye[Ze][0]==="enter")Ue.push(Ze);else{const pe=Ue.pop();Ze=i(ye,pe,Ze)}for(Ze=-1;++Ze<ye.length;){const pe=t[ye[Ze][0]];mle.call(pe,ye[Ze][1].type)&&pe[ye[Ze][1].type].call(Object.assign({sliceSerialize:ye[Ze][2].sliceSerialize},Ge),ye[Ze][1])}if(Ge.tokenStack.length>0){const pe=Ge.tokenStack[Ge.tokenStack.length-1];(pe[1]||vV).call(Ge,void 0,pe[0])}for(Be.position={start:rh(ye.length>0?ye[0][1].start:{line:1,column:1,offset:0}),end:rh(ye.length>0?ye[ye.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze<t.transforms.length;)Be=t.transforms[Ze](Be)||Be;return Be}function i(ye,Be,Ge){let Ue=Be-1,Ze=-1,pe=!1,mt,ft,wt,Rt;for(;++Ue<=Ge;){const zt=ye[Ue];switch(zt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zt[0]==="enter"?Ze++:Ze--,Rt=void 0;break}case"lineEndingBlank":{zt[0]==="enter"&&(mt&&!Rt&&!Ze&&!wt&&(wt=Ue),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!Ze&&zt[0]==="enter"&&zt[1].type==="listItemPrefix"||Ze===-1&&zt[0]==="exit"&&(zt[1].type==="listUnordered"||zt[1].type==="listOrdered")){if(mt){let gt=Ue;for(ft=void 0;gt--;){const Lt=ye[gt];if(Lt[1].type==="lineEnding"||Lt[1].type==="lineEndingBlank"){if(Lt[0]==="exit")continue;ft&&(ye[ft][1].type="lineEndingBlank",pe=!0),Lt[1].type="lineEnding",ft=gt}else if(!(Lt[1].type==="linePrefix"||Lt[1].type==="blockQuotePrefix"||Lt[1].type==="blockQuotePrefixWhitespace"||Lt[1].type==="blockQuoteMarker"||Lt[1].type==="listItemIndent"))break}wt&&(!ft||wt<ft)&&(mt._spread=!0),mt.end=Object.assign({},ft?ye[ft][1].start:zt[1].end),ye.splice(ft||Ue,0,["exit",mt,zt[2]]),Ue++,Ge++}if(zt[1].type==="listItemPrefix"){const gt={type:"listItem",_spread:!1,start:Object.assign({},zt[1].start),end:void 0};mt=gt,ye.splice(Ue,0,["enter",gt,zt[2]]),Ue++,Ge++,wt=void 0,Rt=!0}}}return ye[Be][1]._spread=pe,Ge}function s(ye,Be){return Ge;function Ge(Ue){o.call(this,ye(Ue),Ue),Be&&Be.call(this,Ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(ye,Be,Ge){this.stack[this.stack.length-1].children.push(ye),this.stack.push(ye),this.tokenStack.push([Be,Ge||void 0]),ye.position={start:rh(Be.start),end:void 0}}function c(ye){return Be;function Be(Ge){ye&&ye.call(this,Ge),u.call(this,Ge)}}function u(ye,Be){const Ge=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==ye.type&&(Be?Be.call(this,ye,Ue[0]):(Ue[1]||vV).call(this,ye,Ue[0]));else throw new Error("Cannot close `"+ye.type+"` ("+Lw({start:ye.start,end:ye.end})+"): it’s not open");Ge.position.end=rh(ye.end)}function d(){return T6(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function A(ye){if(this.data.expectingFirstListItemValue){const Be=this.stack[this.stack.length-2];Be.start=Number.parseInt(this.sliceSerialize(ye),10),this.data.expectingFirstListItemValue=void 0}}function f(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.lang=ye}function p(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.meta=ye}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye.replace(/(\r?\n|\r)$/g,"")}function v(ye){const Be=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Be,Ge.identifier=xc(this.sliceSerialize(ye)).toLowerCase()}function x(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.title=ye}function b(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.url=ye}function w(ye){const Be=this.stack[this.stack.length-1];if(!Be.depth){const Ge=this.sliceSerialize(ye).length;Be.depth=Ge}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function j(ye){const Be=this.stack[this.stack.length-1];Be.depth=this.sliceSerialize(ye).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function E(ye){const Ge=this.stack[this.stack.length-1].children;let Ue=Ge[Ge.length-1];(!Ue||Ue.type!=="text")&&(Ue=Dt(),Ue.position={start:rh(ye.start),end:void 0},Ge.push(Ue)),this.stack.push(Ue)}function P(ye){const Be=this.stack.pop();Be.value+=this.sliceSerialize(ye),Be.position.end=rh(ye.end)}function T(ye){const Be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ge=Be.children[Be.children.length-1];Ge.position.end=rh(ye.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Be.type)&&(E.call(this,ye),P.call(this,ye))}function N(){this.data.atHardBreak=!0}function F(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye}function L(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye}function U(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye}function H(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const Be=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=Be,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function W(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const Be=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=Be,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function $(ye){const Be=this.sliceSerialize(ye),Ge=this.stack[this.stack.length-2];Ge.label=cLe(Be),Ge.identifier=xc(Be).toLowerCase()}function z(){const ye=this.stack[this.stack.length-1],Be=this.resume(),Ge=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ge.type==="link"){const Ue=ye.children;Ge.children=Ue}else Ge.alt=Be}function Q(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.url=ye}function ce(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.title=ye}function R(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function Y(ye){const Be=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Be,Ge.identifier=xc(this.sliceSerialize(ye)).toLowerCase(),this.data.referenceType="full"}function X(ye){this.data.characterReferenceType=ye.type}function V(ye){const Be=this.sliceSerialize(ye),Ge=this.data.characterReferenceType;let Ue;Ge?(Ue=ale(Be,Ge==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=I6(Be);const Ze=this.stack[this.stack.length-1];Ze.value+=Ue}function Z(ye){const Be=this.stack.pop();Be.position.end=rh(ye.end)}function de(ye){P.call(this,ye);const Be=this.stack[this.stack.length-1];Be.url=this.sliceSerialize(ye)}function ue(ye){P.call(this,ye);const Be=this.stack[this.stack.length-1];Be.url="mailto:"+this.sliceSerialize(ye)}function se(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function je(){return{type:"break"}}function nt(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function Ne(){return{type:"link",title:null,url:"",children:[]}}function st(ye){return{type:"list",ordered:ye.type==="listOrdered",start:null,spread:ye._spread,children:[]}}function we(ye){return{type:"listItem",spread:ye._spread,checked:null,children:[]}}function He(){return{type:"paragraph",children:[]}}function Ve(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function pt(){return{type:"thematicBreak"}}}function rh(e){return{line:e.line,column:e.column,offset:e.offset}}function gle(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gle(e,r):fLe(e,r)}}function fLe(e,t){let n;for(n in t)if(mle.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function vV(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lw({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lw({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lw({start:t.start,end:t.end})+") is still open")}function ALe(e){const t=this;t.parser=n;function n(r){return dLe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pLe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function mLe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function gLe(e,t){const n=t.value?t.value+`
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function yLe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vLe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xLe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=g0(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function wLe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bLe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yle(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function CLe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yle(e,t);const i={src:g0(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function SLe(e,t){const n={src:g0(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function kLe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function _Le(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yle(e,t);const i={href:g0(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function jLe(e,t){const n={href:g0(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function BLe(e,t,n){const r=e.all(t),i=n?NLe(n):vle(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function NLe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=vle(n[r])}return t}function vle(e){const t=e.spread;return t??e.children.length>1}function ELe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function TLe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ILe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PLe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OLe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=j6(t.children[1]),c=Joe(t.children[t.children.length-1]);o&&c&&(a.position={start:o,end:c}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function FLe(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const h=t.children[c],A={},f=a?a[c]:void 0;f&&(A.align=f);let p={type:"element",tagName:s,properties:A,children:[]};h&&(p.children=e.all(h),e.patch(h,p),p=e.applyData(h,p)),u.push(p)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function MLe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const xV=9,wV=32;function LLe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(bV(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(bV(t.slice(i),i>0,!1)),s.join("")}function bV(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===xV||s===wV;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===xV||s===wV;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function RLe(e,t){const n={type:"text",value:LLe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function DLe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ULe={blockquote:pLe,break:mLe,code:gLe,delete:yLe,emphasis:vLe,footnoteReference:xLe,heading:wLe,html:bLe,imageReference:CLe,image:SLe,inlineCode:kLe,linkReference:_Le,link:jLe,listItem:BLe,list:ELe,paragraph:TLe,root:ILe,strong:PLe,table:OLe,tableCell:MLe,tableRow:FLe,text:RLe,thematicBreak:DLe,toml:xS,yaml:xS,definition:xS,footnoteDefinition:xS};function xS(){}const xle=-1,QE=0,Dw=1,kj=2,O6=3,F6=4,M6=5,L6=6,wle=7,ble=8,CV=typeof self=="object"?self:globalThis,HLe=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case QE:case xle:return n(a,i);case Dw:{const o=n([],i);for(const c of a)o.push(r(c));return o}case kj:{const o=n({},i);for(const[c,u]of a)o[r(c)]=r(u);return o}case O6:return n(new Date(a),i);case F6:{const{source:o,flags:c}=a;return n(new RegExp(o,c),i)}case M6:{const o=n(new Map,i);for(const[c,u]of a)o.set(r(c),r(u));return o}case L6:{const o=n(new Set,i);for(const c of a)o.add(r(c));return o}case wle:{const{name:o,message:c}=a;return n(new CV[o](c),i)}case ble:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new CV[s](a),i)};return r},SV=e=>HLe(new Map,e)(0),og="",{toString:QLe}={},{keys:$Le}=Object,Cx=e=>{const t=typeof e;if(t!=="object"||!e)return[QE,t];const n=QLe.call(e).slice(8,-1);switch(n){case"Array":return[Dw,og];case"Object":return[kj,og];case"Date":return[O6,og];case"RegExp":return[F6,og];case"Map":return[M6,og];case"Set":return[L6,og];case"DataView":return[Dw,n]}return n.includes("Array")?[Dw,n]:n.includes("Error")?[wle,n]:[kj,n]},wS=([e,t])=>e===QE&&(t==="function"||t==="symbol"),zLe=(e,t,n,r)=>{const i=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},s=a=>{if(n.has(a))return n.get(a);let[o,c]=Cx(a);switch(o){case QE:{let d=a;switch(c){case"bigint":o=ble,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([xle],a)}return i([o,d],a)}case Dw:{if(c){let A=a;return c==="DataView"?A=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(A=new Uint8Array(a)),i([c,[...A]],a)}const d=[],h=i([o,d],a);for(const A of a)d.push(s(A));return h}case kj:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],h=i([o,d],a);for(const A of $Le(a))(e||!wS(Cx(a[A])))&&d.push([s(A),s(a[A])]);return h}case O6:return i([o,a.toISOString()],a);case F6:{const{source:d,flags:h}=a;return i([o,{source:d,flags:h}],a)}case M6:{const d=[],h=i([o,d],a);for(const[A,f]of a)(e||!(wS(Cx(A))||wS(Cx(f))))&&d.push([s(A),s(f)]);return h}case L6:{const d=[],h=i([o,d],a);for(const A of a)(e||!wS(Cx(A)))&&d.push(s(A));return h}}const{message:u}=a;return i([o,{name:c,message:u}],a)};return s},kV=(e,{json:t,lossy:n}={})=>{const r=[];return zLe(!(t||n),!!t,new Map,r)(e),r},_j=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?SV(kV(e,t)):structuredClone(e):(e,t)=>SV(kV(e,t));function VLe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function KLe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function qLe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||VLe,r=e.options.footnoteBackLabel||KLe,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),A=g0(h.toLowerCase());let f=0;const p=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++f<=m;){p.length>0&&p.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,f);typeof v=="string"&&(v={type:"text",value:v}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+A+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=d[d.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...p)}else d.push(...p);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+A},children:e.wrap(d,!0)};e.patch(u,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{..._j(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
`}]}}const $E=function(e){if(e==null)return XLe;if(typeof e=="function")return zE(e);if(typeof e=="object")return Array.isArray(e)?WLe(e):GLe(e);if(typeof e=="string")return YLe(e);throw new Error("Expected function, string, or object as test")};function WLe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$E(e[n]);return zE(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function GLe(e){const t=e;return zE(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function YLe(e){return zE(t);function t(n){return n&&n.type===e}}function zE(e){return t;function t(n,r,i){return!!(JLe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function XLe(){return!0}function JLe(e){return e!==null&&typeof e=="object"&&"type"in e}const Cle=[],ZLe=!0,ZF=!1,eRe="skip";function Sle(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=$E(i),a=r?-1:1;o(e,void 0,[])();function o(c,u,d){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(A,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return A;function A(){let f=Cle,p,m,g;if((!t||s(c,u,d[d.length-1]||void 0))&&(f=tRe(n(c,d)),f[0]===ZF))return f;if("children"in c&&c.children){const y=c;if(y.children&&f[0]!==eRe)for(m=(r?y.children.length:-1)+a,g=d.concat(y);m>-1&&m<y.children.length;){const v=y.children[m];if(p=o(v,m,g)(),p[0]===ZF)return p;m=typeof p[1]=="number"?p[1]:m+a}}return f}}}function tRe(e){return Array.isArray(e)?e:typeof e=="number"?[ZLe,e]:e==null?Cle:[e]}function R6(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),Sle(e,s,o,i);function o(c,u){const d=u[u.length-1],h=d?d.children.indexOf(c):void 0;return a(c,h,d)}}const eM={}.hasOwnProperty,nRe={};function rRe(e,t){const n=t||nRe,r=new Map,i=new Map,s=new Map,a={...ULe,...n.handlers},o={all:u,applyData:sRe,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:c,options:n,patch:iRe,wrap:oRe};return R6(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,A=String(d.identifier).toUpperCase();h.has(A)||h.set(A,d)}}),o;function c(d,h){const A=d.type,f=o.handlers[A];if(eM.call(o.handlers,A)&&f)return f(o,d,h);if(o.options.passThrough&&o.options.passThrough.includes(A)){if("children"in d){const{children:m,...g}=d,y=_j(g);return y.children=o.all(d),y}return _j(d)}return(o.options.unknownHandler||aRe)(o,d,h)}function u(d){const h=[];if("children"in d){const A=d.children;let f=-1;for(;++f<A.length;){const p=o.one(A[f],d);if(p){if(f&&A[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=_V(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=_V(m.value))}Array.isArray(p)?h.push(...p):h.push(p)}}}return h}}function iRe(e,t){e.position&&(t.position=K3e(e))}function sRe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,_j(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function aRe(e,t){const n=t.data||{},r="value"in t&&!(eM.call(n,"hProperties")||eM.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oRe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function _V(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function jV(e,t){const n=rRe(e,t),r=n.one(e,void 0),i=qLe(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function lRe(e,t){return e&&"run"in e?async function(n,r){const i=jV(n,{file:r,...t});await e.run(i,r)}:function(n,r){return jV(n,{file:r,...e||t})}}function BV(e){if(e)throw e}var o_=Object.prototype.hasOwnProperty,kle=Object.prototype.toString,NV=Object.defineProperty,EV=Object.getOwnPropertyDescriptor,TV=function(t){return typeof Array.isArray=="function"?Array.isArray(t):kle.call(t)==="[object Array]"},IV=function(t){if(!t||kle.call(t)!=="[object Object]")return!1;var n=o_.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&o_.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||o_.call(t,i)},PV=function(t,n){NV&&n.name==="__proto__"?NV(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},OV=function(t,n){if(n==="__proto__")if(o_.call(t,n)){if(EV)return EV(t,n).value}else return;return t[n]},cRe=function e(){var t,n,r,i,s,a,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=OV(o,n),i=OV(t,n),o!==i&&(d&&i&&(IV(i)||(s=TV(i)))?(s?(s=!1,a=r&&TV(r)?r:[]):a=r&&IV(r)?r:{},PV(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&PV(o,{name:n,newValue:i}));return o};const yP=Mn(cRe);function tM(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uRe(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(c,...u){const d=e[++s];let h=-1;if(c){a(c);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,d?dRe(d,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function dRe(e,t){let n;return r;function r(...a){const o=e.length>a.length;let c;o&&a.push(i);try{c=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const qc={basename:hRe,dirname:fRe,extname:ARe,join:pRe,sep:"/"};function hRe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');T2(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function fRe(e){if(T2(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ARe(e){T2(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function pRe(...e){let t=-1,n;for(;++t<e.length;)T2(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":mRe(n)}function mRe(e){T2(e);const t=e.codePointAt(0)===47;let n=gRe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gRe(e,t){let n="",r=0,i=-1,s=0,a=-1,o,c;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function T2(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const yRe={cwd:vRe};function vRe(){return"/"}function nM(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xRe(e){if(typeof e=="string")e=new URL(e);else if(!nM(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return wRe(e)}function wRe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const vP=["history","path","basename","stem","extname","dirname"];class _le{constructor(t){let n;t?nM(t)?n={path:t}:typeof t=="string"||bRe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":yRe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vP.length;){const s=vP[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)vP.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?qc.basename(this.path):void 0}set basename(t){wP(t,"basename"),xP(t,"basename"),this.path=qc.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qc.dirname(this.path):void 0}set dirname(t){FV(this.basename,"dirname"),this.path=qc.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qc.extname(this.path):void 0}set extname(t){if(xP(t,"extname"),FV(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=qc.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){nM(t)&&(t=xRe(t)),wP(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qc.basename(this.path,this.extname):void 0}set stem(t){wP(t,"stem"),xP(t,"stem"),this.path=qc.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new la(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xP(e,t){if(e&&e.includes(qc.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qc.sep+"`")}function wP(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function FV(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function bRe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CRe=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},SRe={}.hasOwnProperty;class D6 extends CRe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=uRe()}copy(){const t=new D6;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(yP(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(SP("data",this.frozen),this.namespace[t]=n,this):SRe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(SP("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=bS(t),r=this.parser||this.Parser;return bP("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),bP("process",this.parser||this.Parser),CP("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=bS(t),c=r.parse(o);r.run(c,o,function(d,h,A){if(d||!h||!A)return u(d);const f=h,p=r.stringify(f,A);jRe(p)?A.value=p:A.result=p,u(d,A)});function u(d,h){d||!h?a(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),bP("processSync",this.parser||this.Parser),CP("processSync",this.compiler||this.Compiler),this.process(t,i),LV("processSync","process",n),r;function i(s,a){n=!0,BV(s),r=a}}run(t,n,r){MV(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const c=bS(n);i.run(t,c,u);function u(d,h,A){const f=h||t;d?o(d):a?a(f):r(void 0,f,A)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),LV("runSync","run",r),i;function s(a,o){BV(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=bS(n),i=this.compiler||this.Compiler;return CP("stringify",i),MV(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(SP("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;c(d,h)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=yP(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let h=-1,A=-1;for(;++h<r.length;)if(r[h][0]===u){A=h;break}if(A===-1)r.push([u,...d]);else if(d.length>0){let[f,...p]=d;const m=r[A][1];tM(m)&&tM(f)&&(f=yP(!0,m,f)),r[A]=[u,f,...p]}}}}const kRe=new D6().freeze();function bP(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function CP(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function SP(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function MV(e){if(!tM(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function LV(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bS(e){return _Re(e)?e:new _le(e)}function _Re(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jRe(e){return typeof e=="string"||BRe(e)}function BRe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NRe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",RV=[],DV={allowDangerousHtml:!0},ERe=/^(https?|ircs?|mailto|xmpp)$/i,TRe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function U6(e){const t=IRe(e),n=PRe(e);return ORe(t.runSync(t.parse(n),n),e)}function IRe(e){const t=e.rehypePlugins||RV,n=e.remarkPlugins||RV,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...DV}:DV;return kRe().use(ALe).use(n).use(lRe,r).use(t)}function PRe(e){const t=e.children||"",n=new _le;return typeof t=="string"&&(n.value=t),n}function ORe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||FRe;for(const d of TRe)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+NRe+d.id,void 0);return R6(e,u),X3e(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,h,A){if(d.type==="raw"&&A&&typeof h=="number")return a?A.children.splice(h,1):A.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let f;for(f in pP)if(Object.hasOwn(pP,f)&&Object.hasOwn(d.properties,f)){const p=d.properties[f],m=pP[f];(m===null||m.includes(d.tagName))&&(d.properties[f]=c(String(p||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(d,h,A)),f&&A&&typeof h=="number")return o&&d.children?A.children.splice(h,1,...d.children):A.children.splice(h,1),h}}}function FRe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||ERe.test(e.slice(0,t))?e:""}function UV(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function MRe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LRe(e,t,n){const i=$E((n||{}).ignore||[]),s=RRe(t);let a=-1;for(;++a<s.length;)Sle(e,"text",o);function o(u,d){let h=-1,A;for(;++h<d.length;){const f=d[h],p=A?A.children:void 0;if(i(f,p?p.indexOf(f):void 0,A))return;A=f}if(A)return c(u,d)}function c(u,d){const h=d[d.length-1],A=s[a][0],f=s[a][1];let p=0;const g=h.children.indexOf(u);let y=!1,v=[];A.lastIndex=0;let x=A.exec(u.value);for(;x;){const b=x.index,w={index:x.index,input:x.input,stack:[...d,u]};let k=f(...x,w);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?A.lastIndex=b+1:(p!==b&&v.push({type:"text",value:u.value.slice(p,b)}),Array.isArray(k)?v.push(...k):k&&v.push(k),p=b+x[0].length,y=!0),!A.global)break;x=A.exec(u.value)}return y?(p<u.value.length&&v.push({type:"text",value:u.value.slice(p)}),h.children.splice(g,1,...v)):v=[u],g+v.length}}function RRe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([DRe(i[0]),URe(i[1])])}return t}function DRe(e){return typeof e=="string"?new RegExp(MRe(e),"g"):e}function URe(e){return typeof e=="function"?e:function(){return e}}const kP="phrasing",_P=["autolink","link","image","label"];function HRe(){return{transforms:[WRe],enter:{literalAutolink:$Re,literalAutolinkEmail:jP,literalAutolinkHttp:jP,literalAutolinkWww:jP},exit:{literalAutolink:qRe,literalAutolinkEmail:KRe,literalAutolinkHttp:zRe,literalAutolinkWww:VRe}}}function QRe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kP,notInConstruct:_P},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kP,notInConstruct:_P},{character:":",before:"[ps]",after:"\\/",inConstruct:kP,notInConstruct:_P}]}}function $Re(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function jP(e){this.config.enter.autolinkProtocol.call(this,e)}function zRe(e){this.config.exit.autolinkProtocol.call(this,e)}function VRe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function KRe(e){this.config.exit.autolinkEmail.call(this,e)}function qRe(e){this.exit(e)}function WRe(e){LRe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,GRe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),YRe]],{ignore:["link","linkReference"]})}function GRe(e,t,n,r,i){let s="";if(!jle(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!XRe(n)))return!1;const a=JRe(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function YRe(e,t,n,r){return!jle(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function XRe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function JRe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=UV(e,"(");let s=UV(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function jle(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Xp(n)||UE(n))&&(!t||n!==47)}Ble.peek=oDe;function ZRe(){this.buffer()}function eDe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function tDe(){this.buffer()}function nDe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rDe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iDe(e){this.exit(e)}function sDe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function aDe(e){this.exit(e)}function oDe(){return"["}function Ble(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function lDe(){return{enter:{gfmFootnoteCallString:ZRe,gfmFootnoteCall:eDe,gfmFootnoteDefinitionLabelString:tDe,gfmFootnoteDefinition:nDe},exit:{gfmFootnoteCallString:rDe,gfmFootnoteCall:iDe,gfmFootnoteDefinitionLabelString:sDe,gfmFootnoteDefinition:aDe}}}function cDe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ble},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let c=o.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=o.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Nle:uDe))),u(),c}}function uDe(e,t,n){return t===0?e:Nle(e,t,n)}function Nle(e,t,n){return(n?"":"    ")+e}const dDe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ele.peek=mDe;function hDe(){return{canContainEols:["delete"],enter:{strikethrough:ADe},exit:{strikethrough:pDe}}}function fDe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dDe}],handlers:{delete:Ele}}}function ADe(e){this.enter({type:"delete",children:[]},e)}function pDe(e){this.exit(e)}function Ele(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function mDe(){return"~"}function gDe(e){return e.length}function yDe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||gDe,s=[],a=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const m=[],g=[];let y=-1;for(e[d].length>u&&(u=e[d].length);++y<e[d].length;){const v=vDe(e[d][y]);if(n.alignDelimiters!==!1){const x=i(v);g[y]=x,(c[y]===void 0||x>c[y])&&(c[y]=x)}m.push(v)}a[d]=m,o[d]=g}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)s[h]=HV(r[h]);else{const m=HV(r);for(;++h<u;)s[h]=m}h=-1;const A=[],f=[];for(;++h<u;){const m=s[h];let g="",y="";m===99?(g=":",y=":"):m===108?g=":":m===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,c[h]-g.length-y.length);const x=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>c[h]&&(c[h]=v),f[h]=v),A[h]=x}a.splice(1,0,A),o.splice(1,0,f),d=-1;const p=[];for(;++d<a.length;){const m=a[d],g=o[d];h=-1;const y=[];for(;++h<u;){const v=m[h]||"";let x="",b="";if(n.alignDelimiters!==!1){const w=c[h]-(g[h]||0),k=s[h];k===114?x=" ".repeat(w):k===99?w%2?(x=" ".repeat(w/2+.5),b=" ".repeat(w/2-.5)):(x=" ".repeat(w/2),b=x):b=" ".repeat(w)}n.delimiterStart!==!1&&!h&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||h)&&y.push(" "),n.alignDelimiters!==!1&&y.push(x),y.push(v),n.alignDelimiters!==!1&&y.push(b),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||h!==u-1)&&y.push("|")}p.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
`)}function vDe(e){return e==null?"":String(e)}function HV(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function xDe(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),wDe);return i(),a}function wDe(e,t,n){return">"+(n?"":" ")+e}function bDe(e,t){return QV(e,t.inConstruct,!0)&&!QV(e,t.notInConstruct,!1)}function QV(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $V(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&bDe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function CDe(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function SDe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function kDe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function _De(e,t,n,r){const i=kDe(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(SDe(e,n)){const h=n.enter("codeIndented"),A=n.indentLines(s,jDe);return h(),A}const o=n.createTracker(r),c=i.repeat(Math.max(CDe(s,i)+1,3)),u=n.enter("codeFenced");let d=o.move(c);if(e.lang){const h=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
`,encode:["`"],...o.current()})),h()}return d+=o.move(`
`),s&&(d+=o.move(s+`
`)),d+=o.move(c),u(),d}function jDe(e,t,n){return(n?"":"    ")+e}function H6(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function BDe(e,t,n,r){const i=H6(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
`,...c.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),a(),u}function NDe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xb(e){return"&#x"+e.toString(16).toUpperCase()+";"}function jj(e,t,n){const r=hv(e),i=hv(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Tle.peek=EDe;function Tle(e,t,n,r){const i=NDe(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=jj(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Xb(u)+c.slice(1));const h=c.charCodeAt(c.length-1),A=jj(r.after.charCodeAt(0),h,i);A.inside&&(c=c.slice(0,-1)+Xb(h));const f=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:A.outside,before:d.outside},o+c+f}function EDe(e,t,n){return n.options.emphasis||"*"}function TDe(e,t){let n=!1;return R6(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ZF}),!!((!e.depth||e.depth<3)&&T6(e)&&(t.options.setext||n))}function IDe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(TDe(e,n)){const d=n.enter("headingSetext"),h=n.enter("phrasing"),A=n.containerPhrasing(e,{...s.current(),before:`
`,after:`
`});return h(),d(),A+`
`+(i===1?"=":"-").repeat(A.length-(Math.max(A.lastIndexOf("\r"),A.lastIndexOf(`
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(u)&&(u=Xb(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),o(),u}Ile.peek=PDe;function Ile(e){return e.value||""}function PDe(){return"<"}Ple.peek=ODe;function Ple(e,t,n,r){const i=H6(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),u+=c.move(")"),a(),u}function ODe(){return"!"}Ole.peek=FDe;function Ole(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==h?c+=o.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function FDe(){return"!"}Fle.peek=MDe;function Fle(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let c;if(a.atBreak)for(;c=o.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function MDe(){return"`"}function Mle(e,t){const n=T6(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Lle.peek=LDe;function Lle(e,t,n,r){const i=H6(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(Mle(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),o(),n.stack=d,h}o=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),o(),u}function LDe(e,t,n){return Mle(e,n)?"<":"["}Rle.peek=RDe;function Rle(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==h?c+=o.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function RDe(){return"["}function Q6(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function DDe(e){const t=Q6(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function UDe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Dle(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function HDe(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?UDe(n):Q6(n);const o=e.ordered?a==="."?")":".":DDe(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Dle(n)===a&&d){let h=-1;for(;++h<e.children.length;){const A=e.children[h];if(A&&A.type==="listItem"&&A.children&&A.children[0]&&A.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function QDe(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $De(e,t,n,r){const i=QDe(n);let s=n.bulletCurrent||Q6(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(h,A,f){return A?(f?"":" ".repeat(a))+h:(f?s:s+" ".repeat(a-s.length))+h}}function zDe(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const VDe=$E(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KDe(e,t,n,r){return(e.children.some(function(a){return VDe(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function qDe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ule.peek=WDe;function Ule(e,t,n,r){const i=qDe(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=jj(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Xb(u)+c.slice(1));const h=c.charCodeAt(c.length-1),A=jj(r.after.charCodeAt(0),h,i);A.inside&&(c=c.slice(0,-1)+Xb(h));const f=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:A.outside,before:d.outside},o+c+f}function WDe(e,t,n){return n.options.strong||"*"}function GDe(e,t,n,r){return n.safe(e.value,r)}function YDe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XDe(e,t,n){const r=(Dle(n)+(n.options.ruleSpaces?" ":"")).repeat(YDe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Hle={blockquote:xDe,break:$V,code:_De,definition:BDe,emphasis:Tle,hardBreak:$V,heading:IDe,html:Ile,image:Ple,imageReference:Ole,inlineCode:Fle,link:Lle,linkReference:Rle,list:HDe,listItem:$De,paragraph:zDe,root:KDe,strong:Ule,text:GDe,thematicBreak:XDe};function JDe(){return{enter:{table:ZDe,tableData:zV,tableHeader:zV,tableRow:tUe},exit:{codeText:nUe,table:eUe,tableData:BP,tableHeader:BP,tableRow:BP}}}function ZDe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function eUe(e){this.exit(e),this.data.inTable=void 0}function tUe(e){this.enter({type:"tableRow",children:[]},e)}function BP(e){this.exit(e)}function zV(e){this.enter({type:"tableCell",children:[]},e)}function nUe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rUe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rUe(e,t){return t==="|"?t:e}function iUe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:A,table:a,tableCell:c,tableRow:o}};function a(f,p,m,g){return u(d(f,m,g),f.align)}function o(f,p,m,g){const y=h(f,m,g),v=u([y]);return v.slice(0,v.indexOf(`
`))}function c(f,p,m,g){const y=m.enter("tableCell"),v=m.enter("phrasing"),x=m.containerPhrasing(f,{...g,before:s,after:s});return v(),y(),x}function u(f,p){return yDe(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function d(f,p,m){const g=f.children;let y=-1;const v=[],x=p.enter("table");for(;++y<g.length;)v[y]=h(g[y],p,m);return x(),v}function h(f,p,m){const g=f.children;let y=-1;const v=[],x=p.enter("tableRow");for(;++y<g.length;)v[y]=c(g[y],f,p,m);return x(),v}function A(f,p,m){let g=Hle.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function sUe(){return{exit:{taskListCheckValueChecked:VV,taskListCheckValueUnchecked:VV,paragraph:oUe}}}function aUe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lUe}}}function VV(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function oUe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function lUe(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let c=Hle.listItem(e,t,n,{...r,...o.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+a}}function cUe(){return[HRe(),lDe(),hDe(),JDe(),sUe()]}function uUe(e){return{extensions:[QRe(),cDe(e),fDe(),iUe(e),aUe()]}}const dUe={tokenize:gUe,partial:!0},Qle={tokenize:yUe,partial:!0},$le={tokenize:vUe,partial:!0},zle={tokenize:xUe,partial:!0},hUe={tokenize:wUe,partial:!0},Vle={name:"wwwAutolink",tokenize:pUe,previous:qle},Kle={name:"protocolAutolink",tokenize:mUe,previous:Wle},Od={name:"emailAutolink",tokenize:AUe,previous:Gle},wu={};function fUe(){return{text:wu}}let BA=48;for(;BA<123;)wu[BA]=Od,BA++,BA===58?BA=65:BA===91&&(BA=97);wu[43]=Od;wu[45]=Od;wu[46]=Od;wu[95]=Od;wu[72]=[Od,Kle];wu[104]=[Od,Kle];wu[87]=[Od,Vle];wu[119]=[Od,Vle];function AUe(e,t,n){const r=this;let i,s;return a;function a(h){return!rM(h)||!Gle.call(r,r.previous)||$6(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return rM(h)?(e.consume(h),o):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(hUe,d,u)(h):h===45||h===95||na(h)?(s=!0,e.consume(h),c):d(h)}function u(h){return e.consume(h),i=!0,c}function d(h){return s&&i&&wa(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function pUe(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!qle.call(r,r.previous)||$6(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dUe,e.attempt(Qle,e.attempt($le,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function mUe(e,t,n){const r=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&Wle.call(r,r.previous)&&!$6(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if(wa(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const A=i.toLowerCase();if(A==="http"||A==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),s?u:(s=!0,c)):n(h)}function u(h){return h===null||Sj(h)||mr(h)||Xp(h)||UE(h)?n(h):e.attempt(Qle,e.attempt($le,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function gUe(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function yUe(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(zle,c,o)(u):u===null||mr(u)||Xp(u)||u!==45&&UE(u)?c(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function c(u){return i||r||!s?n(u):t(u)}}function vUe(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(zle,t,s)(a):a===null||mr(a)||Xp(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function xUe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||mr(o)||Xp(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||mr(o)||Xp(o)?t(o):r(o)}function s(o){return wa(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):wa(o)?(e.consume(o),a):n(o)}}function wUe(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return na(s)?n(s):t(s)}}function qle(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||mr(e)}function Wle(e){return!wa(e)}function Gle(e){return!(e===47||rM(e))}function rM(e){return e===43||e===45||e===46||e===95||na(e)}function $6(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const bUe={tokenize:EUe,partial:!0};function CUe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jUe,continuation:{tokenize:BUe},exit:NUe}},text:{91:{name:"gfmFootnoteCall",tokenize:_Ue},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:SUe,resolveTo:kUe}}}}function SUe(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return n(c);const u=xc(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function kUe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function _Ue(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(s>999||h===93&&!a||h===null||h===91||mr(h))return n(h);if(h===93){e.exit("chunkString");const A=e.exit("gfmFootnoteCallString");return i.includes(xc(r.sliceSerialize(A)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return mr(h)||(a=!0),s++,e.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}}function jUe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return c;function c(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(p)}function d(p){if(a>999||p===93&&!o||p===null||p===91||mr(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=xc(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),A}return mr(p)||(o=!0),a++,e.consume(p),p===92?h:d}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}function A(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),On(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function BUe(e,t,n){return e.check(E2,t,e.attempt(bUe,t,n))}function NUe(e){e.exit("gfmFootnoteDefinition")}function EUe(e,t,n){const r=this;return On(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function TUe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let u=c;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[c][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[c][1].end)},h={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[c][1].start)},A=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",h,o]],f=o.parser.constructs.insideSpan.null;f&&Ho(A,A.length,0,HE(f,a.slice(u+1,c),o)),Ho(A,A.length,0,[["exit",h,o],["enter",a[c][1],o],["exit",a[c][1],o],["exit",d,o]]),Ho(a,u-1,c-u+3,A),c=u+A.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function s(a,o,c){const u=this.previous,d=this.events;let h=0;return A;function A(p){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(p):(a.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=hv(u);if(p===126)return h>1?c(p):(a.consume(p),h++,f);if(h<2&&!n)return c(p);const g=a.exit("strikethroughSequenceTemporary"),y=hv(p);return g._open=!y||y===2&&!!m,g._close=!m||m===2&&!!y,o(p)}}}class IUe{constructor(){this.map=[]}add(t,n,r){PUe(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function PUe(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function OUe(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function FUe(){return{flow:{null:{name:"table",tokenize:MUe,resolveAll:LUe}}}}function MUe(e,t,n){const r=this;let i=0,s=0,a;return o;function o(P){let T=r.events.length-1;for(;T>-1;){const L=r.events[T][1].type;if(L==="lineEnding"||L==="linePrefix")T--;else break}const N=T>-1?r.events[T][1].type:null,F=N==="tableHead"||N==="tableRow"?k:c;return F===k&&r.parser.lazy[r.now().line]?n(P):F(P)}function c(P){return e.enter("tableHead"),e.enter("tableRow"),u(P)}function u(P){return P===124||(a=!0,s+=1),d(P)}function d(P){return P===null?n(P):$t(P)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),f):n(P):Cn(P)?On(e,d,"whitespace")(P):(s+=1,a&&(a=!1,i+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(P)))}function h(P){return P===null||P===124||mr(P)?(e.exit("data"),d(P)):(e.consume(P),P===92?A:h)}function A(P){return P===92||P===124?(e.consume(P),h):h(P)}function f(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),a=!1,Cn(P)?On(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):p(P))}function p(P){return P===45||P===58?g(P):P===124?(a=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),m):w(P)}function m(P){return Cn(P)?On(e,g,"whitespace")(P):g(P)}function g(P){return P===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),y):P===45?(s+=1,y(P)):P===null||$t(P)?b(P):w(P)}function y(P){return P===45?(e.enter("tableDelimiterFiller"),v(P)):w(P)}function v(P){return P===45?(e.consume(P),v):P===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(P))}function x(P){return Cn(P)?On(e,b,"whitespace")(P):b(P)}function b(P){return P===124?p(P):P===null||$t(P)?!a||i!==s?w(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):w(P)}function w(P){return n(P)}function k(P){return e.enter("tableRow"),j(P)}function j(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),j):P===null||$t(P)?(e.exit("tableRow"),t(P)):Cn(P)?On(e,j,"whitespace")(P):(e.enter("data"),B(P))}function B(P){return P===null||P===124||mr(P)?(e.exit("data"),j(P)):(e.consume(P),P===92?E:B)}function E(P){return P===92||P===124?(e.consume(P),B):B(P)}}function LUe(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,d,h;const A=new IUe;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(o=!1,c!==0&&(KV(A,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},A.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},A.add(n,0,[["enter",d,t]])),i=p.type==="tableDelimiterRow"?2:d?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=CS(A,t,s,i,void 0,h),s=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],h=CS(A,t,s,i,void 0,h)),s=a,a=[s[1],n,0,0])):p.type==="tableHead"?(o=!0,c=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(c=n,s[1]!==0?(a[0]=a[1],h=CS(A,t,s,i,n,h)):a[1]!==0&&(h=CS(A,t,a,i,n,h)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&KV(A,t,c,u,d),A.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=OUe(t.events,n))}return e}function CS(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Og(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=Og(t.events,n[1]);if(s={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Og(t.events,n[2]),d=Og(t.events,n[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const A=t.events[n[2]],f=t.events[n[3]];if(A[1].end=Object.assign({},f[1].end),A[1].type="chunkText",A[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(s.end=Object.assign({},Og(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function KV(e,t,n,r,i){const s=[],a=Og(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Og(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const RUe={name:"tasklistCheck",tokenize:UUe};function DUe(){return{text:{91:RUe}}}function UUe(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return mr(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return $t(c)?t(c):Cn(c)?e.check({tokenize:HUe},t,n)(c):n(c)}}function HUe(e,t,n){return On(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function QUe(e){return sle([fUe(),CUe(),TUe(e),FUe(),DUe()])}const $Ue={};function zUe(e){const t=this,n=e||$Ue,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(QUe(n)),s.push(cUe()),a.push(uUe(n))}const qV="616-403-6393",VUe=["What's the housing market like in East Grand Rapids right now?","How much should I save for a down payment as a first-time buyer?","What neighborhoods are good for downsizing in Grand Rapids?","How long does it usually take to sell a home in West Michigan?","What does Holden's commission structure look like?","How does the home inspection process work?"],KUe=({onPick:e})=>l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{className:"text-xs uppercase tracking-[0.2em] text-muted-foreground flex items-center gap-2",children:[l.jsx(Os,{size:12,className:"text-gold"}),"Try asking"]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:VUe.map(t=>l.jsx("button",{onClick:()=>e(t),className:"text-left text-sm px-3.5 py-2 border border-border bg-card hover:bg-secondary hover:border-gold/50 transition-colors text-foreground",children:t},t))})]}),qUe=/^(https?:|mailto:|tel:|sms:|\/|#)/i,WUe=e=>qUe.test(e)?e:"",GUe=({href:e,children:t,...n})=>{const r=e&&/^https?:/i.test(e),i=e&&/^(sms:|tel:|mailto:)/i.test(e);return l.jsx("a",{href:e,...r?{target:"_blank",rel:"noopener noreferrer"}:{},...i?{rel:"noopener"}:{},...n,children:t})},YUe="https://khmmwvmdbhaplcfcndjx.supabase.co/functions/v1/faq-concierge",XUe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",JUe=()=>{const[e,t]=C.useState([]),[n,r]=C.useState(""),[i,s]=C.useState(!1),[a,o]=C.useState(null),c=C.useRef(null),u=C.useRef(null);C.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e,i]);const d=async f=>{const p=f.trim();if(!p||i)return;o(null);const m={role:"user",content:p},g=[...e,m];t(g),r(""),s(!0);try{const y=await fetch(YUe,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${XUe}`},body:JSON.stringify({messages:g})});if(y.status===429){o("Too many requests right now — try again in a moment."),s(!1);return}if(y.status===402){o(`AI service is temporarily unavailable. Text Holden directly at ${qV}.`),s(!1);return}if(!y.ok)throw new Error(`Server returned ${y.status}`);const v=await y.json();t([...g,{role:"assistant",content:v.content||"(no answer)"}])}catch(y){console.error("concierge error:",y),o(`Something went wrong. Text Holden at ${qV} and he'll get back to you fast.`)}finally{s(!1)}},h=f=>{f.preventDefault(),d(n)},A=f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),d(n))};return l.jsxs("div",{className:"border border-border bg-card flex flex-col",style:{minHeight:"min(70vh, 700px)"},children:[l.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto p-4 md:p-6 space-y-6",style:{maxHeight:"60vh"},children:[e.length===0&&l.jsxs("div",{className:"space-y-6 py-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:l.jsx(Gk,{size:18})}),l.jsx("div",{className:"bg-secondary px-4 py-3 text-sm text-foreground max-w-[85%]",children:"Hi — I'm Holden's AI assistant. Ask me anything about Grand Rapids real estate, neighborhoods, the buying or selling process, or how Holden works. I'll search his site first and then the open web if I have to."})]}),l.jsx(KUe,{onPick:f=>d(f)})]}),e.map((f,p)=>l.jsxs("div",{className:`flex items-start gap-3 ${f.role==="user"?"flex-row-reverse":""}`,children:[l.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center shrink-0 ${f.role==="user"?"bg-gold/20 text-gold border border-gold/30":"bg-primary text-primary-foreground"}`,children:f.role==="user"?l.jsx(nj,{size:16}):l.jsx(Gk,{size:18})}),l.jsx("div",{className:`px-4 py-3 text-sm max-w-[85%] ${f.role==="user"?"bg-primary text-primary-foreground":"bg-secondary text-foreground"}`,children:f.role==="assistant"?l.jsx("div",{className:"prose prose-sm max-w-none prose-headings:text-foreground prose-p:text-foreground prose-li:text-foreground prose-strong:text-foreground prose-a:text-accent prose-a:underline prose-hr:border-border",children:l.jsx(U6,{remarkPlugins:[zUe],urlTransform:WUe,components:{a:GUe},children:f.content})}):l.jsx("p",{className:"whitespace-pre-wrap",children:f.content})})]},p)),i&&l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:l.jsx(Gk,{size:18})}),l.jsxs("div",{className:"bg-secondary px-4 py-3 text-sm text-muted-foreground flex items-center gap-2",children:[l.jsx(Ea,{size:14,className:"animate-spin"}),"Searching the site…"]})]}),a&&l.jsx("div",{className:"bg-destructive/10 border border-destructive/30 px-4 py-3 text-sm text-destructive",children:a})]}),l.jsxs("form",{onSubmit:h,className:"border-t border-border p-3 md:p-4 flex gap-2 bg-background",children:[l.jsx("textarea",{ref:u,value:n,onChange:f=>r(f.target.value),onKeyDown:A,placeholder:"Ask anything about Grand Rapids real estate…",rows:1,disabled:i,className:"flex-1 resize-none px-4 py-3 bg-secondary text-foreground placeholder:text-muted-foreground border border-border focus:outline-none focus:border-gold/60 text-sm",style:{maxHeight:"120px"}}),l.jsxs("button",{type:"submit",disabled:i||!n.trim(),className:"px-4 md:px-6 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-40 disabled:cursor-not-allowed transition-colors flex items-center gap-2",children:[i?l.jsx(Ea,{size:16,className:"animate-spin"}):l.jsx(Nre,{size:16}),l.jsx("span",{className:"hidden sm:inline text-xs uppercase tracking-wider font-medium",children:"Send"})]})]})]})};function ZUe(){return Br({queryKey:["all-faqs-aggregated"],queryFn:async()=>{var h,A,f,p;const[e,t,n]=await Promise.all([Me.from("aeo_categories").select("id, name, slug, parent_id, faq_json, display_order, enabled").eq("enabled",!0).order("display_order"),Me.from("aeo_pages").select("id, title, h1, slug, faq_json, category_id, display_order").eq("status","published").order("display_order"),Me.from("blog_posts").select("id, title, slug, faq_json, category").eq("published",!0)]),r=e.data||[],i=t.data||[],s=n.data||[],a={};r.forEach(m=>a[m.id]=m);const o=m=>{const g=a[m.category_id];if(!g)return"/blog";if(g.parent_id){const y=a[g.parent_id];return y?`/${y.slug}/${g.slug}/${m.slug}`:`/${g.slug}/${m.slug}`}return`/${g.slug}/${m.slug}`},c=m=>{if(m.parent_id){const g=a[m.parent_id];return g?`/${g.slug}/${m.slug}`:`/${m.slug}`}return`/${m.slug}`},u={},d=m=>{const g=m.parent_id&&a[m.parent_id]||m;return u[g.id]||(u[g.id]={categoryName:g.name,categorySlug:g.slug,faqs:[]}),u[g.id]};for(const m of r){const g=Array.isArray(m.faq_json)?m.faq_json:[],y=c(m),v=d(m);for(const x of g)!(x!=null&&x.question)||!(x!=null&&x.answer)||v.faqs.push({question:x.question,answer:x.answer,sourceUrl:y,sourceTitle:m.name,category:((h=a[m.parent_id])==null?void 0:h.name)||m.name,categorySlug:((A=a[m.parent_id])==null?void 0:A.slug)||m.slug})}for(const m of i){const g=a[m.category_id];if(!g)continue;const y=Array.isArray(m.faq_json)?m.faq_json:[],v=o(m),x=d(g);for(const b of y)!(b!=null&&b.question)||!(b!=null&&b.answer)||x.faqs.push({question:b.question,answer:b.answer,sourceUrl:v,sourceTitle:m.h1||m.title,category:((f=a[g.parent_id])==null?void 0:f.name)||g.name,categorySlug:((p=a[g.parent_id])==null?void 0:p.slug)||g.slug})}for(const m of s){const g=Array.isArray(m.faq_json)?m.faq_json:[];if(g.length===0)continue;const y=m.category||"Blog",v=y.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"blog",x=`blog::${v}`;u[x]||(u[x]={categoryName:y,categorySlug:v,faqs:[]});for(const b of g)!(b!=null&&b.question)||!(b!=null&&b.answer)||u[x].faqs.push({question:b.question,answer:b.answer,sourceUrl:`/blog/${m.slug}`,sourceTitle:m.title,category:y,categorySlug:v})}return Object.values(u).filter(m=>m.faqs.length>0).sort((m,g)=>m.categoryName.localeCompare(g.categoryName))},staleTime:1e3*60*10})}function e6e(e,t){if(!t.trim())return[];const n=t.toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(i=>i.length>2);if(n.length===0)return[];const r=[];for(const i of e)for(const s of i.faqs){const a=s.question.toLowerCase(),o=s.answer.toLowerCase();let c=0;for(const u of n)c+=(a.split(u).length-1)*3,c+=o.split(u).length-1;c>0&&r.push({...s,_score:c})}return r.sort((i,s)=>s._score-i._score),r.slice(0,30).map(({_score:i,...s})=>s)}const t6e=()=>{const{data:e,isLoading:t}=ZUe(),[n,r]=C.useState(""),[i,s]=C.useState(null),[a,o]=C.useState(null),c=C.useMemo(()=>!e||!n.trim()?[]:e6e(e,n),[e,n]),u=(e||[]).reduce((d,h)=>d+h.faqs.length,0);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"heading-section mb-2",children:"Browse all questions"}),l.jsx("p",{className:"text-body text-muted-foreground",children:t?"Loading…":`${u} question${u===1?"":"s"} across ${(e||[]).length} categor${(e||[]).length===1?"y":"ies"} on the site. Each links to its full source page.`})]}),l.jsxs("div",{className:"relative",children:[l.jsx(cE,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{type:"search",value:n,onChange:d=>r(d.target.value),placeholder:"Filter by keyword…",className:"w-full pl-11 pr-4 py-3 bg-card border border-border focus:outline-none focus:border-gold/60 text-sm text-foreground placeholder:text-muted-foreground"})]}),n.trim()&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:[c.length," match",c.length===1?"":"es"]}),c.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"No matches. Try the chat above — it can search the web too."}),l.jsx("div",{className:"space-y-2",children:c.map((d,h)=>{const A=`search-${h}`,f=a===A;return l.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[l.jsxs("button",{onClick:()=>o(f?null:A),className:"w-full flex items-start gap-3 p-4 text-left hover:bg-secondary/50 transition-colors",children:[l.jsx(vc,{size:16,className:`mt-0.5 shrink-0 text-gold transition-transform ${f?"rotate-90":""}`}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"font-medium text-foreground text-sm",children:d.question}),l.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mt-1",children:d.category})]})]}),f&&l.jsxs("div",{className:"px-4 pb-4 pl-11 space-y-3",children:[l.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:d.answer}),l.jsxs(St,{to:d.sourceUrl,className:"inline-flex items-center gap-1.5 text-xs uppercase tracking-wider text-accent hover:text-gold transition-colors",children:["Read full answer on ",d.sourceTitle,l.jsx(ao,{size:11})]})]})]},A)})})]}),!n.trim()&&l.jsx("div",{className:"space-y-3",children:(e||[]).map(d=>{const h=i===d.categorySlug;return l.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[l.jsxs("button",{onClick:()=>s(h?null:d.categorySlug),className:"w-full flex items-center justify-between p-4 hover:bg-secondary/50 transition-colors",children:[l.jsxs("div",{className:"text-left",children:[l.jsx("p",{className:"font-medium text-foreground",children:d.categoryName}),l.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mt-0.5",children:[d.faqs.length," question",d.faqs.length===1?"":"s"]})]}),l.jsx(yc,{size:16,className:`text-gold transition-transform ${h?"rotate-180":""}`})]}),h&&l.jsx("div",{className:"border-t border-border divide-y divide-border",children:d.faqs.map((A,f)=>{const p=`${d.categorySlug}-${f}`,m=a===p;return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>o(m?null:p),className:"w-full flex items-start gap-3 p-4 text-left hover:bg-secondary/50 transition-colors",children:[l.jsx(vc,{size:14,className:`mt-1 shrink-0 text-gold transition-transform ${m?"rotate-90":""}`}),l.jsx("p",{className:"flex-1 text-sm text-foreground",children:A.question})]}),m&&l.jsxs("div",{className:"px-4 pb-4 pl-11 space-y-3",children:[l.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:A.answer}),l.jsxs(St,{to:A.sourceUrl,className:"inline-flex items-center gap-1.5 text-xs uppercase tracking-wider text-accent hover:text-gold transition-colors",children:["Read full answer on ",A.sourceTitle,l.jsx(ao,{size:11})]})]})]},p)})})]},d.categorySlug)})})]})},n6e=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),l.jsx("meta",{name:"description",content:"Get instant answers to your Grand Rapids real estate questions. Holden's AI concierge searches his entire site to answer about buying, selling, neighborhoods, market trends, and more."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/faq"}),l.jsx("meta",{property:"og:title",content:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),l.jsx("meta",{property:"og:description",content:"AI-powered answers to every Grand Rapids real estate question — pulled from Holden's hundreds of FAQ pages and expert content."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/faq"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),l.jsx("meta",{name:"twitter:description",content:"AI-powered answers to every Grand Rapids real estate question."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"Ask Holden",item:"https://www.holdengr.com/faq"}]})}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"WebApplication","@id":"https://www.holdengr.com/faq#concierge",name:"Ask Holden Anything",url:"https://www.holdengr.com/faq",applicationCategory:"BusinessApplication",description:"AI concierge that answers Grand Rapids real estate questions using Holden Richardson's site content and the open web.",isPartOf:{"@id":"https://www.holdengr.com/#website"},about:{"@id":"https://www.holdengr.com/#agent"},offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}})})]}),l.jsx("section",{className:"bg-secondary -mt-20 pt-32 md:pt-40 pb-12 md:pb-16",children:l.jsx("div",{className:"container-page text-center max-w-3xl",children:l.jsxs(_e,{children:[l.jsxs("p",{className:"text-caption text-muted-foreground mb-4 flex items-center justify-center gap-2",children:[l.jsx(Os,{size:12,className:"text-gold"}),"AI Concierge"]}),l.jsx("h1",{className:"heading-display mb-6",children:"Ask Holden Anything"}),l.jsx("p",{className:"text-body text-muted-foreground",children:"Type any question about Grand Rapids real estate. The concierge searches Holden's site first — and the open web if it has to — then gives you a real answer with sources."})]})})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page max-w-4xl",children:l.jsx(_e,{children:l.jsx(JUe,{})})})}),l.jsx("section",{className:"section-padding bg-secondary/30",children:l.jsx("div",{className:"container-page max-w-4xl",children:l.jsx(_e,{children:l.jsx(t6e,{})})})})]}),r6e=v2("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 Yt({className:e,variant:t,...n}){return l.jsx("div",{className:ot(r6e({variant:t}),e),...n})}const NP=10,Yle=({categoryId:e,parentCategorySlug:t})=>{const[n,r]=C.useState(1),{data:i,isLoading:s}=Br({queryKey:["news-releases",e],queryFn:async()=>{const{data:h,error:A}=await Me.from("aeo_pages").select("id, title, slug, h1, subheadline, intro_text, body_content, created_at, published_at, press_links, status").eq("category_id",e).eq("status","published").order("published_at",{ascending:!1});if(A)throw A;return h}}),a=i||[],o=Math.max(1,Math.ceil(a.length/NP)),c=a.slice((n-1)*NP,n*NP),u=h=>{const f=(h.intro_text||h.body_content||"").replace(/<[^>]*>/g,"").trim();return f.length<=200?f:f.slice(0,200).replace(/\s+\S*$/,"")+"…"},d=h=>h?new Date(h).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsxs("div",{className:"bg-background",children:[l.jsx("section",{className:"py-16 md:py-20",children:l.jsx("div",{className:"container-page max-w-4xl mx-auto",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-4 font-semibold",children:"Press & Media"}),l.jsx("h2",{className:"font-serif text-3xl md:text-4xl font-light mb-4 text-foreground",children:"News & Press Releases"}),l.jsx("div",{className:"w-16 h-px bg-accent mb-6"}),l.jsx("p",{className:"text-foreground/70 max-w-2xl text-lg leading-relaxed",children:"Stay up to date with the latest announcements, market insights, and press coverage. Each release reflects our commitment to transparency and leadership in the Grand Rapids real estate market."})]})})}),l.jsx("div",{className:"container-page max-w-4xl mx-auto",children:l.jsx("div",{className:"h-px bg-gradient-to-r from-accent/40 via-border/60 to-transparent"})}),l.jsx("section",{className:"py-12 md:py-16",children:l.jsx("div",{className:"container-page max-w-4xl mx-auto",children:s?l.jsx("div",{className:"space-y-6",children:[1,2,3].map(h=>l.jsx("div",{className:"h-40 bg-secondary/30 animate-pulse rounded"},h))}):a.length===0?l.jsx("div",{className:"text-center py-16",children:l.jsx("p",{className:"text-muted-foreground text-lg",children:"No press releases published yet."})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-6",children:c.map((h,A)=>{const f=h.press_links,p=[f==null?void 0:f.national,f==null?void 0:f.local,f==null?void 0:f.source].filter(Boolean).length;return l.jsx(_e,{delay:A*.05,children:l.jsx("article",{className:"group border border-border/50 hover:border-accent/30 transition-all duration-300 bg-background",children:l.jsxs("div",{className:"p-6 md:p-8",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[l.jsx(Cl,{className:"w-3.5 h-3.5"}),d(h.published_at||h.created_at)]}),p>0&&l.jsxs(Yt,{variant:"secondary",className:"text-xs font-normal",children:["Featured in ",p," outlet",p>1?"s":""]})]}),l.jsx(St,{to:`/news/${h.slug}`,className:"block group-hover:text-accent transition-colors",children:l.jsx("h3",{className:"font-serif text-xl md:text-2xl font-medium leading-snug mb-3",children:h.h1||h.title})}),h.subheadline&&l.jsx("p",{className:"text-accent/80 text-sm font-medium mb-2",children:h.subheadline}),l.jsx("p",{className:"text-foreground/65 leading-relaxed mb-4 text-[0.95rem]",children:u(h)}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[f&&l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"As seen in:"}),f.national&&l.jsxs("a",{href:f.national,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["National ",l.jsx(ao,{className:"w-3 h-3"})]}),f.local&&l.jsxs("a",{href:f.local,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["Local ",l.jsx(ao,{className:"w-3 h-3"})]}),f.source&&l.jsxs("a",{href:f.source,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["Source ",l.jsx(ao,{className:"w-3 h-3"})]})]}),l.jsxs(St,{to:`/news/${h.slug}`,className:"inline-flex items-center gap-1.5 text-sm text-accent font-medium hover:gap-2.5 transition-all",children:["Read Full Release ",l.jsx(Xa,{className:"w-4 h-4"})]})]})]})})},h.id)})}),o>1&&l.jsxs("div",{className:"flex items-center justify-center gap-4 mt-12",children:[l.jsxs(xe,{variant:"outline",size:"sm",disabled:n===1,onClick:()=>r(h=>Math.max(1,h-1)),children:[l.jsx(vre,{className:"w-4 h-4 mr-1"})," Previous"]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",n," of ",o]}),l.jsxs(xe,{variant:"outline",size:"sm",disabled:n===o,onClick:()=>r(h=>Math.min(o,h+1)),children:["Next ",l.jsx(vc,{className:"w-4 h-4 ml-1"})]})]})]})})})]})},i6e=()=>{const{data:e,isLoading:t}=Br({queryKey:["news-category-flat"],queryFn:async()=>{const{data:n,error:r}=await Me.from("aeo_categories").select("id, name, slug, intro_text, parent_id").eq("slug","news").maybeSingle();if(r)throw r;return n}});return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"News & Press | Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"description",content:"Latest press coverage, market news, and announcements from Holden Richardson — Grand Rapids Realtor at 616 Realty LLC."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/news"}),l.jsx("meta",{property:"og:title",content:"News & Press | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Latest press coverage and announcements from Grand Rapids Realtor Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/news"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"News & Press | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Latest press coverage and announcements from Grand Rapids Realtor Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"News",item:"https://www.holdengr.com/news"}]})})]}),l.jsx("section",{className:"bg-secondary -mt-20 pt-32 md:pt-40 pb-12 md:pb-16",children:l.jsx("div",{className:"container-page text-center max-w-3xl",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"News & Press"}),l.jsx("h1",{className:"heading-display mb-6",children:"In the News"}),l.jsx("p",{className:"text-body text-muted-foreground",children:(e==null?void 0:e.intro_text)||"Press coverage, market announcements, and updates from Holden Richardson and 616 Realty LLC."})]})})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsxs("div",{className:"container-page max-w-5xl",children:[t&&l.jsx("p",{className:"text-center text-muted-foreground",children:"Loading…"}),e&&l.jsx(Yle,{categoryId:e.id,parentCategorySlug:""})]})})]})};var EP="focusScope.autoFocusOnMount",TP="focusScope.autoFocusOnUnmount",WV={bubbles:!1,cancelable:!0},s6e="FocusScope",VE=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,c]=C.useState(null),u=Yi(i),d=Yi(s),h=C.useRef(null),A=sn(t,m=>c(m)),f=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(x){if(f.paused||!o)return;const b=x.target;o.contains(b)?h.current=b:fh(h.current,{select:!0})},g=function(x){if(f.paused||!o)return;const b=x.relatedTarget;b!==null&&(o.contains(b)||fh(h.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&fh(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(y);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[r,o,f.paused]),C.useEffect(()=>{if(o){YV.add(f);const m=document.activeElement;if(!o.contains(m)){const y=new CustomEvent(EP,WV);o.addEventListener(EP,u),o.dispatchEvent(y),y.defaultPrevented||(a6e(d6e(Xle(o)),{select:!0}),document.activeElement===m&&fh(o))}return()=>{o.removeEventListener(EP,u),setTimeout(()=>{const y=new CustomEvent(TP,WV);o.addEventListener(TP,d),o.dispatchEvent(y),y.defaultPrevented||fh(m??document.body,{select:!0}),o.removeEventListener(TP,d),YV.remove(f)},0)}}},[o,u,d,f]);const p=C.useCallback(m=>{if(!n&&!r||f.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const v=m.currentTarget,[x,b]=o6e(v);x&&b?!m.shiftKey&&y===b?(m.preventDefault(),n&&fh(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),n&&fh(b,{select:!0})):y===v&&m.preventDefault()}},[n,r,f.paused]);return l.jsx(_t.div,{tabIndex:-1,...a,ref:A,onKeyDown:p})});VE.displayName=s6e;function a6e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fh(r,{select:t}),document.activeElement!==n)return}function o6e(e){const t=Xle(e),n=GV(t,e),r=GV(t.reverse(),e);return[n,r]}function Xle(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function GV(e,t){for(const n of e)if(!l6e(n,{upTo:t}))return n}function l6e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function c6e(e){return e instanceof HTMLInputElement&&"select"in e}function fh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&c6e(e)&&t&&e.select()}}var YV=u6e();function u6e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=XV(e,t),e.unshift(t)},remove(t){var n;e=XV(e,t),(n=e[0])==null||n.resume()}}}function XV(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function d6e(e){return e.filter(t=>t.tagName!=="A")}var IP=0;function z6(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??JV()),document.body.insertAdjacentElement("beforeend",e[1]??JV()),IP++,()=>{IP===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),IP--}},[])}function JV(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var l_="right-scroll-bar-position",c_="width-before-scroll-bar",h6e="with-scroll-bars-hidden",f6e="--removed-body-scroll-bar-size";function PP(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function A6e(e,t){var n=C.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var p6e=typeof window<"u"?C.useLayoutEffect:C.useEffect,ZV=new WeakMap;function m6e(e,t){var n=A6e(null,function(r){return e.forEach(function(i){return PP(i,r)})});return p6e(function(){var r=ZV.get(n);if(r){var i=new Set(r),s=new Set(e),a=n.current;i.forEach(function(o){s.has(o)||PP(o,null)}),s.forEach(function(o){i.has(o)||PP(o,a)})}ZV.set(n,e)},[e]),n}function g6e(e){return e}function y6e(e,t){t===void 0&&(t=g6e);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(s),a=n}var c=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function v6e(e){e===void 0&&(e={});var t=y6e(null);return t.options=eu({async:!0,ssr:!1},e),t}var Jle=function(e){var t=e.sideCar,n=d0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,eu({},n))};Jle.isSideCarExport=!0;function x6e(e,t){return e.useMedium(t),Jle}var Zle=v6e(),OP=function(){},KE=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:OP,onWheelCapture:OP,onTouchMoveCapture:OP}),i=r[0],s=r[1],a=e.forwardProps,o=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,A=e.sideCar,f=e.noRelative,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,x=e.gapMode,b=d0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=A,k=m6e([n,t]),j=eu(eu({},b),i);return C.createElement(C.Fragment,null,d&&C.createElement(w,{sideCar:Zle,removeScrollBar:u,shards:h,noRelative:f,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:x}),a?C.cloneElement(C.Children.only(o),eu(eu({},j),{ref:k})):C.createElement(v,eu({},j,{className:c,ref:k}),o))});KE.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};KE.classNames={fullWidth:c_,zeroRight:l_};var w6e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function b6e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=w6e();return t&&e.setAttribute("nonce",t),e}function C6e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function S6e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var k6e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=b6e())&&(C6e(t,n),S6e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_6e=function(){var e=k6e();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ece=function(){var e=_6e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},j6e={left:0,top:0,right:0,gap:0},FP=function(e){return parseInt(e||"",10)||0},B6e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[FP(n),FP(r),FP(i)]},N6e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return j6e;var t=B6e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},E6e=ece(),_y="data-scroll-locked",T6e=function(e,t,n,r){var i=e.left,s=e.top,a=e.right,o=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(h6e,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body[`).concat(_y,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(l_,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(c_,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(l_," .").concat(l_,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(c_," .").concat(c_,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(_y,`] {
    `).concat(f6e,": ").concat(o,`px;
  }
`)},eK=function(){var e=parseInt(document.body.getAttribute(_y)||"0",10);return isFinite(e)?e:0},I6e=function(){C.useEffect(function(){return document.body.setAttribute(_y,(eK()+1).toString()),function(){var e=eK()-1;e<=0?document.body.removeAttribute(_y):document.body.setAttribute(_y,e.toString())}},[])},P6e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;I6e();var s=C.useMemo(function(){return N6e(i)},[i]);return C.createElement(E6e,{styles:T6e(s,!t,i,n?"":"!important")})},iM=!1;if(typeof window<"u")try{var SS=Object.defineProperty({},"passive",{get:function(){return iM=!0,!0}});window.addEventListener("test",SS,SS),window.removeEventListener("test",SS,SS)}catch{iM=!1}var lg=iM?{passive:!1}:!1,O6e=function(e){return e.tagName==="TEXTAREA"},tce=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!O6e(e)&&n[t]==="visible")},F6e=function(e){return tce(e,"overflowY")},M6e=function(e){return tce(e,"overflowX")},tK=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=nce(e,r);if(i){var s=rce(e,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},L6e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},R6e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},nce=function(e,t){return e==="v"?F6e(t):M6e(t)},rce=function(e,t){return e==="v"?L6e(t):R6e(t)},D6e=function(e,t){return e==="h"&&t==="rtl"?-1:1},U6e=function(e,t,n,r,i){var s=D6e(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,c=t.contains(o),u=!1,d=a>0,h=0,A=0;do{if(!o)break;var f=rce(e,o),p=f[0],m=f[1],g=f[2],y=m-g-s*p;(p||y)&&nce(e,o)&&(h+=y,A+=p);var v=o.parentNode;o=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(d&&(Math.abs(h)<1||!i)||!d&&(Math.abs(A)<1||!i))&&(u=!0),u},kS=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nK=function(e){return[e.deltaX,e.deltaY]},rK=function(e){return e&&"current"in e?e.current:e},H6e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Q6e=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},$6e=0,cg=[];function z6e(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState($6e++)[0],s=C.useState(ece)[0],a=C.useRef(e);C.useEffect(function(){a.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=wTe([e.lockRef.current],(e.shards||[]).map(rK),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=C.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var y=kS(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-y[0],b="deltaY"in m?m.deltaY:v[1]-y[1],w,k=m.target,j=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in m&&j==="h"&&k.type==="range")return!1;var B=tK(j,k);if(!B)return!0;if(B?w=j:(w=j==="v"?"h":"v",B=tK(j,k)),!B)return!1;if(!r.current&&"changedTouches"in m&&(x||b)&&(r.current=w),!w)return!0;var E=r.current||w;return U6e(E,g,m,E==="h"?x:b,!0)},[]),c=C.useCallback(function(m){var g=m;if(!(!cg.length||cg[cg.length-1]!==s)){var y="deltaY"in g?nK(g):kS(g),v=t.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&H6e(w.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var x=(a.current.shards||[]).map(rK).filter(Boolean).filter(function(w){return w.contains(g.target)}),b=x.length>0?o(g,x[0]):!a.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),u=C.useCallback(function(m,g,y,v){var x={name:m,delta:g,target:y,should:v,shadowParent:V6e(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),d=C.useCallback(function(m){n.current=kS(m),r.current=void 0},[]),h=C.useCallback(function(m){u(m.type,nK(m),m.target,o(m,e.lockRef.current))},[]),A=C.useCallback(function(m){u(m.type,kS(m),m.target,o(m,e.lockRef.current))},[]);C.useEffect(function(){return cg.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:A}),document.addEventListener("wheel",c,lg),document.addEventListener("touchmove",c,lg),document.addEventListener("touchstart",d,lg),function(){cg=cg.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,lg),document.removeEventListener("touchmove",c,lg),document.removeEventListener("touchstart",d,lg)}},[]);var f=e.removeScrollBar,p=e.inert;return C.createElement(C.Fragment,null,p?C.createElement(s,{styles:Q6e(i)}):null,f?C.createElement(P6e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function V6e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const K6e=x6e(Zle,z6e);var qE=C.forwardRef(function(e,t){return C.createElement(KE,eu({},e,{ref:t,sideCar:K6e}))});qE.classNames=KE.classNames;var q6e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ug=new WeakMap,_S=new WeakMap,jS={},MP=0,ice=function(e){return e&&(e.host||ice(e.parentNode))},W6e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ice(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},G6e=function(e,t,n,r){var i=W6e(t,Array.isArray(e)?e:[e]);jS[n]||(jS[n]=new WeakMap);var s=jS[n],a=[],o=new Set,c=new Set(i),u=function(h){!h||o.has(h)||(o.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(A){if(o.has(A))d(A);else try{var f=A.getAttribute(r),p=f!==null&&f!=="false",m=(ug.get(A)||0)+1,g=(s.get(A)||0)+1;ug.set(A,m),s.set(A,g),a.push(A),m===1&&p&&_S.set(A,!0),g===1&&A.setAttribute(n,"true"),p||A.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",A,y)}})};return d(t),o.clear(),MP++,function(){a.forEach(function(h){var A=ug.get(h)-1,f=s.get(h)-1;ug.set(h,A),s.set(h,f),A||(_S.has(h)||h.removeAttribute(r),_S.delete(h)),f||h.removeAttribute(n)}),MP--,MP||(ug=new WeakMap,ug=new WeakMap,_S=new WeakMap,jS={})}},V6=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=q6e(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),G6e(r,i,n,"aria-hidden")):function(){return null}},WE="Dialog",[sce,ace]=fs(WE),[Y6e,Bc]=sce(WE),oce=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=C.useRef(null),c=C.useRef(null),[u,d]=lo({prop:r,defaultProp:i??!1,onChange:s,caller:WE});return l.jsx(Y6e,{scope:t,triggerRef:o,contentRef:c,contentId:kl(),titleId:kl(),descriptionId:kl(),open:u,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(h=>!h),[d]),modal:a,children:n})};oce.displayName=WE;var lce="DialogTrigger",cce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Bc(lce,n),s=sn(t,i.triggerRef);return l.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":W6(i.open),...r,ref:s,onClick:at(e.onClick,i.onOpenToggle)})});cce.displayName=lce;var K6="DialogPortal",[X6e,uce]=sce(K6,{forceMount:void 0}),dce=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Bc(K6,t);return l.jsx(X6e,{scope:t,forceMount:n,children:C.Children.map(r,a=>l.jsx(aa,{present:n||s.open,children:l.jsx(g2,{asChild:!0,container:i,children:a})}))})};dce.displayName=K6;var Bj="DialogOverlay",hce=C.forwardRef((e,t)=>{const n=uce(Bj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Bc(Bj,e.__scopeDialog);return s.modal?l.jsx(aa,{present:r||s.open,children:l.jsx(Z6e,{...i,ref:t})}):null});hce.displayName=Bj;var J6e=zp("DialogOverlay.RemoveScroll"),Z6e=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Bc(Bj,n);return l.jsx(qE,{as:J6e,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(_t.div,{"data-state":W6(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jp="DialogContent",fce=C.forwardRef((e,t)=>{const n=uce(Jp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Bc(Jp,e.__scopeDialog);return l.jsx(aa,{present:r||s.open,children:s.modal?l.jsx(eHe,{...i,ref:t}):l.jsx(tHe,{...i,ref:t})})});fce.displayName=Jp;var eHe=C.forwardRef((e,t)=>{const n=Bc(Jp,e.__scopeDialog),r=C.useRef(null),i=sn(t,n.contentRef,r);return C.useEffect(()=>{const s=r.current;if(s)return V6(s)},[]),l.jsx(Ace,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:at(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:at(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:at(e.onFocusOutside,s=>s.preventDefault())})}),tHe=C.forwardRef((e,t)=>{const n=Bc(Jp,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return l.jsx(Ace,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Ace=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=Bc(Jp,n),c=C.useRef(null),u=sn(t,c);return z6(),l.jsxs(l.Fragment,{children:[l.jsx(VE,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(Zv,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":W6(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(rHe,{titleId:o.titleId}),l.jsx(sHe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),q6="DialogTitle",pce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Bc(q6,n);return l.jsx(_t.h2,{id:i.titleId,...r,ref:t})});pce.displayName=q6;var mce="DialogDescription",gce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Bc(mce,n);return l.jsx(_t.p,{id:i.descriptionId,...r,ref:t})});gce.displayName=mce;var yce="DialogClose",vce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Bc(yce,n);return l.jsx(_t.button,{type:"button",...r,ref:t,onClick:at(e.onClick,()=>i.onOpenChange(!1))})});vce.displayName=yce;function W6(e){return e?"open":"closed"}var xce="DialogTitleWarning",[nHe,wce]=Jbe(xce,{contentName:Jp,titleName:q6,docsSlug:"dialog"}),rHe=({titleId:e})=>{const t=wce(xce),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},iHe="DialogDescriptionWarning",sHe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wce(iHe).contentName}}.`;return C.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},G6=oce,aHe=cce,Y6=dce,I2=hce,P2=fce,O2=pce,F2=gce,GE=vce;const Fo=G6,oHe=Y6,bce=C.forwardRef(({className:e,...t},n)=>l.jsx(I2,{ref:n,className:ot("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",e),...t}));bce.displayName=I2.displayName;const Ja=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(oHe,{children:[l.jsx(bce,{}),l.jsxs(P2,{ref:r,className:ot("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",e),...n,children:[t,l.jsxs(GE,{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:[l.jsx(ra,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ja.displayName=P2.displayName;const Za=({className:e,...t})=>l.jsx("div",{className:ot("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Za.displayName="DialogHeader";const eo=C.forwardRef(({className:e,...t},n)=>l.jsx(O2,{ref:n,className:ot("text-lg font-semibold leading-none tracking-tight",e),...t}));eo.displayName=O2.displayName;const Nj=C.forwardRef(({className:e,...t},n)=>l.jsx(F2,{ref:n,className:ot("text-sm text-muted-foreground",e),...t}));Nj.displayName=F2.displayName;const Wf=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:n,className:ot("w-full caption-bottom text-sm",e),...t})}));Wf.displayName="Table";const Gf=C.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:ot("[&_tr]:border-b",e),...t}));Gf.displayName="TableHeader";const Yf=C.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:ot("[&_tr:last-child]:border-0",e),...t}));Yf.displayName="TableBody";const lHe=C.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:ot("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));lHe.displayName="TableFooter";const Li=C.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:ot("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Li.displayName="TableRow";const vn=C.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:ot("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));vn.displayName="TableHead";const on=C.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:ot("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));on.displayName="TableCell";const cHe=C.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:ot("mt-4 text-sm text-muted-foreground",e),...t}));cHe.displayName="TableCaption";function YE(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var XE="Switch",[uHe,MTt]=fs(XE),[dHe,hHe]=uHe(XE),Cce=C.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:c="on",onCheckedChange:u,form:d,...h}=e,[A,f]=C.useState(null),p=sn(t,x=>f(x)),m=C.useRef(!1),g=A?d||!!A.closest("form"):!0,[y,v]=lo({prop:i,defaultProp:s??!1,onChange:u,caller:XE});return l.jsxs(dHe,{scope:n,checked:y,disabled:o,children:[l.jsx(_t.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":jce(y),"data-disabled":o?"":void 0,disabled:o,value:c,...h,ref:p,onClick:at(e.onClick,x=>{v(b=>!b),g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),g&&l.jsx(_ce,{control:A,bubbles:!m.current,name:r,value:c,checked:y,required:a,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});Cce.displayName=XE;var Sce="SwitchThumb",kce=C.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=hHe(Sce,n);return l.jsx(_t.span,{"data-state":jce(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});kce.displayName=Sce;var fHe="SwitchBubbleInput",_ce=C.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},s)=>{const a=C.useRef(null),o=sn(a,s),c=YE(n),u=pE(t);return C.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&f){const p=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(p)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_ce.displayName=fHe;function jce(e){return e?"checked":"unchecked"}var Bce=Cce,AHe=kce;const wc=C.forwardRef(({className:e,...t},n)=>l.jsx(Bce,{className:ot("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:l.jsx(AHe,{className:ot("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));wc.displayName=Bce.displayName;var Nce={exports:{}},Ece={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var fv=C;function pHe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mHe=typeof Object.is=="function"?Object.is:pHe,gHe=fv.useState,yHe=fv.useEffect,vHe=fv.useLayoutEffect,xHe=fv.useDebugValue;function wHe(e,t){var n=t(),r=gHe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return vHe(function(){i.value=n,i.getSnapshot=t,LP(i)&&s({inst:i})},[e,n,t]),yHe(function(){return LP(i)&&s({inst:i}),e(function(){LP(i)&&s({inst:i})})},[e]),xHe(n),n}function LP(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mHe(e,n)}catch{return!0}}function bHe(e,t){return t()}var CHe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?bHe:wHe;Ece.useSyncExternalStore=fv.useSyncExternalStore!==void 0?fv.useSyncExternalStore:CHe;Nce.exports=Ece;var X6=Nce.exports;function Ss(e){this.content=e}Ss.prototype={constructor:Ss,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return i==-1?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new Ss(s)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ss(n)},addToStart:function(e,t){return new Ss([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ss(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(s==-1?i.length:s,0,t,n),new Ss(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ss.from(e),e.size?new Ss(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ss.from(e),e.size?new Ss(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ss.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Ss.from=function(e){if(e instanceof Ss)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ss(t)};function Tce(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),s=t.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=Tce(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function Ice(e,t,n,r){for(let i=e.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let a=e.child(--i),o=t.child(--s),c=a.nodeSize;if(a==o){n-=c,r-=c;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let u=0,d=Math.min(a.text.length,o.text.length);for(;u<d&&a.text[a.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(a.content.size||o.content.size){let u=Ice(a.content,o.content,n-1,r-1);if(u)return u}n-=c,r-=c}}class $e{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,s){for(let a=0,o=0;o<n;a++){let c=this.content[a],u=o+c.nodeSize;if(u>t&&r(c,i+o,s||null,a)!==!1&&c.content.size){let d=o+1;c.nodesBetween(Math.max(0,t-d),Math.min(c.content.size,n-d),r,i+d)}o=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let s="",a=!0;return this.nodesBetween(t,n,(o,c)=>{let u=o.isText?o.text.slice(Math.max(t,c)-c,n-c):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(a?a=!1:s+=r),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new $e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let s=0,a=0;a<n;s++){let o=this.content[s],c=a+o.nodeSize;c>t&&((a<t||c>n)&&(o.isText?o=o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=c}return new $e(r,i)}cutByIndex(t,n){return t==n?$e.empty:t==0&&n==this.content.length?this:new $e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new $e(i,s)}addToStart(t){return new $e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new $e(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return Tce(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return Ice(this,t,n,r)}findIndex(t){if(t==0)return BS(0,t);if(t==this.size)return BS(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=t)return s==t?BS(n+1,s):BS(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return $e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new $e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return $e.empty;let n,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(n||(n=t.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new $e(n||t,r)}static from(t){if(!t)return $e.empty;if(t instanceof $e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new $e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$e.empty=new $e([],0);const RP={index:0,offset:0};function BS(e,t){return RP.index=e,RP.offset=t,RP}function Ej(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Ej(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Ej(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let hr=class sM{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let s=t[i];if(this.eq(s))return t;if(this.type.excludes(s.type))n||(n=t.slice(0,i));else{if(s.type.excludes(this.type))return t;!r&&s.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Ej(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return sM.none;if(t instanceof sM)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};hr.none=[];class Tj extends Error{}class ct{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Oce(this.content,t+this.openStart,n);return r&&new ct(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ct(Pce(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ct.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ct($e.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new ct(t,r,i)}}ct.empty=new ct($e.empty,0,0);function Pce(e,t,n){let{index:r,offset:i}=e.findIndex(t),s=e.maybeChild(r),{index:a,offset:o}=e.findIndex(n);if(i==t||s.isText){if(o!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,s.copy(Pce(s.content,t-i-1,n-i-1)))}function Oce(e,t,n,r){let{index:i,offset:s}=e.findIndex(t),a=e.maybeChild(i);if(s==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let o=Oce(a.content,t-s-1,n,a);return o&&e.replaceChild(i,a.copy(o))}function SHe(e,t,n){if(n.openStart>e.depth)throw new Tj("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Tj("Inconsistent open depths");return Fce(e,t,n,0)}function Fce(e,t,n,r){let i=e.index(r),s=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=Fce(e,t,n,r+1);return s.copy(s.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,o=a.content;return Np(a,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}else{let{start:a,end:o}=kHe(n,e);return Np(s,Lce(e,a,o,t,r))}else return Np(s,Ij(e,t,r))}function Mce(e,t){if(!t.type.compatibleContent(e.type))throw new Tj("Cannot join "+t.type.name+" onto "+e.type.name)}function aM(e,t,n){let r=e.node(n);return Mce(r,t.node(n)),r}function Bp(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Uw(e,t,n,r){let i=(t||e).node(n),s=0,a=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(Bp(e.nodeAfter,r),s++));for(let o=s;o<a;o++)Bp(i.child(o),r);t&&t.depth==n&&t.textOffset&&Bp(t.nodeBefore,r)}function Np(e,t){return e.type.checkContent(t),e.copy(t)}function Lce(e,t,n,r,i){let s=e.depth>i&&aM(e,t,i+1),a=r.depth>i&&aM(n,r,i+1),o=[];return Uw(null,e,i,o),s&&a&&t.index(i)==n.index(i)?(Mce(s,a),Bp(Np(s,Lce(e,t,n,r,i+1)),o)):(s&&Bp(Np(s,Ij(e,t,i+1)),o),Uw(t,n,i,o),a&&Bp(Np(a,Ij(n,r,i+1)),o)),Uw(r,null,i,o),new $e(o)}function Ij(e,t,n){let r=[];if(Uw(null,e,n,r),e.depth>n){let i=aM(e,t,n+1);Bp(Np(i,Ij(e,t,n+1)),r)}return Uw(t,null,n,r),new $e(r)}function kHe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)i=t.node(s).copy($e.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Jb{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<t;s++)i+=r.child(s).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return hr.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Pj(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let a=t;;){let{index:o,offset:c}=a.content.findIndex(s),u=s-c;if(r.push(a,o,i+c),!u||(a=a.child(o),a.isText))break;s=u-1,i+=c+1}return new Jb(n,r,s)}static resolveCached(t,n){let r=iK.get(t);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else iK.set(t,r=new _He);let i=r.elts[r.i]=Jb.resolve(t,n);return r.i=(r.i+1)%jHe,i}}class _He{constructor(){this.elts=[],this.i=0}}const jHe=12,iK=new WeakMap;class Pj{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const BHe=Object.create(null);let Af=class oM{constructor(t,n,r,i=hr.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||$e.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Ej(this.attrs,n||t.defaultAttrs||BHe)&&hr.sameSet(this.marks,r||hr.none)}copy(t=null){return t==this.content?this:new oM(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new oM(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ct.empty;let i=this.resolve(t),s=this.resolve(n),a=r?0:i.sharedDepth(n),o=i.start(a),u=i.node(a).content.cut(i.pos-o,s.pos-o);return new ct(u,i.depth-a,s.depth-a)}replace(t,n,r){return SHe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Jb.resolveCached(this,t)}resolveNoCache(t){return Jb.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Rce(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=$e.empty,i=0,s=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,s),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(t).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=hr.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!hr.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=$e.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Af.prototype.text=void 0;class Oj extends Af{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Rce(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Oj(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Oj(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Rce(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Zp{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new NHe(t,n);if(r.next==null)return Zp.empty;let i=Dce(r);r.next&&r.err("Unexpected trailing text");let s=MHe(FHe(i));return LHe(s,r),s}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(t.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function s(a,o){let c=a.matchFragment(t,r);if(c&&(!n||c.validEnd))return $e.from(o.map(u=>u.createAndFill()));for(let u=0;u<a.next.length;u++){let{type:d,next:h}=a.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let A=s(h,o.concat(d));if(A)return A}}return null}return s(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(t)){let a=[];for(let o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:o,next:c}=s.next[a];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||c.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return s}).join(`
`)}}Zp.empty=new Zp(!0);class NHe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Dce(e){let t=[];do t.push(EHe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function EHe(e){let t=[];do t.push(THe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function THe(e){let t=OHe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=IHe(e,t);else break;return t}function sK(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function IHe(e,t){let n=sK(e),r=n;return e.eat(",")&&(e.next!="}"?r=sK(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function PHe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let s in n){let a=n[s];a.isInGroup(t)&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function OHe(e){if(e.eat("(")){let t=Dce(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=PHe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function FHe(e){let t=[[]];return i(s(e,0),n()),t;function n(){return t.push([])-1}function r(a,o,c){let u={term:c,to:o};return t[a].push(u),u}function i(a,o){a.forEach(c=>c.to=o)}function s(a,o){if(a.type=="choice")return a.exprs.reduce((c,u)=>c.concat(s(u,o)),[]);if(a.type=="seq")for(let c=0;;c++){let u=s(a.exprs[c],o);if(c==a.exprs.length-1)return u;i(u,o=n())}else if(a.type=="star"){let c=n();return r(o,c),i(s(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=n();return i(s(a.expr,o),c),i(s(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(o)].concat(s(a.expr,o));if(a.type=="range"){let c=o;for(let u=0;u<a.min;u++){let d=n();i(s(a.expr,c),d),c=d}if(a.max==-1)i(s(a.expr,c),c);else for(let u=a.min;u<a.max;u++){let d=n();r(c,d),i(s(a.expr,c),d),c=d}return[r(c)]}else{if(a.type=="name")return[r(o,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Uce(e,t){return t-e}function aK(e,t){let n=[];return r(t),n.sort(Uce);function r(i){let s=e[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:o,to:c}=s[a];!o&&n.indexOf(c)==-1&&r(c)}}}function MHe(e){let t=Object.create(null);return n(aK(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:o,to:c})=>{if(!o)return;let u;for(let d=0;d<i.length;d++)i[d][0]==o&&(u=i[d][1]);aK(e,c).forEach(d=>{u||i.push([o,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=t[r.join(",")]=new Zp(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let o=i[a][1].sort(Uce);s.next.push({type:i[a][0],next:t[o.join(",")]||n(o)})}return s}}function LHe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],s=!i.validEnd,a=[];for(let o=0;o<i.next.length;o++){let{type:c,next:u}=i.next[o];a.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Hce(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Qce(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let s=e[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function $ce(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let s=e[i];s.validate&&s.validate(t[i])}}function zce(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new DHe(e,r,t[r]);return n}let oK=class Vce{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=zce(t,r.attrs),this.defaultAttrs=Hce(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Zp.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Qce(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Af(this,this.computeAttrs(t),$e.from(n),hr.setFrom(r))}createChecked(t=null,n,r){return n=$e.from(n),this.checkContent(n),new Af(this,this.computeAttrs(t),n,hr.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=$e.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore($e.empty,!0);return s?new Af(this,t,n.append(s),hr.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){$ce(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:hr.none:t}static compile(t,n){let r=Object.create(null);t.forEach((s,a)=>r[s]=new Vce(s,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function RHe(e,t,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${s}`)}}class DHe{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?RHe(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class JE{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=zce(t,i.attrs),this.excluded=null;let s=Hce(this.attrs);this.instance=s?new hr(this,s):null}create(t=null){return!t&&this.instance?this.instance:new hr(this,Qce(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((s,a)=>r[s]=new JE(s,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){$ce(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Kce{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=Ss.from(t.nodes),n.marks=Ss.from(t.marks||{}),this.nodes=oK.compile(this.spec.nodes,this),this.marks=JE.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",o=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Zp.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=o=="_"?null:o?lK(this,o.split(" ")):o==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:lK(this,a.split(" "))}this.nodeFromJSON=i=>Af.fromJSON(this,i),this.markFromJSON=i=>hr.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof oK){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Oj(r,r.defaultAttrs,t,hr.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function lK(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],a=s;if(s)n.push(s);else for(let o in e.marks){let c=e.marks[o];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function UHe(e){return e.tag!=null}function HHe(e){return e.style!=null}class pf{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(UHe(i))this.tags.push(i);else if(HHe(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=t.nodes[i.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let r=new uK(this,n,!1);return r.addAll(t,hr.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new uK(this,n,!0);return r.addAll(t,hr.none,n.from,n.to),ct.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(zHe(t,s.tag)&&(s.namespace===void 0||t.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(t,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],o=a.style;if(!(o.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||o.length>t.length&&(o.charCodeAt(t.length)!=61||o.slice(t.length+1)!=n))){if(a.getAttrs){let c=a.getAttrs(n);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let o=n[a];if((o.priority==null?50:o.priority)<s)break}n.splice(a,0,i)}for(let i in t.marks){let s=t.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=dK(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let s=t.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=dK(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new pf(t,pf.schemaRules(t)))}}const qce={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},QHe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wce={ol:!0,ul:!0},Zb=1,lM=2,Hw=4;function cK(e,t,n){return t!=null?(t?Zb:0)|(t==="full"?lM:0):e&&e.whitespace=="pre"?Zb|lM:n&~Hw}class NS{constructor(t,n,r,i,s,a){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=hr.none,this.match=s||(a&Hw?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore($e.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Zb)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=$e.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore($e.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!qce.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class uK{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,a=cK(null,n.preserveWhitespace,0)|(r?Hw:0);i?s=new NS(i.type,i.attrs,hr.none,!0,n.topMatch||i.type.contentMatch,a):r?s=new NS(null,null,hr.none,!0,null,a):s=new NS(t.schema.topNodeType,null,hr.none,!0,null,a),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,s=i.options&lM?"full":this.localPreserveWS||(i.options&Zb)>0,{schema:a}=this.parser;if(s==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let c=0;c<o.length;c++)c&&this.insertNode(a.linebreakReplacement.create(),n,!0),o[c]&&this.insertNode(a.text(o[c]),n,!/\S/.test(o[c]));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 o=i.content[i.content.length-1],c=t.previousSibling;(!o||c&&c.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,s=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),o;Wce.hasOwnProperty(a)&&this.parser.normalizeLists&&$He(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,r));e:if(c?c.ignore:QHe.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let u,d=this.needsBlock;if(qce.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let h=c&&c.skip?n:this.readStyles(t,n);h&&this.addAll(t,h),u&&this.sync(s),this.needsBlock=d}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,c,u,c.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let o=void 0;;){let c=this.parser.matchStyle(s,a,this,o);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(u=>!c.clearMark(u)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)o=c;else break}}return n}addElementByRule(t,n,r,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let c=this.enter(a,n.attrs||null,r,n.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,r),this.findAround(t,c,!1)}s&&this.sync(o)&&this.open--}addAll(t,n,r,i){let s=r||0;for(let a=r?t.childNodes[r]:t.firstChild,o=i==null?null:t.childNodes[i];a!=o;a=a.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(a,n);this.findAtPoint(t,s)}findPlace(t,n,r){let i,s;for(let a=this.open,o=0;a>=0;a--){let c=this.nodes[a],u=c.findWrapping(t);if(u&&(!i||i.length>u.length+o)&&(i=u,s=c,!u.length))break;if(c.solid){if(r)break;o+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)n=this.enterInner(i[a],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(t.type));let a=hr.none;for(let o of i.concat(t.marks))(s.type?s.type.allowsMarkType(o.type):hK(o.type,t.type))&&(a=o.addToSet(a));return s.content.push(t.mark(a)),!0}return!1}enter(t,n,r,i){let s=this.findPlace(t.create(n),r,!1);return s&&(s=this.enterInner(t,n,r,!0,i)),s}enterInner(t,n,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let o=cK(t,s,a.options);a.options&Hw&&a.content.length==0&&(o|=Hw);let c=hr.none;return r=r.filter(u=>(a.type?a.type.allowsMarkType(u.type):hK(u.type,t))?(c=u.addToSet(c),!1):!0),this.nodes.push(new NS(t,n,c,i,null,o)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Zb)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),a=(o,c)=>{for(;o>=0;o--){let u=n[o];if(u==""){if(o==n.length-1||o==0)continue;for(;c>=s;c--)if(a(o-1,c))return!0;return!1}else{let d=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;c--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function $He(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&Wce.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function zHe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function dK(e){let t={};for(let n in e)t[n]=e[n];return t}function hK(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],a=o=>{s.push(o);for(let c=0;c<o.edgeCount;c++){let{type:u,next:d}=o.edge(c);if(u==t||s.indexOf(d)<0&&a(d))return!0}};if(a(i.contentMatch))return!0}}class xm{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=DP(n).createDocumentFragment());let i=r,s=[];return t.forEach(a=>{if(s.length||a.marks.length){let o=0,c=0;for(;o<s.length&&c<a.marks.length;){let u=a.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(s[o][0])||u.type.spec.spanning===!1)break;o++,c++}for(;o<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let u=a.marks[c++],d=this.serializeMark(u,a.isInline,n);d&&(s.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=u_(DP(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let s=this.serializeMark(t.marks[i],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&u_(DP(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return u_(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new xm(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=fK(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return fK(t.marks)}}function fK(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function DP(e){return e.document||window.document}const AK=new WeakMap;function VHe(e){let t=AK.get(e);return t===void 0&&AK.set(e,t=KHe(e)),t}function KHe(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function u_(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=VHe(r))&&s.indexOf(t)>-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 a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let o,c=n?e.createElementNS(n,i):e.createElement(i),u=t[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let A=h.indexOf(" ");A>0?c.setAttributeNS(h.slice(0,A),h.slice(A+1),u[h]):h=="style"&&c.style?c.style.cssText=u[h]:c.setAttribute(h,u[h])}}for(let h=d;h<t.length;h++){let A=t[h];if(A===0){if(h<t.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:f,contentDOM:p}=u_(e,A,n,r);if(c.appendChild(f),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:c,contentDOM:o}}const Gce=65535,Yce=Math.pow(2,16);function qHe(e,t){return e+t*Yce}function pK(e){return e&Gce}function WHe(e){return(e-(e&Gce))/Yce}const Xce=1,Jce=2,d_=4,Zce=8;class cM{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Zce)>0}get deletedBefore(){return(this.delInfo&(Xce|d_))>0}get deletedAfter(){return(this.delInfo&(Jce|d_))>0}get deletedAcross(){return(this.delInfo&d_)>0}}class Io{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Io.empty)return Io.empty}recover(t){let n=0,r=pK(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+WHe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?i:0);if(c>t)break;let u=this.ranges[o+s],d=this.ranges[o+a],h=c+u;if(t<=h){let A=u?t==c?-1:t==h?1:n:n,f=c+i+(A<0?0:d);if(r)return f;let p=t==(n<0?c:h)?null:qHe(o/3,t-c),m=t==c?Jce:t==h?Xce:d_;return(n<0?t!=c:t!=h)&&(m|=Zce),new cM(f,m,p)}i+=d-u}return r?t+i:new cM(t+i,0,null)}touches(t,n){let r=0,i=pK(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?r:0);if(c>t)break;let u=this.ranges[o+s],d=c+u;if(t<=d&&o==i*3)return!0;r+=this.ranges[o+a]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],o=a-(this.inverted?s:0),c=a+(this.inverted?0:s),u=this.ranges[i+n],d=this.ranges[i+r];t(o,o+u,c,c+d),s+=d-u}}invert(){return new Io(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Io.empty:new Io(t<0?[0,-t,0]:[0,0,t])}}Io.empty=new Io([]);class e1{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e1(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new e1;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],o=a.mapResult(t,n);if(o.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,t=this._maps[c].recover(o.recover);continue}}i|=o.delInfo,t=o.pos}return r?t:new cM(t,i,null)}}const UP=Object.create(null);let ca=class{getMap(){return Io.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=UP[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in UP)throw new RangeError("Duplicate use of step JSON ID "+t);return UP[t]=n,n.prototype.jsonID=t,n}};class Mi{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Mi(t,null)}static fail(t){return new Mi(null,t)}static fromReplace(t,n,r,i){try{return Mi.ok(t.replace(n,r,i))}catch(s){if(s instanceof Tj)return Mi.fail(s.message);throw s}}}function J6(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(J6(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s)}return $e.fromArray(r)}class qh extends ca{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new ct(J6(n.content,(a,o)=>!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Mi.fromReplace(t,this.from,this.to,s)}invert(){return new Ac(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new qh(n.pos,r.pos,this.mark)}merge(t){return t instanceof qh&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new qh(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new qh(n.from,n.to,t.markFromJSON(n.mark))}}ca.jsonID("addMark",qh);class Ac extends ca{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ct(J6(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Mi.fromReplace(t,this.from,this.to,r)}invert(){return new qh(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ac(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ac&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ac(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ac(n.from,n.to,t.markFromJSON(n.mark))}}ca.jsonID("removeMark",Ac);class Wh extends ca{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Mi.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Mi.fromReplace(t,this.pos,this.pos+1,new ct($e.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Wh(this.pos,n.marks[i]);return new Wh(this.pos,this.mark)}}return new em(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Wh(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Wh(n.pos,t.markFromJSON(n.mark))}}ca.jsonID("addNodeMark",Wh);class em extends ca{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Mi.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Mi.fromReplace(t,this.pos,this.pos+1,new ct($e.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Wh(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new em(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new em(n.pos,t.markFromJSON(n.mark))}}ca.jsonID("removeNodeMark",em);class cs extends ca{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&uM(t,this.from,this.to)?Mi.fail("Structure replace would overwrite content"):Mi.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Io([this.from,this.to-this.from,this.slice.size])}invert(t){return new cs(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new cs(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof cs)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ct.empty:new ct(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new cs(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ct.empty:new ct(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new cs(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new cs(n.from,n.to,ct.fromJSON(t,n.slice),!!n.structure)}}ca.jsonID("replace",cs);class ds extends ca{constructor(t,n,r,i,s,a,o=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=o}apply(t){if(this.structure&&(uM(t,this.from,this.gapFrom)||uM(t,this.gapTo,this.to)))return Mi.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Mi.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Mi.fromReplace(t,this.from,this.to,r):Mi.fail("Content does not fit in gap")}getMap(){return new Io([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new ds(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new ds(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ds(n.from,n.to,n.gapFrom,n.gapTo,ct.fromJSON(t,n.slice),n.insert,!!n.structure)}}ca.jsonID("replaceAround",ds);function uM(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function GHe(e,t,n,r){let i=[],s=[],a,o;e.doc.nodesBetween(t,n,(c,u,d)=>{if(!c.isInline)return;let h=c.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let A=Math.max(u,t),f=Math.min(u+c.nodeSize,n),p=r.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(p)||(a&&a.to==A&&a.mark.eq(h[m])?a.to=f:i.push(a=new Ac(A,f,h[m])));o&&o.to==A?o.to=f:s.push(o=new qh(A,f,r))}}),i.forEach(c=>e.step(c)),s.forEach(c=>e.step(c))}function YHe(e,t,n,r){let i=[],s=0;e.doc.nodesBetween(t,n,(a,o)=>{if(!a.isInline)return;s++;let c=null;if(r instanceof JE){let u=a.marks,d;for(;d=r.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let u=Math.min(o+a.nodeSize,n);for(let d=0;d<c.length;d++){let h=c[d],A;for(let f=0;f<i.length;f++){let p=i[f];p.step==s-1&&h.eq(i[f].style)&&(A=p)}A?(A.to=u,A.step=s):i.push({style:h,from:Math.max(o,t),to:u,step:s})}}}),i.forEach(a=>e.step(new Ac(a.from,a.to,a.style)))}function Z6(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),a=[],o=t+1;for(let c=0;c<s.childCount;c++){let u=s.child(c),d=o+u.nodeSize,h=r.matchType(u.type);if(!h)a.push(new cs(o,d,ct.empty));else{r=h;for(let A=0;A<u.marks.length;A++)n.allowsMarkType(u.marks[A].type)||e.step(new Ac(o,d,u.marks[A]));if(i&&u.isText&&n.whitespace!="pre"){let A,f=/\r?\n|\r/g,p;for(;A=f.exec(u.text);)p||(p=new ct($e.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),a.push(new cs(o+A.index,o+A.index+A[0].length,p))}}o=d}if(!r.validEnd){let c=r.fillBefore($e.empty,!0);e.replace(o,o,new ct(c,0,0))}for(let c=a.length-1;c>=0;c--)e.step(a[c])}function XHe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function y0(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,s=0;;--r){let a=e.$from.node(r),o=e.$from.index(r)+i,c=e.$to.indexAfter(r)-s;if(r<e.depth&&a.canReplace(o,c,n))return r;if(r==0||a.type.spec.isolating||!XHe(a,o,c))break;o&&(i=1),c<a.childCount&&(s=1)}return null}function JHe(e,t,n){let{$from:r,$to:i,depth:s}=t,a=r.before(s+1),o=i.after(s+1),c=a,u=o,d=$e.empty,h=0;for(let p=s,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,d=$e.from(r.node(p).copy(d)),h++):c--;let A=$e.empty,f=0;for(let p=s,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,A=$e.from(i.node(p).copy(A)),f++):u++;e.step(new ds(c,u,a,o,new ct(d.append(A),h,f),d.size-h,!0))}function eH(e,t,n=null,r=e){let i=ZHe(e,t),s=i&&eQe(r,t);return s?i.map(mK).concat({type:t,attrs:n}).concat(s.map(mK)):null}function mK(e){return{type:e,attrs:null}}function ZHe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let a=s.length?s[0]:t;return n.canReplaceWith(r,i,a)?s:null}function eQe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),a=t.contentMatch.findWrapping(s.type);if(!a)return null;let c=(a.length?a[a.length-1]:t).contentMatch;for(let u=r;c&&u<i;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:a}function tQe(e,t,n){let r=$e.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let o=n[a].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=$e.from(n[a].type.create(n[a].attrs,r))}let i=t.start,s=t.end;e.step(new ds(i,s,i,s,new ct(r,0,0),n.length,!0))}function nQe(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(a,o)=>{let c=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,c)&&rQe(e.doc,e.mapping.slice(s).map(o),r)){let u=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?u=!1:!f&&p&&(u=!0)}u===!1&&tue(e,a,o,s),Z6(e,e.mapping.slice(s).map(o,1),r,void 0,u===null);let d=e.mapping.slice(s),h=d.map(o,1),A=d.map(o+a.nodeSize,1);return e.step(new ds(h,A,h+1,A-1,new ct($e.from(r.create(c,null,a.marks)),0,0),1,!0)),u===!0&&eue(e,a,o,s),!1}})}function eue(e,t,n,r){t.forEach((i,s)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let c=e.mapping.slice(r).map(n+1+s+a.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function tue(e,t,n,r){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=e.mapping.slice(r).map(n+1+s);e.replaceWith(a,a+1,t.type.schema.text(`
`))}})}function rQe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function iQe(e,t,n,r,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(r,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ds(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new ct($e.from(a),0,0),1,!0))}function jy(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,a=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=n-2;u>s;u--,d--){let h=i.node(u),A=i.index(u);if(h.type.spec.isolating)return!1;let f=h.content.cutByIndex(A,h.childCount),p=r&&r[d+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[d]||h;if(!h.canReplace(A+1,h.childCount)||!m.type.validContent(f))return!1}let o=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(o,o,c?c.type:i.node(s+1).type)}function sQe(e,t,n=1,r){let i=e.doc.resolve(t),s=$e.empty,a=$e.empty;for(let o=i.depth,c=i.depth-n,u=n-1;o>c;o--,u--){s=$e.from(i.node(o).copy(s));let d=r&&r[u];a=$e.from(d?d.type.create(d.attrs,a):i.node(o).copy(a))}e.step(new cs(t,t,new ct(s.append(a),n,n),!0))}function Xf(e,t){let n=e.resolve(t),r=n.index();return nue(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function aQe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let s=t.child(i),a=s.type==r?e.type.schema.nodes.text:s.type;if(n=n.matchType(a),!n||!e.type.allowsMarks(s.marks))return!1}return n.validEnd}function nue(e,t){return!!(e&&t&&!e.isLeaf&&aQe(e,t))}function ZE(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let s,a,o=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):n>0?(s=r.node(i+1),o++,a=r.node(i).maybeChild(o)):(s=r.node(i).maybeChild(o-1),a=r.node(i+1)),s&&!s.isTextblock&&nue(s,a)&&r.node(i).canReplace(o,o+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function oQe(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-n),a=s.node().type;if(i&&a.inlineContent){let d=a.whitespace=="pre",h=!!a.contentMatch.matchType(i);d&&!h?r=!1:!d&&h&&(r=!0)}let o=e.steps.length;if(r===!1){let d=e.doc.resolve(t+n);tue(e,d.node(),d.before(),o)}a.inlineContent&&Z6(e,t+n-1,a,s.node().contentMatchAt(s.index()),r==null);let c=e.mapping.slice(o),u=c.map(t-n);if(e.step(new cs(u,c.map(t+n,-1),ct.empty,!0)),r===!0){let d=e.doc.resolve(u);eue(e,d.node(),d.before(),e.steps.length)}return e}function lQe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function rue(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=r.depth;a>=0;a--){let o=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(o>0?1:0),u=r.node(a),d=!1;if(s==1)d=u.canReplace(c,c,i);else{let h=u.contentMatchAt(c).findWrapping(i.firstChild.type);d=h&&u.canReplaceWith(c,c,h[0])}if(d)return o==0?r.pos:o<0?r.before(a+1):r.after(a+1)}return null}function e5(e,t,n=t,r=ct.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return iue(i,s,r)?new cs(t,n,r):new cQe(i,s,r).fit()}function iue(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class cQe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=$e.empty;for(let i=0;i<=t.depth;i++){let s=t.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=$e.from(t.node(i).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 t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let s=this.placed,a=r.depth,o=i.depth;for(;a&&o&&s.childCount==1;)s=s.firstChild.content,a--,o--;let c=new ct(s,a,o);return t>-1?new ds(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new cs(r.pos,i.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){t=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=HP(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:c,match:u}=this.frontier[o],d,h=null;if(n==1&&(a?u.matchType(a.type)||(h=u.fillBefore($e.from(a),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:o,parent:s,inject:h};if(n==2&&a&&(d=u.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:o,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=HP(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ct(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=HP(t,n);if(i.childCount<=1&&n>0){let s=t.size-n<=n+i.size;this.unplaced=new ct(iw(t,n-1,1),n-1,s?n-1:r)}else this.unplaced=new ct(iw(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let a=this.unplaced,o=r?r.content:a.content,c=a.openStart-t,u=0,d=[],{match:h,type:A}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)d.push(i.child(m));h=h.matchFragment(i)}let f=o.size+t-(a.content.size-a.openEnd);for(;u<o.childCount;){let m=o.child(u),g=h.matchType(m.type);if(!g)break;u++,(u>1||c==0||m.content.size)&&(h=g,d.push(sue(m.mark(A.allowedMarks(m.marks)),u==1?c:0,u==o.childCount?f:-1)))}let p=u==o.childCount;p||(f=-1),this.placed=sw(this.placed,n,$e.from(d)),this.frontier[n].match=h,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=o;m<f;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?t==0?ct.empty:new ct(iw(a.content,t-1,1),t-1,f<0?a.openEnd:t-1):new ct(iw(a.content,t,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!QP(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=QP(t,n,i,r,s);if(a){for(let o=n-1;o>=0;o--){let{match:c,type:u}=this.frontier[o],d=QP(t,o,u,c,!0);if(!d||d.childCount)continue e}return{depth:n,fit:a,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=sw(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,s)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=sw(this.placed,this.depth,$e.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore($e.empty,!0);n.childCount&&(this.placed=sw(this.placed,this.frontier.length,n))}}function iw(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(iw(e.firstChild.content,t-1,n)))}function sw(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(sw(e.lastChild.content,t-1,n)))}function HP(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function sue(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,sue(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore($e.empty,!0)))),e.copy(r)}function QP(e,t,n,r,i){let s=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let o=r.fillBefore(s.content,!0,a);return o&&!uQe(n,s.content,a)?o:null}function uQe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function dQe(e){return e.spec.defining||e.spec.definingForContent}function hQe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(iue(i,s,r))return e.step(new cs(t,n,r));let a=oue(i,s);a[a.length-1]==0&&a.pop();let o=-(i.depth+1);a.unshift(o);for(let A=i.depth,f=i.pos-1;A>0;A--,f--){let p=i.node(A).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;a.indexOf(A)>-1?o=A:i.before(A)==f&&a.splice(1,0,-A)}let c=a.indexOf(o),u=[],d=r.openStart;for(let A=r.content,f=0;;f++){let p=A.firstChild;if(u.push(p),f==r.openStart)break;A=p.content}for(let A=d-1;A>=0;A--){let f=u[A],p=dQe(f.type);if(p&&!f.sameMarkup(i.node(Math.abs(o)-1)))d=A;else if(p||!f.type.isTextblock)break}for(let A=r.openStart;A>=0;A--){let f=(A+d+1)%(r.openStart+1),p=u[f];if(p)for(let m=0;m<a.length;m++){let g=a[(m+c)%a.length],y=!0;g<0&&(y=!1,g=-g);let v=i.node(g-1),x=i.index(g-1);if(v.canReplaceWith(x,x,p.type,p.marks))return e.replace(i.before(g),y?s.after(g):n,new ct(aue(r.content,0,r.openStart,f),f,r.openEnd))}}let h=e.steps.length;for(let A=a.length-1;A>=0&&(e.replace(t,n,r),!(e.steps.length>h));A--){let f=a[A];f<0||(t=i.before(f),n=s.after(f))}}function aue(e,t,n,r,i){if(t<n){let s=e.firstChild;e=e.replaceChild(0,s.copy(aue(s.content,t+1,n,r,s)))}if(t>r){let s=i.contentMatchAt(0),a=s.fillBefore(e).append(e);e=a.append(s.matchFragment(a).fillBefore($e.empty,!0))}return e}function fQe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=lQe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new ct($e.from(r),0,0))}function AQe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),s=oue(r,i);for(let a=0;a<s.length;a++){let o=s[a],c=a==s.length-1;if(c&&o==0||r.node(o).type.contentMatch.validEnd)return e.delete(r.start(o),i.end(o));if(o>0&&(c||r.node(o-1).canReplace(r.index(o-1),i.indexAfter(o-1))))return e.delete(r.before(o),i.after(o))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function oue(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let s=e.start(i);if(s<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(s==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==s-1)&&n.push(i)}return n}class By extends ca{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Mi.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Mi.fromReplace(t,this.pos,this.pos+1,new ct($e.from(i),0,n.isLeaf?0:1))}getMap(){return Io.empty}invert(t){return new By(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new By(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new By(n.pos,n.attr,n.value)}}ca.jsonID("attr",By);class t1 extends ca{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Mi.ok(r)}getMap(){return Io.empty}invert(t){return new t1(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t1(n.attr,n.value)}}ca.jsonID("docAttr",t1);let Av=class extends Error{};Av=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Av.prototype=Object.create(Error.prototype);Av.prototype.constructor=Av;Av.prototype.name="TransformError";class lue{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new e1}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Av(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((s,a,o,c)=>{t=Math.min(t,o),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ct.empty){let i=e5(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ct($e.from(r),0,0))}delete(t,n){return this.replace(t,n,ct.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return hQe(this,t,n,r),this}replaceRangeWith(t,n,r){return fQe(this,t,n,r),this}deleteRange(t,n){return AQe(this,t,n),this}lift(t,n){return JHe(this,t,n),this}join(t,n=1){return oQe(this,t,n),this}wrap(t,n){return tQe(this,t,n),this}setBlockType(t,n=t,r,i=null){return nQe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return iQe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new By(t,n,r)),this}setDocAttribute(t,n){return this.step(new t1(t,n)),this}addNodeMark(t,n){return this.step(new Wh(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof hr)n.isInSet(r.marks)&&this.step(new em(t,n));else{let i=r.marks,s,a=[];for(;s=n.isInSet(i);)a.push(new em(t,s)),i=s.removeFromSet(i);for(let o=a.length-1;o>=0;o--)this.step(a[o])}return this}split(t,n=1,r){return sQe(this,t,n,r),this}addMark(t,n,r){return GHe(this,t,n,r),this}removeMark(t,n,r){return YHe(this,t,n,r),this}clearIncompatible(t,n,r){return Z6(this,t,n,r),this}}const $P=Object.create(null);class gn{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new pQe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ct.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let s=t.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:c,$to:u}=a[o],d=t.mapping.slice(s);t.replaceRange(d.map(c.pos),d.map(u.pos),o?ct.empty:n),o==0&&vK(t,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:o}=i[s],c=t.mapping.slice(r),u=c.map(a.pos),d=c.map(o.pos);s?t.deleteRange(u,d):(t.replaceRangeWith(u,d,n),vK(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new rn(t):Fg(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let s=t.depth-1;s>=0;s--){let a=n<0?Fg(t.node(0),t.node(s),t.before(s+1),t.index(s),n,r):Fg(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new jl(t.node(0))}static atStart(t){return Fg(t,t,0,0,1)||new jl(t)}static atEnd(t){return Fg(t,t,t.content.size,t.childCount,-1)||new jl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=$P[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in $P)throw new RangeError("Duplicate use of selection JSON ID "+t);return $P[t]=n,n.prototype.jsonID=t,n}getBookmark(){return rn.between(this.$anchor,this.$head).getBookmark()}}gn.prototype.visible=!0;class pQe{constructor(t,n){this.$from=t,this.$to=n}}let gK=!1;function yK(e){!gK&&!e.parent.inlineContent&&(gK=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class rn extends gn{constructor(t,n=t){yK(t),yK(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return gn.near(r);let i=t.resolve(n.map(this.anchor));return new rn(i.parent.inlineContent?i:r,r)}replace(t,n=ct.empty){if(super.replace(t,n),n==ct.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof rn&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new t5(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new rn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=gn.findFrom(n,r,!0)||gn.findFrom(n,-r,!0);if(s)n=s.$head;else return gn.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(gn.findFrom(t,-r,!0)||gn.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new rn(t,n)}}gn.jsonID("text",rn);class t5{constructor(t,n){this.anchor=t,this.head=n}map(t){return new t5(t.map(this.anchor),t.map(this.head))}resolve(t){return rn.between(t.resolve(this.anchor),t.resolve(this.head))}}class Qt extends gn{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=t.resolve(i);return r?gn.near(s):new Qt(s)}content(){return new ct($e.from(this.node),0,0)}eq(t){return t instanceof Qt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new tH(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Qt(t.resolve(n.anchor))}static create(t,n){return new Qt(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Qt.prototype.visible=!1;gn.jsonID("node",Qt);class tH{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new t5(r,r):new tH(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Qt.isSelectable(r)?new Qt(n):gn.near(n)}}class jl extends gn{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ct.empty){if(n==ct.empty){t.delete(0,t.doc.content.size);let r=gn.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new jl(t)}map(t){return new jl(t)}eq(t){return t instanceof jl}getBookmark(){return mQe}}gn.jsonID("all",jl);const mQe={map(){return this},resolve(e){return new jl(e)}};function Fg(e,t,n,r,i,s=!1){if(t.inlineContent)return rn.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let o=t.child(a);if(o.isAtom){if(!s&&Qt.isSelectable(o))return Qt.create(e,n-(i<0?o.nodeSize:0))}else{let c=Fg(e,o,n+i,i<0?o.childCount:0,i,s);if(c)return c}n+=o.nodeSize*i}return null}function vK(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof cs||i instanceof ds))return;let s=e.mapping.maps[r],a;s.forEach((o,c,u,d)=>{a==null&&(a=d)}),e.setSelection(gn.near(e.doc.resolve(a),n))}const xK=1,ES=2,wK=4;class gQe extends lue{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|xK)&~ES,this.storedMarks=null,this}get selectionSet(){return(this.updated&xK)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ES,this}ensureMarks(t){return hr.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ES)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ES,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||hr.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(gn.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=wK,this}get scrolledIntoView(){return(this.updated&wK)>0}}function bK(e,t){return!t||!e?e:e.bind(t)}class aw{constructor(t,n,r){this.name=t,this.init=bK(n.init,r),this.apply=bK(n.apply,r)}}const yQe=[new aw("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new aw("selection",{init(e,t){return e.selection||gn.atStart(t.doc)},apply(e){return e.selection}}),new aw("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new aw("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class zP{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yQe.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 aw(r.key,r.spec.state,r))})}}class sy{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let c=i?i[a].n:0,u=i?i[a].state:this,d=c<n.length&&o.spec.appendTransaction.call(o,c?n.slice(c):n,u,r);if(d&&r.filterTransaction(d,a)){if(d.setMeta("appendedTransaction",t),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<a?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[a]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new sy(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(t,this[s.name],this,n)}return n}get tr(){return new gQe(this)}static create(t){let n=new zP(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new sy(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new zP(this.schema,t.plugins),r=n.fields,i=new sy(n);for(let s=0;s<r.length;s++){let a=r[s].name;i[a]=this.hasOwnProperty(a)?this[a]:r[s].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new zP(t.schema,t.plugins),s=new sy(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=Af.fromJSON(t.schema,n.doc);else if(a.name=="selection")s.selection=gn.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let o in r){let c=r[o],u=c.spec.state;if(c.key==a.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,o)){s[a.name]=u.fromJSON.call(c,t,n[o],s);return}}s[a.name]=a.init(t,s)}}),s}}function cue(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=cue(i,t,{})),n[r]=i}return n}class ti{constructor(t){this.spec=t,this.props={},t.props&&cue(t.props,this,this.props),this.key=t.key?t.key.key:uue("plugin")}getState(t){return t[this.key]}}const VP=Object.create(null);function uue(e){return e in VP?e+"$"+ ++VP[e]:(VP[e]=0,e+"$")}class es{constructor(t="key"){this.key=uue(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const vQe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function due(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const xQe=(e,t,n)=>{let r=due(e,n);if(!r)return!1;let i=nH(r);if(!i){let a=r.blockRange(),o=a&&y0(a);return o==null?!1:(t&&t(e.tr.lift(a,o).scrollIntoView()),!0)}let s=i.nodeBefore;if(pue(e,i,t,-1))return!0;if(r.parent.content.size==0&&(pv(s,"end")||Qt.isSelectable(s)))for(let a=r.depth;;a--){let o=e5(e.doc,r.before(a),r.after(a),ct.empty);if(o&&o.slice.size<o.to-o.from){if(t){let c=e.tr.step(o);c.setSelection(pv(s,"end")?gn.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Qt.create(c.doc,i.pos-s.nodeSize)),t(c.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},wQe=(e,t,n)=>{let r=due(e,n);if(!r)return!1;let i=nH(r);return i?hue(e,i,t):!1},bQe=(e,t,n)=>{let r=fue(e,n);if(!r)return!1;let i=rH(r);return i?hue(e,i,t):!1};function hue(e,t,n){let r=t.nodeBefore,i=r,s=t.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let a=t.nodeAfter,o=a,c=t.pos+1;for(;!o.isTextblock;c++){if(o.type.spec.isolating)return!1;let d=o.firstChild;if(!d)return!1;o=d}let u=e5(e.doc,s,c,ct.empty);if(!u||u.from!=s||u instanceof cs&&u.slice.size>=c-s)return!1;if(n){let d=e.tr.step(u);d.setSelection(rn.create(d.doc,s)),n(d.scrollIntoView())}return!0}function pv(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const CQe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=nH(r)}let a=s&&s.nodeBefore;return!a||!Qt.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Qt.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function nH(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function fue(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const SQe=(e,t,n)=>{let r=fue(e,n);if(!r)return!1;let i=rH(r);if(!i)return!1;let s=i.nodeAfter;if(pue(e,i,t,1))return!0;if(r.parent.content.size==0&&(pv(s,"start")||Qt.isSelectable(s))){let a=e5(e.doc,r.before(),r.after(),ct.empty);if(a&&a.slice.size<a.to-a.from){if(t){let o=e.tr.step(a);o.setSelection(pv(s,"start")?gn.findFrom(o.doc.resolve(o.mapping.map(i.pos)),1):Qt.create(o.doc,o.mapping.map(i.pos))),t(o.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},kQe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=rH(r)}let a=s&&s.nodeAfter;return!a||!Qt.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Qt.create(e.doc,s.pos)).scrollIntoView()),!0)};function rH(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const _Qe=(e,t)=>{let n=e.selection,r=n instanceof Qt,i;if(r){if(n.node.isTextblock||!Xf(e.doc,n.from))return!1;i=n.from}else if(i=ZE(e.doc,n.from,-1),i==null)return!1;if(t){let s=e.tr.join(i);r&&s.setSelection(Qt.create(s.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},jQe=(e,t)=>{let n=e.selection,r;if(n instanceof Qt){if(n.node.isTextblock||!Xf(e.doc,n.to))return!1;r=n.to}else if(r=ZE(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},BQe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),s=i&&y0(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},NQe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
`).scrollIntoView()),!0)};function Aue(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const EQe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),a=Aue(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(t){let o=n.after(),c=e.tr.replaceWith(o,o,a.createAndFill());c.setSelection(gn.near(c.doc.resolve(o),1)),t(c.scrollIntoView())}return!0},TQe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof jl||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Aue(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(a,s.createAndFill());o.setSelection(rn.create(o.doc,a+1)),t(o.scrollIntoView())}return!0},IQe=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(jy(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&y0(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},PQe=(e,t)=>{let{$from:n,to:r}=e.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),t&&t(e.tr.setSelection(Qt.create(e.doc,i))),!0)};function OQe(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,s=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(i.isTextblock||Xf(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function pue(e,t,n,r){let i=t.nodeBefore,s=t.nodeAfter,a,o,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&OQe(e,t,n))return!0;let u=!c&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(a[0]||s.type).validEnd){if(n){let f=t.pos+s.nodeSize,p=$e.empty;for(let y=a.length-1;y>=0;y--)p=$e.from(a[y].create(null,p));p=$e.from(i.copy(p));let m=e.tr.step(new ds(t.pos-1,f,t.pos,f,new ct(p,1,0),a.length,!0)),g=m.doc.resolve(f+2*a.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Xf(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&c?null:gn.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),A=h&&y0(h);if(A!=null&&A>=t.depth)return n&&n(e.tr.lift(h,A).scrollIntoView()),!0;if(u&&pv(s,"start",!0)&&pv(i,"end")){let f=i,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let y=$e.empty;for(let x=p.length-1;x>=0;x--)y=$e.from(p[x].copy(y));let v=e.tr.step(new ds(t.pos-p.length,t.pos+s.nodeSize,t.pos+g,t.pos+s.nodeSize-g,new ct(y,p.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function mue(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(t.tr.setSelection(rn.create(t.doc,e<0?i.start(s):i.end(s)))),!0):!1}}const FQe=mue(-1),MQe=mue(1);function LQe(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),o=a&&eH(a,e,t);return o?(r&&r(n.tr.wrap(a,o).scrollIntoView()),!0):!1}}function CK(e,t=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[s];n.doc.nodesBetween(a,o,(c,u)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)i=!0;else{let d=n.doc.resolve(u),h=d.index();i=d.parent.canReplaceWith(h,h+1,e)}})}if(!i)return!1;if(r){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:o},$to:{pos:c}}=n.selection.ranges[a];s.setBlockType(o,c,e,t)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function RQe(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s);if(!a)return!1;let o=r?n.tr:null;return DQe(o,a,e,t)?(r&&r(o.scrollIntoView()),!0):!1}}function DQe(e,t,n,r=null){let i=!1,s=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=a.resolve(t.start-2);s=new Pj(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new Pj(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let o=eH(s,n,r,t);return o?(e&&UQe(e,t,o,i,n),!0):!1}function UQe(e,t,n,r,i){let s=$e.empty;for(let d=n.length-1;d>=0;d--)s=$e.from(n[d].type.create(n[d].attrs,s));e.step(new ds(t.start-(r?2:0),t.end,t.start,t.end,new ct(s,0,0),n.length,!0));let a=0;for(let d=0;d<n.length;d++)n[d].type==i&&(a=d+1);let o=n.length-a,c=t.start+n.length-(r?2:0),u=t.parent;for(let d=t.startIndex,h=t.endIndex,A=!0;d<h;d++,A=!1)!A&&jy(e.doc,c,o)&&(e.split(c,o),c+=2*o),c+=u.child(d).nodeSize;return e}function HQe(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return s?n?r.node(s.depth-1).type==e?QQe(t,n,e,s):$Qe(t,n,s):!0:!1}}function QQe(e,t,n,r){let i=e.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new ds(s-1,a,s,a,new ct($e.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Pj(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const o=y0(r);if(o==null)return!1;i.lift(r,o);let c=i.doc.resolve(i.mapping.map(s,-1)-1);return Xf(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function $Qe(e,t,n){let r=e.tr,i=n.parent;for(let f=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+1);let s=r.doc.resolve(n.start),a=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let o=n.startIndex==0,c=n.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(o?0:1),d+1,a.content.append(c?$e.empty:$e.from(i))))return!1;let h=s.pos,A=h+a.nodeSize;return r.step(new ds(h-(o?1:0),A+(c?1:0),h+1,A-1,new ct((o?$e.empty:$e.from(i.copy($e.empty))).append(c?$e.empty:$e.from(i.copy($e.empty))),o?0:1,c?0:1),o?0:1)),t(r.scrollIntoView()),!0}function zQe(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==e);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let o=s.parent,c=o.child(a-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==o.type,d=$e.from(u?e.create():null),h=new ct($e.from(e.create(null,$e.from(o.type.create(null,d)))),u?3:1,0),A=s.start,f=s.end;n(t.tr.step(new ds(A-(u?3:1),f,A,f,h,1,!0)).scrollIntoView())}return!0}}const Bs=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},mv=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let dM=null;const Ju=function(e,t,n){let r=dM||(dM=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},VQe=function(){dM=null},tm=function(e,t,n,r){return n&&(SK(e,t,n,r,-1)||SK(e,t,n,r,1))},KQe=/^(img|br|input|textarea|hr)$/i;function SK(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:pl(e))){let a=e.parentNode;if(!a||a.nodeType!=1||M2(e)||KQe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Bs(e)+(i<0?0:1),e=a}else if(e.nodeType==1){let a=e.childNodes[t+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)t+=i;else return!1;else e=a,t=i<0?pl(e):0}else return!1}}function pl(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function qQe(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=pl(e)}else if(e.parentNode&&!M2(e))t=Bs(e),e=e.parentNode;else return null}}function WQe(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!M2(e))t=Bs(e)+1,e=e.parentNode;else return null}}function GQe(e,t,n){for(let r=t==0,i=t==pl(e);r||i;){if(e==n)return!0;let s=Bs(e);if(e=e.parentNode,!e)return!1;r=r&&s==0,i=i&&s==pl(e)}}function M2(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const n5=function(e){return e.focusNode&&tm(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function KA(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function YQe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function XQe(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(pl(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(pl(r.startContainer),r.startOffset)}}}const gu=typeof navigator<"u"?navigator:null,kK=typeof document<"u"?document:null,Jf=gu&&gu.userAgent||"",hM=/Edge\/(\d+)/.exec(Jf),gue=/MSIE \d/.exec(Jf),fM=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jf),oo=!!(gue||fM||hM),mf=gue?document.documentMode:fM?+fM[1]:hM?+hM[1]:0,Bl=!oo&&/gecko\/(\d+)/i.test(Jf);Bl&&+(/Firefox\/(\d+)/.exec(Jf)||[0,0])[1];const AM=!oo&&/Chrome\/(\d+)/.exec(Jf),Es=!!AM,yue=AM?+AM[1]:0,sa=!oo&&!!gu&&/Apple Computer/.test(gu.vendor),gv=sa&&(/Mobile\/\w+/.test(Jf)||!!gu&&gu.maxTouchPoints>2),cl=gv||(gu?/Mac/.test(gu.platform):!1),vue=gu?/Win/.test(gu.platform):!1,ad=/Android \d/.test(Jf),L2=!!kK&&"webkitFontSmoothing"in kK.documentElement.style,JQe=L2?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ZQe(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Du(e,t){return typeof e=="number"?e:e[t]}function e$e(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function _K(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let a=n||e.dom;a;){if(a.nodeType!=1){a=mv(a);continue}let o=a,c=o==s.body,u=c?ZQe(s):e$e(o),d=0,h=0;if(t.top<u.top+Du(r,"top")?h=-(u.top-t.top+Du(i,"top")):t.bottom>u.bottom-Du(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+Du(i,"top")-u.top:t.bottom-u.bottom+Du(i,"bottom")),t.left<u.left+Du(r,"left")?d=-(u.left-t.left+Du(i,"left")):t.right>u.right-Du(r,"right")&&(d=t.right-u.right+Du(i,"right")),d||h)if(c)s.defaultView.scrollBy(d,h);else{let f=o.scrollLeft,p=o.scrollTop;h&&(o.scrollTop+=h),d&&(o.scrollLeft+=d);let m=o.scrollLeft-f,g=o.scrollTop-p;t={left:t.left-m,top:t.top-g,right:t.right-m,bottom:t.bottom-g}}let A=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(A))break;a=A=="absolute"?a.offsetParent:mv(a)}}function t$e(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let s=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let o=e.root.elementFromPoint(s,a);if(!o||o==e.dom||!e.dom.contains(o))continue;let c=o.getBoundingClientRect();if(c.top>=n-20){r=o,i=c.top;break}}return{refDOM:r,refTop:i,stack:xue(e.dom)}}function xue(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=mv(r));return t}function n$e({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;wue(n,r==0?0:r-t)}function wue(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}let dg=null;function r$e(e){if(e.setActive)return e.setActive();if(dg)return e.focus(dg);let t=xue(e);e.focus(dg==null?{get preventScroll(){return dg={preventScroll:!0},!0}}:void 0),dg||(dg=!1,wue(t,0))}function bue(e,t){let n,r=2e8,i,s=0,a=t.top,o=t.top,c,u;for(let d=e.firstChild,h=0;d;d=d.nextSibling,h++){let A;if(d.nodeType==1)A=d.getClientRects();else if(d.nodeType==3)A=Ju(d).getClientRects();else continue;for(let f=0;f<A.length;f++){let p=A[f];if(p.top<=a&&p.bottom>=o){a=Math.max(p.bottom,a),o=Math.min(p.top,o);let m=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(m<r){n=d,r=m,i=m&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,d.nodeType==1&&m&&(s=h+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=d,u={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(s=h+1)}}return!n&&c&&(n=c,i=u,r=0),n&&n.nodeType==3?i$e(n,i):!n||r&&n.nodeType==1?{node:e,offset:s}:bue(n,i)}function i$e(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let a=Ah(r,1);if(a.top!=a.bottom&&iH(t,a)){i={node:e,offset:s+(t.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function iH(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function s$e(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function a$e(e,t,n){let{node:r,offset:i}=bue(t,n),s=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}function o$e(e,t,n,r){let i=-1;for(let s=t,a=!1;s!=e.dom;){let o=e.docView.nearestDesc(s,!0),c;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((c=o.dom.getBoundingClientRect()).width||c.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!a&&c.left>r.left||c.top>r.top?i=o.posBefore:(!a&&c.right<r.left||c.bottom<r.top)&&(i=o.posAfter),a=!0),!o.contentDOM&&i<0&&!o.node.isText))return(o.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?o.posBefore:o.posAfter;s=o.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Cue(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let a=e.childNodes[s];if(a.nodeType==1){let o=a.getClientRects();for(let c=0;c<o.length;c++){let u=o[c];if(iH(t,u))return Cue(a,t,u)}}if((s=(s+1)%r)==i)break}return e}function l$e(e,t){let n=e.dom.ownerDocument,r,i=0,s=XQe(n,t.left,t.top);s&&({node:r,offset:i}=s);let a=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),o;if(!a||!e.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=e.dom.getBoundingClientRect();if(!iH(t,u)||(a=Cue(e.dom,t,u),!a))return null}if(sa)for(let u=a;r&&u;u=mv(u))u.draggable&&(r=void 0);if(a=s$e(a,t),r){if(Bl&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=t.left&&h.bottom>t.top&&i++}let u;L2&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(o=o$e(e,r,i,t))}o==null&&(o=a$e(e,a,t));let c=e.docView.nearestDesc(a,!0);return{pos:o,inside:c?c.posAtStart-c.border:-1}}function jK(e){return e.top<e.bottom||e.left<e.right}function Ah(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(jK(r))return r}return Array.prototype.find.call(n,jK)||e.getBoundingClientRect()}const c$e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Sue(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),a=L2||Bl;if(r.nodeType==3)if(a&&(c$e.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Ah(Ju(r,i,i),n);if(Bl&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Ah(Ju(r,i-1,i-1),-1);if(u.top==c.top){let d=Ah(Ju(r,i,i+1),-1);if(d.top!=c.top)return Sx(d,d.left<u.left)}}return c}else{let c=i,u=i,d=n<0?1:-1;return n<0&&!i?(u++,d=-1):n>=0&&i==r.nodeValue.length?(c--,d=1):n<0?c--:u++,Sx(Ah(Ju(r,c,u),d),d<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==pl(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return KP(c.getBoundingClientRect(),!1)}if(s==null&&i<pl(r)){let c=r.childNodes[i];if(c.nodeType==1)return KP(c.getBoundingClientRect(),!0)}return KP(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==pl(r))){let c=r.childNodes[i-1],u=c.nodeType==3?Ju(c,pl(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return Sx(Ah(u,1),!1)}if(s==null&&i<pl(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let u=c?c.nodeType==3?Ju(c,0,a?0:1):c.nodeType==1?c:null:null;if(u)return Sx(Ah(u,-1),!0)}return Sx(Ah(r.nodeType==3?Ju(r):r,-n),n>=0)}function Sx(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function KP(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function kue(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function u$e(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return kue(e,t,()=>{let{node:s}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let o=e.docView.nearestDesc(s,!0);if(!o)break;if(o.node.isBlock){s=o.contentDOM||o.dom;break}s=o.dom.parentNode}let a=Sue(e,i.pos,1);for(let o=s.firstChild;o;o=o.nextSibling){let c;if(o.nodeType==1)c=o.getClientRects();else if(o.nodeType==3)c=Ju(o,0,o.nodeValue.length).getClientRects();else continue;for(let u=0;u<c.length;u++){let d=c[u];if(d.bottom>d.top+1&&(n=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}const d$e=/[\u0590-\u08ac]/;function h$e(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,a=i==r.parent.content.size,o=e.domSelection();return o?!d$e.test(r.parent.textContent)||!o.modify?n=="left"||n=="backward"?s:a:kue(e,t,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:h}=e.domSelectionRange(),A=o.caretBidiLevel;o.modify("move",n,"character");let f=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),g=p&&!f.contains(p.nodeType==1?p:p.parentNode)||c==p&&u==m;try{o.collapse(d,h),c&&(c!=d||u!=h)&&o.extend&&o.extend(c,u)}catch{}return A!=null&&(o.caretBidiLevel=A),g}):r.pos==r.start()||r.pos==r.end()}let BK=null,NK=null,EK=!1;function f$e(e,t,n){return BK==t&&NK==n?EK:(BK=t,NK=n,EK=n=="up"||n=="down"?u$e(e,t,n):h$e(e,t,n))}const Nl=0,TK=1,tp=2,yu=3;class R2{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Nl,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let s,a;if(t==this.contentDOM)s=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.previousSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}else{let s,a;if(t==this.contentDOM)s=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>Bs(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let s=this.getDesc(i),a;if(s&&(!n||s.node))if(r&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return s}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==t&&s!=r){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let o=i.children[a];if(o.size){i=o;break}}return i}if(t<s)return i.descAt(t-r-i.border);r=s}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let a=this.children[r],o=s+a.size;if(o>t||a instanceof jue){i=t-s;break}s=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof _ue&&s.side>=0;r--);if(n<=0){let s,a=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Bs(s.dom)+1:0}}else{let s,a=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Bs(s.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=r,o=0;;o++){let c=this.children[o],u=a+c.size;if(i==-1&&t<=u){let d=a+c.border;if(t>=d&&n<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,d);t=a;for(let h=o;h>0;h--){let A=this.children[h-1];if(A.size&&A.dom.parentNode==this.contentDOM&&!A.emptyChildAt(1)){i=Bs(A.dom)+1;break}t-=A.size}i==-1&&(i=0)}if(i>-1&&(u>n||o==this.children.length-1)){n=u;for(let d=o+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=Bs(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=u}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:s}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let s=Math.min(t,n),a=Math.max(t,n);for(let f=0,p=0;f<this.children.length;f++){let m=this.children[f],g=p+m.size;if(s>p&&a<g)return m.setSelection(t-p-m.border,n-p-m.border,r,i);p=g}let o=this.domFromPos(t,t?-1:1),c=n==t?o:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if((Bl||sa)&&t==n){let{node:f,offset:p}=o;if(f.nodeType==3){if(h=!!(p&&f.nodeValue[p-1]==`
`),h&&p==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(o=c={node:g.parentNode,offset:Bs(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=f.childNodes[p-1];h=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Bl&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let f=d.focusNode.childNodes[d.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||h&&sa)&&tm(o.node,o.offset,d.anchorNode,d.anchorOffset)&&tm(c.node,c.offset,d.focusNode,d.focusOffset))return;let A=!1;if((u.extend||t==n)&&!(h&&Bl)){u.collapse(o.node,o.offset);try{t!=n&&u.extend(c.node,c.offset),A=!0}catch{}}if(!A){if(t>n){let p=o;o=c,c=p}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(o.node,o.offset),u.removeAllRanges(),u.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],a=r+s.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let o=r+s.border,c=a-s.border;if(t>=o&&n<=c){this.dirty=t==r||n==a?tp:TK,t==o&&n==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=yu:s.markDirty(t-o,n-o);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?tp:yu}r=a}this.dirty=tp}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?tp:TK;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class _ue extends R2{constructor(t,n,r,i){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(a.nodeType!=1){let o=document.createElement("span");o.appendChild(a),a=o}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(t){return this.dirty==Nl&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class A$e extends R2{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class nm extends R2{constructor(t,n,r,i,s){super(t,[],r,i),this.mark=n,this.spec=s}static create(t,n,r,i){let s=i.nodeViews[n.type.name],a=s&&s(n,i,r);return(!a||!a.dom)&&(a=xm.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new nm(t,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&yu||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=yu&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Nl){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Nl}}slice(t,n,r){let i=nm.create(this.parent,this.mark,!0,r),s=this.children,a=this.size;n<a&&(s=mM(s,n,a,r)),t>0&&(s=mM(s,0,t,r));for(let o=0;o<s.length;o++)s[o].parent=i;return i.children=s,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class gf extends R2{constructor(t,n,r,i,s,a,o,c,u){super(t,[],s,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=o}static create(t,n,r,i,s,a){let o=s.nodeViews[n.type.name],c,u=o&&o(n,s,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},r,i),d=u&&u.dom,h=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:h}=xm.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let A=d;return d=Eue(d,r,n),u?c=new p$e(t,n,r,i,d,h||null,A,u,s,a+1):n.isText?new r5(t,n,r,i,d,A,s):new gf(t,n,r,i,d,h||null,A,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>$e.empty)}return t}matchesNode(t,n,r){return this.dirty==Nl&&t.eq(this.node)&&Fj(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,s=t.composing?this.localCompositionInfo(t,n):null,a=s&&s.pos>-1?s:null,o=s&&s.pos<0,c=new g$e(this,a&&a.node,t);x$e(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?c.syncToMarks(u.spec.marks,r,t,d):u.type.side>=0&&!h&&c.syncToMarks(d==this.node.childCount?hr.none:this.node.child(d).marks,r,t,d),c.placeWidget(u,t,i)},(u,d,h,A)=>{c.syncToMarks(u.marks,r,t,A);let f;c.findNodeMatch(u,d,h,A)||o&&t.state.selection.from>i&&t.state.selection.to<i+u.nodeSize&&(f=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(u,d,h,f,t)||c.updateNextNode(u,d,h,t,A,i)||c.addNode(u,d,h,t,i),i+=u.nodeSize}),c.syncToMarks([],r,t,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==tp)&&(a&&this.protectLocalComposition(t,a),Bue(this.contentDOM,this.children,t),gv&&w$e(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof rn)||r<n||i>n+this.node.content.size)return null;let s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,o=b$e(this.node.content,a,r-n,i-n);return o<0?null:{node:s,pos:o,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new A$e(this,s,n,i);t.input.compositionNodes.push(a),this.children=mM(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==yu||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Nl}updateOuterDeco(t){if(Fj(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Nue(this.dom,this.nodeDOM,pM(this.outerDeco,this.node,n),pM(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.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 IK(e,t,n,r,i){Eue(r,t,e);let s=new gf(void 0,e,t,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class r5 extends gf{constructor(t,n,r,i,s,a,o){super(t,n,r,i,s,null,a,o,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==yu||this.dirty!=Nl&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Nl||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Nl,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),s=document.createTextNode(i.text);return new r5(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=yu)}get domAtom(){return!1}isText(t){return this.node.text==t}}class jue extends R2{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Nl&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class p$e extends gf{constructor(t,n,r,i,s,a,o,c,u,d){super(t,n,r,i,s,a,o,u,d),this.spec=c}update(t,n,r,i){if(this.dirty==yu)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let s=this.spec.update(t,n,r);return s&&this.updateInner(t,n,r,i),s}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Bue(e,t,n){let r=e.firstChild,i=!1;for(let s=0;s<t.length;s++){let a=t[s],o=a.dom;if(o.parentNode==e){for(;o!=r;)r=PK(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(o,r);if(a instanceof nm){let c=r?r.previousSibling:e.lastChild;Bue(a.contentDOM,a.children,n),r=c?c.nextSibling:e.firstChild}}for(;r;)r=PK(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Qw=function(e){e&&(this.nodeName=e)};Qw.prototype=Object.create(null);const np=[new Qw];function pM(e,t,n){if(e.length==0)return np;let r=n?np[0]:new Qw,i=[r];for(let s=0;s<e.length;s++){let a=e[s].type.attrs;if(a){a.nodeName&&i.push(r=new Qw(a.nodeName));for(let o in a){let c=a[o];c!=null&&(n&&i.length==1&&i.push(r=new Qw(t.isInline?"span":"div")),o=="class"?r.class=(r.class?r.class+" ":"")+c:o=="style"?r.style=(r.style?r.style+";":"")+c:o!="nodeName"&&(r[o]=c))}}}return i}function Nue(e,t,n,r){if(n==np&&r==np)return t;let i=t;for(let s=0;s<r.length;s++){let a=r[s],o=n[s];if(s){let c;o&&o.nodeName==a.nodeName&&i!=e&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),o=np[0]),i=c}m$e(i,o||np[0],a)}return i}function m$e(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&e.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&e.classList.add(i[s]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function Eue(e,t,n){return Nue(e,e,np,pM(t,n,e.nodeType!=1))}function Fj(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function PK(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class g$e{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=y$e(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let s=0,a=this.stack.length>>1,o=Math.min(a,t.length);for(;s<o&&(s==a-1?this.top:this.stack[s+1<<1]).matchesMark(t[s])&&t[s].type.spec.spanning!==!1;)s++;for(;s<a;)this.destroyRest(),this.top.dirty=Nl,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<t.length;){this.stack.push(this.top,this.index+1);let c=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let d=this.index;d<u;d++){let h=this.top.children[d];if(h.matchesMark(t[a])&&!this.isLocked(h.dom)){c=d;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let d=nm.create(this.top,t[a],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,a++}}findNodeMatch(t,n,r,i){let s=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))s=this.top.children.indexOf(a,this.index);else for(let o=this.index,c=Math.min(this.top.children.length,o+5);o<c;o++){let u=this.top.children[o];if(u.matchesNode(t,n,r)&&!this.preMatch.matched.has(u)){s=o;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(t,n,r,i,s){let a=this.top.children[i];return a.dirty==yu&&a.dom==a.contentDOM&&(a.dirty=tp),a.update(t,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,s,a){for(let o=this.index;o<this.top.children.length;o++){let c=this.top.children[o];if(c instanceof gf){let u=this.preMatch.matched.get(c);if(u!=null&&u!=s)return!1;let d=c.dom,h,A=this.isLocked(d)&&!(t.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==t.text&&c.dirty!=yu&&Fj(n,c.outerDeco));if(!A&&c.update(t,n,r,i))return this.destroyBetween(this.index,o),c.dom!=d&&(this.changed=!0),this.index++,!0;if(!A&&(h=this.recreateWrapper(c,t,n,r,i,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=tp,h.updateChildren(i,a+1),h.dirty=Nl),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,s,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Fj(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let o=gf.create(this.top,n,r,i,s,a);if(o.contentDOM){o.children=t.children,t.children=[];for(let c of o.children)c.parent=o}return t.destroy(),o}addNode(t,n,r,i,s){let a=gf.create(this.top,t,n,r,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new _ue(this.top,t,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof nm;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof r5)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((sa||Es)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new jue(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function y$e(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map,a=[];e:for(;i>0;){let o;for(;;)if(r){let u=n.children[r-1];if(u instanceof nm)n=u,r=u.children.length;else{o=u,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=o.node;if(c){if(c!=e.child(i-1))break;--i,s.set(o,i),a.push(o)}}return{index:i,matched:s,matches:a.reverse()}}function v$e(e,t){return e.type.side-t.type.side}function x$e(e,t,n,r){let i=t.locals(e),s=0;if(i.length==0){for(let u=0;u<e.childCount;u++){let d=e.child(u);r(d,i,t.forChild(s,d),u),s+=d.nodeSize}return}let a=0,o=[],c=null;for(let u=0;;){let d,h;for(;a<i.length&&i[a].to==s;){let g=i[a++];g.widget&&(d?(h||(h=[d])).push(g):d=g)}if(d)if(h){h.sort(v$e);for(let g=0;g<h.length;g++)n(h[g],u,!!c)}else n(d,u,!!c);let A,f;if(c)f=-1,A=c,c=null;else if(u<e.childCount)f=u,A=e.child(u++);else break;for(let g=0;g<o.length;g++)o[g].to<=s&&o.splice(g--,1);for(;a<i.length&&i[a].from<=s&&i[a].to>s;)o.push(i[a++]);let p=s+A.nodeSize;if(A.isText){let g=p;a<i.length&&i[a].from<g&&(g=i[a].from);for(let y=0;y<o.length;y++)o[y].to<g&&(g=o[y].to);g<p&&(c=A.cut(g-s),A=A.cut(0,g-s),p=g,f=-1)}else for(;a<i.length&&i[a].to<p;)a++;let m=A.isInline&&!A.isLeaf?o.filter(g=>!g.inline):o.slice();r(A,m,t.forChild(s,A),f),s=p}}function w$e(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function b$e(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let a=e.child(i++),o=s;if(s+=a.nodeSize,!a.isText)continue;let c=a.text;for(;i<e.childCount;){let u=e.child(i++);if(s+=u.nodeSize,!u.isText)break;c+=u.text}if(s>=n){if(s>=r&&c.slice(r-t.length-o,r-o)==t)return r-t.length;let u=o<r?c.lastIndexOf(t,r-o-1):-1;if(u>=0&&u+t.length+o>=n)return o+u;if(n==r&&c.length>=r+t.length-o&&c.slice(r-o,r-o+t.length)==t)return r}}return-1}function mM(e,t,n,r,i){let s=[];for(let a=0,o=0;a<e.length;a++){let c=e[a],u=o,d=o+=c.size;u>=n||d<=t?s.push(c):(u<t&&s.push(c.slice(0,t-u,r)),i&&(s.push(i),i=void 0),d>n&&s.push(c.slice(n-u,c.size,r)))}return s}function sH(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let o=r.resolve(a),c,u;if(n5(n)){for(c=a;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&Qt.isSelectable(h)&&i.parent&&!(h.isInline&&GQe(n.focusNode,n.focusOffset,i.dom))){let A=i.posBefore;u=new Qt(a==A?o:r.resolve(A))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=a,A=a;for(let f=0;f<n.rangeCount;f++){let p=n.getRangeAt(f);h=Math.min(h,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),A=Math.max(A,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(h<0)return null;[c,a]=A==e.state.selection.anchor?[A,h]:[h,A],o=r.resolve(a)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let d=r.resolve(c);if(!u){let h=t=="pointer"||e.state.selection.head<o.pos&&!s?1:-1;u=aH(e,d,o,h)}return u}function Tue(e){return e.editable?e.hasFocus():Pue(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function dd(e,t=!1){let n=e.state.selection;if(Iue(e,n),!!Tue(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Es){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&tm(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)S$e(e);else{let{anchor:r,head:i}=n,s,a;OK&&!(n instanceof rn)&&(n.$from.parent.inlineContent||(s=FK(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=FK(e,n.to))),e.docView.setSelection(r,i,e,t),OK&&(s&&MK(s),a&&MK(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&C$e(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const OK=sa||Es&&yue<63;function FK(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(sa&&i&&i.contentEditable=="false")return qP(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return qP(i);if(s)return qP(s)}}function qP(e){return e.contentEditable="true",sa&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function MK(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function C$e(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Tue(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function S$e(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,Bs(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&oo&&mf<=11&&(n.disabled=!0,n.disabled=!1)}function Iue(e,t){if(t instanceof Qt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(LK(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else LK(e)}function LK(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function aH(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||rn.between(t,n,r)}function RK(e){return e.editable&&!e.hasFocus()?!1:Pue(e)}function Pue(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function k$e(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return tm(t.node,t.offset,n.anchorNode,n.anchorOffset)}function gM(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&gn.findFrom(s,t)}function xh(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function DK(e,t,n){let r=e.state.selection;if(r instanceof rn)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+s.nodeSize*(t<0?-1:1));return xh(e,new rn(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=gM(e.state,t);return i&&i instanceof Qt?xh(e,i):!1}else if(!(cl&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let o=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?Qt.isSelectable(s)?xh(e,new Qt(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):L2?xh(e,new rn(e.state.doc.resolve(t<0?o:o+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Qt&&r.node.isInline)return xh(e,new rn(t>0?r.$to:r.$from));{let i=gM(e.state,t);return i?xh(e,i):!1}}}function Mj(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function $w(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function hg(e,t){return t<0?_$e(e):j$e(e)}function _$e(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,a=!1;for(Bl&&n.nodeType==1&&r<Mj(n)&&$w(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let o=n.childNodes[r-1];if($w(o,-1))i=n,s=--r;else if(o.nodeType==3)n=o,r=n.nodeValue.length;else break}}else{if(Oue(n))break;{let o=n.previousSibling;for(;o&&$w(o,-1);)i=n.parentNode,s=Bs(o),o=o.previousSibling;if(o)n=o,r=Mj(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?yM(e,n,r):i&&yM(e,i,s)}function j$e(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Mj(n),s,a;for(;;)if(r<i){if(n.nodeType!=1)break;let o=n.childNodes[r];if($w(o,1))s=n,a=++r;else break}else{if(Oue(n))break;{let o=n.nextSibling;for(;o&&$w(o,1);)s=o.parentNode,a=Bs(o)+1,o=o.nextSibling;if(o)n=o,r=0,i=Mj(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}s&&yM(e,s,a)}function Oue(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function B$e(e,t){for(;e&&t==e.childNodes.length&&!M2(e);)t=Bs(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function N$e(e,t){for(;e&&!t&&!M2(e);)t=Bs(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function yM(e,t,n){if(t.nodeType!=3){let s,a;(a=B$e(t,n))?(t=a,n=0):(s=N$e(t,n))&&(t=s,n=s.nodeValue.length)}let r=e.domSelection();if(!r)return;if(n5(r)){let s=document.createRange();s.setEnd(t,n),s.setStart(t,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&dd(e)},50)}function UK(e,t){let n=e.state.doc.resolve(t);if(!(Es||vue)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let s=e.coordsAtPos(t-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(t<n.end()){let s=e.coordsAtPos(t+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function HK(e,t,n){let r=e.state.selection;if(r instanceof rn&&!r.empty||n.indexOf("s")>-1||cl&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=gM(e.state,t);if(a&&a instanceof Qt)return xh(e,a)}if(!i.parent.inlineContent){let a=t<0?i:s,o=r instanceof jl?gn.near(a,t):gn.findFrom(a,t);return o?xh(e,o):!1}return!1}function QK(e,t){if(!(e.state.selection instanceof rn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=e.state.tr;return t<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),e.dispatch(a),!0}return!1}function $K(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function E$e(e){if(!sa||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;$K(e,r,"true"),setTimeout(()=>$K(e,r,"false"),20)}return!1}function T$e(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function I$e(e,t){let n=t.keyCode,r=T$e(t);if(n==8||cl&&n==72&&r=="c")return QK(e,-1)||hg(e,-1);if(n==46&&!t.shiftKey||cl&&n==68&&r=="c")return QK(e,1)||hg(e,1);if(n==13||n==27)return!0;if(n==37||cl&&n==66&&r=="c"){let i=n==37?UK(e,e.state.selection.from)=="ltr"?-1:1:-1;return DK(e,i,r)||hg(e,i)}else if(n==39||cl&&n==70&&r=="c"){let i=n==39?UK(e,e.state.selection.from)=="ltr"?1:-1:1;return DK(e,i,r)||hg(e,i)}else{if(n==38||cl&&n==80&&r=="c")return HK(e,-1,r)||hg(e,-1);if(n==40||cl&&n==78&&r=="c")return E$e(e)||HK(e,1,r)||hg(e,1);if(r==(cl?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function oH(e,t){e.someProp("transformCopied",f=>{t=f(t,e)});let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let a=e.someProp("clipboardSerializer")||xm.fromSchema(e.state.schema),o=Uue(),c=o.createElement("div");c.appendChild(a.serializeFragment(r,{document:o}));let u=c.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=Due[u.nodeName.toLowerCase()]);){for(let f=d.length-1;f>=0;f--){let p=o.createElement(d[f]);for(;c.firstChild;)p.appendChild(c.firstChild);c.appendChild(p),h++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let A=e.someProp("clipboardTextSerializer",f=>f(t,e))||t.content.textBetween(0,t.content.size,`

`);return{dom:c,text:A,slice:t}}function Fue(e,t,n,r,i){let s=i.parent.type.spec.code,a,o;if(!n&&!t)return null;let c=!!t&&(r||s||!n);if(c){if(e.someProp("transformPastedText",A=>{t=A(t,s||r,e)}),s)return o=new ct($e.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp("transformPasted",A=>{o=A(o,e,!0)}),o;let h=e.someProp("clipboardTextParser",A=>A(t,i,r,e));if(h)o=h;else{let A=i.marks(),{schema:f}=e.state,p=xm.fromSchema(f);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=a.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(f.text(m,A)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),a=M$e(n),L2&&L$e(a);let u=a&&a.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let A=a.firstChild;for(;A&&A.nodeType!=1;)A=A.nextSibling;if(!A)break;a=A}if(o||(o=(e.someProp("clipboardParser")||e.someProp("domParser")||pf.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||d),context:i,ruleFromNode(A){return A.nodeName=="BR"&&!A.nextSibling&&A.parentNode&&!P$e.test(A.parentNode.nodeName)?{ignore:!0}:null}})),d)o=R$e(zK(o,+d[1],+d[2]),d[4]);else if(o=ct.maxOpen(O$e(o.content,i),!0),o.openStart||o.openEnd){let h=0,A=0;for(let f=o.content.firstChild;h<o.openStart&&!f.type.spec.isolating;h++,f=f.firstChild);for(let f=o.content.lastChild;A<o.openEnd&&!f.type.spec.isolating;A++,f=f.lastChild);o=zK(o,h,A)}return e.someProp("transformPasted",h=>{o=h(o,e,c)}),o}const P$e=/^(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 O$e(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),s,a=[];if(e.forEach(o=>{if(!a)return;let c=i.findWrapping(o.type),u;if(!c)return a=null;if(u=a.length&&s.length&&Lue(c,s,o,a[a.length-1],0))a[a.length-1]=u;else{a.length&&(a[a.length-1]=Rue(a[a.length-1],s.length));let d=Mue(o,c);a.push(d),i=i.matchType(d.type),s=c}}),a)return $e.from(a)}return e}function Mue(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,$e.from(e));return e}function Lue(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=Lue(e,t,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append($e.from(Mue(n,e,i+1))))}}function Rue(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Rue(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore($e.empty,!0);return e.copy(n.append(r))}function vM(e,t,n,r,i,s){let a=t<0?e.firstChild:e.lastChild,o=a.content;return e.childCount>1&&(s=0),i<r-1&&(o=vM(o,t,n,r,i+1,s)),i>=n&&(o=t<0?a.contentMatchAt(0).fillBefore(o,s<=i).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore($e.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(o))}function zK(e,t,n){return t<e.openStart&&(e=new ct(vM(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ct(vM(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Due={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 VK=null;function Uue(){return VK||(VK=document.implementation.createHTMLDocument("title"))}let WP=null;function F$e(e){let t=window.trustedTypes;return t?(WP||(WP=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),WP.createHTML(e)):e}function M$e(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Uue().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Due[r[1].toLowerCase()])&&(e=i.map(s=>"<"+s+">").join("")+e+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=F$e(e),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function L$e(e){let t=e.querySelectorAll(Es?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function R$e(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:s,openEnd:a}=e;for(let o=r.length-2;o>=0;o-=2){let c=n.nodes[r[o]];if(!c||c.hasRequiredAttrs())break;i=$e.from(c.create(r[o+1],i)),s++,a++}return new ct(i,s,a)}const Ta={},Ia={},D$e={touchstart:!0,touchmove:!0};class U$e{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 H$e(e){for(let t in Ta){let n=Ta[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{$$e(e,r)&&!lH(e,r)&&(e.editable||!(r.type in Ia))&&n(e,r)},D$e[t]?{passive:!0}:void 0)}sa&&e.dom.addEventListener("input",()=>null),xM(e)}function Gh(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Q$e(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function xM(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>lH(e,r))})}function lH(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function $$e(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function z$e(e,t){!lH(e,t)&&Ta[t.type]&&(e.editable||!(t.type in Ia))&&Ta[t.type](e,t)}Ia.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Que(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(ad&&Es&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),gv&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,KA(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||I$e(e,n)?n.preventDefault():Gh(e,"key")};Ia.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Ia.keypress=(e,t)=>{let n=t;if(Que(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||cl&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof rn)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",a=>a(e,r.$from.pos,r.$to.pos,i,s))&&e.dispatch(s()),n.preventDefault()}};function i5(e){return{left:e.clientX,top:e.clientY}}function V$e(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function cH(e,t,n,r,i){if(r==-1)return!1;let s=e.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(e.someProp(t,o=>a>s.depth?o(e,n,s.nodeAfter,s.before(a),i,!0):o(e,n,s.node(a),s.before(a),i,!1)))return!0;return!1}function Ny(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function K$e(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Qt.isSelectable(r)?(Ny(e,new Qt(n)),!0):!1}function q$e(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Qt&&(r=n.node);let s=e.state.doc.resolve(t);for(let a=s.depth+1;a>0;a--){let o=a>s.depth?s.nodeAfter:s.node(a);if(Qt.isSelectable(o)){r&&n.$from.depth>0&&a>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(a);break}}return i!=null?(Ny(e,Qt.create(e.state.doc,i)),!0):!1}function W$e(e,t,n,r,i){return cH(e,"handleClickOn",t,n,r)||e.someProp("handleClick",s=>s(e,t,r))||(i?q$e(e,n):K$e(e,n))}function G$e(e,t,n,r){return cH(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function Y$e(e,t,n,r){return cH(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||X$e(e,n,r)}function X$e(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Ny(e,rn.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),o=i.before(s);if(a.inlineContent)Ny(e,rn.create(r,o+1,o+1+a.content.size));else if(Qt.isSelectable(a))Ny(e,Qt.create(r,o));else continue;return!0}}function uH(e){return Lj(e)}const Hue=cl?"metaKey":"ctrlKey";Ta.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=uH(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&V$e(n,e.input.lastClick)&&!n[Hue]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let a=e.posAtCoords(i5(n));a&&(s=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new J$e(e,a,n,!!r)):(s=="doubleClick"?G$e:Y$e)(e,a.pos,a.inside,n)?n.preventDefault():Gh(e,"pointer"))};class J$e{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Hue],this.allowDefault=r.shiftKey;let s,a;if(n.inside>-1)s=t.state.doc.nodeAt(n.inside),a=n.inside;else{let d=t.state.doc.resolve(n.pos);s=d.parent,a=d.depth?d.before():0}const o=i?null:r.target,c=o?t.docView.nearestDesc(o,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=t.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Qt&&u.from<=a&&u.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Bl&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Gh(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>dd(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(i5(t))),this.updateAllowDefault(t),this.allowDefault||!n?Gh(this.view,"pointer"):W$e(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||sa&&this.mightDrag&&!this.mightDrag.node.isAtom||Es&&!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)?(Ny(this.view,gn.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Gh(this.view,"pointer")}move(t){this.updateAllowDefault(t),Gh(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Ta.touchstart=e=>{e.input.lastTouch=Date.now(),uH(e),Gh(e,"pointer")};Ta.touchmove=e=>{e.input.lastTouch=Date.now(),Gh(e,"pointer")};Ta.contextmenu=e=>uH(e);function Que(e,t){return e.composing?!0:sa&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Z$e=ad?5e3:-1;Ia.compositionstart=Ia.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof rn&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Es&&vue&&e8e(e)))e.markCursor=e.state.storedMarks||n.marks(),Lj(e,!0),e.markCursor=null;else if(Lj(e,!t.selection.empty),Bl&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let o=e.domSelection();o&&o.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}e.input.composing=!0}$ue(e,Z$e)};function e8e(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Ia.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,$ue(e,20))};function $ue(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Lj(e),t))}function zue(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=n8e());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function t8e(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=qQe(t.focusNode,t.focusOffset),r=WQe(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function n8e(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Lj(e,t=!1){if(!(ad&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),zue(e),t||e.docView&&e.docView.dirty){let n=sH(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function r8e(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const n1=oo&&mf<15||gv&&JQe<604;Ta.copy=Ia.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let s=n1?null:n.clipboardData,a=r.content(),{dom:o,text:c}=oH(e,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",c)):r8e(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function i8e(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function s8e(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?r1(e,r.value,null,i,t):r1(e,r.textContent,r.innerHTML,i,t)},50)}function r1(e,t,n,r,i){let s=Fue(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,i,s||ct.empty)))return!0;if(!s)return!1;let a=i8e(s),o=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(s);return e.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Vue(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ia.paste=(e,t)=>{let n=t;if(e.composing&&!ad)return;let r=n1?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&r1(e,Vue(r),r.getData("text/html"),i,n)?n.preventDefault():s8e(e,n)};class Kue{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const a8e=cl?"altKey":"ctrlKey";function que(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[a8e]}Ta.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(i5(n)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Qt?i.to-1:i.to))){if(r&&r.mightDrag)a=Qt.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=e.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=e.docView&&(a=Qt.create(e.state.doc,h.posBefore))}}let o=(a||e.state.selection).content(),{dom:c,text:u,slice:d}=oH(e,o);(!n.dataTransfer.files.length||!Es||yue>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(n1?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",n1||n.dataTransfer.setData("text/plain",u),e.dragging=new Kue(d,que(e,n),a)};Ta.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Ia.dragover=Ia.dragenter=(e,t)=>t.preventDefault();Ia.drop=(e,t)=>{try{o8e(e,t,e.dragging)}finally{e.dragging=null}};function o8e(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(i5(t));if(!r)return;let i=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",f=>{s=f(s,e,!1)}):s=Fue(e,Vue(t.dataTransfer),n1?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&que(e,t));if(e.someProp("handleDrop",f=>f(e,t,s||ct.empty,a))){t.preventDefault();return}if(!s)return;t.preventDefault();let o=s?rue(e.state.doc,i.pos,s):i.pos;o==null&&(o=i.pos);let c=e.state.tr;if(a){let{node:f}=n;f?f.replace(c):c.deleteSelection()}let u=c.mapping.map(o),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let A=c.doc.resolve(u);if(d&&Qt.isSelectable(s.content.firstChild)&&A.nodeAfter&&A.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Qt(A));else{let f=c.mapping.map(o);c.mapping.maps[c.mapping.maps.length-1].forEach((p,m,g,y)=>f=y),c.setSelection(aH(e,A,c.doc.resolve(f)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}Ta.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&dd(e)},20))};Ta.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Ta.beforeinput=(e,t)=>{if(Es&&ad&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",s=>s(e,KA(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Ia)Ta[e]=Ia[e];function i1(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Rj{constructor(t,n){this.toDOM=t,this.spec=n||Ep,this.side=this.spec.side||0}map(t,n,r,i){let{pos:s,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new _a(s-r,s-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Rj&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&i1(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class yf{constructor(t,n){this.attrs=t,this.spec=n||Ep}map(t,n,r,i){let s=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new _a(s,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof yf&&i1(this.attrs,t.attrs)&&i1(this.spec,t.spec)}static is(t){return t.type instanceof yf}destroy(){}}class dH{constructor(t,n){this.attrs=t,this.spec=n||Ep}map(t,n,r,i){let s=t.mapResult(n.from+i,1);if(s.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=s.pos?null:new _a(s.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),s;return i==n.from&&!(s=t.child(r)).isText&&i+s.nodeSize==n.to}eq(t){return this==t||t instanceof dH&&i1(this.attrs,t.attrs)&&i1(this.spec,t.spec)}destroy(){}}class _a{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new _a(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new _a(t,t,new Rj(n,r))}static inline(t,n,r,i){return new _a(t,n,new yf(r,i))}static node(t,n,r,i){return new _a(t,n,new dH(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof yf}get widget(){return this.type instanceof Rj}}const Mg=[],Ep={};class Xr{constructor(t,n){this.local=t.length?t:Mg,this.children=n.length?n:Mg}static create(t,n){return n.length?Dj(n,t,0,Ep):Gs}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,s){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=n&&o.to>=t&&(!s||s(o.spec))&&r.push(o.copy(o.from+i,o.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let o=this.children[a]+1;this.children[a+2].findInner(t-o,n-o,r,i+o,s)}}map(t,n,r){return this==Gs||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Ep)}mapInner(t,n,r,i,s){let a;for(let o=0;o<this.local.length;o++){let c=this.local[o].map(t,r,i);c&&c.type.valid(n,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?l8e(this.children,a||[],t,n,r,i,s):a?new Xr(a.sort(Tp),Mg):Gs}add(t,n){return n.length?this==Gs?Xr.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,s=0;t.forEach((o,c)=>{let u=c+r,d;if(d=Gue(n,o,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(o,d,u+1):i.splice(s,0,c,c+o.nodeSize,Dj(d,o,u+1,Ep)),s+=3}});let a=Wue(s?Yue(n):n,-r);for(let o=0;o<a.length;o++)a[o].type.valid(t,a[o])||a.splice(o--,1);return new Xr(a.length?this.local.concat(a).sort(Tp):this.local,i||this.children)}remove(t){return t.length==0||this==Gs?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let a,o=r[s]+n,c=r[s+1]+n;for(let d=0,h;d<t.length;d++)(h=t[d])&&h.from>o&&h.to<c&&(t[d]=null,(a||(a=[])).push(h));if(!a)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(a,o+1);u!=Gs?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<t.length;s++)if(a=t[s])for(let o=0;o<i.length;o++)i[o].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(o--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Xr(i,r):Gs}forChild(t,n){if(this==Gs)return this;if(n.isLeaf)return Xr.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let s=t+1,a=s+n.content.size;for(let o=0;o<this.local.length;o++){let c=this.local[o];if(c.from<a&&c.to>s&&c.type instanceof yf){let u=Math.max(s,c.from)-s,d=Math.min(a,c.to)-s;u<d&&(i||(i=[])).push(c.copy(u,d))}}if(i){let o=new Xr(i.sort(Tp),Mg);return r?new Bh([o,r]):o}return r||Gs}eq(t){if(this==t)return!0;if(!(t instanceof Xr)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return hH(this.localsInner(t))}localsInner(t){if(this==Gs)return Mg;if(t.inlineContent||!this.local.some(yf.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof yf||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Xr.empty=new Xr([],[]);Xr.removeOverlap=hH;const Gs=Xr.empty;class Bh{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,Ep));return Bh.from(r)}forChild(t,n){if(n.isLeaf)return Xr.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(t,n);s!=Gs&&(s instanceof Bh?r=r.concat(s.members):r.push(s))}return Bh.from(r)}eq(t){if(!(t instanceof Bh)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(t);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let a=0;a<s.length;a++)n.push(s[a])}}return n?hH(r?n:n.sort(Tp)):Mg}static from(t){switch(t.length){case 0:return Gs;case 1:return t[0];default:return new Bh(t.every(n=>n instanceof Xr)?t:t.reduce((n,r)=>n.concat(r instanceof Xr?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function l8e(e,t,n,r,i,s,a){let o=e.slice();for(let u=0,d=s;u<n.maps.length;u++){let h=0;n.maps[u].forEach((A,f,p,m)=>{let g=m-p-(f-A);for(let y=0;y<o.length;y+=3){let v=o[y+1];if(v<0||A>v+d-h)continue;let x=o[y]+d-h;f>=x?o[y+1]=A<=x?-2:-1:A>=d&&g&&(o[y]+=g,o[y+1]+=g)}h+=g}),d=n.maps[u].map(d,-1)}let c=!1;for(let u=0;u<o.length;u+=3)if(o[u+1]<0){if(o[u+1]==-2){c=!0,o[u+1]=-1;continue}let d=n.map(e[u]+s),h=d-i;if(h<0||h>=r.content.size){c=!0;continue}let A=n.map(e[u+1]+s,-1),f=A-i,{index:p,offset:m}=r.content.findIndex(h),g=r.maybeChild(p);if(g&&m==h&&m+g.nodeSize==f){let y=o[u+2].mapInner(n,g,d+1,e[u]+s+1,a);y!=Gs?(o[u]=h,o[u+1]=f,o[u+2]=y):(o[u+1]=-2,c=!0)}else c=!0}if(c){let u=c8e(o,e,t,n,i,s,a),d=Dj(u,r,0,a);t=d.local;for(let h=0;h<o.length;h+=3)o[h+1]<0&&(o.splice(h,3),h-=3);for(let h=0,A=0;h<d.children.length;h+=3){let f=d.children[h];for(;A<o.length&&o[A]<f;)A+=3;o.splice(A,0,d.children[h],d.children[h+1],d.children[h+2])}}return new Xr(t.sort(Tp),o)}function Wue(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new _a(i.from+t,i.to+t,i.type))}return n}function c8e(e,t,n,r,i,s,a){function o(c,u){for(let d=0;d<c.local.length;d++){let h=c.local[d].map(r,i,u);h?n.push(h):a.onRemove&&a.onRemove(c.local[d].spec)}for(let d=0;d<c.children.length;d+=3)o(c.children[d+2],c.children[d]+u+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&o(e[c+2],t[c]+s+1);return n}function Gue(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let s=0,a;s<e.length;s++)(a=e[s])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[s]=null);return i}function Yue(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Dj(e,t,n,r){let i=[],s=!1;t.forEach((o,c)=>{let u=Gue(e,o,c+n);if(u){s=!0;let d=Dj(u,o,n+c+1,r);d!=Gs&&i.push(c,c+o.nodeSize,d)}});let a=Wue(s?Yue(e):e,-n).sort(Tp);for(let o=0;o<a.length;o++)a[o].type.valid(t,a[o])||(r.onRemove&&r.onRemove(a[o].spec),a.splice(o--,1));return a.length||i.length?new Xr(a,i):Gs}function Tp(e,t){return e.from-t.from||e.to-t.to}function hH(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from==r.from){s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),KK(t,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),KK(t,i,r.copy(s.from,r.to)));break}}}return t}function KK(e,t,n){for(;t<e.length&&Tp(n,e[t])>0;)t++;e.splice(t,0,n)}function GP(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Gs&&t.push(r)}),e.cursorWrapper&&t.push(Xr.create(e.state.doc,[e.cursorWrapper.deco])),Bh.from(t)}const u8e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},d8e=oo&&mf<=11;class h8e{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class f8e{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new h8e,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);oo&&mf<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():sa&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),d8e&&(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,u8e)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(RK(this.view)){if(this.suppressingSelectionUpdates)return dd(this.view);if(oo&&mf<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&tm(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let s=t.focusNode;s;s=mv(s))n.add(s);for(let s=t.anchorNode;s;s=mv(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&RK(t)&&!this.ignoreSelectionChange(r),s=-1,a=-1,o=!1,c=[];if(t.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],c);h&&(s=s<0?h.from:Math.min(h.from,s),a=a<0?h.to:Math.max(h.to,a),h.typeOver&&(o=!0))}if(c.some(d=>d.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let d of c)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&d.parentNode.removeChild(d)}}else if(Bl&&c.length){let d=c.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,A]=d;h.parentNode&&h.parentNode.parentNode==A.parentNode?A.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let A of d){let f=A.parentNode;f&&f.nodeName=="LI"&&(!h||m8e(t,h)!=f)&&A.remove()}}}let u=null;s<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&n5(r)&&(u=sH(t))&&u.eq(gn.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,dd(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||i)&&(s>-1&&(t.docView.markDirty(s,a),A8e(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,g8e(t,c)),this.handleDOMChange(s,a,o,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||dd(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let d=0;d<t.addedNodes.length;d++){let h=t.addedNodes[d];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,s=t.nextSibling;if(oo&&mf<=11&&t.addedNodes.length)for(let d=0;d<t.addedNodes.length;d++){let{previousSibling:h,nextSibling:A}=t.addedNodes[d];(!h||Array.prototype.indexOf.call(t.addedNodes,h)<0)&&(i=h),(!A||Array.prototype.indexOf.call(t.addedNodes,A)<0)&&(s=A)}let a=i&&i.parentNode==t.target?Bs(i)+1:0,o=r.localPosFromDOM(t.target,a,-1),c=s&&s.parentNode==t.target?Bs(s):t.target.childNodes.length,u=r.localPosFromDOM(t.target,c,1);return{from:o,to:u}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let qK=new WeakMap,WK=!1;function A8e(e){if(!qK.has(e)&&(qK.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Bl,WK)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."),WK=!0}}function GK(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return tm(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function p8e(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return GK(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?GK(e,n):null}function m8e(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function g8e(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let s of t)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=s.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let o=a;for(;;){let c=o.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;o=c}o.insertBefore(s,o.firstChild),r==s&&e.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function y8e(e,t,n){let{node:r,fromOffset:i,toOffset:s,from:a,to:o}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u,d=c.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:c.anchorOffset}],n5(c)||u.push({node:c.focusNode,offset:c.focusOffset})),Es&&e.input.lastKeyCode===8)for(let g=s;g>i;g--){let y=r.childNodes[g-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){s=g;break}if(!v||v.size)break}let h=e.state.doc,A=e.someProp("domParser")||pf.fromSchema(e.state.schema),f=h.resolve(a),p=null,m=A.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:v8e,context:f});if(u&&u[0].pos!=null){let g=u[0].pos,y=u[1]&&u[1].pos;y==null&&(y=g),p={anchor:g+a,head:y+a}}return{doc:m,sel:p,from:a,to:o}}function v8e(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(sa&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||sa&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const x8e=/^(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 w8e(e,t,n,r,i){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let j=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,B=sH(e,j);if(B&&!e.state.selection.eq(B)){if(Es&&ad&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",P=>P(e,KA(13,"Enter"))))return;let E=e.state.tr.setSelection(B);j=="pointer"?E.setMeta("pointer",!0):j=="key"&&E.scrollIntoView(),s&&E.setMeta("composition",s),e.dispatch(E)}return}let a=e.state.doc.resolve(t),o=a.sharedDepth(n);t=a.before(o+1),n=e.state.doc.resolve(n).after(o+1);let c=e.state.selection,u=y8e(e,t,n),d=e.state.doc,h=d.slice(u.from,u.to),A,f;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(A=e.state.selection.to,f="end"):(A=e.state.selection.from,f="start"),e.input.lastKeyCode=null;let p=S8e(h.content,u.doc.content,u.from,A,f);if(p&&e.input.domChangeCount++,(gv&&e.input.lastIOSEnter>Date.now()-225||ad)&&i.some(j=>j.nodeType==1&&!x8e.test(j.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",j=>j(e,KA(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&c instanceof rn&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let j=YK(e,e.state.doc,u.sel);if(j&&!j.eq(e.state.selection)){let B=e.state.tr.setSelection(j);s&&B.setMeta("composition",s),e.dispatch(B)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof rn&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),oo&&mf<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=u.doc.resolveNoCache(p.start-u.from),g=u.doc.resolveNoCache(p.endB-u.from),y=d.resolve(p.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((gv&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(j=>j.nodeName=="DIV"||j.nodeName=="P"))||!v&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",j=>j(e,KA(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&C8e(d,p.start,p.endA,m,g)&&e.someProp("handleKeyDown",j=>j(e,KA(8,"Backspace")))){ad&&Es&&e.domObserver.suppressSelectionUpdates();return}Es&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),ad&&!v&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,g=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(j){return j(e,KA(13,"Enter"))})},20));let x=p.start,b=p.endA,w=j=>{let B=j||e.state.tr.replace(x,b,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let E=YK(e,B.doc,u.sel);E&&!(Es&&e.composing&&E.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(E.head==x||E.head==B.mapping.map(b)-1)||oo&&E.empty&&E.head==x)&&B.setSelection(E)}return s&&B.setMeta("composition",s),B.scrollIntoView()},k;if(v)if(m.pos==g.pos){oo&&mf<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>dd(e),20));let j=w(e.state.tr.delete(x,b)),B=d.resolve(p.start).marksAcross(d.resolve(p.endA));B&&j.ensureMarks(B),e.dispatch(j)}else if(p.endA==p.endB&&(k=b8e(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let j=w(e.state.tr);k.type=="add"?j.addMark(x,b,k.mark):j.removeMark(x,b,k.mark),e.dispatch(j)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let j=m.parent.textBetween(m.parentOffset,g.parentOffset),B=()=>w(e.state.tr.insertText(j,x,b));e.someProp("handleTextInput",E=>E(e,x,b,j,B))||e.dispatch(B())}else e.dispatch(w());else e.dispatch(w())}function YK(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:aH(e,t.resolve(n.anchor),t.resolve(n.head))}function b8e(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,s=r,a,o,c;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)o=i[0],a="add",c=d=>d.mark(o.addToSet(d.marks));else if(i.length==0&&s.length==1)o=s[0],a="remove",c=d=>d.mark(o.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<t.childCount;d++)u.push(c(t.child(d)));if($e.from(u).eq(e))return{mark:o,type:a}}function C8e(e,t,n,r,i){if(n-t<=i.pos-r.pos||YP(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let o=s.nodeAfter;return o!=null&&n==t+o.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=e.resolve(YP(s,!0,!0));return!a.parent.isTextblock||a.pos>n||YP(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function YP(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let s=e.node(r).maybeChild(e.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function S8e(e,t,n,r,i){let s=e.findDiffStart(t,n);if(s==null)return null;let{a,b:o}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let c=Math.max(0,s-Math.min(a,o));r-=a+c-s}if(a<s&&e.size<t.size){let c=r<=s&&r>=a?s-r:0;s-=c,s&&s<t.size&&XK(t.textBetween(s-1,s+1))&&(s+=c?1:-1),o=s+(o-a),a=s}else if(o<s){let c=r<=s&&r>=o?s-r:0;s-=c,s&&s<e.size&&XK(e.textBetween(s-1,s+1))&&(s+=c?1:-1),a=s+(a-o),o=s}return{start:s,endA:a,endB:o}}function XK(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Xue{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new U$e,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(nq),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=eq(this),ZK(this),this.nodeViews=tq(this),this.docView=IK(this.state.doc,JK(this),GP(this),this.dom,this),this.domObserver=new f8e(this,(r,i,s,a)=>w8e(this,r,i,s,a)),this.domObserver.start(),H$e(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&xM(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(nq),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,s=!1,a=!1;t.storedMarks&&this.composing&&(zue(this),a=!0),this.state=t;let o=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(o||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=tq(this);_8e(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&xM(this),this.editable=eq(this),ZK(this);let c=GP(this),u=JK(this),d=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(t.doc,u,c);(h||!t.selection.eq(i.selection))&&(a=!0);let A=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&t$e(this);if(a){this.domObserver.stop();let f=h&&(oo||Es)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&k8e(i.selection,t.selection);if(h){let p=Es?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=t8e(this)),(s||!this.docView.update(t.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=IK(t.doc,u,c,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&k$e(this))?dd(this,f):(Iue(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():A&&n$e(A)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Qt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&_K(this,n.getBoundingClientRect(),t)}else _K(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new Kue(t.slice,t.move,i<0?void 0:Qt.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let o=this.directPlugins[a].props[t];if(o!=null&&(i=n?n(o):o))return i}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let o=s[a].props[t];if(o!=null&&(i=n?n(o):o))return i}}hasFocus(){if(oo){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&r$e(this.dom),dd(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return l$e(this,t)}coordsAtPos(t,n=1){return Sue(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return f$e(this,n||this.state,t)}pasteHTML(t,n){return r1(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return r1(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return oH(this,t)}destroy(){this.docView&&(Q$e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],GP(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,VQe())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return z$e(this,t)}domSelectionRange(){let t=this.domSelection();return t?sa&&this.root.nodeType===11&&YQe(this.dom.ownerDocument)==this.dom&&p8e(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Xue.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function JK(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[_a.node(0,e.state.doc.content.size,t)]}function ZK(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:_a.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function eq(e){return!e.someProp("editable",t=>t(e.state)===!1)}function k8e(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function tq(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function _8e(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function nq(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Of={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:"'"},Uj={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},j8e=typeof navigator<"u"&&/Mac/.test(navigator.platform),B8e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ns=0;Ns<10;Ns++)Of[48+Ns]=Of[96+Ns]=String(Ns);for(var Ns=1;Ns<=24;Ns++)Of[Ns+111]="F"+Ns;for(var Ns=65;Ns<=90;Ns++)Of[Ns]=String.fromCharCode(Ns+32),Uj[Ns]=String.fromCharCode(Ns);for(var XP in Of)Uj.hasOwnProperty(XP)||(Uj[XP]=Of[XP]);function N8e(e){var t=j8e&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||B8e&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Uj:Of)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const E8e=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),T8e=typeof navigator<"u"&&/Win/.test(navigator.platform);function I8e(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,s,a;for(let o=0;o<t.length-1;o++){let c=t[o];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))E8e?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function P8e(e){let t=Object.create(null);for(let n in e)t[I8e(n)]=e[n];return t}function JP(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function O8e(e){return new ti({props:{handleKeyDown:Jue(e)}})}function Jue(e){let t=P8e(e);return function(n,r){let i=N8e(r),s,a=t[JP(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let o=t[JP(i,r,!1)];if(o&&o(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(T8e&&r.ctrlKey&&r.altKey)&&(s=Of[r.keyCode])&&s!=i){let o=t[JP(s,r)];if(o&&o(n.state,n.dispatch,n))return!0}}return!1}}var F8e=Object.defineProperty,fH=(e,t)=>{for(var n in t)F8e(e,n,{get:t[n],enumerable:!0})};function s5(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var a5=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,o])=>[a,(...u)=>{const d=o(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a=[],o=!!e,c=e||i.tr,u=()=>(!o&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(n).map(([h,A])=>[h,(...p)=>{const m=this.buildProps(c,t),g=A(...p)(m);return a.push(g),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([o,c])=>[o,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a={tr:e,editor:r,view:s,state:s5({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([o,c])=>[o,(...u)=>c(...u)(a)]))}};return a}},Zue={};fH(Zue,{blur:()=>M8e,clearContent:()=>L8e,clearNodes:()=>R8e,command:()=>D8e,createParagraphNear:()=>U8e,cut:()=>H8e,deleteCurrentNode:()=>Q8e,deleteNode:()=>$8e,deleteRange:()=>z8e,deleteSelection:()=>V8e,enter:()=>K8e,exitCode:()=>q8e,extendMarkRange:()=>W8e,first:()=>G8e,focus:()=>X8e,forEach:()=>J8e,insertContent:()=>Z8e,insertContentAt:()=>n7e,joinBackward:()=>s7e,joinDown:()=>i7e,joinForward:()=>a7e,joinItemBackward:()=>o7e,joinItemForward:()=>l7e,joinTextblockBackward:()=>c7e,joinTextblockForward:()=>u7e,joinUp:()=>r7e,keyboardShortcut:()=>h7e,lift:()=>f7e,liftEmptyBlock:()=>A7e,liftListItem:()=>p7e,newlineInCode:()=>m7e,resetAttributes:()=>g7e,scrollIntoView:()=>y7e,selectAll:()=>v7e,selectNodeBackward:()=>x7e,selectNodeForward:()=>w7e,selectParentNode:()=>b7e,selectTextblockEnd:()=>C7e,selectTextblockStart:()=>S7e,setContent:()=>k7e,setMark:()=>V7e,setMeta:()=>K7e,setNode:()=>q7e,setNodeSelection:()=>W7e,setTextDirection:()=>G7e,setTextSelection:()=>Y7e,sinkListItem:()=>X7e,splitBlock:()=>J7e,splitListItem:()=>Z7e,toggleList:()=>eze,toggleMark:()=>tze,toggleNode:()=>nze,toggleWrap:()=>rze,undoInputRule:()=>ize,unsetAllMarks:()=>sze,unsetMark:()=>aze,unsetTextDirection:()=>oze,updateAttributes:()=>lze,wrapIn:()=>cze,wrapInList:()=>uze});var M8e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),L8e=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),R8e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:a})=>{e.doc.nodesBetween(s.pos,a.pos,(o,c)=>{if(o.type.isText)return;const{doc:u,mapping:d}=t,h=u.resolve(d.map(c)),A=u.resolve(d.map(c+o.nodeSize)),f=h.blockRange(A);if(!f)return;const p=y0(f);if(o.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(f.start,m)}(p||p===0)&&t.lift(f,p)})}),!0},D8e=e=>t=>e(t),U8e=()=>({state:e,dispatch:t})=>TQe(e,t),H8e=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,s.content),r.setSelection(new rn(r.doc.resolve(Math.max(a-1,0)))),!0},Q8e=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(t){const o=i.before(s),c=i.after(s);e.delete(o,c).scrollIntoView()}return!0}return!1};function Di(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var $8e=e=>({tr:t,state:n,dispatch:r})=>{const i=Di(e,n.schema),s=t.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const c=s.before(a),u=s.after(a);t.delete(c,u).scrollIntoView()}return!0}return!1},z8e=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},V8e=()=>({state:e,dispatch:t})=>vQe(e,t),K8e=()=>({commands:e})=>e.keyboardShortcut("Enter"),q8e=()=>({state:e,dispatch:t})=>EQe(e,t);function AH(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Hj(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:AH(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function ede(e,t,n={}){return e.find(r=>r.type===t&&Hj(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function rq(e,t,n={}){return!!ede(e,t,n)}function pH(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===t)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!ede([...i.node.marks],t,n)))return;let a=i.index,o=e.start()+i.offset,c=a+1,u=o+i.node.nodeSize;for(;a>0&&rq([...e.parent.child(a-1).marks],t,n);)a-=1,o-=e.parent.child(a).nodeSize;for(;c<e.parent.childCount&&rq([...e.parent.child(c).marks],t,n);)u+=e.parent.child(c).nodeSize,c+=1;return{from:o,to:u}}function Fd(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var W8e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=Fd(e,r.schema),{doc:a,selection:o}=n,{$from:c,from:u,to:d}=o;if(i){const h=pH(c,s,t);if(h&&h.from<=u&&h.to>=d){const A=rn.create(a,h.from,h.to);n.setSelection(A)}}return!0},G8e=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function tde(e){return e instanceof rn}function rp(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function nde(e,t=null){if(!t)return null;const n=gn.atStart(e),r=gn.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,s=r.to;return t==="all"?rn.create(e,rp(0,i,s),rp(e.content.size,i,s)):rn.create(e,rp(t,i,s),rp(t,i,s))}function iq(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Qj(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Y8e(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var X8e=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const a=()=>{(Qj()||iq())&&r.dom.focus(),Y8e()&&!Qj()&&!iq()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(s&&e===null&&!tde(n.state.selection))return a(),!0;const o=nde(i.doc,e)||n.state.selection,c=n.state.selection.eq(o);return s&&(c||i.setSelection(o),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},J8e=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),Z8e=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),rde=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&rde(r)}return e};function TS(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return rde(n)}function s1(e,t,n){if(e instanceof Af||e instanceof $e)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return $e.fromArray(e.map(o=>t.nodeFromJSON(o)));const a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",s),s1("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,o="";const c=new Kce({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(a=!0,o=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?pf.fromSchema(c).parseSlice(TS(e),n.parseOptions):pf.fromSchema(c).parse(TS(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const s=pf.fromSchema(t);return n.slice?s.parseSlice(TS(e),n.parseOptions).content:s.parse(TS(e),n.parseOptions)}return s1("",t,n)}function e7e(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof cs||i instanceof ds))return;const s=e.mapping.maps[r];let a=0;s.forEach((o,c,u,d)=>{a===0&&(a=d)}),e.setSelection(gn.near(e.doc.resolve(a),n))}var t7e=e=>!("type"in e),n7e=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let o;const c=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{s1(t,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){c(g)}try{o=s1(t,s.schema,{parseOptions:u,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(g){return c(g),!1}let{from:d,to:h}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},A=!0,f=!0;if((t7e(o)?o:[o]).forEach(g=>{g.check(),A=A?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),d===h&&f){const{parent:g}=r.doc.resolve(d);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(d-=1,h+=1)}let m;if(A){if(Array.isArray(t))m=t.map(g=>g.text||"").join("");else if(t instanceof $e){let g="";t.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof t=="object"&&t&&t.text?m=t.text:m=t;r.insertText(m,d,h)}else{m=o;const g=r.doc.resolve(d),y=g.node(),v=g.parentOffset===0,x=y.isText||y.isTextblock,b=y.content.size>0;v&&x&&b&&(d=Math.max(0,d-1)),r.replaceWith(d,h,m)}n.updateSelection&&e7e(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:m}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:m})}return!0},r7e=()=>({state:e,dispatch:t})=>_Qe(e,t),i7e=()=>({state:e,dispatch:t})=>jQe(e,t),s7e=()=>({state:e,dispatch:t})=>xQe(e,t),a7e=()=>({state:e,dispatch:t})=>SQe(e,t),o7e=()=>({state:e,dispatch:t,tr:n})=>{try{const r=ZE(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},l7e=()=>({state:e,dispatch:t,tr:n})=>{try{const r=ZE(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},c7e=()=>({state:e,dispatch:t})=>wQe(e,t),u7e=()=>({state:e,dispatch:t})=>bQe(e,t);function ide(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function d7e(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,s,a;for(let o=0;o<t.length-1;o+=1){const c=t[o];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))Qj()||ide()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var h7e=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=d7e(e).split(/-(?!$)/),a=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),o=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,o))});return c==null||c.steps.forEach(u=>{const d=u.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Ff(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,a=t?Di(t,e.schema):null,o=[];e.doc.nodesBetween(r,i,(h,A)=>{if(h.isText)return;const f=Math.max(r,A),p=Math.min(i,A+h.nodeSize);o.push({node:h,from:f,to:p})});const c=i-r,u=o.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>Hj(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,A)=>h+A.to-A.from,0)>=c}var f7e=(e,t={})=>({state:n,dispatch:r})=>{const i=Di(e,n.schema);return Ff(n,i,t)?BQe(n,r):!1},A7e=()=>({state:e,dispatch:t})=>IQe(e,t),p7e=e=>({state:t,dispatch:n})=>{const r=Di(e,t.schema);return HQe(r)(t,n)},m7e=()=>({state:e,dispatch:t})=>NQe(e,t);function o5(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function sq(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var g7e=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const o=o5(typeof e=="string"?e:e.name,r.schema);if(!o)return!1;o==="node"&&(s=Di(e,r.schema)),o==="mark"&&(a=Fd(e,r.schema));let c=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,h)=>{s&&s===d.type&&(c=!0,i&&n.setNodeMarkup(h,void 0,sq(d.attrs,t))),a&&d.marks.length&&d.marks.forEach(A=>{a===A.type&&(c=!0,i&&n.addMark(h,h+d.nodeSize,a.create(sq(A.attrs,t))))})})}),c},y7e=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),v7e=()=>({tr:e,dispatch:t})=>{if(t){const n=new jl(e.doc);e.setSelection(n)}return!0},x7e=()=>({state:e,dispatch:t})=>CQe(e,t),w7e=()=>({state:e,dispatch:t})=>kQe(e,t),b7e=()=>({state:e,dispatch:t})=>PQe(e,t),C7e=()=>({state:e,dispatch:t})=>MQe(e,t),S7e=()=>({state:e,dispatch:t})=>FQe(e,t);function wM(e,t,n={},r={}){return s1(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var k7e=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:a,commands:o})=>{const{doc:c}=s;if(r.preserveWhitespace!=="full"){const u=wM(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return a&&s.replaceWith(0,c.content.size,u).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),o.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function sde(e,t){const n=Fd(t,e.schema),{from:r,to:i,empty:s}=e.selection,a=[];s?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const o=a.find(c=>c.type.name===n.name);return o?{...o.attrs}:{}}function ade(e,t){const n=new lue(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function _7e(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function j7e(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function B7e(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function l5(e){return t=>B7e(t.$from,e)}function Ft(e,t,n){return e.config[t]===void 0&&e.parent?Ft(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Ft(e.parent,t,n):null}):e.config[t]}function mH(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Ft(t,"addExtensions",n);return r?[t,...mH(r())]:t}).flat(10)}function gH(e,t){const n=xm.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function ode(e){return typeof e=="function"}function Qn(e,t=void 0,...n){return ode(e)?t?e.bind(t)(...n):e(...n):e}function N7e(e={}){return Object.keys(e).length===0&&e.constructor===Object}function yv(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function lde(e){const t=[],{nodeExtensions:n,markExtensions:r}=yv(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(u=>u.name!=="text").map(u=>u.name),o=r.map(u=>u.name),c=[...a,...o];return e.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage,extensions:i},h=Ft(u,"addGlobalAttributes",d);if(!h)return;h().forEach(f=>{let p;Array.isArray(f.types)?p=f.types:f.types==="*"?p=c:f.types==="nodes"?p=a:f.types==="marks"?p=o:p=[],p.forEach(m=>{Object.entries(f.attributes).forEach(([g,y])=>{t.push({type:m,name:g,attribute:{...s,...y}})})})})}),i.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage},h=Ft(u,"addAttributes",d);if(!h)return;const A=h();Object.entries(A).forEach(([f,p])=>{const m={...s,...p};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,t.push({type:u.name,name:f,attribute:m})})}),t}function fi(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],u=o.filter(d=>!c.includes(d));r[i]=[...c,...u].join(" ")}else if(i==="style"){const o=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;c.forEach(d=>{const[h,A]=d.split(":").map(f=>f.trim());u.set(h,A)}),o.forEach(d=>{const[h,A]=d.split(":").map(f=>f.trim());u.set(h,A)}),r[i]=Array.from(u.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[i]=s}),r},{})}function a1(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>fi(n,r),{})}function E7e(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function aq(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((s,a)=>{const o=a.attribute.parseHTML?a.attribute.parseHTML(n):E7e(n.getAttribute(a.name));return o==null?s:{...s,[a.name]:o}},{});return{...r,...i}}}}function oq(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&N7e(n)?!1:n!=null))}function lq(e){var t,n;const r={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function T7e(e,t){var n;const r=lde(e),{nodeExtensions:i,markExtensions:s}=yv(e),a=(n=i.find(u=>Ft(u,"topNode")))==null?void 0:n.name,o=Object.fromEntries(i.map(u=>{const d=r.filter(y=>y.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},A=e.reduce((y,v)=>{const x=Ft(v,"extendNodeSchema",h);return{...y,...x?x(u):{}}},{}),f=oq({...A,content:Qn(Ft(u,"content",h)),marks:Qn(Ft(u,"marks",h)),group:Qn(Ft(u,"group",h)),inline:Qn(Ft(u,"inline",h)),atom:Qn(Ft(u,"atom",h)),selectable:Qn(Ft(u,"selectable",h)),draggable:Qn(Ft(u,"draggable",h)),code:Qn(Ft(u,"code",h)),whitespace:Qn(Ft(u,"whitespace",h)),linebreakReplacement:Qn(Ft(u,"linebreakReplacement",h)),defining:Qn(Ft(u,"defining",h)),isolating:Qn(Ft(u,"isolating",h)),attrs:Object.fromEntries(d.map(lq))}),p=Qn(Ft(u,"parseHTML",h));p&&(f.parseDOM=p.map(y=>aq(y,d)));const m=Ft(u,"renderHTML",h);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:a1(y,d)}));const g=Ft(u,"renderText",h);return g&&(f.toText=g),[u.name,f]})),c=Object.fromEntries(s.map(u=>{const d=r.filter(g=>g.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},A=e.reduce((g,y)=>{const v=Ft(y,"extendMarkSchema",h);return{...g,...v?v(u):{}}},{}),f=oq({...A,inclusive:Qn(Ft(u,"inclusive",h)),excludes:Qn(Ft(u,"excludes",h)),group:Qn(Ft(u,"group",h)),spanning:Qn(Ft(u,"spanning",h)),code:Qn(Ft(u,"code",h)),attrs:Object.fromEntries(d.map(lq))}),p=Qn(Ft(u,"parseHTML",h));p&&(f.parseDOM=p.map(g=>aq(g,d)));const m=Ft(u,"renderHTML",h);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:a1(g,d)})),[u.name,f]}));return new Kce({topNode:a,nodes:o,marks:c})}function I7e(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function zw(e){return e.sort((n,r)=>{const i=Ft(n,"priority")||100,s=Ft(r,"priority")||100;return i>s?-1:i<s?1:0})}function cde(e){const t=zw(mH(e)),n=I7e(t.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.`),t}function ude(e,t,n){const{from:r,to:i}=t,{blockSeparator:s=`

`,textSerializers:a={}}=n||{};let o="";return e.nodesBetween(r,i,(c,u,d,h)=>{var A;c.isBlock&&u>r&&(o+=s);const f=a==null?void 0:a[c.type.name];if(f)return d&&(o+=f({node:c,pos:u,parent:d,index:h,range:t})),!1;c.isText&&(o+=(A=c==null?void 0:c.text)==null?void 0:A.slice(Math.max(r,u)-u,i-u))}),o}function P7e(e,t){const n={from:0,to:e.content.size};return ude(e,n,t)}function dde(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function O7e(e,t){const n=Di(t,e.schema),{from:r,to:i}=e.selection,s=[];e.doc.nodesBetween(r,i,o=>{s.push(o)});const a=s.reverse().find(o=>o.type.name===n.name);return a?{...a.attrs}:{}}function hde(e,t){const n=o5(typeof t=="string"?t:t.name,e.schema);return n==="node"?O7e(e,t):n==="mark"?sde(e,t):{}}function F7e(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function M7e(e){const t=F7e(e);return t.length===1?t:t.filter((n,r)=>!t.filter((s,a)=>a!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function fde(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((o,c)=>{a.push({from:o,to:c})});else{const{from:o,to:c}=n[s];if(o===void 0||c===void 0)return;a.push({from:o,to:c})}a.forEach(({from:o,to:c})=>{const u=t.slice(s).map(o,-1),d=t.slice(s).map(c),h=t.invert().map(u,-1),A=t.invert().map(d);r.push({oldRange:{from:h,to:A},newRange:{from:u,to:d}})})}),M7e(r)}function yH(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const s=n.resolve(e),a=pH(s,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}var L7e=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let s=r,a=null;for(;s>0&&a===null;){const o=i.node(s);(o==null?void 0:o.type.name)===t?a=o:s-=1}return[a,s]};function kx(e,t){return t.nodes[e]||t.marks[e]||null}function h_(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(s=>s.type===t&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var R7e=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,s,a,o)=>{var c,u;const d=((u=(c=i.type.spec).toText)==null?void 0:u.call(c,{node:i,pos:s,parent:a,index:o}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function bM(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?Fd(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Hj(h.attrs,n,{strict:!1}));let a=0;const o=[];if(i.forEach(({$from:h,$to:A})=>{const f=h.pos,p=A.pos;e.doc.nodesBetween(f,p,(m,g)=>{if(s&&m.inlineContent&&!m.type.allowsMarkType(s))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),v=Math.min(p,g+m.nodeSize),x=v-y;a+=x,o.push(...m.marks.map(b=>({mark:b,from:y,to:v})))})}),a===0)return!1;const c=o.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Hj(h.mark.attrs,n,{strict:!1})).reduce((h,A)=>h+A.to-A.from,0),u=o.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,A)=>h+A.to-A.from,0);return(c>0?c+u:c)>=a}function D7e(e,t,n={}){if(!t)return Ff(e,null,n)||bM(e,null,n);const r=o5(t,e.schema);return r==="node"?Ff(e,t,n):r==="mark"?bM(e,t,n):!1}var U7e=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const s=l5(o=>o.type.name===t)(e.selection);if(!s)return!1;const a=e.doc.resolve(s.pos+1);return i.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},H7e=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function cq(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function uq(e,t){const{nodeExtensions:n}=yv(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=Qn(Ft(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function c5(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(s=>{i!==!1&&(c5(s,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function Ade(e){return e instanceof Qt}var pde=class mde{constructor(t){this.position=t}static fromJSON(t){return new mde(t.position)}toJSON(){return{position:this.position}}};function Q7e(e,t){const n=t.mapping.mapResult(e.position);return{position:new pde(n.pos),mapResult:n}}function $7e(e){return new pde(e)}function z7e(e,t,n){var r;const{selection:i}=t;let s=null;if(tde(i)&&(s=i.$cursor),s){const o=(r=e.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(o)||!o.some(u=>u.type.excludes(n)))}const{ranges:a}=i;return a.some(({$from:o,$to:c})=>{let u=o.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(o.pos,c.pos,(d,h,A)=>{if(u)return!1;if(d.isInline){const f=!A||A.type.allowsMarkType(n),p=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));u=f&&p}return!u}),u})}var V7e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:o}=s,c=Fd(e,r.schema);if(i)if(a){const u=sde(r,c);n.addStoredMark(c.create({...u,...t}))}else o.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(A,f)=>{const p=Math.max(f,d),m=Math.min(f+A.nodeSize,h);A.marks.find(y=>y.type===c)?A.marks.forEach(y=>{c===y.type&&n.addMark(p,m,c.create({...y.attrs,...t}))}):n.addMark(p,m,c.create(t))})});return z7e(r,n,c)},K7e=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),q7e=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=Di(e,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:o})=>CK(s,{...a,...t})(n)?!0:o.clearNodes()).command(({state:o})=>CK(s,{...a,...t})(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},W7e=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=rp(e,0,r.content.size),s=Qt.create(r,i);t.setSelection(s)}return!0},G7e=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let a,o;return typeof t=="number"?(a=t,o=t):t&&"from"in t&&"to"in t?(a=t.from,o=t.to):(a=s.from,o=s.to),i&&n.doc.nodesBetween(a,o,(c,u)=>{c.isText||n.setNodeMarkup(u,void 0,{...c.attrs,dir:e})}),!0},Y7e=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:s}=typeof e=="number"?{from:e,to:e}:e,a=rn.atStart(r).from,o=rn.atEnd(r).to,c=rp(i,a,o),u=rp(s,a,o),d=rn.create(r,c,u);t.setSelection(d)}return!0},X7e=e=>({state:t,dispatch:n})=>{const r=Di(e,t.schema);return zQe(r)(t,n)};function dq(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}var J7e=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=t,{$from:o,$to:c}=s,u=i.extensionManager.attributes,d=h_(u,o.node().type.name,o.node().attrs);if(s instanceof Qt&&s.node.isBlock)return!o.parentOffset||!jy(a,o.pos)?!1:(r&&(e&&dq(n,i.extensionManager.splittableMarks),t.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const h=c.parentOffset===c.parent.content.size,A=o.depth===0?void 0:_7e(o.node(-1).contentMatchAt(o.indexAfter(-1)));let f=h&&A?[{type:A,attrs:d}]:void 0,p=jy(t.doc,t.mapping.map(o.pos),1,f);if(!f&&!p&&jy(t.doc,t.mapping.map(o.pos),1,A?[{type:A}]:void 0)&&(p=!0,f=A?[{type:A,attrs:d}]:void 0),r){if(p&&(s instanceof rn&&t.deleteSelection(),t.split(t.mapping.map(o.pos),1,f),A&&!h&&!o.parentOffset&&o.parent.type!==A)){const m=t.mapping.map(o.before()),g=t.doc.resolve(m);o.node(-1).canReplaceWith(g.index(),g.index()+1,A)&&t.setNodeMarkup(t.mapping.map(o.before()),A)}e&&dq(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},Z7e=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var a;const o=Di(e,r.schema),{$from:c,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||c.depth<2||!c.sameParent(u))return!1;const h=c.node(-1);if(h.type!==o)return!1;const A=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==o||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let y=$e.empty;const v=c.index(-1)?1:c.index(-2)?2:3;for(let B=c.depth-v;B>=c.depth-3;B-=1)y=$e.from(c.node(B).copy(y));const x=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...h_(A,c.node().type.name,c.node().attrs),...t},w=((a=o.contentMatch.defaultType)==null?void 0:a.createAndFill(b))||void 0;y=y.append($e.from(o.createAndFill(null,w)||void 0));const k=c.before(c.depth-(v-1));n.replace(k,c.after(-x),new ct(y,4-v,0));let j=-1;n.doc.nodesBetween(k,n.doc.content.size,(B,E)=>{if(j>-1)return!1;B.isTextblock&&B.content.size===0&&(j=E+1)}),j>-1&&n.setSelection(rn.near(n.doc.resolve(j))),n.scrollIntoView()}return!0}const f=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,p={...h_(A,h.type.name,h.attrs),...t},m={...h_(A,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,u.pos);const g=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!jy(n.doc,c.pos,2))return!1;if(i){const{selection:y,storedMarks:v}=r,{splittableMarks:x}=s.extensionManager,b=v||y.$to.parentOffset&&y.$from.marks();if(n.split(c.pos,2,g).scrollIntoView(),!b||!i)return!0;const w=b.filter(k=>x.includes(k.type.name));n.ensureMarks(w)}return!0},ZP=(e,t)=>{const n=l5(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Xf(e.doc,n.pos)&&e.join(n.pos),!0},e4=(e,t)=>{const n=l5(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Xf(e.doc,r)&&e.join(r),!0},eze=(e,t,n,r={})=>({editor:i,tr:s,state:a,dispatch:o,chain:c,commands:u,can:d})=>{const{extensions:h,splittableMarks:A}=i.extensionManager,f=Di(e,a.schema),p=Di(t,a.schema),{selection:m,storedMarks:g}=a,{$from:y,$to:v}=m,x=y.blockRange(v),b=g||m.$to.parentOffset&&m.$from.marks();if(!x)return!1;const w=l5(k=>uq(k.type.name,h))(m);if(x.depth>=1&&w&&x.depth-w.depth<=1){if(w.node.type===f)return u.liftListItem(p);if(uq(w.node.type.name,h)&&f.validContent(w.node.content)&&o)return c().command(()=>(s.setNodeMarkup(w.pos,f),!0)).command(()=>ZP(s,f)).command(()=>e4(s,f)).run()}return!n||!b||!o?c().command(()=>d().wrapInList(f,r)?!0:u.clearNodes()).wrapInList(f,r).command(()=>ZP(s,f)).command(()=>e4(s,f)).run():c().command(()=>{const k=d().wrapInList(f,r),j=b.filter(B=>A.includes(B.type.name));return s.ensureMarks(j),k?!0:u.clearNodes()}).wrapInList(f,r).command(()=>ZP(s,f)).command(()=>e4(s,f)).run()},tze=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=Fd(e,r.schema);return bM(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,t)},nze=(e,t,n={})=>({state:r,commands:i})=>{const s=Di(e,r.schema),a=Di(t,r.schema),o=Ff(r,s,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),o?i.setNode(a,c):i.setNode(s,{...c,...n})},rze=(e,t={})=>({state:n,commands:r})=>{const i=Di(e,n.schema);return Ff(n,i,t)?r.lift(i):r.wrapIn(i,t)},ize=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const a=e.tr,o=s.transform;for(let c=o.steps.length-1;c>=0;c-=1)a.step(o.steps[c].invert(o.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,e.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},sze=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(s=>{e.removeMark(s.$from.pos,s.$to.pos)}),!0},aze=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,c=Fd(e,r.schema),{$from:u,empty:d,ranges:h}=o;if(!i)return!0;if(d&&a){let{from:A,to:f}=o;const p=(s=u.marks().find(g=>g.type===c))==null?void 0:s.attrs,m=pH(u,c,p);m&&(A=m.from,f=m.to),n.removeMark(A,f,c)}else h.forEach(A=>{n.removeMark(A.$from.pos,A.$to.pos,c)});return n.removeStoredMark(c),!0},oze=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let s,a;return typeof e=="number"?(s=e,a=e):e&&"from"in e&&"to"in e?(s=e.from,a=e.to):(s=i.from,a=i.to),r&&t.doc.nodesBetween(s,a,(o,c)=>{if(o.isText)return;const u={...o.attrs};delete u.dir,t.setNodeMarkup(c,void 0,u)}),!0},lze=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const o=o5(typeof e=="string"?e:e.name,r.schema);if(!o)return!1;o==="node"&&(s=Di(e,r.schema)),o==="mark"&&(a=Fd(e,r.schema));let c=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;let A,f,p,m;n.selection.empty?r.doc.nodesBetween(d,h,(g,y)=>{s&&s===g.type&&(c=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,h),A=y,f=g)}):r.doc.nodesBetween(d,h,(g,y)=>{y<d&&s&&s===g.type&&(c=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,h),A=y,f=g),y>=d&&y<=h&&(s&&s===g.type&&(c=!0,i&&n.setNodeMarkup(y,void 0,{...g.attrs,...t})),a&&g.marks.length&&g.marks.forEach(v=>{if(a===v.type&&(c=!0,i)){const x=Math.max(y,d),b=Math.min(y+g.nodeSize,h);n.addMark(x,b,a.create({...v.attrs,...t}))}}))}),f&&(A!==void 0&&i&&n.setNodeMarkup(A,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(g=>{a===g.type&&i&&n.addMark(p,m,a.create({...g.attrs,...t}))}))}),c},cze=(e,t={})=>({state:n,dispatch:r})=>{const i=Di(e,n.schema);return LQe(i,t)(n,r)},uze=(e,t={})=>({state:n,dispatch:r})=>{const i=Di(e,n.schema);return RQe(i,t)(n,r)},dze=class{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}once(t,n){const r=(...i)=>{this.off(t,r),n.apply(this,i)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}},u5=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},hze=(e,t)=>{if(AH(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,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 IS(e){var t;const{editor:n,from:r,to:i,text:s,rules:a,plugin:o}=e,{view:c}=n;if(c.composing)return!1;const u=c.state.doc.resolve(r);if(u.parent.type.spec.code||(t=u.nodeBefore||u.nodeAfter)!=null&&t.marks.find(A=>A.type.spec.code))return!1;let d=!1;const h=R7e(u)+s;return a.forEach(A=>{if(d)return;const f=hze(h,A.find);if(!f)return;const p=c.state.tr,m=s5({state:c.state,transaction:p}),g={from:r-(f[0].length-s.length),to:i},{commands:y,chain:v,can:x}=new a5({editor:n,state:m});A.handler({state:m,range:g,match:f,commands:y,chain:v,can:x})===null||!p.steps.length||(A.undoable&&p.setMeta(o,{transform:p,from:r,to:i,text:s}),c.dispatch(p),d=!0)}),d}function fze(e){const{editor:t,rules:n}=e,r=new ti({state:{init(){return null},apply(i,s,a){const o=i.getMeta(r);if(o)return o;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=gH($e.from(d),a.schema);const{from:h}=c,A=h+d.length;IS({editor:t,from:h,to:A,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,o){return IS({editor:t,from:s,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&IS({editor:t,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?IS({editor:t,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Aze(e){return Object.prototype.toString.call(e).slice(8,-1)}function PS(e){return Aze(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function gde(e,t){const n={...e};return PS(e)&&PS(t)&&Object.keys(t).forEach(r=>{PS(t[r])&&PS(e[r])?n[r]=gde(e[r],t[r]):n[r]=t[r]}),n}var vH=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Qn(Ft(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Qn(Ft(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>gde(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},wm=class yde extends vH{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new yde(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const c=a.find(u=>(u==null?void 0:u.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function pze(e){return typeof e=="number"}var vde=class{constructor(e){this.find=e.find,this.handler=e.handler}},mze=(e,t,n)=>{if(AH(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=e,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function gze(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:a,dropEvent:o}=e,{commands:c,chain:u,can:d}=new a5({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(f,p)=>{var m,g,y,v,x;if((g=(m=f.type)==null?void 0:m.spec)!=null&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const b=(x=(v=(y=f.content)==null?void 0:y.size)!=null?v:f.nodeSize)!=null?x:0,w=Math.max(r,p),k=Math.min(i,p+b);if(w>=k)return;const j=f.isText?f.text||"":f.textBetween(w-p,k-p,void 0,"");mze(j,s.find,a).forEach(E=>{if(E.index===void 0)return;const P=w+E.index+1,T=P+E[0].length,N={from:n.tr.mapping.map(P),to:n.tr.mapping.map(T)},F=s.handler({state:n,range:N,match:E,commands:c,chain:u,can:d,pasteEvent:a,dropEvent:o});h.push(F)})}),h.every(f=>f!==null)}var OS=null,yze=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function vze(e){const{editor:t,rules:n}=e;let r=null,i=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,o;try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}const c=({state:d,from:h,to:A,rule:f,pasteEvt:p})=>{const m=d.tr,g=s5({state:d,transaction:m});if(!(!gze({editor:t,state:g,from:Math.max(h-1,0),to:A.b-1,rule:f,pasteEvent:p,dropEvent:o})||!m.steps.length)){try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new ti({view(h){const A=p=>{var m;r=(m=h.dom.parentElement)!=null&&m.contains(p.target)?h.dom.parentElement:null,r&&(OS=t)},f=()=>{OS&&(OS=null)};return window.addEventListener("dragstart",A),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",A),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(h,A)=>{if(s=r===h.dom.parentElement,o=A,!s){const f=OS;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(h,A)=>{var f;const p=(f=A.clipboardData)==null?void 0:f.getData("text/html");return a=A,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(h,A,f)=>{const p=h[0],m=p.getMeta("uiEvent")==="paste"&&!i,g=p.getMeta("uiEvent")==="drop"&&!s,y=p.getMeta("applyPasteRules"),v=!!y;if(!m&&!g&&!v)return;if(v){let{text:w}=y;typeof w=="string"?w=w:w=gH($e.from(w),f.schema);const{from:k}=y,j=k+w.length,B=yze(w);return c({rule:d,state:f,from:k,to:{b:j},pasteEvt:B})}const x=A.doc.content.findDiffStart(f.doc.content),b=A.doc.content.findDiffEnd(f.doc.content);if(!(!pze(x)||!b||x===b.b))return c({rule:d,state:f,from:x,to:b,pasteEvt:a})}}))}var d5=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=cde(e),this.schema=T7e(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:kx(t.name,this.schema)},r=Ft(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return zw([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:kx(r.name,this.schema)},s=[],a=Ft(r,"addKeyboardShortcuts",i);let o={};if(r.type==="mark"&&Ft(r,"exitable",i)&&(o.ArrowRight=()=>wm.handleExit({editor:e,mark:r})),a){const A=Object.fromEntries(Object.entries(a()).map(([f,p])=>[f,()=>p({editor:e})]));o={...o,...A}}const c=O8e(o);s.push(c);const u=Ft(r,"addInputRules",i);if(cq(r,e.options.enableInputRules)&&u){const A=u();if(A&&A.length){const f=fze({editor:e,rules:A}),p=Array.isArray(f)?f:[f];s.push(...p)}}const d=Ft(r,"addPasteRules",i);if(cq(r,e.options.enablePasteRules)&&d){const A=d();if(A&&A.length){const f=vze({editor:e,rules:A});s.push(...f)}}const h=Ft(r,"addProseMirrorPlugins",i);if(h){const A=h();s.push(...A)}return s})}get attributes(){return lde(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=yv(this.extensions);return Object.fromEntries(t.filter(n=>!!Ft(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Di(n.name,this.schema)},s=Ft(n,"addNodeView",i);if(!s)return[];const a=s();if(!a)return[];const o=(c,u,d,h,A)=>{const f=a1(c,r);return a({node:c,view:u,getPos:d,decorations:h,innerDecorations:A,editor:e,extension:n,HTMLAttributes:f})};return[n.name,o]}))}dispatchTransaction(e){const{editor:t}=this;return zw([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:kx(i.name,this.schema)},a=Ft(i,"dispatchTransaction",s);return a?o=>{a.call(s,{transaction:o,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return zw([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:kx(i.name,this.schema)},a=Ft(i,"transformPastedHTML",s);return a?(o,c)=>{const u=r(o,c);return a.call(s,u)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=yv(this.extensions);return Object.fromEntries(t.filter(n=>!!Ft(n,"addMarkView")).map(n=>{const r=this.attributes.filter(o=>o.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Fd(n.name,this.schema)},s=Ft(n,"addMarkView",i);if(!s)return[];const a=(o,c,u)=>{const d=a1(o,r);return s()({mark:o,view:c,inline:u,editor:e,extension:n,HTMLAttributes:d,updateAttributes:h=>{Pze(o,e,h)}})};return[n.name,a]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:kx(t.name,this.schema)};t.type==="mark"&&((n=Qn(Ft(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const i=Ft(t,"onBeforeCreate",r),s=Ft(t,"onCreate",r),a=Ft(t,"onUpdate",r),o=Ft(t,"onSelectionUpdate",r),c=Ft(t,"onTransaction",r),u=Ft(t,"onFocus",r),d=Ft(t,"onBlur",r),h=Ft(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),o&&this.editor.on("selectionUpdate",o),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};d5.resolve=cde;d5.sort=zw;d5.flatten=mH;var xze={};fH(xze,{ClipboardTextSerializer:()=>wde,Commands:()=>bde,Delete:()=>Cde,Drop:()=>Sde,Editable:()=>kde,FocusEvents:()=>jde,Keymap:()=>Bde,Paste:()=>Nde,Tabindex:()=>Ede,TextDirection:()=>Tde,focusEventsPluginKey:()=>_de});var _i=class xde extends vH{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new xde(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},wde=_i.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ti({key:new es("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),o=Math.max(...s.map(d=>d.$to.pos)),c=dde(n);return ude(r,{from:a,to:o},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),bde=_i.create({name:"commands",addCommands(){return{...Zue}}}),Cde=_i.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var a,o,c,u;if((u=(c=(o=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:o.filterTransaction)==null?void 0:c.call(o,e))!=null?u:e.getMeta("y-sync$"))return;const d=ade(e.before,[e,...t]);fde(d).forEach(f=>{d.mapping.mapResult(f.oldRange.from).deletedAfter&&d.mapping.mapResult(f.oldRange.to).deletedBefore&&d.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=f.oldRange.from<=m&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:d.mapping.map(m),newTo:d.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:e,combinedTransform:d})})});const A=d.mapping;d.steps.forEach((f,p)=>{var m,g;if(f instanceof Ac){const y=A.slice(p).map(f.from,-1),v=A.slice(p).map(f.to),x=A.invert().map(y,-1),b=A.invert().map(v),w=(m=d.doc.nodeAt(y-1))==null?void 0:m.marks.some(j=>j.eq(f.mark)),k=(g=d.doc.nodeAt(v))==null?void 0:g.marks.some(j=>j.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:x,to:b},newRange:{from:y,to:v},partial:!!(k||w),editor:this.editor,transaction:e,combinedTransform:d})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),Sde=_i.create({name:"drop",addProseMirrorPlugins(){return[new ti({key:new es("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),kde=_i.create({name:"editable",addProseMirrorPlugins(){return[new ti({key:new es("editable"),props:{editable:()=>this.editor.options.editable}})]}}),_de=new es("focusEvents"),jde=_i.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new ti({key:_de,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Bde=_i.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:o})=>{const{selection:c,doc:u}=o,{empty:d,$anchor:h}=c,{pos:A,parent:f}=h,p=h.parent.isTextblock&&A>0?o.doc.resolve(A-1):h,m=p.parent.type.spec.isolating,g=h.pos-h.parentOffset,y=m&&p.parent.childCount===1?g===h.pos:gn.atStart(u).from===A;return!d||!f.type.isTextblock||f.textContent.length||!y||y&&h.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Qj()||ide()?s:i},addProseMirrorPlugins(){return[new ti({key:new es("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(m=>m.getMeta("composition")))return;const r=e.some(m=>m.docChanged)&&!t.doc.eq(n.doc),i=e.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:o}=t.selection,c=gn.atStart(t.doc).from,u=gn.atEnd(t.doc).to;if(s||!(a===c&&o===u)||!c5(n.doc))return;const A=n.tr,f=s5({state:n,transaction:A}),{commands:p}=new a5({editor:this.editor,state:f});if(p.clearNodes(),!!A.steps.length)return A}})]}}),Nde=_i.create({name:"paste",addProseMirrorPlugins(){return[new ti({key:new es("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Ede=_i.create({name:"tabindex",addProseMirrorPlugins(){return[new ti({key:new es("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Tde=_i.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=yv(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new ti({key:new es("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),wze=class ow{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}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 t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){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},t)}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 t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new ow(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new ow(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new ow(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=n.isInline,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(o);if(!i&&!a&&c.depth<=this.depth)return;const u=new ow(c,this.editor,i,i||a?n:null);i&&(u.actualDepth=this.depth+1),t.push(u)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const s=i.node.attrs,a=Object.keys(n);for(let o=0;o<a.length;o+=1){const c=a[o];if(s[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(a=>{r&&i.length>0||(a.node.type.name===t&&s.every(c=>n[c]===a.node.attrs[c])&&i.push(a),!(r&&i.length>0)&&(i=i.concat(a.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},bze=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`;function Cze(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var Sze=class extends dze{constructor(e={}){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:Q7e,createMappablePosition:$7e},this.setOptions(e),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:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=nde(t,this.options.autofocus);this.editorState=sy.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){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(e),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 e=this.editorView.dom;e!=null&&e.editor&&delete e.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(e){console.warn("Failed to remove CSS element:",e)}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=Cze(bze,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=ode(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(a=>!a.key.startsWith(s))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const r=[...this.options.enableCoreExtensions?[kde,wde.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),bde,jde,Bde,Ede,Sde,Nde,Cde,Tde.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new d5(r,this)}createCommandManager(){this.commandManager=new a5({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=wM(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,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()}}),e=wM(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=t.transformPastedHTML,a=this.extensionManager.transformPastedHTML(s);this.editorView=new Xue(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS();const c=this.view.dom;c.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(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(u)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const a=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),o=a==null?void 0:a.getMeta("focus"),c=a==null?void 0:a.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:a}),c&&this.emit("blur",{editor:this,event:c.event,transaction:a}),!(e.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||s.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return hde(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return D7e(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gH(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`

`,textSerializers:n={}}=e||{};return P7e(this.state.doc,{blockSeparator:t,textSerializers:{...dde(this.schema),...n}})}get isEmpty(){return c5(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new wze(t,this)}get $doc(){return this.$pos(0)}};function vv(e){return new u5({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Qn(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=t,a=r[r.length-1],o=r[0];if(a){const c=o.search(/\S/),u=n.from+o.indexOf(a),d=u+a.length;if(yH(n.from,n.to,t.doc).filter(f=>f.mark.type.excluded.find(m=>m===e.type&&m!==f.mark.type)).filter(f=>f.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+c,u);const A=n.from+c+a.length;s.addMark(n.from+c,A,e.type.create(i||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function Ide(e){return new u5({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Qn(e.getAttributes,void 0,r)||{},{tr:s}=t,a=n.from;let o=n.to;const c=e.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=a+u;d>o?d=o:o=d+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,a+r[0].length-1),s.replaceWith(d,o,c)}else if(r[0]){const u=e.type.isInline?a:a-1;s.insert(u,e.type.create(i)).delete(s.mapping.map(a),s.mapping.map(o))}s.scrollIntoView()},undoable:e.undoable})}function CM(e){return new u5({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),s=Qn(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,s)},undoable:e.undoable})}function xv(e){return new u5({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const s=Qn(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),c=a.doc.resolve(n.from).blockRange(),u=c&&eH(c,e.type,s);if(!u)return null;if(a.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:A}=t,{splittableMarks:f}=e.editor.extensionManager,p=A||h.$to.parentOffset&&h.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));a.ensureMarks(m)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,s).run()}const d=a.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&Xf(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&a.join(n.from-1)},undoable:e.undoable})}var kze=e=>"touches"in e,_ze=class{constructor(e){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.clientX-this.startX,u=o.clientY-this.startY;this.handleResize(c,u)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.touches[0];if(!c)return;const u=c.clientX-this.startX,d=c.clientY-this.startY;this.handleResize(u,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,c=this.element.offsetHeight;this.onCommit(o,c),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var t,n,r,i,s,a;this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(t=e.options)!=null&&t.min&&(this.minSize={...this.minSize,...e.options.min}),(n=e.options)!=null&&n.max&&(this.maxSize=e.options.max),(r=e==null?void 0:e.options)!=null&&r.directions&&(this.directions=e.options.directions),(i=e.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(s=e.options)!=null&&s.className&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(a=e.options)!=null&&a.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var e;return(e=this.contentElement)!=null?e:null}handleEditorUpdate(){const e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type!==this.node.type?!1:(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display="flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){const e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){const t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){const n=t.includes("top"),r=t.includes("bottom"),i=t.includes("left"),s=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),i&&(e.style.left="0"),s&&(e.style.right="0"),(t==="top"||t==="bottom")&&(e.style.left="0",e.style.right="0"),(t==="left"||t==="right")&&(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach(e=>{let t;this.createCustomHandle?t=this.createCustomHandle(e):t=this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",n=>this.handleResizeStart(n,e)),t.addEventListener("touchstart",n=>this.handleResizeStart(n,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){const e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,kze(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),s=this.applyConstraints(r,i,n);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight;const s=e.includes("right"),a=e.includes("left"),o=e.includes("bottom"),c=e.includes("top");return s?r=this.startWidth+t:a&&(r=this.startWidth-t),o?i=this.startHeight+n:c&&(i=this.startHeight-n),(e==="right"||e==="left")&&(r=this.startWidth+(s?t:-t)),(e==="top"||e==="bottom")&&(i=this.startHeight+(o?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){var r,i,s,a;if(!n){let u=Math.max(this.minSize.width,e),d=Math.max(this.minSize.height,t);return(r=this.maxSize)!=null&&r.width&&(u=Math.min(this.maxSize.width,u)),(i=this.maxSize)!=null&&i.height&&(d=Math.min(this.maxSize.height,d)),{width:u,height:d}}let o=e,c=t;return o<this.minSize.width&&(o=this.minSize.width,c=o/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,o=c*this.aspectRatio),(s=this.maxSize)!=null&&s.width&&o>this.maxSize.width&&(o=this.maxSize.width,c=o/this.aspectRatio),(a=this.maxSize)!=null&&a.height&&c>this.maxSize.height&&(c=this.maxSize.height,o=c*this.aspectRatio),{width:o,height:c}}applyAspectRatio(e,t,n){const r=n==="left"||n==="right",i=n==="top"||n==="bottom";return r?{width:e,height:e/this.aspectRatio}:i?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function jze(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof Qt){const s=r.index();return r.parent.canReplaceWith(s,s+1,t)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(t))return!0;i-=1}return!1}var Bze={};fH(Bze,{createAtomBlockMarkdownSpec:()=>Pde,createBlockMarkdownSpec:()=>Nze,createInlineMarkdownSpec:()=>Ize,parseAttributes:()=>xH,parseIndentedBlocks:()=>SM,renderNestedMarkdownContent:()=>bH,serializeAttributes:()=>wH});function xH(e){if(!(e!=null&&e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const u=i.map(d=>d.trim().slice(1));t.class=u.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,u,d])=>{var h;const A=parseInt(((h=d.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),f=n[A];f&&(t[u]=f.slice(1,-1))});const c=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 c&&c.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(t[d]=!0)}),t}function wH(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function Pde(e){const{nodeName:t,name:n,parseAttributes:r=xH,serializeAttributes:i=wH,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:o}=e,c=n||t,u=d=>{if(!o)return d;const h={};return o.forEach(A=>{A in d&&(h[A]=d[A])}),h};return{parseMarkdown:(d,h)=>{const A={...s,...d.attributes};return h.createNode(t,A,[])},markdownTokenizer:{name:t,level:"block",start(d){var h;const A=new RegExp(`^:::${c}(?:\\s|$)`,"m"),f=(h=d.match(A))==null?void 0:h.index;return f!==void 0?f:-1},tokenize(d,h,A){const f=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=d.match(f);if(!p)return;const m=p[1]||"",g=r(m);if(!a.find(v=>!(v in g)))return{type:t,raw:p[0],attributes:g}}},renderMarkdown:d=>{const h=u(d.attrs||{}),A=i(h),f=A?` {${A}}`:"";return`:::${c}${f} :::`}}}function Nze(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=xH,serializeAttributes:s=wH,defaultAttributes:a={},content:o="block",allowedAttributes:c}=e,u=n||t,d=h=>{if(!c)return h;const A={};return c.forEach(f=>{f in h&&(A[f]=h[f])}),A};return{parseMarkdown:(h,A)=>{let f;if(r){const m=r(h);f=typeof m=="string"?[{type:"text",text:m}]:m}else o==="block"?f=A.parseChildren(h.tokens||[]):f=A.parseInline(h.tokens||[]);const p={...a,...h.attributes};return A.createNode(t,p,f)},markdownTokenizer:{name:t,level:"block",start(h){var A;const f=new RegExp(`^:::${u}`,"m"),p=(A=h.match(f))==null?void 0:A.index;return p!==void 0?p:-1},tokenize(h,A,f){var p;const m=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=h.match(m);if(!g)return;const[y,v=""]=g,x=i(v);let b=1;const w=y.length;let k="";const j=/^:::([\w-]*)(\s.*)?/gm,B=h.slice(w);for(j.lastIndex=0;;){const E=j.exec(B);if(E===null)break;const P=E.index,T=E[1];if(!((p=E[2])!=null&&p.endsWith(":::"))){if(T)b+=1;else if(b-=1,b===0){const N=B.slice(0,P);k=N.trim();const F=h.slice(0,w+P+E[0].length);let L=[];if(k)if(o==="block")for(L=f.blockTokens(N),L.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=f.inlineTokens(U.text))});L.length>0;){const U=L[L.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))L.pop();else break}else L=f.inlineTokens(k);return{type:t,raw:F,attributes:x,content:k,tokens:L}}}}}},renderMarkdown:(h,A)=>{const f=d(h.attrs||{}),p=s(f),m=p?` {${p}}`:"",g=A.renderChildren(h.content||[],`

`);return`:::${u}${m}

${g}

:::`}}}function Eze(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,i,s,a]=r;t[i]=s||a,r=n.exec(e)}return t}function Tze(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function Ize(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=Eze,serializeAttributes:s=Tze,defaultAttributes:a={},selfClosing:o=!1,allowedAttributes:c}=e,u=n||t,d=A=>{if(!c)return A;const f={};return c.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in A){const y=A[m];if(g!==void 0&&y===g)return;f[m]=y}}),f},h=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(A,f)=>{const p={...a,...A.attributes};if(o)return f.createNode(t,p);const m=r?r(A):A.content||"";return m?f.createNode(t,p,[f.createTextNode(m)]):f.createNode(t,p,[])},markdownTokenizer:{name:t,level:"inline",start(A){const f=o?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),p=A.match(f),m=p==null?void 0:p.index;return m!==void 0?m:-1},tokenize(A,f,p){const m=o?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),g=A.match(m);if(!g)return;let y="",v="";if(o){const[,b]=g;v=b}else{const[,b,w]=g;v=b,y=w||""}const x=i(v.trim());return{type:t,raw:g[0],content:y.trim(),attributes:x}}},renderMarkdown:A=>{let f="";r?f=r(A):A.content&&A.content.length>0&&(f=A.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=d(A.attrs||{}),m=s(p),g=m?` ${m}`:"";return o?`[${u}${g}]`:`[${u}${g}]${f}[/${u}]`}}}function SM(e,t,n){var r,i,s,a;const o=e.split(`
`),c=[];let u="",d=0;const h=t.baseIndentSize||2;for(;d<o.length;){const A=o[d],f=A.match(t.itemPattern);if(!f){if(c.length>0)break;if(A.trim()===""){d+=1,u=`${u}${A}
`;continue}else return}const p=t.extractItemData(f),{indentLevel:m,mainContent:g}=p;u=`${u}${A}
`;const y=[g];for(d+=1;d<o.length;){const w=o[d];if(w.trim()===""){const j=o.slice(d+1).findIndex(P=>P.trim()!=="");if(j===-1)break;if((((i=(r=o[d+1+j].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>m){y.push(w),u=`${u}${w}
`,d+=1;continue}else break}if((((a=(s=w.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:a.length)||0)>m)y.push(w),u=`${u}${w}
`,d+=1;else break}let v;const x=y.slice(1);if(x.length>0){const w=x.map(k=>k.slice(m+h)).join(`
`);w.trim()&&(t.customNestedParser?v=t.customNestedParser(w):v=n.blockTokens(w))}const b=t.createToken(p,v);c.push(b)}if(c.length!==0)return{items:c,raw:u}}function bH(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[s,...a]=e.content,o=t.renderChildren([s]),c=[`${i}${o}`];return a&&a.length>0&&a.forEach(u=>{const d=t.renderChildren([u]);if(d){const h=d.split(`
`).map(A=>A?t.indent(A):"").join(`
`);c.push(h)}}),c.join(`
`)}function Pze(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,a=e;i.descendants((o,c)=>{const u=s.mapping.map(c),d=s.mapping.map(c)+o.nodeSize;let h=null;if(o.marks.forEach(f=>{if(f!==a)return!1;h=f}),!h)return;let A=!1;if(Object.keys(n).forEach(f=>{n[f]!==h.attrs[f]&&(A=!0)}),A){const f=e.type.create({...e.attrs,...n});s.removeMark(u,d,e.type),s.addMark(u,d,f)}}),s.docChanged&&t.view.dispatch(s)}var Fa=class Ode extends vH{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new Ode(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function rm(e){return new vde({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const s=Qn(e.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=t,o=r[r.length-1],c=r[0];let u=n.to;if(o){const d=c.search(/\S/),h=n.from+c.indexOf(o),A=h+o.length;if(yH(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(g=>g===e.type&&g!==p.mark.type)).filter(p=>p.to>h).length)return null;A<n.to&&a.delete(A,n.to),h>n.from&&a.delete(n.from+d,h),u=n.from+d+o.length,a.addMark(n.from+d,u,e.type.create(s||{})),a.removeStoredMark(e.type)}}})}function Oze(e){return new vde({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){const s=Qn(e.getAttributes,void 0,t,i),a=Qn(e.getContent,void 0,s);if(s===!1||s===null)return null;const o={type:e.type.name,attrs:s};a&&(o.content=a),t.input&&n().deleteRange(r).insertContentAt(r.from,o)}})}const{getOwnPropertyNames:Fze,getOwnPropertySymbols:Mze}=Object,{hasOwnProperty:Lze}=Object.prototype;function t4(e,t){return function(r,i,s){return e(r,i,s)&&t(r,i,s)}}function FS(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:s}=i,a=s.get(n),o=s.get(r);if(a&&o)return a===r&&o===n;s.set(n,r),s.set(r,n);const c=e(n,r,i);return s.delete(n),s.delete(r),c}}function Rze(e){return e!=null?e[Symbol.toStringTag]:void 0}function hq(e){return Fze(e).concat(Mze(e))}const Dze=Object.hasOwn||((e,t)=>Lze.call(e,t));function bm(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Uze="__v",Hze="__o",Qze="_owner",{getOwnPropertyDescriptor:fq,keys:Aq}=Object;function $ze(e,t){return e.byteLength===t.byteLength&&$j(new Uint8Array(e),new Uint8Array(t))}function zze(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Vze(e,t){return e.byteLength===t.byteLength&&$j(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Kze(e,t){return bm(e.getTime(),t.getTime())}function qze(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Wze(e,t){return e===t}function pq(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.entries();let a,o,c=0;for(;(a=s.next())&&!a.done;){const u=t.entries();let d=!1,h=0;for(;(o=u.next())&&!o.done;){if(i[h]){h++;continue}const A=a.value,f=o.value;if(n.equals(A[0],f[0],c,h,e,t,n)&&n.equals(A[1],f[1],A[0],f[0],e,t,n)){d=i[h]=!0;break}h++}if(!d)return!1;c++}return!0}const Gze=bm;function Yze(e,t,n){const r=Aq(e);let i=r.length;if(Aq(t).length!==i)return!1;for(;i-- >0;)if(!Fde(e,t,n,r[i]))return!1;return!0}function _x(e,t,n){const r=hq(e);let i=r.length;if(hq(t).length!==i)return!1;let s,a,o;for(;i-- >0;)if(s=r[i],!Fde(e,t,n,s)||(a=fq(e,s),o=fq(t,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function Xze(e,t){return bm(e.valueOf(),t.valueOf())}function Jze(e,t){return e.source===t.source&&e.flags===t.flags}function mq(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.values();let a,o;for(;(a=s.next())&&!a.done;){const c=t.values();let u=!1,d=0;for(;(o=c.next())&&!o.done;){if(!i[d]&&n.equals(a.value,o.value,a.value,o.value,e,t,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function $j(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Zze(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Fde(e,t,n,r){return(r===Qze||r===Hze||r===Uze)&&(e.$$typeof||t.$$typeof)?!0:Dze(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const e9e="[object ArrayBuffer]",t9e="[object Arguments]",n9e="[object Boolean]",r9e="[object DataView]",i9e="[object Date]",s9e="[object Error]",a9e="[object Map]",o9e="[object Number]",l9e="[object Object]",c9e="[object RegExp]",u9e="[object Set]",d9e="[object String]",h9e={"[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]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},f9e="[object URL]",A9e=Object.prototype.toString;function p9e({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:o,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:A,areUrlsEqual:f,unknownTagComparators:p}){return function(g,y,v){if(g===y)return!0;if(g==null||y==null)return!1;const x=typeof g;if(x!==typeof y)return!1;if(x!=="object")return x==="number"?o(g,y,v):x==="function"?s(g,y,v):!1;const b=g.constructor;if(b!==y.constructor)return!1;if(b===Object)return c(g,y,v);if(Array.isArray(g))return t(g,y,v);if(b===Date)return r(g,y,v);if(b===RegExp)return d(g,y,v);if(b===Map)return a(g,y,v);if(b===Set)return h(g,y,v);const w=A9e.call(g);if(w===i9e)return r(g,y,v);if(w===c9e)return d(g,y,v);if(w===a9e)return a(g,y,v);if(w===u9e)return h(g,y,v);if(w===l9e)return typeof g.then!="function"&&typeof y.then!="function"&&c(g,y,v);if(w===f9e)return f(g,y,v);if(w===s9e)return i(g,y,v);if(w===t9e)return c(g,y,v);if(h9e[w])return A(g,y,v);if(w===e9e)return e(g,y,v);if(w===r9e)return n(g,y,v);if(w===n9e||w===o9e||w===d9e)return u(g,y,v);if(p){let k=p[w];if(!k){const j=Rze(g);j&&(k=p[j])}if(k)return k(g,y,v)}return!1}}function m9e({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:$ze,areArraysEqual:n?_x:zze,areDataViewsEqual:Vze,areDatesEqual:Kze,areErrorsEqual:qze,areFunctionsEqual:Wze,areMapsEqual:n?t4(pq,_x):pq,areNumbersEqual:Gze,areObjectsEqual:n?_x:Yze,arePrimitiveWrappersEqual:Xze,areRegExpsEqual:Jze,areSetsEqual:n?t4(mq,_x):mq,areTypedArraysEqual:n?t4($j,_x):$j,areUrlsEqual:Zze,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=FS(r.areArraysEqual),s=FS(r.areMapsEqual),a=FS(r.areObjectsEqual),o=FS(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:o})}return r}function g9e(e){return function(t,n,r,i,s,a,o){return e(t,n,o)}}function y9e({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,c){const{cache:u=e?new WeakMap:void 0,meta:d}=n();return t(o,c,{cache:u,equals:r,meta:d,strict:i})};if(e)return function(o,c){return t(o,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(o,c){return t(o,c,s)}}const Mde=Zf();Zf({strict:!0});Zf({circular:!0});Zf({circular:!0,strict:!0});Zf({createInternalComparator:()=>bm});Zf({strict:!0,createInternalComparator:()=>bm});Zf({circular:!0,createInternalComparator:()=>bm});Zf({circular:!0,createInternalComparator:()=>bm,strict:!0});function Zf(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=m9e(e),a=p9e(s),o=n?n(a):g9e(a);return y9e({circular:t,comparator:a,createState:r,equals:o,strict:i})}var Lde={exports:{}},Rde={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var h5=C,v9e=X6;function x9e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var w9e=typeof Object.is=="function"?Object.is:x9e,b9e=v9e.useSyncExternalStore,C9e=h5.useRef,S9e=h5.useEffect,k9e=h5.useMemo,_9e=h5.useDebugValue;Rde.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=C9e(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=k9e(function(){function c(f){if(!u){if(u=!0,d=f,f=r(f),i!==void 0&&a.hasValue){var p=a.value;if(i(p,f))return h=p}return h=f}if(p=h,w9e(d,f))return p;var m=r(f);return i!==void 0&&i(p,m)?(d=f,p):(d=f,h=m)}var u=!1,d,h,A=n===void 0?null:n;return[function(){return c(t())},A===null?void 0:function(){return c(A())}]},[t,n,r,i]);var o=b9e(e,s[0],s[1]);return S9e(function(){a.hasValue=!0,a.value=o},[o]),_9e(o),o};Lde.exports=Rde;var j9e=Lde.exports,B9e=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},N9e=({contentComponent:e})=>{const t=X6.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return l.jsx(l.Fragment,{children:Object.values(t)})};function E9e(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:XD.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var T9e=class extends re.Component{constructor(e){var t;super(e),this.editorContentRef=re.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=e.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=E9e(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:B9e(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&l.jsx(N9e,{contentComponent:e.contentComponent})]})}},I9e=C.forwardRef((e,t)=>{const n=re.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return re.createElement(T9e,{key:n,innerRef:t,...e})}),Dde=re.memo(I9e),P9e=typeof window<"u"?C.useLayoutEffect:C.useEffect,O9e=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function F9e(e){var t;const[n]=C.useState(()=>new O9e(e.editor)),r=j9e.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:Mde);return P9e(()=>n.watch(e.editor),[e.editor,n]),C.useDebugValue(r),r}var M9e=!1,kM=typeof window>"u",L9e=kM||!!(typeof window<"u"&&window.next),R9e=class Ude{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return kM||L9e?null:this.createEditor();if(this.options.current.immediatelyRender&&kM&&M9e)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 t={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)}};return new Sze(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,s)=>{var a;return i===((a=n.extensions)==null?void 0:a[s])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?Ude.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function D9e(e={},t=[]){const n=C.useRef(e);n.current=e;const[r]=C.useState(()=>new R9e(n)),i=X6.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return C.useDebugValue(i),C.useEffect(r.onRender(t)),F9e({editor:i,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),i}var Hde=C.createContext({editor:null});Hde.Consumer;var U9e=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),H9e=()=>C.useContext(U9e);re.forwardRef((e,t)=>{const{onDragStart:n}=H9e(),r=e.as||"div";return l.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});re.createContext({markViewContentRef:()=>{}});var CH=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});CH.displayName="TiptapContext";var Q9e=()=>C.useContext(CH);function Qde({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=C.useMemo(()=>({editor:r}),[r]),s=C.useMemo(()=>({editor:r}),[r]);return l.jsx(Hde.Provider,{value:s,children:l.jsx(CH.Provider,{value:i,children:n})})}Qde.displayName="Tiptap";function $de({...e}){const{editor:t}=Q9e();return l.jsx(Dde,{editor:t,...e})}$de.displayName="Tiptap.Content";Object.assign(Qde,{Content:$de});var zj=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},$9e=/^\s*>\s$/,z9e=Fa.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return zj("blockquote",{...fi(this.options.HTMLAttributes,e),children:zj("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach(i=>{const o=t.renderChildren([i]).split(`
`).map(c=>c.trim()===""?n:`${n} ${c}`);r.push(o.join(`
`))}),r.join(`
${n}
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[xv({find:$9e,type:this.type})]}}),V9e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,K9e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,q9e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,W9e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,G9e=wm.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return zj("strong",{...fi(this.options.HTMLAttributes,e),children:zj("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[vv({find:V9e,type:this.type}),vv({find:q9e,type:this.type})]},addPasteRules(){return[rm({find:K9e,type:this.type}),rm({find:W9e,type:this.type})]}}),Y9e=/(^|[^`])`([^`]+)`(?!`)$/,X9e=/(^|[^`])`([^`]+)`(?!`)/g,J9e=wm.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",fi(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[vv({find:Y9e,type:this.type})]},addPasteRules(){return[rm({find:X9e,type:this.type})]}}),n4=4,Z9e=/^```([a-z]+)?[\s\n]$/,eVe=/^~~~([a-z]+)?[\s\n]$/,tVe=Fa.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:n4,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",fi(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
`):r=`\`\`\`${i}

\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:n4,{state:r}=e,{selection:i}=r,{$from:s,empty:a}=i;if(s.parent.type!==this.type)return!1;const o=" ".repeat(n);return a?e.commands.insertContent(o):e.commands.command(({tr:c})=>{const{from:u,to:d}=i,f=r.doc.textBetween(u,d,`
`,`
`).split(`
`).map(p=>o+p).join(`
`);return c.replaceWith(u,d,r.schema.text(f)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:n4,{state:r}=e,{selection:i}=r,{$from:s,empty:a}=i;return s.parent.type!==this.type?!1:a?e.commands.command(({tr:o})=>{var c;const{pos:u}=s,d=s.start(),h=s.end(),f=r.doc.textBetween(d,h,`
`,`
`).split(`
`);let p=0,m=0;const g=u-d;for(let k=0;k<f.length;k+=1){if(m+f[k].length>=g){p=k;break}m+=f[k].length+1}const v=((c=f[p].match(/^ */))==null?void 0:c[0])||"",x=Math.min(v.length,n);if(x===0)return!0;let b=d;for(let k=0;k<p;k+=1)b+=f[k].length+1;return o.delete(b,b+x),u-b<=x&&o.setSelection(rn.create(o.doc,b)),!0}):e.commands.command(({tr:o})=>{const{from:c,to:u}=i,A=r.doc.textBetween(c,u,`
`,`
`).split(`
`).map(f=>{var p;const m=((p=f.match(/^ */))==null?void 0:p[0])||"",g=Math.min(m.length,n);return f.slice(g)}).join(`
`);return o.replaceWith(c,u,r.schema.text(A)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`

`);return!s||!a?!1:e.chain().command(({tr:o})=>(o.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:u})=>(u.setSelection(gn.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[CM({find:Z9e,type:this.type,getAttributes:e=>({language:e[1]})}),CM({find:eVe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new ti({key:new es("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:o}=e.state,c=o.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:s},c)),a.selection.$from.parent.type!==this.type&&a.setSelection(rn.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),nVe=Fa.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`

`):""}),rVe=Fa.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",fi(this.options.HTMLAttributes,e)]},renderText(){return`
`},renderMarkdown:()=>`  
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&c&&a){const h=c.filter(A=>o.includes(A.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),iVe=Fa.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,fi(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>CM({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),sVe=Fa.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",fi(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!jze(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return Ade(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:o})=>{if(o){const{$to:c}=a.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(rn.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Qt.create(a.doc,c.pos)):a.setSelection(rn.create(a.doc,c.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,h=d==null?void 0:d.create();h&&(a.insert(u,h),a.setSelection(rn.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Ide({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),aVe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,oVe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,lVe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,cVe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,uVe=wm.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",fi(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[vv({find:aVe,type:this.type}),vv({find:lVe,type:this.type})]},addPasteRules(){return[rm({find:oVe,type:this.type}),rm({find:cVe,type:this.type})]}});const dVe="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",hVe="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",_M="numeric",jM="ascii",BM="alpha",Vw="asciinumeric",lw="alphanumeric",NM="domain",zde="emoji",fVe="scheme",AVe="slashscheme",r4="whitespace";function pVe(e,t){return e in t||(t[e]=[]),t[e]}function ip(e,t,n){t[_M]&&(t[Vw]=!0,t[lw]=!0),t[jM]&&(t[Vw]=!0,t[BM]=!0),t[Vw]&&(t[lw]=!0),t[BM]&&(t[lw]=!0),t[lw]&&(t[NM]=!0),t[zde]&&(t[NM]=!0);for(const r in t){const i=pVe(r,n);i.indexOf(e)<0&&i.push(e)}}function mVe(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Ga(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Ga.groups={};Ga.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],s=t.jr[r][1];if(s&&i.test(e))return s}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||Ga.groups;let i;return t&&t.j?i=t:(i=new Ga(t),n&&r&&ip(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const s=e.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(e[a]);return i.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||Ga.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const s=t;let a,o=i.go(e);if(o?(a=new Ga,Object.assign(a.j,o.j),a.jr.push.apply(a.jr,o.jr),a.jd=o.jd,a.t=o.t):a=new Ga,s){if(r)if(a.t&&typeof a.t=="string"){const c=Object.assign(mVe(a.t,r),n);ip(s,c,r)}else n&&ip(s,n,r);a.t=s}return i.j[e]=a,a}};const mn=(e,t,n,r,i)=>e.ta(t,n,r,i),si=(e,t,n,r,i)=>e.tr(t,n,r,i),gq=(e,t,n,r,i)=>e.ts(t,n,r,i),Ke=(e,t,n,r,i)=>e.tt(t,n,r,i),Gu="WORD",EM="UWORD",Vde="ASCIINUMERICAL",Kde="ALPHANUMERICAL",o1="LOCALHOST",TM="TLD",IM="UTLD",f_="SCHEME",Lg="SLASH_SCHEME",SH="NUM",PM="WS",kH="NL",Kw="OPENBRACE",qw="CLOSEBRACE",Vj="OPENBRACKET",Kj="CLOSEBRACKET",qj="OPENPAREN",Wj="CLOSEPAREN",Gj="OPENANGLEBRACKET",Yj="CLOSEANGLEBRACKET",Xj="FULLWIDTHLEFTPAREN",Jj="FULLWIDTHRIGHTPAREN",Zj="LEFTCORNERBRACKET",eB="RIGHTCORNERBRACKET",tB="LEFTWHITECORNERBRACKET",nB="RIGHTWHITECORNERBRACKET",rB="FULLWIDTHLESSTHAN",iB="FULLWIDTHGREATERTHAN",sB="AMPERSAND",aB="APOSTROPHE",oB="ASTERISK",wh="AT",lB="BACKSLASH",cB="BACKTICK",uB="CARET",Nh="COLON",_H="COMMA",dB="DOLLAR",Wc="DOT",hB="EQUALS",jH="EXCLAMATION",il="HYPHEN",Ww="PERCENT",fB="PIPE",AB="PLUS",pB="POUND",Gw="QUERY",BH="QUOTE",qde="FULLWIDTHMIDDLEDOT",NH="SEMI",Gc="SLASH",Yw="TILDE",mB="UNDERSCORE",Wde="EMOJI",gB="SYM";var Gde=Object.freeze({__proto__:null,ALPHANUMERICAL:Kde,AMPERSAND:sB,APOSTROPHE:aB,ASCIINUMERICAL:Vde,ASTERISK:oB,AT:wh,BACKSLASH:lB,BACKTICK:cB,CARET:uB,CLOSEANGLEBRACKET:Yj,CLOSEBRACE:qw,CLOSEBRACKET:Kj,CLOSEPAREN:Wj,COLON:Nh,COMMA:_H,DOLLAR:dB,DOT:Wc,EMOJI:Wde,EQUALS:hB,EXCLAMATION:jH,FULLWIDTHGREATERTHAN:iB,FULLWIDTHLEFTPAREN:Xj,FULLWIDTHLESSTHAN:rB,FULLWIDTHMIDDLEDOT:qde,FULLWIDTHRIGHTPAREN:Jj,HYPHEN:il,LEFTCORNERBRACKET:Zj,LEFTWHITECORNERBRACKET:tB,LOCALHOST:o1,NL:kH,NUM:SH,OPENANGLEBRACKET:Gj,OPENBRACE:Kw,OPENBRACKET:Vj,OPENPAREN:qj,PERCENT:Ww,PIPE:fB,PLUS:AB,POUND:pB,QUERY:Gw,QUOTE:BH,RIGHTCORNERBRACKET:eB,RIGHTWHITECORNERBRACKET:nB,SCHEME:f_,SEMI:NH,SLASH:Gc,SLASH_SCHEME:Lg,SYM:gB,TILDE:Yw,TLD:TM,UNDERSCORE:mB,UTLD:IM,UWORD:EM,WORD:Gu,WS:PM});const Uu=/[a-z]/,jx=new RegExp("\\p{L}","u"),i4=new RegExp("\\p{Emoji}","u"),Hu=/\d/,s4=/\s/,yq="\r",a4=`
`,gVe="️",yVe="‍",o4="";let MS=null,LS=null;function vVe(e=[]){const t={};Ga.groups=t;const n=new Ga;MS==null&&(MS=vq(dVe)),LS==null&&(LS=vq(hVe)),Ke(n,"'",aB),Ke(n,"{",Kw),Ke(n,"}",qw),Ke(n,"[",Vj),Ke(n,"]",Kj),Ke(n,"(",qj),Ke(n,")",Wj),Ke(n,"<",Gj),Ke(n,">",Yj),Ke(n,"(",Xj),Ke(n,")",Jj),Ke(n,"「",Zj),Ke(n,"」",eB),Ke(n,"『",tB),Ke(n,"』",nB),Ke(n,"<",rB),Ke(n,">",iB),Ke(n,"&",sB),Ke(n,"*",oB),Ke(n,"@",wh),Ke(n,"`",cB),Ke(n,"^",uB),Ke(n,":",Nh),Ke(n,",",_H),Ke(n,"$",dB),Ke(n,".",Wc),Ke(n,"=",hB),Ke(n,"!",jH),Ke(n,"-",il),Ke(n,"%",Ww),Ke(n,"|",fB),Ke(n,"+",AB),Ke(n,"#",pB),Ke(n,"?",Gw),Ke(n,'"',BH),Ke(n,"/",Gc),Ke(n,";",NH),Ke(n,"~",Yw),Ke(n,"_",mB),Ke(n,"\\",lB),Ke(n,"・",qde);const r=si(n,Hu,SH,{[_M]:!0});si(r,Hu,r);const i=si(r,Uu,Vde,{[Vw]:!0}),s=si(r,jx,Kde,{[lw]:!0}),a=si(n,Uu,Gu,{[jM]:!0});si(a,Hu,i),si(a,Uu,a),si(i,Hu,i),si(i,Uu,i);const o=si(n,jx,EM,{[BM]:!0});si(o,Uu),si(o,Hu,s),si(o,jx,o),si(s,Hu,s),si(s,Uu),si(s,jx,s);const c=Ke(n,a4,kH,{[r4]:!0}),u=Ke(n,yq,PM,{[r4]:!0}),d=si(n,s4,PM,{[r4]:!0});Ke(n,o4,d),Ke(u,a4,c),Ke(u,o4,d),si(u,s4,d),Ke(d,yq),Ke(d,a4),si(d,s4,d),Ke(d,o4,d);const h=si(n,i4,Wde,{[zde]:!0});Ke(h,"#"),si(h,i4,h),Ke(h,gVe,h);const A=Ke(h,yVe);Ke(A,"#"),si(A,i4,h);const f=[[Uu,a],[Hu,i]],p=[[Uu,null],[jx,o],[Hu,s]];for(let m=0;m<MS.length;m++)ih(n,MS[m],TM,Gu,f);for(let m=0;m<LS.length;m++)ih(n,LS[m],IM,EM,p);ip(TM,{tld:!0,ascii:!0},t),ip(IM,{utld:!0,alpha:!0},t),ih(n,"file",f_,Gu,f),ih(n,"mailto",f_,Gu,f),ih(n,"http",Lg,Gu,f),ih(n,"https",Lg,Gu,f),ih(n,"ftp",Lg,Gu,f),ih(n,"ftps",Lg,Gu,f),ip(f_,{scheme:!0,ascii:!0},t),ip(Lg,{slashscheme:!0,ascii:!0},t),e=e.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<e.length;m++){const g=e[m][0],v=e[m][1]?{[fVe]:!0}:{[AVe]:!0};g.indexOf("-")>=0?v[NM]=!0:Uu.test(g)?Hu.test(g)?v[Vw]=!0:v[jM]=!0:v[_M]=!0,gq(n,g,g,v)}return gq(n,"localhost",o1,{ascii:!0}),n.jd=new Ga(gB),{start:n,tokens:Object.assign({groups:t},Gde)}}function Yde(e,t){const n=xVe(t.replace(/[A-Z]/g,o=>o.toLowerCase())),r=n.length,i=[];let s=0,a=0;for(;a<r;){let o=e,c=null,u=0,d=null,h=-1,A=-1;for(;a<r&&(c=o.go(n[a]));)o=c,o.accepts()?(h=0,A=0,d=o):h>=0&&(h+=n[a].length,A++),u+=n[a].length,s+=n[a].length,a++;s-=h,a-=A,u-=h,i.push({t:d.t,v:t.slice(s-u,s),s:s-u,e:s})}return i}function xVe(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),s,a=i<55296||i>56319||r+1===n||(s=e.charCodeAt(r+1))<56320||s>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}function ih(e,t,n,r,i){let s;const a=t.length;for(let o=0;o<a-1;o++){const c=t[o];e.j[c]?s=e.j[c]:(s=new Ga(r),s.jr=i.slice(),e.j[c]=s),e=s}return s=new Ga(n),s.jr=i.slice(),e.j[t[a-1]]=s,s}function vq(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let s=0;for(;i.indexOf(e[r+s])>=0;)s++;if(s>0){t.push(n.join(""));for(let a=parseInt(e.substring(r,r+s),10);a>0;a--)n.pop();r+=s}else n.push(e[r]),r++}return t}const l1={defaultProtocol:"http",events:null,format:xq,formatHref:xq,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function EH(e,t=null){let n=Object.assign({},l1);e&&(n=Object.assign(n,e instanceof EH?e.o:e));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}EH.prototype={o:l1,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:l1[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function xq(e){return e}function Xde(e,t){this.t="token",this.v=e,this.tk=t}Xde.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=l1.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),s=this.toFormattedString(e),a={},o=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),d=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return a.href=r,o&&(a.class=o),c&&(a.target=c),u&&(a.rel=u),d&&Object.assign(a,d),{tagName:i,attributes:a,content:s,eventListeners:h}}};function f5(e,t){class n extends Xde{constructor(i,s){super(i,s),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const wq=f5("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),bq=f5("text"),wVe=f5("nl"),RS=f5("url",{isLink:!0,toHref(e=l1.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==o1&&e[1].t===Nh}}),Jo=e=>new Ga(e);function bVe({groups:e}){const t=e.domain.concat([sB,oB,wh,lB,cB,uB,dB,hB,il,SH,Ww,fB,AB,pB,Gc,gB,Yw,mB]),n=[aB,Nh,_H,Wc,jH,Ww,Gw,BH,NH,Gj,Yj,Kw,qw,Kj,Vj,qj,Wj,Xj,Jj,Zj,eB,tB,nB,rB,iB],r=[sB,aB,oB,lB,cB,uB,dB,hB,il,Kw,qw,Ww,fB,AB,pB,Gw,Gc,gB,Yw,mB],i=Jo(),s=Ke(i,Yw);mn(s,r,s),mn(s,e.domain,s);const a=Jo(),o=Jo(),c=Jo();mn(i,e.domain,a),mn(i,e.scheme,o),mn(i,e.slashscheme,c),mn(a,r,s),mn(a,e.domain,a);const u=Ke(a,wh);Ke(s,wh,u),Ke(o,wh,u),Ke(c,wh,u);const d=Ke(s,Wc);mn(d,r,s),mn(d,e.domain,s);const h=Jo();mn(u,e.domain,h),mn(h,e.domain,h);const A=Ke(h,Wc);mn(A,e.domain,h);const f=Jo(wq);mn(A,e.tld,f),mn(A,e.utld,f),Ke(u,o1,f);const p=Ke(h,il);Ke(p,il,p),mn(p,e.domain,h),mn(f,e.domain,h),Ke(f,Wc,A),Ke(f,il,p);const m=Ke(f,Nh);mn(m,e.numeric,wq);const g=Ke(a,il),y=Ke(a,Wc);Ke(g,il,g),mn(g,e.domain,a),mn(y,r,s),mn(y,e.domain,a);const v=Jo(RS);mn(y,e.tld,v),mn(y,e.utld,v),mn(v,e.domain,a),mn(v,r,s),Ke(v,Wc,y),Ke(v,il,g),Ke(v,wh,u);const x=Ke(v,Nh),b=Jo(RS);mn(x,e.numeric,b);const w=Jo(RS),k=Jo();mn(w,t,w),mn(w,n,k),mn(k,t,w),mn(k,n,k),Ke(v,Gc,w),Ke(b,Gc,w);const j=Ke(o,Nh),B=Ke(c,Nh),E=Ke(B,Gc),P=Ke(E,Gc);mn(o,e.domain,a),Ke(o,Wc,y),Ke(o,il,g),mn(c,e.domain,a),Ke(c,Wc,y),Ke(c,il,g),mn(j,e.domain,w),Ke(j,Gc,w),Ke(j,Gw,w),mn(P,e.domain,w),mn(P,t,w),Ke(P,Gc,w);const T=[[Kw,qw],[Vj,Kj],[qj,Wj],[Gj,Yj],[Xj,Jj],[Zj,eB],[tB,nB],[rB,iB]];for(let N=0;N<T.length;N++){const[F,L]=T[N],U=Ke(w,F);Ke(k,F,U),Ke(U,L,w);const H=Jo(RS);mn(U,t,H);const W=Jo();mn(U,n),mn(H,t,H),mn(H,n,W),mn(W,t,H),mn(W,n,W),Ke(H,L,w),Ke(W,L,w)}return Ke(i,o1,v),Ke(i,kH,wVe),{start:i,tokens:Gde}}function CVe(e,t,n){let r=n.length,i=0,s=[],a=[];for(;i<r;){let o=e,c=null,u=null,d=0,h=null,A=-1;for(;i<r&&!(c=o.go(n[i].t));)a.push(n[i++]);for(;i<r&&(u=c||o.go(n[i].t));)c=null,o=u,o.accepts()?(A=0,h=o):A>=0&&A++,i++,d++;if(A<0)i-=d,i<r&&(a.push(n[i]),i++);else{a.length>0&&(s.push(l4(bq,t,a)),a=[]),i-=A,d-=A;const f=h.t,p=n.slice(i-d,i);s.push(l4(f,t,p))}}return a.length>0&&s.push(l4(bq,t,a)),s}function l4(e,t,n){const r=n[0].s,i=n[n.length-1].e,s=t.slice(r,i);return new e(s,n)}const SVe=typeof console<"u"&&console&&console.warn||(()=>{}),kVe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Fr={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function _Ve(){return Ga.groups={},Fr.scanner=null,Fr.parser=null,Fr.tokenQueue=[],Fr.pluginQueue=[],Fr.customSchemes=[],Fr.initialized=!1,Fr}function Cq(e,t=!1){if(Fr.initialized&&SVe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${kVe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);Fr.customSchemes.push([e,t])}function jVe(){Fr.scanner=vVe(Fr.customSchemes);for(let e=0;e<Fr.tokenQueue.length;e++)Fr.tokenQueue[e][1]({scanner:Fr.scanner});Fr.parser=bVe(Fr.scanner.tokens);for(let e=0;e<Fr.pluginQueue.length;e++)Fr.pluginQueue[e][1]({scanner:Fr.scanner,parser:Fr.parser});return Fr.initialized=!0,Fr}function TH(e){return Fr.initialized||jVe(),CVe(Fr.parser.start,e,Yde(Fr.scanner.start,e))}TH.scan=Yde;function Jde(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new EH(n),i=TH(e),s=[];for(let a=0;a<i.length;a++){const o=i[a];o.isLink&&(!t||o.t===t)&&r.check(o)&&s.push(o.toFormattedObject(r))}return s}var IH="[\0-   ᠎ -\u2029  ]",BVe=new RegExp(IH),NVe=new RegExp(`${IH}$`),EVe=new RegExp(IH,"g");function TVe(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function IVe(e){return new ti({key:new es("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(u=>u.docChanged)&&!n.doc.eq(r.doc),s=t.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,o=ade(n.doc,[...t]);if(fde(o).forEach(({newRange:u})=>{const d=j7e(r.doc,u,f=>f.isTextblock);let h,A;if(d.length>1)h=d[0],A=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const f=r.doc.textBetween(u.from,u.to," "," ");if(!NVe.test(f))return;h=d[0],A=r.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&A){const f=A.split(BVe).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=h.pos+A.lastIndexOf(p);if(!p)return!1;const g=TH(p).map(y=>y.toObject(e.defaultProtocol));if(!TVe(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>e.validate(y.value)).filter(y=>e.shouldAutoLink(y.value)).forEach(y=>{yH(y.from,y.to,r.doc).some(v=>v.mark.type===e.type)||a.addMark(y.from,y.to,e.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function PVe(e){return new ti({key:new es("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,s;if(r.button!==0||!t.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{const c=r.target;if(!c)return!1;const u=e.editor.view.dom;a=c.closest("a"),a&&!u.contains(a)&&(a=null)}if(!a)return!1;let o=!1;if(e.enableClickSelection&&(o=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const c=hde(t.state,e.type.name),u=(i=a.href)!=null?i:c.href,d=(s=a.target)!=null?s:c.target;u&&(window.open(u,d),o=!0)}return o}}})}function OVe(e){return new ti({key:new es("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:s}=t,{selection:a}=s,{empty:o}=a;if(o)return!1;let c="";r.content.forEach(d=>{c+=d.textContent});const u=Jde(c,{defaultProtocol:e.defaultProtocol}).find(d=>d.isLink&&d.value===c);return!c||!u||i!==void 0&&!i(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}function NA(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(EVe,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Zde=wm.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){Cq(e);return}Cq(e.scheme,e.optionalSlashes)})},onDestroy(){_Ve()},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:(e,t)=>!!NA(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const i=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.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:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!NA(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!NA(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",fi(this.options.HTMLAttributes,e),0]:["a",fi(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,s;const a=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",o=(s=(i=e.attrs)==null?void 0:i.title)!=null?s:"",c=t.renderChildren(e);return o?`[${c}](${a} "${o}")`:`[${c}](${a})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!NA(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!NA(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[rm({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=Jde(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!NA(a,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(IVe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!NA(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(PVe({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(OVe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),FVe=Zde,MVe=Object.defineProperty,LVe=(e,t)=>{for(var n in t)MVe(e,n,{get:t[n],enumerable:!0})},RVe="listItem",Sq="textStyle",kq=/^\s*([-+*])\s$/,ehe=Fa.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:e}){return["ul",fi(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(RVe,this.editor.getAttributes(Sq)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=xv({find:kq,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=xv({find:kq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Sq),editor:this.editor})),[e]}}),the=Fa.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",fi(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if(e.type!=="list_item")return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(i=>i.type==="paragraph"))n=t.parseChildren(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const a=e.tokens.slice(1),o=t.parseChildren(a);n.push(...o)}}else n=t.parseChildren(e.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>bH(e,t,r=>{var i,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.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)}}}),DVe={};LVe(DVe,{findListItemPos:()=>D2,getNextListDepth:()=>PH,handleBackspace:()=>OM,handleDelete:()=>FM,hasListBefore:()=>nhe,hasListItemAfter:()=>UVe,hasListItemBefore:()=>rhe,listItemHasSubList:()=>ihe,nextListIsDeeper:()=>she,nextListIsHigher:()=>ahe});var D2=(e,t)=>{const{$from:n}=t.selection,r=Di(e,t.schema);let i=null,s=n.depth,a=n.pos,o=null;for(;s>0&&o===null;)i=n.node(s),i.type===r?o=s:(s-=1,a-=1);return o===null?null:{$pos:t.doc.resolve(a),depth:o}},PH=(e,t)=>{const n=D2(e,t);if(!n)return!1;const[,r]=L7e(t,e,n.$pos.pos+4);return r},nhe=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),s=e.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},rhe=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==e)},ihe=(e,t,n)=>{if(!n)return!1;const r=Di(e,t.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},OM=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Ff(e.state,t)&&nhe(e.state,t,n)){const{$anchor:o}=e.state.selection,c=e.state.doc.resolve(o.before()-1),u=[];c.node().descendants((A,f)=>{A.type.name===t&&u.push({node:A,pos:f})});const d=u.at(-1);if(!d)return!1;const h=e.state.doc.resolve(c.start()+d.pos+1);return e.chain().cut({from:o.start()-1,to:o.end()+1},h.end()).joinForward().run()}if(!Ff(e.state,t)||!H7e(e.state))return!1;const r=D2(t,e.state);if(!r)return!1;const s=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=ihe(t,e.state,s);return rhe(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},she=(e,t)=>{const n=PH(e,t),r=D2(e,t);return!r||!n?!1:n>r.depth},ahe=(e,t)=>{const n=PH(e,t),r=D2(e,t);return!r||!n?!1:n<r.depth},FM=(e,t)=>{if(!Ff(e.state,t)||!U7e(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:she(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():ahe(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},UVe=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==e)},ohe=_i.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&FM(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&FM(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&OM(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&OM(e,n,r)&&(t=!0)}),t}}}}),_q=/^(\s*)(\d+)\.\s+(.*)$/,HVe=/^\s/;function QVe(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],s=i.match(_q);if(!s)break;const[,a,o,c]=s,u=a.length;let d=c,h=n+1;const A=[i];for(;h<e.length;){const f=e[h];if(f.match(_q))break;if(f.trim()==="")A.push(f),d+=`
`,h+=1;else if(f.match(HVe))A.push(f),d+=`
${f.slice(u+2)}`,h+=1;else break}t.push({indent:u,number:parseInt(o,10),content:d.trim(),raw:A.join(`
`)}),r=h,n=h}return[t,r]}function lhe(e,t,n){var r;const i=[];let s=0;for(;s<e.length;){const a=e[s];if(a.indent===t){const o=a.content.split(`
`),c=((r=o[0])==null?void 0:r.trim())||"",u=[];c&&u.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const d=o.slice(1).join(`
`).trim();if(d){const f=n.blockTokens(d);u.push(...f)}let h=s+1;const A=[];for(;h<e.length&&e[h].indent>t;)A.push(e[h]),h+=1;if(A.length>0){const f=Math.min(...A.map(m=>m.indent)),p=lhe(A,f,n);u.push({type:"list",ordered:!0,start:A[0].number,items:p,raw:A.map(m=>m.raw).join(`
`)})}i.push({type:"list_item",raw:a.raw,tokens:u}),s=h}else s+=1}return i}function $Ve(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=t.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=t.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var zVe="listItem",jq="textStyle",Bq=/^(\d+)\.\s$/,che=Fa.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:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",fi(this.options.HTMLAttributes,n),0]:["ol",fi(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?$Ve(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
`),[s,a]=QVe(i);if(s.length===0)return;const o=lhe(s,0,n);return o.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:o,raw:i.slice(0,a).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zVe,this.editor.getAttributes(jq)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=xv({find:Bq,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=xv({find:Bq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(jq)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),VVe=/^\s*(\[([( |x])?\])\s$/,KVe=Fa.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:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",fi(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return bH(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),o=document.createElement("input"),c=document.createElement("div"),u=h=>{var A,f;o.ariaLabel=((f=(A=this.options.a11y)==null?void 0:A.checkboxLabel)==null?void 0:f.call(A,h,o.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};u(e),s.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",h=>h.preventDefault()),o.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:A}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=n();if(typeof p!="number")return!1;const m=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...m==null?void 0:m.attrs,checked:A}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,A)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,A])=>{i.setAttribute(h,A)}),i.dataset.checked=e.attrs.checked,o.checked=e.attrs.checked,s.append(o,a),i.append(s,c),Object.entries(t).forEach(([h,A])=>{i.setAttribute(h,A)});let d=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:h=>{if(h.type!==this.type)return!1;i.dataset.checked=h.attrs.checked,o.checked=h.attrs.checked,u(h);const A=r.extensionManager.attributes,f=a1(h,A),p=new Set(Object.keys(f)),m=this.options.HTMLAttributes;return d.forEach(g=>{p.has(g)||(g in m?i.setAttribute(g,m[g]):i.removeAttribute(g))}),Object.entries(f).forEach(([g,y])=>{y==null?g in m?i.setAttribute(g,m[g]):i.removeAttribute(g):i.setAttribute(g,y)}),d=p,!0}}}},addInputRules(){return[xv({find:VVe,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),qVe=Fa.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:e}){return["ul",fi(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=s=>{const a=SM(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,c)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:c}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=SM(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});_i.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(ehe.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(the.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ohe.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(che.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(KVe.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(qVe.configure(this.options.taskList)),e}});var Nq="&nbsp;",WVe=" ",GVe=Fa.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",fi(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Nq||r[0].text===WVe)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t)=>{if(!e)return"";const n=Array.isArray(e.content)?e.content:[];return n.length===0?Nq:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),YVe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,XVe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,JVe=wm.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",fi(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[vv({find:YVe,type:this.type})]},addPasteRules(){return[rm({find:XVe,type:this.type})]}}),ZVe=Fa.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),eKe=wm.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",fi(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function tKe(e={}){return new ti({view(t){return new nKe(t,e)}})}class nKe{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return t.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,o=s.height/i.offsetHeight;if(n){let h=t.nodeBefore,A=t.nodeAfter;if(h||A){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let p=f.getBoundingClientRect(),m=h?p.bottom:p.top;h&&A&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*o;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),A=this.width/2*a;r={left:h.left-A,right:h.left+A,top:h.top,bottom:h.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.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(!c||c==document.body&&getComputedStyle(c).position=="static")u=-pageXOffset,d=-pageYOffset;else{let h=c.getBoundingClientRect(),A=h.width/c.offsetWidth,f=h.height/c.offsetHeight;u=h.left-c.scrollLeft*A,d=h.top-c.scrollTop*f}this.element.style.left=(r.left-u)/a+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=rue(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class di extends gn{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return di.valid(r)?new di(r):gn.near(r)}content(){return ct.empty}eq(t){return t instanceof di&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new di(t.resolve(n.pos))}getBookmark(){return new OH(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!rKe(t)||!iKe(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&di.valid(t))return t;let i=t.pos,s=null;for(let a=t.depth;;a--){let o=t.node(a);if(n>0?t.indexAfter(a)<o.childCount:t.index(a)>0){s=o.child(n>0?t.indexAfter(a):t.index(a)-1);break}else if(a==0)return null;i+=n;let c=t.doc.resolve(i);if(di.valid(c))return c}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Qt.isSelectable(s)){t=t.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=a,i+=n;let o=t.doc.resolve(i);if(di.valid(o))return o}return null}}}di.prototype.visible=!1;di.findFrom=di.findGapCursorFrom;gn.jsonID("gapcursor",di);class OH{constructor(t){this.pos=t}map(t){return new OH(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return di.valid(n)?new di(n):gn.near(n)}}function uhe(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function rKe(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||uhe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function iKe(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||uhe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function sKe(){return new ti({props:{decorations:cKe,createSelectionBetween(e,t,n){return t.pos==n.pos&&di.valid(n)?new di(n):null},handleClick:oKe,handleKeyDown:aKe,handleDOMEvents:{beforeinput:lKe}}})}const aKe=Jue({ArrowLeft:DS("horiz",-1),ArrowRight:DS("horiz",1),ArrowUp:DS("vert",-1),ArrowDown:DS("vert",1)});function DS(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,s){let a=r.selection,o=t>0?a.$to:a.$from,c=a.empty;if(a instanceof rn){if(!s.endOfTextblock(n)||o.depth==0)return!1;c=!1,o=r.doc.resolve(t>0?o.after():o.before())}let u=di.findGapCursorFrom(o,t,c);return u?(i&&i(r.tr.setSelection(new di(u))),!0):!1}}function oKe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!di.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Qt.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new di(r))),!0)}function lKe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof di))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=$e.empty;for(let a=r.length-1;a>=0;a--)i=$e.from(r[a].createAndFill(null,i));let s=e.state.tr.replace(n.pos,n.pos,new ct(i,0,0));return s.setSelection(rn.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function cKe(e){if(!(e.selection instanceof di))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Xr.create(e.doc,[_a.widget(e.selection.head,t,{key:"gapcursor"})])}var yB=200,hs=function(){};hs.prototype.append=function(t){return t.length?(t=hs.from(t),!this.length&&t||t.length<yB&&this.leafAppend(t)||this.length<yB&&t.leafPrepend(this)||this.appendInner(t)):this};hs.prototype.prepend=function(t){return t.length?hs.from(t).append(this):this};hs.prototype.appendInner=function(t){return new uKe(this,t)};hs.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?hs.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};hs.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};hs.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};hs.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(t(s,a))},n,r),i};hs.from=function(t){return t instanceof hs?t:t&&t.length?new dhe(t):hs.empty};var dhe=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new t(this.values.slice(i,s))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,s,a,o){for(var c=s;c<a;c++)if(i(this.values[c],o+c)===!1)return!1},t.prototype.forEachInvertedInner=function(i,s,a,o){for(var c=s-1;c>=a;c--)if(i(this.values[c],o+c)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=yB)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=yB)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(hs);hs.empty=new dhe([]);var uKe=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,s,a){var o=this.left.length;if(i<o&&this.left.forEachInner(r,i,Math.min(s,o),a)===!1||s>o&&this.right.forEachInner(r,Math.max(i-o,0),Math.min(this.length,s)-o,a+o)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,s,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(r,i-o,Math.max(s,o)-o,a+o)===!1||s<o&&this.left.forEachInvertedInner(r,Math.min(i,o),s,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(hs);const dKe=500;class dc{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=t.tr,o,c,u=[],d=[];return this.items.forEach((h,A)=>{if(!h.step){i||(i=this.remapping(r,A+1),s=i.maps.length),s--,d.push(h);return}if(i){d.push(new sh(h.map));let f=h.step.map(i.slice(s)),p;f&&a.maybeStep(f).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],u.push(new sh(p,void 0,void 0,u.length+d.length))),s--,p&&i.appendMap(p,s)}else a.maybeStep(h.step);if(h.selection)return o=i?h.selection.map(i.slice(s)):h.selection,c=new dc(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:o}}addTransform(t,n,r,i){let s=[],a=this.eventCount,o=this.items,c=!i&&o.length?o.get(o.length-1):null;for(let d=0;d<t.steps.length;d++){let h=t.steps[d].invert(t.docs[d]),A=new sh(t.mapping.maps[d],h,n),f;(f=c&&c.merge(A))&&(A=f,d?s.pop():o=o.slice(0,o.length-1)),s.push(A),n&&(a++,n=void 0),i||(c=A)}let u=a-r.depth;return u>fKe&&(o=hKe(o,u),a-=u),new dc(o.append(s),a)}remapping(t,n){let r=new e1;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new dc(this.items.append(t.map(n=>new sh(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=t.mapping,a=t.steps.length,o=this.eventCount;this.items.forEach(A=>{A.selection&&o--},i);let c=n;this.items.forEach(A=>{let f=s.getMirror(--c);if(f==null)return;a=Math.min(a,f);let p=s.maps[f];if(A.step){let m=t.steps[f].invert(t.docs[f]),g=A.selection&&A.selection.map(s.slice(c+1,f));g&&o++,r.push(new sh(p,m,g))}else r.push(new sh(p))},i);let u=[];for(let A=n;A<a;A++)u.push(new sh(s.maps[A]));let d=this.items.slice(0,i).append(u).append(r),h=new dc(d,o);return h.emptyItemCount()>dKe&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],s=0;return this.items.forEach((a,o)=>{if(o>=t)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(n.slice(r)),u=c&&c.getMap();if(r--,u&&n.appendMap(u,r),c){let d=a.selection&&a.selection.map(n.slice(r));d&&s++;let h=new sh(u.invert(),c,d),A,f=i.length-1;(A=i.length&&i[f].merge(h))?i[f]=A:i.push(h)}}else a.map&&r--},this.items.length,0),new dc(hs.from(i.reverse()),s)}}dc.empty=new dc(hs.empty,0);function hKe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}let sh=class hhe{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new hhe(n.getMap().invert(),n,this.selection)}}};class bh{constructor(t,n,r,i,s){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const fKe=20;function AKe(e,t,n,r){let i=n.getMeta(Ip),s;if(i)return i.historyState;n.getMeta(gKe)&&(e=new bh(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(Ip))return a.getMeta(Ip).redo?new bh(e.done.addTransform(n,void 0,r,A_(t)),e.undone,Eq(n.mapping.maps),e.prevTime,e.prevComposition):new bh(e.done,e.undone.addTransform(n,void 0,r,A_(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),c=e.prevTime==0||!a&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!pKe(n,e.prevRanges)),u=a?c4(e.prevRanges,n.mapping):Eq(n.mapping.maps);return new bh(e.done.addTransform(n,c?t.selection.getBookmark():void 0,r,A_(t)),dc.empty,u,n.time,o??e.prevComposition)}else return(s=n.getMeta("rebased"))?new bh(e.done.rebased(n,s),e.undone.rebased(n,s),c4(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new bh(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),c4(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function pKe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<t.length;s+=2)r<=t[s+1]&&i>=t[s]&&(n=!0)}),n}function Eq(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,s,a)=>t.push(s,a));return t}function c4(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s)}return n}function mKe(e,t,n){let r=A_(t),i=Ip.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),o=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),c=new bh(n?o:s.remaining,n?s.remaining:o,null,0,-1);return s.transform.setSelection(a).setMeta(Ip,{redo:n,historyState:c})}let u4=!1,Tq=null;function A_(e){let t=e.plugins;if(Tq!=t){u4=!1,Tq=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){u4=!0;break}}return u4}const Ip=new es("history"),gKe=new es("closeHistory");function yKe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new ti({key:Ip,state:{init(){return new bh(dc.empty,dc.empty,null,0,-1)},apply(t,n,r){return AKe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?Ahe:r=="historyRedo"?phe:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function fhe(e,t){return(n,r)=>{let i=Ip.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let s=mKe(i,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}const Ahe=fhe(!1,!0),phe=fhe(!0,!0);_i.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new ti({key:new es("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,o=0,c=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(o,c);return e=!0,u}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:t.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!t.getMeta("paste"))return!1;const o=t.selection.$head.pos,c=s-r,u=o-c,d=o;return t.deleteRange(u,d),!(this.storage.characters({node:t.doc})>r)}})]}});var vKe=_i.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[tKe(this.options)]}});_i.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new ti({key:new es("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return Xr.create(e,[]);let a=0;this.options.mode==="deepest"&&e.descendants((c,u)=>{if(c.isText)return;if(!(i>=u&&i<=u+c.nodeSize-1))return!1;a+=1});let o=0;return e.descendants((c,u)=>{if(c.isText||!(i>=u&&i<=u+c.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&a-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";s.push(_a.node(u,u+c.nodeSize,{class:this.options.className}))}),Xr.create(e,s)}}})]}});var xKe=_i.create({name:"gapCursor",addProseMirrorPlugins(){return[sKe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Qn(Ft(e,"allowGapCursor",n)))!=null?t:null}}}),Iq="placeholder";function wKe(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var bKe=_i.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Iq,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${wKe(this.options.dataAttribute)}`:`data-${Iq}`;return[new ti({key:new es("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,s=[];if(!r)return null;const a=this.editor.isEmpty;return t.descendants((o,c)=>{const u=i>=c&&i<=c+o.nodeSize,d=!o.isLeaf&&c5(o);if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];a&&h.push(this.options.emptyEditorClass);const A=_a.node(c,c+o.nodeSize,{class:h.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:c,hasAnchor:u}):this.options.placeholder});s.push(A)}return this.options.includeChildren}),Xr.create(t,s)}}})]}});_i.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new ti({key:new es("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Ade(n.selection)||e.view.dragging?null:Xr.create(n.doc,[_a.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function Pq({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var CKe=_i.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new es(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new ti({key:t,appendTransaction:(i,s,a)=>{const{doc:o,tr:c,schema:u}=a,d=t.getState(a),h=o.content.size,A=u.nodes[n];if(d)return c.insert(h,A.create())},state:{init:(i,s)=>{const a=s.tr.doc.lastChild;return!Pq({node:a,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const a=i.doc.lastChild;return!Pq({node:a,types:r})}}})]}}),SKe=_i.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Ahe(e,t),redo:()=>({state:e,dispatch:t})=>phe(e,t)}},addProseMirrorPlugins(){return[yKe(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()}}}),kKe=_i.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(G9e.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(z9e.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(ehe.configure(this.options.bulletList)),this.options.code!==!1&&i.push(J9e.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(tVe.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(nVe.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(vKe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(xKe.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(rVe.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(iVe.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(SKe.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(sVe.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(uVe.configure(this.options.italic)),this.options.listItem!==!1&&i.push(the.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(ohe.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(Zde.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(che.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(GVe.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(JVe.configure(this.options.strike)),this.options.text!==!1&&i.push(ZVe.configure(this.options.text)),this.options.underline!==!1&&i.push(eKe.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(CKe.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),_Ke=kKe,jKe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,BKe=Fa.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",fi(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,i,s,a;const o=(n=(t=e.attrs)==null?void 0:t.src)!=null?n:"",c=(i=(r=e.attrs)==null?void 0:r.alt)!=null?i:"",u=(a=(s=e.attrs)==null?void 0:s.title)!=null?a:"";return u?`![${c}](${o} "${u}")`:`![${c}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:s,HTMLAttributes:a,editor:o})=>{const c=document.createElement("img");Object.entries(a).forEach(([h,A])=>{if(A!=null)switch(h){case"width":case"height":break;default:c.setAttribute(h,A);break}}),c.src=a.src;const u=new _ze({element:c,editor:o,node:i,getPos:s,onResize:(h,A)=>{c.style.width=`${h}px`,c.style.height=`${A}px`},onCommit:(h,A)=>{const f=s();f!==void 0&&this.editor.chain().setNodeSelection(f).updateAttributes(this.name,{width:h,height:A}).run()},onUpdate:(h,A,f)=>h.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",c.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},u}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Ide({find:jKe,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),NKe=BKe,EKe=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,TKe=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,mhe=e=>e.match(EKe),Oq=(e,t)=>t?"https://www.youtube-nocookie.com/embed/videoseries?list=":e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",IKe=e=>{const{url:t,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:s,controls:a,disableKBcontrols:o,enableIFrameApi:c,endTime:u,interfaceLanguage:d,ivLoadPolicy:h,loop:A,modestBranding:f,nocookie:p,origin:m,playlist:g,progressBarColor:y,startAt:v,rel:x}=e;if(!mhe(t))return null;if(t.includes("/embed/"))return t;if(t.includes("youtu.be")){const B=t.split("/").pop();return B?`${Oq(p)}${B}`:null}const w=/(?:(v|list)=|shorts\/)([-\w]+)/gm.exec(t);if(!w||!w[2])return null;let k=`${Oq(p,w[1]==="list")}${w[2]}`;const j=[];return n===!1&&j.push("fs=0"),r&&j.push("autoplay=1"),i&&j.push(`cc_lang_pref=${i}`),s&&j.push("cc_load_policy=1"),a||j.push("controls=0"),o&&j.push("disablekb=1"),c&&j.push("enablejsapi=1"),u&&j.push(`end=${u}`),d&&j.push(`hl=${d}`),h&&j.push(`iv_load_policy=${h}`),A&&j.push("loop=1"),f&&j.push("modestbranding=1"),m&&j.push(`origin=${m}`),g&&j.push(`playlist=${g}`),v&&j.push(`start=${v}`),y&&j.push(`color=${y}`),x!==void 0&&j.push(`rel=${x}`),j.length&&(k+=`${w[1]==="list"?"&":"?"}${j.join("&")}`),k},PKe=Fa.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640,rel:1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:e=>({commands:t})=>mhe(e.src)?t.insertContent({type:this.name,attrs:e}):!1}},addPasteRules(){return this.options.addPasteHandler?[Oze({find:TKe,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){const t=IKe({url:e.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:e.start||0,rel:this.options.rel});return e.src=t,["div",{"data-youtube-video":""},["iframe",fi(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,rel:this.options.rel},e)]]},...Pde({nodeName:"youtube",allowedAttributes:["src","width","height","start"]})}),OKe=PKe,FKe=bKe;async function ghe(e,t=1200,n=1200,r=.85){return new Promise((i,s)=>{const a=new Image,o=URL.createObjectURL(e);a.onload=()=>{URL.revokeObjectURL(o);let{width:c,height:u}=a;if(c>t||u>n){const A=Math.min(t/c,n/u);c=Math.round(c*A),u=Math.round(u*A)}const d=document.createElement("canvas");d.width=c,d.height=u;const h=d.getContext("2d");if(!h){s(new Error("Could not get canvas context"));return}h.drawImage(a,0,0,c,u),d.toBlob(A=>{if(!A){s(new Error("Could not compress image"));return}const f=new File([A],e.name.replace(/\.[^.]+$/,".webp"),{type:"image/webp"});i(f)},"image/webp",r)},a.onerror=()=>{URL.revokeObjectURL(o),s(new Error("Failed to load image"))},a.src=o})}async function MKe(e){const t=await ghe(e),r=`images/${`${Date.now()}-${t.name}`}`,{error:i}=await Me.storage.from("blog-assets").upload(r,t,{contentType:t.type,upsert:!1});if(i)throw i;const{data:s}=Me.storage.from("blog-assets").getPublicUrl(r);return s.publicUrl}async function LKe(e){const t=await ghe(e,1600,900,.9),r=`featured/${`${Date.now()}-${t.name}`}`,{error:i}=await Me.storage.from("blog-assets").upload(r,t,{contentType:t.type,upsert:!1});if(i)throw i;const{data:s}=Me.storage.from("blog-assets").getPublicUrl(r);return s.publicUrl}var A5="Popover",[yhe,DTt]=fs(A5,[i0]),U2=i0(),[RKe,eA]=yhe(A5),vhe=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,o=U2(t),c=C.useRef(null),[u,d]=C.useState(!1),[h,A]=lo({prop:r,defaultProp:i??!1,onChange:s,caller:A5});return l.jsx(mU,{...o,children:l.jsx(RKe,{scope:t,contentId:kl(),triggerRef:c,open:h,onOpenChange:A,onOpenToggle:C.useCallback(()=>A(f=>!f),[A]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>d(!0),[]),onCustomAnchorRemove:C.useCallback(()=>d(!1),[]),modal:a,children:n})})};vhe.displayName=A5;var xhe="PopoverAnchor",DKe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=eA(xhe,n),s=U2(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return C.useEffect(()=>(a(),()=>o()),[a,o]),l.jsx(mE,{...s,...r,ref:t})});DKe.displayName=xhe;var whe="PopoverTrigger",bhe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=eA(whe,n),s=U2(n),a=sn(t,i.triggerRef),o=l.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":jhe(i.open),...r,ref:a,onClick:at(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:l.jsx(mE,{asChild:!0,...s,children:o})});bhe.displayName=whe;var FH="PopoverPortal",[UKe,HKe]=yhe(FH,{forceMount:void 0}),Che=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=eA(FH,t);return l.jsx(UKe,{scope:t,forceMount:n,children:l.jsx(aa,{present:n||s.open,children:l.jsx(g2,{asChild:!0,container:i,children:r})})})};Che.displayName=FH;var wv="PopoverContent",She=C.forwardRef((e,t)=>{const n=HKe(wv,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=eA(wv,e.__scopePopover);return l.jsx(aa,{present:r||s.open,children:s.modal?l.jsx($Ke,{...i,ref:t}):l.jsx(zKe,{...i,ref:t})})});She.displayName=wv;var QKe=zp("PopoverContent.RemoveScroll"),$Ke=C.forwardRef((e,t)=>{const n=eA(wv,e.__scopePopover),r=C.useRef(null),i=sn(t,r),s=C.useRef(!1);return C.useEffect(()=>{const a=r.current;if(a)return V6(a)},[]),l.jsx(qE,{as:QKe,allowPinchZoom:!0,children:l.jsx(khe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:at(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),s.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:at(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:at(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),zKe=C.forwardRef((e,t)=>{const n=eA(wv,e.__scopePopover),r=C.useRef(!1),i=C.useRef(!1);return l.jsx(khe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),khe=C.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,A=eA(wv,n),f=U2(n);return z6(),l.jsx(VE,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(Zv,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>A.onOpenChange(!1),children:l.jsx(gU,{"data-state":jhe(A.open),role:"dialog",id:A.contentId,...f,...h,ref:t,style:{...h.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)"}})})})}),_he="PopoverClose",VKe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=eA(_he,n);return l.jsx(_t.button,{type:"button",...r,ref:t,onClick:at(e.onClick,()=>i.onOpenChange(!1))})});VKe.displayName=_he;var KKe="PopoverArrow",qKe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=U2(n);return l.jsx(yU,{...i,...r,ref:t})});qKe.displayName=KKe;function jhe(e){return e?"open":"closed"}var WKe=vhe,GKe=bhe,YKe=Che,Bhe=She;const MM=WKe,LM=GKe,vB=C.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>l.jsx(YKe,{children:l.jsx(Bhe,{ref:i,align:t,sideOffset:n,className:ot("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));vB.displayName=Bhe.displayName;const wo=({onClick:e,isActive:t,children:n,title:r})=>l.jsx(xe,{type:"button",variant:t?"default":"ghost",size:"icon",className:"h-8 w-8",onClick:e,title:r,children:n}),XKe=({content:e,onChange:t})=>{const{toast:n}=$f(),r=C.useRef(null),[i,s]=C.useState(""),[a,o]=C.useState(""),c=D9e({extensions:[_Ke,NKe.configure({inline:!1,allowBase64:!1}),OKe.configure({width:640,height:360}),FVe.configure({openOnClick:!1,autolink:!0}),FKe.configure({placeholder:"Start writing your post…"})],content:e,onUpdate:({editor:A})=>{t(A.getHTML())}}),u=C.useCallback(async A=>{var p;const f=(p=A.target.files)==null?void 0:p[0];if(!(!f||!c)){try{n({title:"Uploading image…"});const m=await MKe(f);c.chain().focus().setImage({src:m}).run(),n({title:"Image uploaded"})}catch(m){n({variant:"destructive",title:"Upload failed",description:m instanceof Error?m.message:"Unknown error"})}r.current&&(r.current.value="")}},[c,n]),d=C.useCallback(()=>{!c||!i||(c.commands.setYoutubeVideo({src:i}),s(""))},[c,i]),h=C.useCallback(()=>{!c||!a||(c.chain().focus().setLink({href:a}).run(),o(""))},[c,a]);return c?l.jsxs("div",{className:"border border-input rounded-md overflow-hidden",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 p-2 border-b border-input bg-muted/50",children:[l.jsx(wo,{onClick:()=>c.chain().focus().toggleBold().run(),isActive:c.isActive("bold"),title:"Bold",children:l.jsx(q1e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleItalic().run(),isActive:c.isActive("italic"),title:"Italic",children:l.jsx(u2e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleCode().run(),isActive:c.isActive("code"),title:"Code",children:l.jsx(Z1e,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleHeading({level:1}).run(),isActive:c.isActive("heading",{level:1}),title:"Heading 1",children:l.jsx(s2e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleHeading({level:2}).run(),isActive:c.isActive("heading",{level:2}),title:"Heading 2",children:l.jsx(a2e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleHeading({level:3}).run(),isActive:c.isActive("heading",{level:3}),title:"Heading 3",children:l.jsx(o2e,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleBulletList().run(),isActive:c.isActive("bulletList"),title:"Bullet List",children:l.jsx(m2e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleOrderedList().run(),isActive:c.isActive("orderedList"),title:"Ordered List",children:l.jsx(A2e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().toggleBlockquote().run(),isActive:c.isActive("blockquote"),title:"Blockquote",children:l.jsx(v2e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",children:l.jsx(jre,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(wo,{onClick:()=>{var A;return(A=r.current)==null?void 0:A.click()},title:"Insert Image",children:l.jsx(iU,{className:"h-4 w-4"})}),l.jsx("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:u}),l.jsxs(MM,{children:[l.jsx(LM,{asChild:!0,children:l.jsx(xe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",title:"YouTube",children:l.jsx(Ore,{className:"h-4 w-4"})})}),l.jsx(vB,{className:"w-80",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Je,{placeholder:"YouTube URL",value:i,onChange:A=>s(A.target.value)}),l.jsx(xe,{type:"button",size:"sm",onClick:d,children:"Add"})]})})]}),l.jsxs(MM,{children:[l.jsx(LM,{asChild:!0,children:l.jsx(xe,{type:"button",variant:c.isActive("link")?"default":"ghost",size:"icon",className:"h-8 w-8",title:"Link",children:l.jsx(Sre,{className:"h-4 w-4"})})}),l.jsx(vB,{className:"w-80",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Je,{placeholder:"https://...",value:a,onChange:A=>o(A.target.value)}),l.jsx(xe,{type:"button",size:"sm",onClick:h,children:"Add"})]})})]}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(wo,{onClick:()=>c.chain().focus().undo().run(),title:"Undo",children:l.jsx(_2e,{className:"h-4 w-4"})}),l.jsx(wo,{onClick:()=>c.chain().focus().redo().run(),title:"Redo",children:l.jsx(x2e,{className:"h-4 w-4"})})]}),l.jsx(Dde,{editor:c,className:`prose prose-lg max-w-none p-4 min-h-[300px] focus-within:outline-none
                   prose-headings:font-serif prose-headings:font-medium
                   prose-p:text-foreground prose-a:text-accent
                   [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[280px]
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none`})]}):null},JKe=({value:e,onChange:t})=>{const{toast:n}=$f(),[r,i]=C.useState(!1),[s,a]=C.useState(!1),[o,c]=C.useState(""),[u,d]=C.useState(!1),h=C.useCallback(async p=>{if(!p.type.startsWith("image/")){n({variant:"destructive",title:"Please select an image file"});return}i(!0);try{const m=await LKe(p);t(m),n({title:"Featured image uploaded"})}catch(m){n({variant:"destructive",title:"Upload failed",description:m instanceof Error?m.message:"Unknown error"})}i(!1)},[t,n]),A=C.useCallback(p=>{p.preventDefault(),d(!1);const m=p.dataTransfer.files[0];m&&h(m)},[h]),f=()=>{o.trim()&&(t(o.trim()),c(""),a(!1))};return e?l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{children:"Featured Image"}),l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:e,alt:"Featured",className:"w-full aspect-[16/9] object-cover border border-input rounded-md"}),l.jsx(xe,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(""),children:l.jsx(ra,{className:"h-4 w-4"})})]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{children:"Featured Image"}),l.jsxs("div",{className:`border-2 border-dashed rounded-md p-8 text-center transition-colors ${u?"border-accent bg-accent/10":"border-input hover:border-muted-foreground"}`,onDragOver:p=>{p.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:A,children:[l.jsx(iU,{className:"h-10 w-10 mx-auto mb-3 text-muted-foreground"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r?"Uploading…":"Drag & drop an image or"}),l.jsxs("div",{className:"flex items-center justify-center gap-2",children:[l.jsxs(xe,{type:"button",variant:"outline",size:"sm",disabled:r,onClick:()=>{const p=document.createElement("input");p.type="file",p.accept="image/*",p.onchange=m=>{var y;const g=(y=m.target.files)==null?void 0:y[0];g&&h(g)},p.click()},children:[l.jsx(Pre,{className:"h-4 w-4 mr-1"}),"Upload"]}),l.jsxs(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!s),children:[l.jsx(Sre,{className:"h-4 w-4 mr-1"}),"URL"]})]}),s&&l.jsxs("div",{className:"flex gap-2 mt-4 max-w-md mx-auto",children:[l.jsx(Je,{placeholder:"https://...",value:o,onChange:p=>c(p.target.value)}),l.jsx(xe,{type:"button",size:"sm",onClick:f,children:"Set"})]})]})]})},ZKe=[{term:"white neighborhood",severity:"critical"},{term:"black neighborhood",severity:"critical"},{term:"hispanic area",severity:"critical"},{term:"asian community",severity:"critical"},{term:"segregated",severity:"critical"},{term:"ethnic neighborhood",severity:"critical"},{term:"minority area",severity:"critical"},{term:"colored",severity:"critical"},{term:"exclusive community",severity:"warning"},{term:"private neighborhood",severity:"warning"},{term:"christian neighborhood",severity:"critical"},{term:"jewish area",severity:"critical"},{term:"muslim community",severity:"critical"},{term:"near churches",severity:"warning"},{term:"near synagogues",severity:"warning"},{term:"near mosques",severity:"warning"},{term:"church community",severity:"warning"},{term:"bachelor pad",severity:"warning"},{term:"man cave",severity:"warning"},{term:"master bedroom",severity:"warning"},{term:"no children",severity:"critical"},{term:"adults only",severity:"critical"},{term:"no kids",severity:"critical"},{term:"adult community",severity:"warning"},{term:"perfect for singles",severity:"warning"},{term:"not suitable for families",severity:"critical"},{term:"ideal for young couples",severity:"warning"},{term:"traditional family",severity:"warning"},{term:"best schools for families",severity:"warning"},{term:"great school district",severity:"warning"},{term:"best school district",severity:"warning"},{term:"perfect for retirees",severity:"warning"},{term:"retirees only",severity:"critical"},{term:"handicapped",severity:"critical"},{term:"crippled",severity:"critical"},{term:"wheelchair bound",severity:"critical"},{term:"mentally ill",severity:"critical"},{term:"crazy neighborhood",severity:"critical"},{term:"able-bodied",severity:"warning"},{term:"walking distance",severity:"warning"},{term:"young professionals only",severity:"critical"},{term:"no elderly",severity:"critical"}],eqe=["perfect for families like yours","you would fit in","people like you","your kind of neighborhood","best area for your type","you'll love it here","great for your family","ideal neighborhood for you","you belong here","your type of community"],Fq={"exclusive community":"established community","private neighborhood":"well-maintained neighborhood","walking distance":"nearby amenities within a walkable neighborhood","master bedroom":"primary bedroom","bachelor pad":"studio or one-bedroom home","man cave":"bonus room or flex space","adult community":"age-qualified community (if legally designated)","perfect for singles":"ideal for independent living","ideal for young couples":"great for those starting out","traditional family":"diverse community","best schools for families":"sought-after school district","great school district":"sought-after school district","best school district":"sought-after school district","perfect for retirees":"low-maintenance living","able-bodied":"accessible features available","church community":"established community with local amenities","near churches":"near community gathering places","near synagogues":"near community gathering places","near mosques":"near community gathering places",handicapped:"accessible","wheelchair bound":"wheelchair user","you'll love it here":"a community many find appealing","great for your family":"a neighborhood with broad appeal","ideal neighborhood for you":"a neighborhood worth exploring"};function Mf(e){const t=[],n=e.toLowerCase();for(const{term:r,severity:i}of ZKe){const s=n.indexOf(r);if(s!==-1){const a=Math.max(0,s-30),o=Math.min(e.length,s+r.length+30),c=Fq[r];t.push({term:r,context:`...${e.slice(a,o)}...`,severity:i,suggestion:c?`Replace "${r}" with "${c}".`:`Remove or rephrase "${r}" — it may violate Fair Housing Act protections.`})}}for(const r of eqe){const i=n.indexOf(r);if(i!==-1){const s=Math.max(0,i-30),a=Math.min(e.length,i+r.length+30),o=Fq[r];t.push({term:r,context:`...${e.slice(s,a)}...`,severity:"warning",suggestion:o?`Replace with "${o}".`:`"${r}" could be interpreted as steering. Use neutral, inclusive language.`})}}return t}function Nhe(e){return e.some(t=>t.severity==="critical")}const Ehe=({violations:e})=>{if(e.length===0)return null;const t=e.filter(r=>r.severity==="critical"),n=e.filter(r=>r.severity==="warning");return l.jsxs("div",{className:"border border-destructive/40 bg-destructive/5 rounded p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-destructive",children:[l.jsx(qp,{className:"w-4 h-4"}),"Fair Housing Compliance (",e.length," issue",e.length!==1?"s":"",")"]}),t.map((r,i)=>l.jsxs("div",{className:"flex items-start gap-2 text-sm border-l-2 border-destructive pl-3",children:[l.jsx(x2,{className:"w-3.5 h-3.5 mt-0.5 text-destructive shrink-0"}),l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:['"',r.term,'"']}),l.jsxs("span",{className:"text-muted-foreground ml-1",children:["— ",r.suggestion]})]})]},`c-${i}`)),n.map((r,i)=>l.jsxs("div",{className:"flex items-start gap-2 text-sm border-l-2 border-yellow-500 pl-3",children:[l.jsx(qp,{className:"w-3.5 h-3.5 mt-0.5 text-yellow-600 shrink-0"}),l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:['"',r.term,'"']}),l.jsxs("span",{className:"text-muted-foreground ml-1",children:["— ",r.suggestion]})]})]},`w-${i}`))]})},tqe={title:"",slug:"",excerpt:"",content:"",featured_image:"",author:"Admin",category:"General",tags:"",published:!1,meta_title:"",meta_description:""};function nqe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rqe=({initialData:e,onSubmit:t,onCancel:n,isSubmitting:r,isEditing:i})=>{const[s,a]=C.useState(e||tqe),[o,c]=C.useState(!i),[u,d]=C.useState([]);C.useEffect(()=>{e&&a(e)},[e]);const h=f=>{a(p=>({...p,title:f,slug:o?nqe(f):p.slug}))},A=f=>{f.preventDefault();const p=`${s.title} ${s.excerpt} ${s.content}`,m=Mf(p);d(m),!(s.published&&Nhe(m))&&t(s)};return l.jsxs("form",{onSubmit:A,className:"space-y-6",children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-title",children:"Title *"}),l.jsx(Je,{id:"editor-title",value:s.title,onChange:f=>h(f.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-slug",children:"Slug"}),l.jsx(Je,{id:"editor-slug",value:s.slug,onChange:f=>{c(!1),a({...s,slug:f.target.value})},placeholder:"auto-generated-from-title"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-excerpt",children:"Excerpt"}),l.jsx(hi,{id:"editor-excerpt",value:s.excerpt,onChange:f=>a({...s,excerpt:f.target.value}),rows:2,placeholder:"A brief summary of the post…"})]}),l.jsx(JKe,{value:s.featured_image,onChange:f=>a({...s,featured_image:f})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{children:"Content *"}),l.jsx(XKe,{content:s.content,onChange:f=>a({...s,content:f})})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-author",children:"Author"}),l.jsx(Je,{id:"editor-author",value:s.author,onChange:f=>a({...s,author:f.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-category",children:"Category"}),l.jsx(Je,{id:"editor-category",value:s.category,onChange:f=>a({...s,category:f.target.value})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-tags",children:"Tags (comma-separated)"}),l.jsx(Je,{id:"editor-tags",value:s.tags,onChange:f=>a({...s,tags:f.target.value}),placeholder:"real estate, market, tips"})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-meta-title",children:"Meta Title"}),l.jsx(Je,{id:"editor-meta-title",value:s.meta_title,onChange:f=>a({...s,meta_title:f.target.value}),placeholder:"SEO title (uses post title if empty)"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"editor-meta-desc",children:"Meta Description"}),l.jsx(Je,{id:"editor-meta-desc",value:s.meta_description,onChange:f=>a({...s,meta_description:f.target.value}),placeholder:"SEO description…"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(wc,{id:"editor-published",checked:s.published,onCheckedChange:f=>a({...s,published:f})}),l.jsx(qe,{htmlFor:"editor-published",children:"Publish immediately"})]}),l.jsx(Ehe,{violations:u}),l.jsxs("div",{className:"flex justify-end gap-4",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),l.jsx(xe,{type:"submit",disabled:r,children:r?"Saving…":i?"Update Post":"Create Post"})]})]})};var The="AlertDialog",[iqe,UTt]=fs(The,[ace]),Md=ace(),Ihe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Md(t);return l.jsx(G6,{...r,...n,modal:!0})};Ihe.displayName=The;var sqe="AlertDialogTrigger",aqe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Md(n);return l.jsx(aHe,{...i,...r,ref:t})});aqe.displayName=sqe;var oqe="AlertDialogPortal",Phe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Md(t);return l.jsx(Y6,{...r,...n})};Phe.displayName=oqe;var lqe="AlertDialogOverlay",Ohe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Md(n);return l.jsx(I2,{...i,...r,ref:t})});Ohe.displayName=lqe;var Ey="AlertDialogContent",[cqe,uqe]=iqe(Ey),dqe=Qne("AlertDialogContent"),Fhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=Md(n),a=C.useRef(null),o=sn(t,a),c=C.useRef(null);return l.jsx(nHe,{contentName:Ey,titleName:Mhe,docsSlug:"alert-dialog",children:l.jsx(cqe,{scope:n,cancelRef:c,children:l.jsxs(P2,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:at(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(dqe,{children:r}),l.jsx(fqe,{contentRef:a})]})})})});Fhe.displayName=Ey;var Mhe="AlertDialogTitle",Lhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Md(n);return l.jsx(O2,{...i,...r,ref:t})});Lhe.displayName=Mhe;var Rhe="AlertDialogDescription",Dhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Md(n);return l.jsx(F2,{...i,...r,ref:t})});Dhe.displayName=Rhe;var hqe="AlertDialogAction",Uhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Md(n);return l.jsx(GE,{...i,...r,ref:t})});Uhe.displayName=hqe;var Hhe="AlertDialogCancel",Qhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=uqe(Hhe,n),s=Md(n),a=sn(t,i);return l.jsx(GE,{...s,...r,ref:a})});Qhe.displayName=Hhe;var fqe=({contentRef:e})=>{const t=`\`${Ey}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${Ey}\` by passing a \`${Rhe}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, 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 \`${Ey}\`. 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.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Aqe=Ihe,pqe=Phe,$he=Ohe,zhe=Fhe,Vhe=Uhe,Khe=Qhe,qhe=Lhe,Whe=Dhe;const xB=Aqe,mqe=pqe,Ghe=C.forwardRef(({className:e,...t},n)=>l.jsx($he,{className:ot("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",e),...t,ref:n}));Ghe.displayName=$he.displayName;const c1=C.forwardRef(({className:e,...t},n)=>l.jsxs(mqe,{children:[l.jsx(Ghe,{}),l.jsx(zhe,{ref:n,className:ot("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",e),...t})]}));c1.displayName=zhe.displayName;const u1=({className:e,...t})=>l.jsx("div",{className:ot("flex flex-col space-y-2 text-center sm:text-left",e),...t});u1.displayName="AlertDialogHeader";const d1=({className:e,...t})=>l.jsx("div",{className:ot("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});d1.displayName="AlertDialogFooter";const h1=C.forwardRef(({className:e,...t},n)=>l.jsx(qhe,{ref:n,className:ot("text-lg font-semibold",e),...t}));h1.displayName=qhe.displayName;const f1=C.forwardRef(({className:e,...t},n)=>l.jsx(Whe,{ref:n,className:ot("text-sm text-muted-foreground",e),...t}));f1.displayName=Whe.displayName;const Ty=C.forwardRef(({className:e,...t},n)=>l.jsx(Vhe,{ref:n,className:ot(C6(),e),...t}));Ty.displayName=Vhe.displayName;const A1=C.forwardRef(({className:e,...t},n)=>l.jsx(Khe,{ref:n,className:ot(C6({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));A1.displayName=Khe.displayName;const gqe=()=>{const e=Ll(),{toast:t}=$f(),{user:n,isLoading:r,isAdmin:i,signOut:s}=p0(),[a,o]=C.useState(""),[c,u]=C.useState(!1),[d,h]=C.useState(!1),[A,f]=C.useState(null),[p,m]=C.useState(null),{data:g,isLoading:y,error:v,refetch:x}=x4e(),b=w4e(),w=b4e(),k=C4e();C.useEffect(()=>{const U=localStorage.getItem("blog_api_key");U&&(o(U),u(!0))},[]),C.useEffect(()=>{!r&&!n?e("/auth"):!r&&n&&!i&&(t({variant:"destructive",title:"Access Denied",description:"You don't have permission to access this page."}),e("/"))},[n,r,i,e,t]);const j=()=>{localStorage.setItem("blog_api_key",a),u(!0),x(),t({title:"API Key Saved",description:"Your API key has been saved locally."})},B=()=>{f(null),h(!0)},E=U=>{f(U),h(!0)},P=U=>{var H;return{title:U.title,slug:U.slug,excerpt:U.excerpt||"",content:U.content,featured_image:U.featured_image||"",author:U.author,category:U.category,tags:((H=U.tags)==null?void 0:H.join(", "))||"",published:U.published,meta_title:U.meta_title||"",meta_description:U.meta_description||""}},T=async U=>{const H={title:U.title,slug:U.slug||void 0,excerpt:U.excerpt||void 0,content:U.content,featured_image:U.featured_image||void 0,author:U.author||"Admin",category:U.category||"General",tags:U.tags?U.tags.split(",").map(W=>W.trim()):[],published:U.published,meta_title:U.meta_title||void 0,meta_description:U.meta_description||void 0};try{A?(await w.mutateAsync({slug:A.slug,data:H}),t({title:"Post updated successfully"})):(await b.mutateAsync(H),t({title:"Post created successfully"})),h(!1),f(null)}catch(W){t({variant:"destructive",title:"Error",description:W instanceof Error?W.message:"Something went wrong"})}},N=async()=>{if(p)try{await k.mutateAsync(p),t({title:"Post deleted successfully"}),m(null)}catch(U){t({variant:"destructive",title:"Error",description:U instanceof Error?U.message:"Failed to delete post"})}},F=async U=>{try{await w.mutateAsync({slug:U.slug,data:{published:!U.published}}),t({title:U.published?"Post unpublished":"Post published"})}catch(H){t({variant:"destructive",title:"Error",description:H instanceof Error?H.message:"Failed to update post"})}},L=async()=>{await s(),e("/auth")};return r?l.jsx(un,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):!n||!i?null:l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Blog Admin | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-8",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"heading-section",children:"Blog Admin"}),l.jsx("p",{className:"text-muted-foreground mt-2",children:"Manage your blog posts"})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(xe,{variant:"outline",size:"sm",onClick:()=>e("/admin/profile"),children:[l.jsx(dE,{className:"w-4 h-4 mr-2"}),"Profile"]}),l.jsxs(xe,{variant:"outline",size:"sm",onClick:L,children:[l.jsx(_re,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]}),!c&&l.jsxs(Zt,{className:"mb-8",children:[l.jsx(Sa,{children:l.jsxs(ka,{className:"flex items-center gap-2",children:[l.jsx(sU,{className:"w-5 h-5"}),"API Key Setup"]})}),l.jsxs(en,{children:[l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Enter your BLOG_API_KEY to manage posts. This will be stored locally in your browser."}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx(Je,{type:"password",placeholder:"Enter your BLOG_API_KEY",value:a,onChange:U=>o(U.target.value),className:"max-w-md"}),l.jsx(xe,{onClick:j,children:"Save Key"})]})]})]}),c&&l.jsxs(Zt,{children:[l.jsxs(Sa,{className:"flex flex-row items-center justify-between",children:[l.jsx(ka,{children:"Posts"}),l.jsxs(xe,{onClick:B,children:[l.jsx(Kp,{className:"w-4 h-4 mr-2"}),"New Post"]})]}),l.jsxs(en,{children:[y&&l.jsx("div",{className:"space-y-4",children:[...Array(5)].map((U,H)=>l.jsx(ht,{className:"h-16 w-full"},H))}),v&&l.jsxs("div",{className:"text-center py-8",children:[l.jsx("p",{className:"text-destructive mb-4",children:"Failed to load posts. Check your API key."}),l.jsx(xe,{variant:"outline",onClick:()=>u(!1),children:"Update API Key"})]}),!y&&!v&&g&&l.jsxs(Wf,{children:[l.jsx(Gf,{children:l.jsxs(Li,{children:[l.jsx(vn,{children:"Title"}),l.jsx(vn,{children:"Category"}),l.jsx(vn,{children:"Status"}),l.jsx(vn,{children:"Date"}),l.jsx(vn,{className:"text-right",children:"Actions"})]})}),l.jsxs(Yf,{children:[g.length===0&&l.jsx(Li,{children:l.jsx(on,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No posts yet. Create your first post!"})}),g.map(U=>l.jsxs(Li,{children:[l.jsx(on,{className:"font-medium",children:U.title}),l.jsx(on,{children:U.category}),l.jsx(on,{children:l.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-1 text-xs rounded ${U.published?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200"}`,children:U.published?l.jsxs(l.Fragment,{children:[l.jsx(Tb,{className:"w-3 h-3"})," Published"]}):l.jsxs(l.Fragment,{children:[l.jsx(w7,{className:"w-3 h-3"})," Draft"]})})}),l.jsx(on,{children:new Date(U.created_at).toLocaleDateString()}),l.jsx(on,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>F(U),title:U.published?"Unpublish":"Publish",children:U.published?l.jsx(w7,{className:"w-4 h-4"}):l.jsx(Tb,{className:"w-4 h-4"})}),l.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>E(U),children:l.jsx(Bre,{className:"w-4 h-4"})}),l.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>m(U.slug),children:l.jsx(Ol,{className:"w-4 h-4 text-destructive"})})]})})]},U.id))]})]})]})]})]})}),l.jsx(Fo,{open:d,onOpenChange:h,children:l.jsxs(Ja,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[l.jsx(Za,{children:l.jsx(eo,{children:A?"Edit Post":"Create New Post"})}),l.jsx(rqe,{initialData:A?P(A):void 0,onSubmit:T,onCancel:()=>h(!1),isSubmitting:b.isPending||w.isPending,isEditing:!!A})]})}),l.jsx(xB,{open:!!p,onOpenChange:()=>m(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsx(h1,{children:"Delete Post"}),l.jsx(f1,{children:"Are you sure you want to delete this post? This action cannot be undone."})]}),l.jsxs(d1,{children:[l.jsx(A1,{children:"Cancel"}),l.jsx(Ty,{onClick:N,className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})})]})},yqe=()=>{const e=Ll(),{toast:t}=$f(),{user:n,isLoading:r,isAdmin:i}=p0(),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1),[f,p]=C.useState(""),[m,g]=C.useState(!1);C.useEffect(()=>{!r&&!n?e("/auth"):!r&&n&&!i&&(t({variant:"destructive",title:"Access Denied",description:"You don't have permission to access this page."}),e("/"))},[n,r,i,e,t]),C.useEffect(()=>{const x=localStorage.getItem("blog_api_key");x&&p(x)},[]);const y=async x=>{if(x.preventDefault(),o!==u){t({variant:"destructive",title:"Passwords don't match",description:"Please make sure your new passwords match."});return}if(o.length<6){t({variant:"destructive",title:"Password too short",description:"Password must be at least 6 characters."});return}A(!0);const{error:b}=await Me.auth.updateUser({password:o});b?t({variant:"destructive",title:"Failed to update password",description:b.message}):(t({title:"Password updated",description:"Your password has been changed successfully."}),a(""),c(""),d("")),A(!1)},v=()=>{localStorage.setItem("blog_api_key",f),t({title:"API Key updated",description:"Your API key has been saved locally."})};return r?l.jsx(un,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):!n||!i?null:l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Profile Settings | Holden Richardson | 616 Realty"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-2xl",children:[l.jsxs(xe,{variant:"ghost",onClick:()=>e("/admin/blog"),className:"mb-6",children:[l.jsx(mm,{className:"w-4 h-4 mr-2"}),"Back to Blog Admin"]}),l.jsx("h1",{className:"heading-section mb-8",children:"Profile Settings"}),l.jsxs(Zt,{className:"mb-8",children:[l.jsxs(Sa,{children:[l.jsx(ka,{children:"Account Information"}),l.jsx(jp,{children:"Your account details"})]}),l.jsx(en,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(qe,{className:"text-muted-foreground",children:"Email"}),l.jsx("p",{className:"text-foreground",children:n.email})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"text-muted-foreground",children:"User ID"}),l.jsx("p",{className:"text-foreground font-mono text-sm",children:n.id})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"text-muted-foreground",children:"Role"}),l.jsx("p",{className:"text-foreground",children:"Administrator"})]})]})})]}),l.jsxs(Zt,{className:"mb-8",children:[l.jsxs(Sa,{children:[l.jsx(ka,{children:"Change Password"}),l.jsx(jp,{children:"Update your password"})]}),l.jsx(en,{children:l.jsxs("form",{onSubmit:y,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"new-password",children:"New Password"}),l.jsx(Je,{id:"new-password",type:"password",value:o,onChange:x=>c(x.target.value),placeholder:"••••••••",required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"confirm-new-password",children:"Confirm New Password"}),l.jsx(Je,{id:"confirm-new-password",type:"password",value:u,onChange:x=>d(x.target.value),placeholder:"••••••••",required:!0})]}),l.jsxs(xe,{type:"submit",disabled:h,children:[l.jsx(Ib,{className:"w-4 h-4 mr-2"}),h?"Updating...":"Update Password"]})]})})]}),l.jsxs(Zt,{children:[l.jsxs(Sa,{children:[l.jsxs(ka,{className:"flex items-center gap-2",children:[l.jsx(d2e,{className:"w-5 h-5"}),"API Key"]}),l.jsx(jp,{children:"Your Blog API key for managing posts. This is stored locally in your browser."})]}),l.jsx(en,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"api-key",children:"BLOG_API_KEY"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Je,{id:"api-key",type:m?"text":"password",value:f,onChange:x=>p(x.target.value),placeholder:"Enter your API key"}),l.jsx(xe,{type:"button",variant:"outline",onClick:()=>g(!m),children:m?"Hide":"Show"})]})]}),l.jsxs(xe,{onClick:v,children:[l.jsx(Ib,{className:"w-4 h-4 mr-2"}),"Save API Key"]})]})})]})]})})]})};function Yhe(){const{configMap:e,isLoading:t}=oa(),n=Yae(),r=e.product_tier==="aeo"?"aeo":"core";return{tier:r,isAeo:r==="aeo",isCore:r==="core",isLoading:t,setTier:s=>{n.mutate([{key:"product_tier",value:s}])}}}const vqe=[{key:"agent_name",label:"Agent Name"},{key:"agent_market",label:"Market / City"},{key:"agent_brokerage",label:"Brokerage"},{key:"agent_team",label:"Team Name"},{key:"agent_title",label:"Professional Title"},{key:"agent_phone",label:"Phone Number"},{key:"agent_email",label:"Email Address"}],xqe=[{key:"booking_url",label:"Booking URL (Calendly, etc.)",placeholder:"https://calendly.com/yourname"},{key:"site_base_url",label:"Published Site URL",placeholder:"https://www.holdengr.com"}],wqe=[{key:"about_google_business",label:"Google Business Profile",placeholder:"https://g.page/yourbusiness"},{key:"about_website",label:"Website URL",placeholder:"https://www.yoursite.com"},{key:"about_facebook",label:"Facebook",placeholder:"https://facebook.com/yourpage"},{key:"about_instagram",label:"Instagram",placeholder:"https://instagram.com/yourhandle"},{key:"about_linkedin",label:"LinkedIn",placeholder:"https://linkedin.com/in/yourprofile"},{key:"about_youtube",label:"YouTube",placeholder:"https://youtube.com/@yourchannel"},{key:"about_x",label:"X (Twitter)",placeholder:"https://x.com/yourhandle"},{key:"about_tiktok",label:"TikTok",placeholder:"https://tiktok.com/@yourhandle"},{key:"about_zillow",label:"Zillow",placeholder:"https://zillow.com/profile/yourprofile"},{key:"about_realtor",label:"Realtor.com",placeholder:"https://realtor.com/realestateagents/yourprofile"}],bqe=()=>{const{configMap:e,isLoading:t}=oa(),n=Yae(),[r,i]=C.useState({}),s={...e,...r},a=()=>{const c=Object.entries(r).map(([u,d])=>({key:u,value:d}));if(c.length===0){De({title:"No changes to save"});return}n.mutate(c,{onSuccess:()=>{De({title:"Configuration saved!"}),i({})},onError:u=>De({title:"Error saving",description:u.message,variant:"destructive"})})};if(t)return l.jsx("div",{className:"space-y-4",children:Array.from({length:6}).map((c,u)=>l.jsx(ht,{className:"h-10 w-full"},u))});const o=c=>l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:c.map(u=>l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(qe,{htmlFor:u.key,className:"text-xs uppercase tracking-wider",children:u.label}),l.jsx(Je,{id:u.key,value:s[u.key]||"",onChange:d=>i(h=>({...h,[u.key]:d.target.value})),placeholder:u.placeholder||u.label,type:u.key==="agent_email"?"email":u.key==="agent_phone"?"tel":"text"})]},u.key))});return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"Agent Identity"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Your agent details power AI-generated content and JSON-LD schema across the site."}),o(vqe)]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"CTAs & Site Settings"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Configure your booking link and published site URL. The site URL is used for all JSON-LD schema, Open Graph tags, canonical links, and sitemaps."}),o(xqe)]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"About & Profile Links"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Add your full profile URLs to build authority in AI models and search engines."}),o(wqe)]}),l.jsx("div",{className:"rounded-md border border-accent/30 bg-accent/5 p-4",children:l.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.jsx("span",{className:"font-semibold text-foreground",children:"Follow Up Boss API Key:"})," This key is stored securely as a secret — not in this form. To add or update it, paste your API key in the Lovable chat and ask to save it as a secret."]})}),l.jsxs(xe,{onClick:a,disabled:n.isPending,className:"btn-gold border-0",children:[l.jsx(Ib,{className:"w-4 h-4 mr-2"}),n.isPending?"Saving...":"Save Config"]})]})};function tA(e){return Br({queryKey:["aeo-categories","all"],queryFn:async()=>{let t=Me.from("aeo_categories").select("*").order("display_order");const{data:n,error:r}=await t;if(r)throw r;return n.map(i=>({...i,faq_json:i.faq_json||[],faq_title:i.faq_title||null,video_orientation:i.video_orientation||"horizontal",section_headings:i.section_headings||[],cover_image_id:i.cover_image_id||null,content_image_ids:i.content_image_ids||[],parent_id:i.parent_id||null,stats_json:i.stats_json||[]}))}})}function Cqe(e){return Br({queryKey:["aeo-subcategories",e],enabled:!!e,queryFn:async()=>{const{data:t,error:n}=await Me.from("aeo_categories").select("*").eq("parent_id",e).eq("enabled",!0).order("display_order");if(n)throw n;return t.map(r=>({...r,faq_json:r.faq_json||[],faq_title:r.faq_title||null,video_orientation:r.video_orientation||"horizontal",section_headings:r.section_headings||[],cover_image_id:r.cover_image_id||null,content_image_ids:r.content_image_ids||[],parent_id:r.parent_id||null,stats_json:r.stats_json||[]}))}})}function Nc(e){return Br({queryKey:["aeo-pages",e],queryFn:async()=>{let t=Me.from("aeo_pages").select("*, aeo_categories!inner(*)");const{data:n,error:r}=await t.order("display_order");if(r)throw r;return n.map(i=>({...i,category:i.aeo_categories,faq_json:i.faq_json||[]}))}})}function Sqe(e,t,n){return Br({queryKey:["aeo-page",e,n,t],enabled:!!e&&!!t,queryFn:async()=>{const r=n||e;if(n){const{data:a}=await Me.from("aeo_categories").select("id").eq("slug",e).is("parent_id",null).maybeSingle();if(!a)return null;const{data:o}=await Me.from("aeo_categories").select("id").eq("slug",n).eq("parent_id",a.id).maybeSingle();if(!o)return null;const{data:c,error:u}=await Me.from("aeo_pages").select("*, aeo_categories!inner(*)").eq("category_id",o.id).eq("slug",t).maybeSingle();if(u)throw u;return c?{...c,category:c.aeo_categories,faq_json:c.faq_json||[]}:null}const{data:i,error:s}=await Me.from("aeo_pages").select("*, aeo_categories!inner(*)").eq("aeo_categories.slug",r).eq("slug",t).maybeSingle();if(s)throw s;return i?{...i,category:i.aeo_categories,faq_json:i.faq_json||[]}:null}})}function kqe(e){return Br({queryKey:["aeo-children",e],enabled:!!e,queryFn:async()=>{const{data:t,error:n}=await Me.from("aeo_pages").select("*, aeo_categories(*)").eq("parent_id",e).order("display_order");if(n)throw n;return t.map(r=>({...r,category:r.aeo_categories,faq_json:r.faq_json||[]}))}})}const _qe=new Set(["the","and","for","with","that","this","what","when","where","which","how","why","you","your","are","was","were","from","have","has","had","but","not","can","does","did","into","about","over","under","they","them","their","our","out","get","got","any","all","one","two","its","it's","i've","i'm","don't","grand","rapids","michigan","mi"]);function Mq(e){return new Set((e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(t=>t.length>3&&!_qe.has(t)))}function jqe(e,t,n,r=5){return Br({queryKey:["aeo-peers",e,t,r],enabled:!!e&&!!t,queryFn:async()=>{const{data:i,error:s}=await Me.from("aeo_pages").select("id, title, slug, h1, intro_text, faq_json, display_order").eq("category_id",e).eq("status","published").neq("id",t).order("display_order");if(s)throw s;const a=i||[],o=Mq(n||""),c=a.map(d=>{const A=(Array.isArray(d.faq_json)?d.faq_json:[]).map(m=>`${(m==null?void 0:m.question)||""} ${(m==null?void 0:m.answer)||""}`).join(" "),f=Mq(`${d.h1||""} ${d.title||""} ${d.intro_text||""} ${A}`);let p=0;if(o.size>0)for(const m of o)f.has(m)&&(p+=1);return{p:d,overlap:p}}),u=c.some(d=>d.overlap>0);return c.sort((d,h)=>u&&h.overlap!==d.overlap?h.overlap-d.overlap:(d.p.display_order??0)-(h.p.display_order??0)),c.slice(0,r).map(({p:d})=>({id:d.id,title:d.title,slug:d.slug,h1:d.h1,intro_text:d.intro_text}))}})}function Xhe(){const e=As();return Ms({mutationFn:async t=>{const{data:n,error:r}=await Me.from("aeo_pages").insert(t).select().single();if(r)throw r;return n},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-pages"]})})}function p5(){const e=As();return Ms({mutationFn:async({id:t,...n})=>{const{category:r,children:i,...s}=n,{data:a,error:o}=await Me.from("aeo_pages").update(s).eq("id",t).select().single();if(o)throw o;return a},onSuccess:()=>{e.invalidateQueries({queryKey:["aeo-pages"]}),e.invalidateQueries({queryKey:["aeo-page"]})}})}function Jhe(){const e=As();return Ms({mutationFn:async t=>{const{error:n}=await Me.from("aeo_pages").delete().eq("id",t);if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-pages"]})})}function Zhe(){const e=As();return Ms({mutationFn:async({id:t,...n})=>{const{error:r}=await Me.from("aeo_categories").update(n).eq("id",t);if(r)throw r},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-categories"]})})}function Bqe(){const e=As();return Ms({mutationFn:async t=>{const{error:n}=await Me.from("aeo_categories").delete().eq("id",t);if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-categories"]})})}function Nqe(){const e=As();return Ms({mutationFn:async t=>{const{data:n,error:r}=await Me.from("aeo_categories").insert(t).select().single();if(r)throw r;return n},onSuccess:()=>{e.invalidateQueries({queryKey:["aeo-categories"]}),e.invalidateQueries({queryKey:["aeo-subcategories"]})}})}function RM(e,[t,n]){return Math.min(n,Math.max(t,e))}var Eqe=[" ","Enter","ArrowUp","ArrowDown"],Tqe=[" ","Enter"],im="Select",[m5,g5,Iqe]=aE(im),[v0,HTt]=fs(im,[Iqe,i0]),y5=i0(),[Pqe,nA]=v0(im),[Oqe,Fqe]=v0(im),efe=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:A,required:f,form:p}=e,m=y5(t),[g,y]=C.useState(null),[v,x]=C.useState(null),[b,w]=C.useState(!1),k=f0(u),[j,B]=lo({prop:r,defaultProp:i??!1,onChange:s,caller:im}),[E,P]=lo({prop:a,defaultProp:o,onChange:c,caller:im}),T=C.useRef(null),N=g?p||!!g.closest("form"):!0,[F,L]=C.useState(new Set),U=Array.from(F).map(H=>H.props.value).join(";");return l.jsx(mU,{...m,children:l.jsxs(Pqe,{required:f,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:b,onValueNodeHasChildrenChange:w,contentId:kl(),value:E,onValueChange:P,open:j,onOpenChange:B,dir:k,triggerPointerDownPosRef:T,disabled:A,children:[l.jsx(m5.Provider,{scope:t,children:l.jsx(Oqe,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(H=>{L(W=>new Set(W).add(H))},[]),onNativeOptionRemove:C.useCallback(H=>{L(W=>{const $=new Set(W);return $.delete(H),$})},[]),children:n})}),N?l.jsxs(Sfe,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:E,onChange:H=>P(H.target.value),disabled:A,form:p,children:[E===void 0?l.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};efe.displayName=im;var tfe="SelectTrigger",nfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=y5(n),a=nA(tfe,n),o=a.disabled||r,c=sn(t,a.onTriggerChange),u=g5(n),d=C.useRef("touch"),[h,A,f]=_fe(m=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===a.value),v=jfe(g,m,y);v!==void 0&&a.onValueChange(v.value)}),p=m=>{o||(a.onOpenChange(!0),f()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(mE,{asChild:!0,...s,children:l.jsx(_t.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":kfe(a.value)?"":void 0,...i,ref:c,onClick:at(i.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&p(m)}),onPointerDown:at(i.onPointerDown,m=>{d.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:at(i.onKeyDown,m=>{const g=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&A(m.key),!(g&&m.key===" ")&&Eqe.includes(m.key)&&(p(),m.preventDefault())})})})});nfe.displayName=tfe;var rfe="SelectValue",ife=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,c=nA(rfe,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,h=sn(t,c.onValueNodeChange);return Zi(()=>{u(d)},[u,d]),l.jsx(_t.span,{...o,ref:h,style:{pointerEvents:"none"},children:kfe(c.value)?l.jsx(l.Fragment,{children:a}):s})});ife.displayName=rfe;var Mqe="SelectIcon",sfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return l.jsx(_t.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});sfe.displayName=Mqe;var Lqe="SelectPortal",afe=e=>l.jsx(g2,{asChild:!0,...e});afe.displayName=Lqe;var sm="SelectContent",ofe=C.forwardRef((e,t)=>{const n=nA(sm,e.__scopeSelect),[r,i]=C.useState();if(Zi(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?Qf.createPortal(l.jsx(lfe,{scope:e.__scopeSelect,children:l.jsx(m5.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(cfe,{...e,ref:t})});ofe.displayName=sm;var tc=10,[lfe,rA]=v0(sm),Rqe="SelectContentImpl",Dqe=zp("SelectContent.RemoveScroll"),cfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:A,collisionPadding:f,sticky:p,hideWhenDetached:m,avoidCollisions:g,...y}=e,v=nA(sm,n),[x,b]=C.useState(null),[w,k]=C.useState(null),j=sn(t,Z=>b(Z)),[B,E]=C.useState(null),[P,T]=C.useState(null),N=g5(n),[F,L]=C.useState(!1),U=C.useRef(!1);C.useEffect(()=>{if(x)return V6(x)},[x]),z6();const H=C.useCallback(Z=>{const[de,...ue]=N().map(ie=>ie.ref.current),[se]=ue.slice(-1),he=document.activeElement;for(const ie of Z)if(ie===he||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===de&&w&&(w.scrollTop=0),ie===se&&w&&(w.scrollTop=w.scrollHeight),ie==null||ie.focus(),document.activeElement!==he))return},[N,w]),W=C.useCallback(()=>H([B,x]),[H,B,x]);C.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:$,triggerPointerDownPosRef:z}=v;C.useEffect(()=>{if(x){let Z={x:0,y:0};const de=se=>{var he,ie;Z={x:Math.abs(Math.round(se.pageX)-(((he=z.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(se.pageY)-(((ie=z.current)==null?void 0:ie.y)??0))}},ue=se=>{Z.x<=10&&Z.y<=10?se.preventDefault():x.contains(se.target)||$(!1),document.removeEventListener("pointermove",de),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",ue,{capture:!0})}}},[x,$,z]),C.useEffect(()=>{const Z=()=>$(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[$]);const[Q,ce]=_fe(Z=>{const de=N().filter(he=>!he.disabled),ue=de.find(he=>he.ref.current===document.activeElement),se=jfe(de,Z,ue);se&&setTimeout(()=>se.ref.current.focus())}),R=C.useCallback((Z,de,ue)=>{const se=!U.current&&!ue;(v.value!==void 0&&v.value===de||se)&&(E(Z),se&&(U.current=!0))},[v.value]),M=C.useCallback(()=>x==null?void 0:x.focus(),[x]),Y=C.useCallback((Z,de,ue)=>{const se=!U.current&&!ue;(v.value!==void 0&&v.value===de||se)&&T(Z)},[v.value]),X=r==="popper"?DM:ufe,V=X===DM?{side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:A,collisionPadding:f,sticky:p,hideWhenDetached:m,avoidCollisions:g}:{};return l.jsx(lfe,{scope:n,content:x,viewport:w,onViewportChange:k,itemRefCallback:R,selectedItem:B,onItemLeave:M,itemTextRefCallback:Y,focusSelectedItem:W,selectedItemText:P,position:r,isPositioned:F,searchRef:Q,children:l.jsx(qE,{as:Dqe,allowPinchZoom:!0,children:l.jsx(VE,{asChild:!0,trapped:v.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:at(i,Z=>{var de;(de=v.trigger)==null||de.focus({preventScroll:!0}),Z.preventDefault()}),children:l.jsx(Zv,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:l.jsx(X,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Z=>Z.preventDefault(),...y,...V,onPlaced:()=>L(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:at(y.onKeyDown,Z=>{const de=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!de&&Z.key.length===1&&ce(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let se=N().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const he=Z.target,ie=se.indexOf(he);se=se.slice(ie+1)}setTimeout(()=>H(se)),Z.preventDefault()}})})})})})})});cfe.displayName=Rqe;var Uqe="SelectItemAlignedPosition",ufe=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=nA(sm,n),a=rA(sm,n),[o,c]=C.useState(null),[u,d]=C.useState(null),h=sn(t,j=>d(j)),A=g5(n),f=C.useRef(!1),p=C.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=a,x=C.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&m&&g&&y){const j=s.trigger.getBoundingClientRect(),B=u.getBoundingClientRect(),E=s.valueNode.getBoundingClientRect(),P=y.getBoundingClientRect();if(s.dir!=="rtl"){const he=P.left-B.left,ie=E.left-he,Ce=j.left-ie,Ie=j.width+Ce,te=Math.max(Ie,B.width),je=window.innerWidth-tc,nt=RM(ie,[tc,Math.max(tc,je-te)]);o.style.minWidth=Ie+"px",o.style.left=nt+"px"}else{const he=B.right-P.right,ie=window.innerWidth-E.right-he,Ce=window.innerWidth-j.right-ie,Ie=j.width+Ce,te=Math.max(Ie,B.width),je=window.innerWidth-tc,nt=RM(ie,[tc,Math.max(tc,je-te)]);o.style.minWidth=Ie+"px",o.style.right=nt+"px"}const T=A(),N=window.innerHeight-tc*2,F=m.scrollHeight,L=window.getComputedStyle(u),U=parseInt(L.borderTopWidth,10),H=parseInt(L.paddingTop,10),W=parseInt(L.borderBottomWidth,10),$=parseInt(L.paddingBottom,10),z=U+H+F+$+W,Q=Math.min(g.offsetHeight*5,z),ce=window.getComputedStyle(m),R=parseInt(ce.paddingTop,10),M=parseInt(ce.paddingBottom,10),Y=j.top+j.height/2-tc,X=N-Y,V=g.offsetHeight/2,Z=g.offsetTop+V,de=U+H+Z,ue=z-de;if(de<=Y){const he=T.length>0&&g===T[T.length-1].ref.current;o.style.bottom="0px";const ie=u.clientHeight-m.offsetTop-m.offsetHeight,Ce=Math.max(X,V+(he?M:0)+ie+W),Ie=de+Ce;o.style.height=Ie+"px"}else{const he=T.length>0&&g===T[0].ref.current;o.style.top="0px";const Ce=Math.max(Y,U+m.offsetTop+(he?R:0)+V)+ue;o.style.height=Ce+"px",m.scrollTop=de-Y+m.offsetTop}o.style.margin=`${tc}px 0`,o.style.minHeight=Q+"px",o.style.maxHeight=N+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[A,s.trigger,s.valueNode,o,u,m,g,y,s.dir,r]);Zi(()=>x(),[x]);const[b,w]=C.useState();Zi(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]);const k=C.useCallback(j=>{j&&p.current===!0&&(x(),v==null||v(),p.current=!1)},[x,v]);return l.jsx(Qqe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:f,onScrollButtonChange:k,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:l.jsx(_t.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});ufe.displayName=Uqe;var Hqe="SelectPopperPosition",DM=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=tc,...s}=e,a=y5(n);return l.jsx(gU,{...a,...s,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});DM.displayName=Hqe;var[Qqe,MH]=v0(sm,{}),UM="SelectViewport",dfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=rA(UM,n),a=MH(UM,n),o=sn(t,s.onViewportChange),c=C.useRef(0);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(m5.Slot,{scope:n,children:l.jsx(_t.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:at(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:A}=a;if(A!=null&&A.current&&h){const f=Math.abs(c.current-d.scrollTop);if(f>0){const p=window.innerHeight-tc*2,m=parseFloat(h.style.minHeight),g=parseFloat(h.style.height),y=Math.max(m,g);if(y<p){const v=y+f,x=Math.min(p,v),b=v-x;h.style.height=x+"px",h.style.bottom==="0px"&&(d.scrollTop=b>0?b:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});dfe.displayName=UM;var hfe="SelectGroup",[$qe,zqe]=v0(hfe),Vqe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=kl();return l.jsx($qe,{scope:n,id:i,children:l.jsx(_t.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Vqe.displayName=hfe;var ffe="SelectLabel",Afe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=zqe(ffe,n);return l.jsx(_t.div,{id:i.id,...r,ref:t})});Afe.displayName=ffe;var wB="SelectItem",[Kqe,pfe]=v0(wB),mfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=nA(wB,n),c=rA(wB,n),u=o.value===r,[d,h]=C.useState(s??""),[A,f]=C.useState(!1),p=sn(t,v=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,v,r,i)}),m=kl(),g=C.useRef("touch"),y=()=>{i||(o.onValueChange(r),o.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 l.jsx(Kqe,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:C.useCallback(v=>{h(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:l.jsx(m5.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:l.jsx(_t.div,{role:"option","aria-labelledby":m,"data-highlighted":A?"":void 0,"aria-selected":u&&A,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:p,onFocus:at(a.onFocus,()=>f(!0)),onBlur:at(a.onBlur,()=>f(!1)),onClick:at(a.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:at(a.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:at(a.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:at(a.onPointerMove,v=>{var x;g.current=v.pointerType,i?(x=c.onItemLeave)==null||x.call(c):g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:at(a.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:at(a.onKeyDown,v=>{var b;((b=c.searchRef)==null?void 0:b.current)!==""&&v.key===" "||(Tqe.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});mfe.displayName=wB;var cw="SelectItemText",gfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=nA(cw,n),o=rA(cw,n),c=pfe(cw,n),u=Fqe(cw,n),[d,h]=C.useState(null),A=sn(t,y=>h(y),c.onItemTextChange,y=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,y,c.value,c.disabled)}),f=d==null?void 0:d.textContent,p=C.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Zi(()=>(m(p),()=>g(p)),[m,g,p]),l.jsxs(l.Fragment,{children:[l.jsx(_t.span,{id:c.textId,...s,ref:A}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Qf.createPortal(s.children,a.valueNode):null]})});gfe.displayName=cw;var yfe="SelectItemIndicator",vfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pfe(yfe,n).isSelected?l.jsx(_t.span,{"aria-hidden":!0,...r,ref:t}):null});vfe.displayName=yfe;var HM="SelectScrollUpButton",xfe=C.forwardRef((e,t)=>{const n=rA(HM,e.__scopeSelect),r=MH(HM,e.__scopeSelect),[i,s]=C.useState(!1),a=sn(t,r.onScrollButtonChange);return Zi(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?l.jsx(bfe,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});xfe.displayName=HM;var QM="SelectScrollDownButton",wfe=C.forwardRef((e,t)=>{const n=rA(QM,e.__scopeSelect),r=MH(QM,e.__scopeSelect),[i,s]=C.useState(!1),a=sn(t,r.onScrollButtonChange);return Zi(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?l.jsx(bfe,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});wfe.displayName=QM;var bfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=rA("SelectScrollButton",n),a=C.useRef(null),o=g5(n),c=C.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),Zi(()=>{var d;const u=o().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),l.jsx(_t.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:at(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:at(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:at(i.onPointerLeave,()=>{c()})})}),qqe="SelectSeparator",Cfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(_t.div,{"aria-hidden":!0,...r,ref:t})});Cfe.displayName=qqe;var $M="SelectArrow",Wqe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=y5(n),s=nA($M,n),a=rA($M,n);return s.open&&a.position==="popper"?l.jsx(yU,{...i,...r,ref:t}):null});Wqe.displayName=$M;var Gqe="SelectBubbleInput",Sfe=C.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=C.useRef(null),s=sn(r,i),a=YE(t);return C.useEffect(()=>{const o=i.current;if(!o)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(o,t),o.dispatchEvent(h)}},[a,t]),l.jsx(_t.select,{...n,style:{...qne,...n.style},ref:s,defaultValue:t})});Sfe.displayName=Gqe;function kfe(e){return e===""||e===void 0}function _fe(e){const t=Yi(e),n=C.useRef(""),r=C.useRef(0),i=C.useCallback(a=>{const o=n.current+a;t(o),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(o)},[t]),s=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function jfe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Yqe(e,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function Yqe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xqe=efe,Bfe=nfe,Jqe=ife,Zqe=sfe,eWe=afe,Nfe=ofe,tWe=dfe,Efe=Afe,Tfe=mfe,nWe=gfe,rWe=vfe,Ife=xfe,Pfe=wfe,Ofe=Cfe;const _r=Xqe,jr=Jqe,fr=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Bfe,{ref:r,className:ot("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,l.jsx(Zqe,{asChild:!0,children:l.jsx(yc,{className:"h-4 w-4 opacity-50"})})]}));fr.displayName=Bfe.displayName;const Ffe=C.forwardRef(({className:e,...t},n)=>l.jsx(Ife,{ref:n,className:ot("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Y1e,{className:"h-4 w-4"})}));Ffe.displayName=Ife.displayName;const Mfe=C.forwardRef(({className:e,...t},n)=>l.jsx(Pfe,{ref:n,className:ot("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(yc,{className:"h-4 w-4"})}));Mfe.displayName=Pfe.displayName;const Ar=C.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>l.jsx(eWe,{children:l.jsxs(Nfe,{ref:i,className:ot("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",e),position:n,...r,children:[l.jsx(Ffe,{}),l.jsx(tWe,{className:ot("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Mfe,{})]})}));Ar.displayName=Nfe.displayName;const iWe=C.forwardRef(({className:e,...t},n)=>l.jsx(Efe,{ref:n,className:ot("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));iWe.displayName=Efe.displayName;const dt=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Tfe,{ref:r,className:ot("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",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(rWe,{children:l.jsx(Sl,{className:"h-4 w-4"})})}),l.jsx(nWe,{children:t})]}));dt.displayName=Tfe.displayName;const sWe=C.forwardRef(({className:e,...t},n)=>l.jsx(Ofe,{ref:n,className:ot("-mx-1 my-1 h-px bg-muted",e),...t}));sWe.displayName=Ofe.displayName;function aWe(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var LH="ScrollArea",[Lfe,QTt]=fs(LH),[oWe,Rl]=Lfe(LH),Rfe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,c]=C.useState(null),[u,d]=C.useState(null),[h,A]=C.useState(null),[f,p]=C.useState(null),[m,g]=C.useState(null),[y,v]=C.useState(0),[x,b]=C.useState(0),[w,k]=C.useState(!1),[j,B]=C.useState(!1),E=sn(t,T=>c(T)),P=f0(i);return l.jsx(oWe,{scope:n,type:r,dir:P,scrollHideDelay:s,scrollArea:o,viewport:u,onViewportChange:d,content:h,onContentChange:A,scrollbarX:f,onScrollbarXChange:p,scrollbarXEnabled:w,onScrollbarXEnabledChange:k,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:j,onScrollbarYEnabledChange:B,onCornerWidthChange:v,onCornerHeightChange:b,children:l.jsx(_t.div,{dir:P,...a,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});Rfe.displayName=LH;var Dfe="ScrollAreaViewport",Ufe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...s}=e,a=Rl(Dfe,n),o=C.useRef(null),c=sn(t,o,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.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:i}),l.jsx(_t.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Ufe.displayName=Dfe;var bu="ScrollAreaScrollbar",RH=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Rl(bu,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return C.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?l.jsx(lWe,{...r,ref:t,forceMount:n}):i.type==="scroll"?l.jsx(cWe,{...r,ref:t,forceMount:n}):i.type==="auto"?l.jsx(Hfe,{...r,ref:t,forceMount:n}):i.type==="always"?l.jsx(DH,{...r,ref:t}):null});RH.displayName=bu;var lWe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Rl(bu,e.__scopeScrollArea),[s,a]=C.useState(!1);return C.useEffect(()=>{const o=i.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),l.jsx(aa,{present:n||s,children:l.jsx(Hfe,{"data-state":s?"visible":"hidden",...r,ref:t})})}),cWe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Rl(bu,e.__scopeScrollArea),s=e.orientation==="horizontal",a=x5(()=>c("SCROLL_END"),100),[o,c]=aWe("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 C.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,i.scrollHideDelay,c]),C.useEffect(()=>{const u=i.viewport,d=s?"scrollLeft":"scrollTop";if(u){let h=u[d];const A=()=>{const f=u[d];h!==f&&(c("SCROLL"),a()),h=f};return u.addEventListener("scroll",A),()=>u.removeEventListener("scroll",A)}},[i.viewport,s,c,a]),l.jsx(aa,{present:n||o!=="hidden",children:l.jsx(DH,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:at(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:at(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Hfe=C.forwardRef((e,t)=>{const n=Rl(bu,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=C.useState(!1),o=e.orientation==="horizontal",c=x5(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?u:d)}},10);return bv(n.viewport,c),bv(n.content,c),l.jsx(aa,{present:r||s,children:l.jsx(DH,{"data-state":s?"visible":"hidden",...i,ref:t})})}),DH=C.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Rl(bu,e.__scopeScrollArea),s=C.useRef(null),a=C.useRef(0),[o,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Kfe(o.viewport,o.content),d={...r,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:A=>s.current=A,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:A=>a.current=A};function h(A,f){return pWe(A,a.current,o,f)}return n==="horizontal"?l.jsx(uWe,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const A=i.viewport.scrollLeft,f=Lq(A,o,i.dir);s.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:A=>{i.viewport&&(i.viewport.scrollLeft=A)},onDragScroll:A=>{i.viewport&&(i.viewport.scrollLeft=h(A,i.dir))}}):n==="vertical"?l.jsx(dWe,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const A=i.viewport.scrollTop,f=Lq(A,o);s.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:A=>{i.viewport&&(i.viewport.scrollTop=A)},onDragScroll:A=>{i.viewport&&(i.viewport.scrollTop=h(A))}}):null}),uWe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Rl(bu,e.__scopeScrollArea),[a,o]=C.useState(),c=C.useRef(null),u=sn(t,c,s.onScrollbarXChange);return C.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx($fe,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":v5(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(s.viewport){const A=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(A),Wfe(A,h)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:CB(a.paddingLeft),paddingEnd:CB(a.paddingRight)}})}})}),dWe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Rl(bu,e.__scopeScrollArea),[a,o]=C.useState(),c=C.useRef(null),u=sn(t,c,s.onScrollbarYChange);return C.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx($fe,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":v5(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(s.viewport){const A=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(A),Wfe(A,h)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:CB(a.paddingTop),paddingEnd:CB(a.paddingBottom)}})}})}),[hWe,Qfe]=Lfe(bu),$fe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...A}=e,f=Rl(bu,n),[p,m]=C.useState(null),g=sn(t,E=>m(E)),y=C.useRef(null),v=C.useRef(""),x=f.viewport,b=r.content-r.viewport,w=Yi(d),k=Yi(c),j=x5(h,10);function B(E){if(y.current){const P=E.clientX-y.current.left,T=E.clientY-y.current.top;u({x:P,y:T})}}return C.useEffect(()=>{const E=P=>{const T=P.target;(p==null?void 0:p.contains(T))&&w(P,b)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[x,p,b,w]),C.useEffect(k,[r,k]),bv(p,j),bv(f.content,j),l.jsx(hWe,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:Yi(s),onThumbPointerUp:Yi(a),onThumbPositionChange:k,onThumbPointerDown:Yi(o),children:l.jsx(_t.div,{...A,ref:g,style:{position:"absolute",...A.style},onPointerDown:at(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),y.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),B(E))}),onPointerMove:at(e.onPointerMove,B),onPointerUp:at(e.onPointerUp,E=>{const P=E.target;P.hasPointerCapture(E.pointerId)&&P.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=v.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),bB="ScrollAreaThumb",zfe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Qfe(bB,e.__scopeScrollArea);return l.jsx(aa,{present:n||i.hasThumb,children:l.jsx(fWe,{ref:t,...r})})}),fWe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=Rl(bB,n),a=Qfe(bB,n),{onThumbPositionChange:o}=a,c=sn(t,h=>a.onThumbChange(h)),u=C.useRef(void 0),d=x5(()=>{u.current&&(u.current(),u.current=void 0)},100);return C.useEffect(()=>{const h=s.viewport;if(h){const A=()=>{if(d(),!u.current){const f=mWe(h,o);u.current=f,o()}};return o(),h.addEventListener("scroll",A),()=>h.removeEventListener("scroll",A)}},[s.viewport,d,o]),l.jsx(_t.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:at(e.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),p=h.clientX-f.left,m=h.clientY-f.top;a.onThumbPointerDown({x:p,y:m})}),onPointerUp:at(e.onPointerUp,a.onThumbPointerUp)})});zfe.displayName=bB;var UH="ScrollAreaCorner",Vfe=C.forwardRef((e,t)=>{const n=Rl(UH,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(AWe,{...e,ref:t}):null});Vfe.displayName=UH;var AWe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Rl(UH,n),[s,a]=C.useState(0),[o,c]=C.useState(0),u=!!(s&&o);return bv(i.scrollbarX,()=>{var h;const d=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),bv(i.scrollbarY,()=>{var h;const d=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(d),a(d)}),u?l.jsx(_t.div,{...r,ref:t,style:{width:s,height:o,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function CB(e){return e?parseInt(e,10):0}function Kfe(e,t){const n=e/t;return isNaN(n)?0:n}function v5(e){const t=Kfe(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function pWe(e,t,n,r="ltr"){const i=v5(n),s=i/2,a=t||s,o=i-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return qfe([c,u],h)(e)}function Lq(e,t,n="ltr"){const r=v5(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,a=t.content-t.viewport,o=s-r,c=n==="ltr"?[0,a]:[a*-1,0],u=RM(e,c);return qfe([0,a],[0,o])(u)}function qfe(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Wfe(e,t){return e>0&&e<t}var mWe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,o=n.top!==s.top;(a||o)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function x5(e,t){const n=Yi(e),r=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),C.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function bv(e,t){const n=Yi(t);Zi(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var Gfe=Rfe,gWe=Ufe,yWe=Vfe;const Yfe=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Gfe,{ref:r,className:ot("relative overflow-hidden",e),...n,children:[l.jsx(gWe,{className:"h-full w-full rounded-[inherit]",children:t}),l.jsx(Xfe,{}),l.jsx(yWe,{})]}));Yfe.displayName=Gfe.displayName;const Xfe=C.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(RH,{ref:r,orientation:t,className:ot("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:l.jsx(zfe,{className:"relative flex-1 rounded-full bg-border"})}));Xfe.displayName=RH.displayName;const SB=({selectedId:e,onSelect:t,label:n})=>{const[r,i]=C.useState(!1),{data:s}=A0(),a=(s||[]).filter(u=>u.media_type==="stock_photo"),o=a.find(u=>u.id===e),c=o?kc(o.file_path):null;return l.jsxs("div",{className:"space-y-1.5",children:[n&&l.jsx("label",{className:"text-xs font-medium text-muted-foreground block",children:n}),l.jsxs(MM,{open:r,onOpenChange:i,children:[l.jsx(LM,{asChild:!0,children:l.jsx(xe,{variant:"outline",className:ot("relative h-auto min-h-[80px] w-full justify-start p-0 overflow-hidden",!c&&"border-dashed"),children:c?l.jsxs("div",{className:"relative w-full",children:[l.jsx("img",{src:c,alt:(o==null?void 0:o.alt_text)||"Selected",className:"w-full h-24 object-cover"}),l.jsx("button",{type:"button",className:"absolute top-1 right-1 bg-background/80 rounded-full p-1 hover:bg-destructive hover:text-destructive-foreground transition-colors",onClick:u=>{u.stopPropagation(),t(null)},children:l.jsx(ra,{className:"w-3 h-3"})})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center w-full py-4 text-muted-foreground",children:[l.jsx(c2e,{className:"w-5 h-5 mb-1"}),l.jsx("span",{className:"text-xs",children:"Pick image"})]})})}),l.jsx(vB,{className:"w-80 p-2",align:"start",children:l.jsx(Yfe,{className:"h-64",children:a.length===0?l.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:"No stock photos uploaded yet."}):l.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:a.map(u=>{const d=kc(u.file_path),h=u.id===e;return l.jsx("button",{type:"button",className:ot("aspect-square overflow-hidden rounded border-2 transition-all",h?"border-primary ring-2 ring-primary/30":"border-transparent hover:border-accent/50"),onClick:()=>{t(u.id),i(!1)},children:l.jsx("img",{src:d,alt:u.alt_text||u.file_name,className:"w-full h-full object-cover",loading:"lazy"})},u.id)})})})})]})]})},Jfe=({category:e})=>{const t=Zhe(),[n,r]=C.useState(e.context||""),[i,s]=C.useState(e.intro_text||""),[a,o]=C.useState(e.faq_json||[]),[c,u]=C.useState(e.faq_title||""),[d,h]=C.useState(e.video_url||""),[A,f]=C.useState(e.video_orientation||"horizontal"),[p,m]=C.useState(e.video_transcript||""),[g,y]=C.useState(e.video_headline||""),[v,x]=C.useState(e.cta_headline||""),[b,w]=C.useState(e.cover_image_id||null),[k,j]=C.useState(e.content_image_ids||[]),[B,E]=C.useState(e.stats_json||[]),[P,T]=C.useState(""),[N,F]=C.useState(!1),[L,U]=C.useState(!1),[H,W]=C.useState(!1),[$,z]=C.useState(null),[Q,ce]=C.useState([]);C.useEffect(()=>{r(e.context||""),s(e.intro_text||""),o(e.faq_json||[]),u(e.faq_title||""),h(e.video_url||""),f(e.video_orientation||"horizontal"),m(e.video_transcript||""),y(e.video_headline||""),x(e.cta_headline||""),w(e.cover_image_id||null),j(e.content_image_ids||[]),E(e.stats_json||[])},[e.id]);const R=i.split(`

`).filter(Boolean);C.useEffect(()=>{j(se=>{const he=[...se];for(;he.length<R.length;)he.push(null);return he.slice(0,R.length)})},[R.length]);const M=()=>o([...a,{question:"",answer:""}]),Y=(se,he,ie)=>{const Ce=[...a];Ce[se]={...Ce[se],[he]:ie},o(Ce)},X=se=>o(a.filter((he,ie)=>ie!==se)),V=async()=>{if(!P.trim()){De({title:"Enter a prompt",description:"Describe the FAQ topics you want generated.",variant:"destructive"});return}F(!0),z(null);try{const{data:se,error:he}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-category-faq",prompt:P.trim(),category_name:e.name,category_slug:e.slug,category_context:n||e.context||null,count:6}});if(he)throw he;if(se!=null&&se.error)throw new Error(se.error);z(se.faq_items||[]),De({title:"FAQ generated!",description:"Review the items below, then approve to add them."})}catch(se){De({title:"Generation failed",description:se.message,variant:"destructive"})}finally{F(!1)}},Z=()=>{$&&(o($),u(P.trim()),z(null),T(""),De({title:"FAQ applied",description:"Don't forget to save!"}))},de=()=>{z(null)},ue=async()=>{const se=a.map(je=>`${je.question} ${je.answer}`).join(" "),he=`${i} ${se}`,ie=Mf(he);ce(ie),ie.length>0&&De({title:"Fair Housing warnings found",description:"Review the warnings below. Critical issues should be fixed.",variant:"destructive"});const Ce=i.split(`

`).filter(Boolean);let Ie=[];if(Ce.length>0)try{const{data:je,error:nt}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-section-headings",paragraphs:Ce,category_name:e.name,category_context:n||e.context||null}});!nt&&(je!=null&&je.headings)&&(Ie=je.headings)}catch{}const te=k.slice(0,Ce.length).map(je=>je||null).filter(je=>je!==null);try{await t.mutateAsync({id:e.id,context:n||null,intro_text:i||null,faq_json:a.filter(je=>je.question.trim()&&je.answer.trim()),faq_title:c||null,video_url:d||null,video_orientation:A,video_transcript:p||null,video_headline:g||null,cta_headline:v||null,section_headings:Ie,cover_image_id:b||null,content_image_ids:te,stats_json:B.filter(je=>je.label.trim()&&je.value.trim())}),De({title:"Category content saved"})}catch(je){De({title:"Error",description:je.message,variant:"destructive"})}};return l.jsxs("div",{className:"space-y-6 pt-4 border-t border-border/50 mt-4",children:[l.jsx("div",{children:l.jsx(SB,{selectedId:b,onSelect:w,label:"Cover Image (hero banner)"})}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:["Category Context ",l.jsx("span",{className:"text-muted-foreground/60",children:"(not visible on site — guides AI generation)"})]}),l.jsx(hi,{value:n,onChange:se=>r(se.target.value),placeholder:"Describe what this category is about, who it's for, and what angle to take.",className:"min-h-[80px] text-sm"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Category Intro (visible on landing page)"}),l.jsxs(xe,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:L,onClick:async()=>{U(!0);try{const{data:se,error:he}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-category-intro",category_name:e.name,category_slug:e.slug,category_context:n||e.context||null}});if(he)throw he;if(se!=null&&se.error)throw new Error(se.error);s(se.intro_text),De({title:"Intro generated!",description:"Review and edit, then save."})}catch(se){De({title:"Generation failed",description:se.message,variant:"destructive"})}finally{U(!1)}},children:[l.jsx(Os,{className:"w-3 h-3 mr-1"}),L?"Generating...":"Generate with AI"]})]}),l.jsx(hi,{value:i,onChange:se=>s(se.target.value),placeholder:"2-3 paragraphs about this topic in West Michigan. Separate paragraphs with a blank line.",className:"min-h-[120px] text-sm"})]}),R.length>0&&l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-2 block",children:["Content Block Images (",R.length," paragraphs)"]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:R.map((se,he)=>l.jsx(SB,{selectedId:k[he]||null,onSelect:ie=>{j(Ce=>{const Ie=[...Ce];return Ie[he]=ie,Ie})},label:`Block ${he+1}`},he))})]}),l.jsxs("div",{className:"border border-dashed border-border rounded p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(gre,{className:"w-4 h-4 text-muted-foreground"}),l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Quick Stats ",l.jsx("span",{className:"text-muted-foreground/60",children:"(shown as stat pills on cards & stats band)"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(xe,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:H,onClick:async()=>{W(!0);try{const se=!e.parent_id,{data:he,error:ie}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-neighborhood-stats",community_name:e.name,is_metro:se}});if(ie)throw ie;if(he!=null&&he.error)throw new Error(he.error);E(he.stats||[]),De({title:"Stats generated!",description:"Review and edit, then save."})}catch(se){De({title:"Generation failed",description:se.message,variant:"destructive"})}finally{W(!1)}},children:[l.jsx(Os,{className:"w-3 h-3 mr-1"}),H?"Looking up…":"Generate Stats"]}),l.jsxs(xe,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>E([...B,{label:"",value:"",icon:"pin"}]),children:[l.jsx(Kp,{className:"w-3 h-3 mr-1"})," Add Manual"]})]})]}),B.map((se,he)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Je,{value:se.label,onChange:ie=>{const Ce=[...B];Ce[he]={...Ce[he],label:ie.target.value},E(Ce)},placeholder:"Label (e.g. Commute)",className:"text-sm flex-1"}),l.jsx(Je,{value:se.value,onChange:ie=>{const Ce=[...B];Ce[he]={...Ce[he],value:ie.target.value},E(Ce)},placeholder:"Value (e.g. 15 min)",className:"text-sm flex-1"}),l.jsxs(_r,{value:se.icon||"pin",onValueChange:ie=>{const Ce=[...B];Ce[he]={...Ce[he],icon:ie},E(Ce)},children:[l.jsx(fr,{className:"w-[100px] text-sm",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"car",children:"🚗 Commute"}),l.jsx(dt,{value:"trees",children:"🌳 Setting"}),l.jsx(dt,{value:"building",children:"🏗️ Build"}),l.jsx(dt,{value:"heart",children:"❤️ Vibe"}),l.jsx(dt,{value:"users",children:"👥 Population"}),l.jsx(dt,{value:"school",children:"🎓 Schools"}),l.jsx(dt,{value:"pin",children:"📍 Location"})]})]}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>E(B.filter((ie,Ce)=>Ce!==he)),children:l.jsx(Ol,{className:"w-3.5 h-3.5"})})]},he)),B.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"No stats yet. Add stats like commute time, setting, vibe, etc."})]}),l.jsxs("div",{className:"border border-dashed border-border rounded p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(B2e,{className:"w-4 h-4 text-muted-foreground"}),l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Category Video ",l.jsx("span",{className:"text-muted-foreground/60",children:"(optional YouTube embed)"})]})]}),l.jsx(Je,{value:g,onChange:se=>y(se.target.value),placeholder:"Video headline, e.g. Watch: Your Guide to Downsizing in West Michigan",className:"text-sm"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(Je,{value:d,onChange:se=>h(se.target.value),placeholder:"YouTube URL, e.g. https://youtube.com/watch?v=...",className:"text-sm flex-1"}),l.jsxs(_r,{value:A,onValueChange:f,children:[l.jsx(fr,{className:"w-[140px] text-sm",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"horizontal",children:"Horizontal"}),l.jsx(dt,{value:"vertical",children:"Vertical"})]})]})]}),l.jsx(hi,{value:p,onChange:se=>m(se.target.value),placeholder:"Paste the video transcript here (shown in an expandable accordion below the video)",className:"min-h-[80px] text-sm"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:["CTA Section Headline ",l.jsx("span",{className:"text-muted-foreground/60",children:"(bottom of category page)"})]}),l.jsx(Je,{value:v,onChange:se=>x(se.target.value),placeholder:`e.g. Ready to Start Your ${e.name} Journey?`,className:"text-sm"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Category FAQ (",a.length," items)"]}),l.jsxs(xe,{variant:"ghost",size:"sm",onClick:M,className:"h-7 text-xs",children:[l.jsx(Kp,{className:"w-3 h-3 mr-1"})," Add Manual"]})]}),l.jsxs("div",{className:"border border-dashed border-border rounded p-3 mb-4 space-y-2",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground block",children:"Generate FAQ with AI"}),l.jsx(Je,{value:P,onChange:se=>T(se.target.value),placeholder:"e.g. Common questions about downsizing in the Grand Rapids market",className:"text-sm",onKeyDown:se=>se.key==="Enter"&&!N&&V()}),l.jsxs(xe,{size:"sm",onClick:V,disabled:!P.trim()||N,className:"btn-gold border-0 text-xs",children:[l.jsx(Os,{className:"w-3 h-3 mr-1"}),N?"Generating...":"Generate FAQ"]})]}),$&&l.jsxs("div",{className:"border border-primary/30 bg-primary/5 rounded p-4 mb-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-medium text-primary",children:["Generated ",$.length," FAQ items — review below"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(xe,{size:"sm",variant:"outline",onClick:de,className:"h-7 text-xs",children:[l.jsx(ra,{className:"w-3 h-3 mr-1"})," Discard"]}),l.jsxs(xe,{size:"sm",onClick:Z,className:"h-7 text-xs btn-gold border-0",children:[l.jsx(Sl,{className:"w-3 h-3 mr-1"})," Approve & Replace"]})]})]}),$.map((se,he)=>l.jsxs("div",{className:"border border-border/50 rounded p-3 space-y-1 bg-background",children:[l.jsx("p",{className:"text-sm font-medium",children:se.question}),l.jsx("p",{className:"text-sm text-muted-foreground",children:se.answer})]},he))]}),l.jsx("div",{className:"space-y-3",children:a.map((se,he)=>l.jsxs("div",{className:"border border-border/50 rounded p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Je,{value:se.question,onChange:ie=>Y(he,"question",ie.target.value),placeholder:"Question...",className:"text-sm"}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>X(he),children:l.jsx(Ol,{className:"w-3.5 h-3.5"})})]}),l.jsx(hi,{value:se.answer,onChange:ie=>Y(he,"answer",ie.target.value),placeholder:"Answer...",className:"text-sm min-h-[60px]"})]},he))})]}),l.jsx(Ehe,{violations:Q}),l.jsxs(xe,{onClick:ue,disabled:t.isPending,size:"sm",children:[l.jsx(Ib,{className:"w-3.5 h-3.5 mr-1.5"}),t.isPending?"Saving...":"Save Content"]})]})},vWe=()=>{const{data:e}=tA(),{configMap:t}=oa(),n=Xhe(),r=p5(),[i,s]=C.useState(""),[a,o]=C.useState(""),[c,u]=C.useState(""),[d,h]=C.useState(""),[A,f]=C.useState(""),[p,m]=C.useState(""),[g,y]=C.useState(null),[v,x]=C.useState(!1),b=(e||[]).find(k=>k.slug==="news"&&k.parent_id!==null),w=async()=>{if(!i.trim()||!a.trim()){De({title:"Title and press release content are required",variant:"destructive"});return}if(!b){De({title:"News category not found",variant:"destructive"});return}x(!0);try{const k={national:d.trim()||null,local:A.trim()||null,source:p.trim()||null},{data:j,error:B}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"create-press-release",title:i.trim(),press_content:a.trim(),press_links:k,date_published:c||new Date().toISOString().split("T")[0],agent_name:t.agent_name,agent_market:t.agent_market}});if(B)throw B;if(j!=null&&j.error)throw new Error(j.error);const E=j.slug||i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),P=await n.mutateAsync({category_id:b.id,title:i.trim(),slug:E,h1:j.h1||i.trim(),is_parent:!1,status:"draft",cover_image_id:g});await r.mutateAsync({id:P.id,h1:j.h1,subheadline:j.subheadline,intro_text:j.intro_text,body_content:j.body_content,faq_json:j.faq_json,meta_title:j.meta_title,meta_description:j.meta_description,schema_markup:j.schema_markup,press_links:j.press_links}),De({title:"Press release created!",description:`Slug: /about/news/${E} — ready for review in Page Generator.`}),s(""),o(""),u(""),h(""),f(""),m(""),y(null)}catch(k){De({title:"Error",description:k.message,variant:"destructive"})}finally{x(!1)}};return l.jsxs("div",{className:"border border-border rounded p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(g2e,{className:"w-5 h-5 text-accent"}),l.jsx("h3",{className:"font-serif text-xl",children:"New Press Release"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste your press release below. The system will wrap it with your entity information, generate FAQs, and build proper NewsArticle schema automatically."}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(qe,{className:"text-xs uppercase tracking-wider",children:"Headline / Title"}),l.jsx(Je,{value:i,onChange:k=>s(k.target.value),placeholder:"e.g., Holden Smith Named Top Agent in Grand Rapids for 2026"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(qe,{className:"text-xs uppercase tracking-wider",children:"Date Published"}),l.jsx(Je,{type:"date",value:c,onChange:k=>u(k.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(qe,{className:"text-xs uppercase tracking-wider",children:"Press Release Content"}),l.jsx(hi,{value:a,onChange:k=>o(k.target.value),placeholder:"Paste the full press release text here...",rows:12,className:"font-mono text-sm"})]}),l.jsxs("div",{className:"border border-border/50 rounded p-4 space-y-3 bg-muted/30",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(ao,{className:"w-4 h-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"Pickup Links"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Where was this press release picked up? Add links to each version."}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs uppercase tracking-wider",children:"National"}),l.jsx(Je,{value:d,onChange:k=>h(k.target.value),placeholder:"https://prnewswire.com/..."})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs uppercase tracking-wider",children:"Local"}),l.jsx(Je,{value:A,onChange:k=>f(k.target.value),placeholder:"https://localnews.com/..."})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs uppercase tracking-wider",children:"Source"}),l.jsx(Je,{value:p,onChange:k=>m(k.target.value),placeholder:"https://yourbrokerage.com/..."})]})]})]}),l.jsxs("div",{className:"flex items-end gap-4",children:[l.jsx("div",{className:"w-40",children:l.jsx(SB,{selectedId:g,onSelect:y,label:"Cover Image"})}),l.jsxs(xe,{onClick:w,disabled:!i.trim()||!a.trim()||v,className:"btn-gold border-0",children:[l.jsx(Os,{className:"w-4 h-4 mr-2"}),v?"Processing...":"Create Press Release"]})]})]})]})},xWe=({categoryId:e})=>{const{data:t}=Nc(),n=p5(),r=Jhe(),i=(t||[]).filter(o=>o.category_id===e).sort((o,c)=>new Date(c.created_at).getTime()-new Date(o.created_at).getTime()),s=async o=>{await n.mutateAsync({id:o.id,status:"published",published_at:new Date().toISOString()}),De({title:"Published!",description:`"${o.title}" is now live.`})},a=async o=>{await r.mutateAsync(o),De({title:"Press release deleted"})};return l.jsxs("div",{className:"space-y-6 pt-4 border-t border-border/50 mt-4",children:[l.jsx(vWe,{}),i.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("h4",{className:"font-serif text-lg",children:["Press Releases (",i.length,")"]}),l.jsx("div",{className:"space-y-2",children:i.map(o=>l.jsxs("div",{className:"flex items-center justify-between p-3 border border-border rounded",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[l.jsx(Yt,{variant:o.status==="published"?"default":"secondary",className:"text-xs capitalize",children:o.status}),l.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(o.created_at).toLocaleDateString()})]}),l.jsx("p",{className:"font-serif text-sm truncate",children:o.title}),o.press_links&&l.jsxs("div",{className:"flex gap-3 mt-1",children:[o.press_links.national&&l.jsx("a",{href:o.press_links.national,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-accent hover:underline",children:"National ↗"}),o.press_links.local&&l.jsx("a",{href:o.press_links.local,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-accent hover:underline",children:"Local ↗"}),o.press_links.source&&l.jsx("a",{href:o.press_links.source,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-accent hover:underline",children:"Source ↗"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[o.status==="draft"&&l.jsxs(xe,{size:"sm",onClick:()=>s(o),className:"btn-gold border-0 text-xs",children:[l.jsx(w2,{className:"w-3 h-3 mr-1"})," Publish"]}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>a(o.id),children:l.jsx(Ol,{className:"w-3 h-3"})})]})]},o.id))})]})]})},Xw=roe,Jw=A6,Zw=m6;var w5="Checkbox",[wWe,$Tt]=fs(w5),[bWe,HH]=wWe(w5);function CWe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:s,form:a,name:o,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=e,[A,f]=lo({prop:n,defaultProp:i??!1,onChange:c,caller:w5}),[p,m]=C.useState(null),[g,y]=C.useState(null),v=C.useRef(!1),x=p?!!a||!!p.closest("form"):!0,b={checked:A,disabled:s,setChecked:f,control:p,setControl:m,name:o,form:a,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:vf(i)?!1:i,isFormControl:x,bubbleInput:g,setBubbleInput:y};return l.jsx(bWe,{scope:t,...b,children:SWe(h)?h(b):r})}var Zfe="CheckboxTrigger",eAe=C.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:s,value:a,disabled:o,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:A,isFormControl:f,bubbleInput:p}=HH(Zfe,e),m=sn(i,d),g=C.useRef(c);return C.useEffect(()=>{const y=s==null?void 0:s.form;if(y){const v=()=>h(g.current);return y.addEventListener("reset",v),()=>y.removeEventListener("reset",v)}},[s,h]),l.jsx(_t.button,{type:"button",role:"checkbox","aria-checked":vf(c)?"mixed":c,"aria-required":u,"data-state":sAe(c),"data-disabled":o?"":void 0,disabled:o,value:a,...r,ref:m,onKeyDown:at(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:at(n,y=>{h(v=>vf(v)?!0:!v),p&&f&&(A.current=y.isPropagationStopped(),A.current||y.stopPropagation())})})});eAe.displayName=Zfe;var QH=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:c,onCheckedChange:u,form:d,...h}=e;return l.jsx(CWe,{__scopeCheckbox:n,checked:i,defaultChecked:s,disabled:o,required:a,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:A})=>l.jsxs(l.Fragment,{children:[l.jsx(eAe,{...h,ref:t,__scopeCheckbox:n}),A&&l.jsx(iAe,{__scopeCheckbox:n})]})})});QH.displayName=w5;var tAe="CheckboxIndicator",nAe=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=HH(tAe,n);return l.jsx(aa,{present:r||vf(s.checked)||s.checked===!0,children:l.jsx(_t.span,{"data-state":sAe(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});nAe.displayName=tAe;var rAe="CheckboxBubbleInput",iAe=C.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:a,required:o,disabled:c,name:u,value:d,form:h,bubbleInput:A,setBubbleInput:f}=HH(rAe,e),p=sn(n,f),m=YE(s),g=pE(r);C.useEffect(()=>{const v=A;if(!v)return;const x=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(x,"checked").set,k=!i.current;if(m!==s&&w){const j=new Event("click",{bubbles:k});v.indeterminate=vf(s),w.call(v,vf(s)?!1:s),v.dispatchEvent(j)}},[A,m,s,i]);const y=C.useRef(vf(s)?!1:s);return l.jsx(_t.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:o,disabled:c,name:u,value:d,form:h,...t,tabIndex:-1,ref:p,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});iAe.displayName=rAe;function SWe(e){return typeof e=="function"}function vf(e){return e==="indeterminate"}function sAe(e){return vf(e)?"indeterminate":e?"checked":"unchecked"}const $o=C.forwardRef(({className:e,...t},n)=>l.jsx(QH,{ref:n,className:ot("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",e),...t,children:l.jsx(nAe,{className:ot("flex items-center justify-center text-current"),children:l.jsx(Sl,{className:"h-4 w-4"})})}));$o.displayName=QH.displayName;var $H="Progress",zH=100,[kWe,zTt]=fs($H),[_We,jWe]=kWe($H),aAe=C.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:s=BWe,...a}=e;(i||i===0)&&!Rq(i)&&console.error(NWe(`${i}`,"Progress"));const o=Rq(i)?i:zH;r!==null&&!Dq(r,o)&&console.error(EWe(`${r}`,"Progress"));const c=Dq(r,o)?r:null,u=kB(c)?s(c,o):void 0;return l.jsx(_We,{scope:n,value:c,max:o,children:l.jsx(_t.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":kB(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":cAe(c,o),"data-value":c??void 0,"data-max":o,...a,ref:t})})});aAe.displayName=$H;var oAe="ProgressIndicator",lAe=C.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=jWe(oAe,n);return l.jsx(_t.div,{"data-state":cAe(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});lAe.displayName=oAe;function BWe(e,t){return`${Math.round(e/t*100)}%`}function cAe(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function kB(e){return typeof e=="number"}function Rq(e){return kB(e)&&!isNaN(e)&&e>0}function Dq(e,t){return kB(e)&&!isNaN(e)&&e<=t&&e>=0}function NWe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${zH}\`.`}function EWe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${zH} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var uAe=aAe,TWe=lAe;const Cv=C.forwardRef(({className:e,value:t,...n},r)=>l.jsx(uAe,{ref:r,className:ot("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:l.jsx(TWe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Cv.displayName=uAe.displayName;const dAe="aeo-blueprint-suggestions";function p_(){try{return JSON.parse(localStorage.getItem(dAe)||"[]")}catch{return[]}}function m_(e){localStorage.setItem(dAe,JSON.stringify(e)),window.dispatchEvent(new Event("blueprint-suggestions-updated"))}const Uq={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},hAe=({open:e,onOpenChange:t,siteDomain:n,questions:r,metro:i,state:s,onImported:a})=>{const[o,c]=C.useState("generating"),[u,d]=C.useState(null),[h,A]=C.useState([]),[f,p]=C.useState(0),[m,g]=C.useState(0),[y,v]=C.useState(""),[x,b]=C.useState(new Set),[w,k]=C.useState({}),[j,B]=C.useState(!1),{data:E}=Nc(),P="khmmwvmdbhaplcfcndjx",T="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",N=C.useMemo(()=>{const R=new Set;return(E||[]).forEach(M=>R.add(M.title.toLowerCase().trim())),R},[E]),F=R=>N.has(R.toLowerCase().trim());C.useEffect(()=>{e&&r.length>0&&(c("generating"),d(null),A([]),p(0),g(0),v(""),b(new Set),k({}),L())},[e]);const L=async()=>{try{const R=await fetch(`https://${P}.supabase.co/functions/v1/generate-blueprint`,{method:"POST",headers:{"Content-Type":"application/json",apikey:T},body:JSON.stringify({questions:r.map(Z=>({question:Z.question,category:Z.category,citability_score:Z.citability_score})),metro:i,state:s,site_domain:n})});if(!R.ok||!R.body)throw new Error(await R.text()||"Failed to start blueprint generation");const M=R.body.getReader(),Y=new TextDecoder;let X="",V=null;for(;;){const{done:Z,value:de}=await M.read();if(Z)break;X+=Y.decode(de,{stream:!0});let ue;for(;(ue=X.indexOf(`

`))!==-1;){const se=X.slice(0,ue).trim();if(X=X.slice(ue+2),!se.startsWith("data: "))continue;const he=se.slice(6).trim();if(he!=="[DONE]")try{const ie=JSON.parse(he);switch(ie.type){case"status":v(ie.message),ie.total&&g(ie.total);break;case"progress":v(ie.message),p(ie.completed),ie.total&&g(ie.total);break;case"title_complete":A(Ce=>[...Ce,{original_question:ie.original_question,page_title:ie.page_title,category:ie.category,citability_score:ie.citability_score}]),p(ie.index+1);break;case"filter_complete":v(ie.message);break;case"error":throw new Error(ie.message);case"result":V=ie;break}}catch(ie){if(ie.message&&!ie.message.includes("JSON"))throw ie}}}if(V){d(V);const Z=new Set;V.titles.forEach((de,ue)=>{F(de.page_title)||Z.add(ue)}),b(Z),c("review")}else throw new Error("No results received")}catch(R){De({title:"Blueprint generation failed",description:R.message,variant:"destructive"}),t(!1)}},U=R=>{b(M=>{const Y=new Set(M);return Y.has(R)?Y.delete(R):Y.add(R),Y})},H=()=>{if(!u)return;const R=u.titles.every((M,Y)=>x.has(Y));b(R?new Set:new Set(u.titles.map((M,Y)=>Y)))},W=(u==null?void 0:u.titles)||[],$=C.useMemo(()=>{let R=0;return W.forEach((M,Y)=>{if(!x.has(Y))return;const X=w[Y]??M.page_title;F(X)||R++}),R},[W,x,w,N]),z=()=>{if(!u||$===0)return;B(!0);const R=p_(),M=new Set(R.map(X=>X.page_title.toLowerCase().trim())),Y=[];W.forEach((X,V)=>{if(!x.has(V))return;const Z=w[V]??X.page_title;F(Z)||M.has(Z.toLowerCase().trim())||Y.push({original_question:X.original_question,page_title:Z,category:X.category,citability_score:X.citability_score})}),m_([...R,...Y]),De({title:"Suggestions saved!",description:`Added ${Y.length} title suggestions to the Blueprint tab.`}),B(!1),a(),t(!1)},Q=m>0?Math.round(f/m*100):0,ce=R=>R>=4?"bg-green-500":R>=3?"bg-yellow-500":"bg-orange-500";return l.jsx(Fo,{open:e,onOpenChange:t,children:l.jsxs(Ja,{className:"max-w-4xl max-h-[90vh] flex flex-col p-0",children:[l.jsx(Za,{className:"px-6 pt-6 pb-4 border-b",children:l.jsxs(eo,{className:"flex items-center gap-2",children:[l.jsx(Os,{className:"w-5 h-5 text-primary"})," FAQ Page Title Generator"]})}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[o==="generating"&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 space-y-4 max-w-lg mx-auto",children:[l.jsx(Ea,{className:"w-10 h-10 animate-spin text-primary"}),l.jsxs("div",{className:"text-center space-y-2 w-full",children:[l.jsx("p",{className:"font-medium",children:"Generating FAQ page titles..."}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Analyzing ",r.length," questions one at a time"]}),m>0&&l.jsxs("div",{className:"space-y-1 pt-2",children:[l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:[f,"/",m," titles"]}),l.jsxs("span",{children:[Q,"%"]})]}),l.jsx(Cv,{value:Q,className:"h-3"})]}),y&&l.jsx("p",{className:"text-xs text-muted-foreground truncate pt-1",children:y})]})]}),h.length>0&&l.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[l.jsxs("div",{className:"bg-muted/40 px-3 py-2 text-xs font-medium text-muted-foreground",children:["Titles generated so far (",h.length,")"]}),l.jsx("div",{className:"max-h-64 overflow-y-auto divide-y",children:h.map((R,M)=>l.jsxs("div",{className:"px-3 py-2 flex items-center gap-3 text-sm",children:[l.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${ce(R.citability_score)}`}),l.jsx("span",{className:"text-muted-foreground truncate flex-1",children:R.original_question}),l.jsx(Xa,{className:"w-3 h-3 text-muted-foreground shrink-0"}),l.jsx("span",{className:"font-medium truncate flex-1",children:R.page_title})]},M))})]})]}),o==="review"&&u&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-1",children:[l.jsxs("p",{className:"font-medium",children:[u.total_titles," FAQ Page Titles Generated"]}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[u.metro,", ",u.state]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Review and edit titles, then save them as suggestions in the Blueprint tab."})]}),l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx($o,{checked:W.length>0&&W.every((R,M)=>x.has(M)),onCheckedChange:H}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:["Select all (",W.length,")"]}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[x.size," selected"]})]}),l.jsx("div",{className:"border rounded-lg divide-y max-h-[50vh] overflow-y-auto",children:W.map((R,M)=>{const Y=w[M]??R.page_title,X=F(Y),V=Uq[R.category]||Uq.general;return l.jsxs("div",{className:"px-3 py-2.5 flex items-start gap-2.5 hover:bg-muted/20",children:[l.jsx($o,{checked:x.has(M),onCheckedChange:()=>U(M),className:"mt-1"}),l.jsx(Vp,{className:"w-3.5 h-3.5 text-muted-foreground mt-1.5 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{className:"flex-1 bg-transparent border-none outline-none text-sm font-medium focus:ring-1 focus:ring-primary rounded px-1 py-0.5",value:Y,onChange:Z=>k(de=>({...de,[M]:Z.target.value}))}),X&&l.jsx(Yt,{variant:"outline",className:"text-[10px] shrink-0 border-amber-400 text-amber-600",children:"Already exists"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground truncate",children:["Original: ",R.original_question]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0 mt-1",children:[l.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[10px] ${V}`,children:R.category}),l.jsx("div",{className:`w-2 h-2 rounded-full ${ce(R.citability_score)}`}),l.jsx("span",{className:"text-xs text-muted-foreground w-6 text-right",children:R.citability_score.toFixed(1)})]})]},M)})})]})]}),o==="review"&&u&&l.jsxs("div",{className:"border-t bg-background px-6 py-4 flex items-center justify-between",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:[$," title suggestions to save"]}),l.jsxs(xe,{onClick:z,disabled:$===0||j,children:[j?l.jsx(Ea,{className:"w-4 h-4 mr-2 animate-spin"}):l.jsx(Sl,{className:"w-4 h-4 mr-2"}),"Save Suggestions"]})]})]})})},Hq=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),IWe=(e,t,n)=>e<t?l.jsxs(Yt,{variant:"outline",className:"text-xs border-yellow-500 text-yellow-600",children:["Low (",e,")"]}):e>n?l.jsxs(Yt,{variant:"outline",className:"text-xs border-destructive text-destructive",children:["Over (",e,")"]}):l.jsxs(Yt,{variant:"outline",className:"text-xs border-green-500 text-green-600",children:["Healthy (",e,")"]}),PWe=({sub:e,pages:t,onUpdate:n,onDelete:r})=>{const i=t.filter(o=>o.category_id===e.id).length,[s,a]=C.useState(!1);return l.jsxs("div",{className:`border rounded p-3 space-y-2 ml-4 transition-opacity ${e.enabled?"border-border/60":"border-border/30 opacity-60"}`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm",children:e.icon||"📁"}),l.jsx("span",{className:"font-serif text-sm font-medium",children:e.name}),l.jsx(Yt,{variant:"outline",className:"text-xs",children:"Sub"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"text-xs text-muted-foreground",children:[i," page(s)"]}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>r(e,i),children:l.jsx(Ol,{className:"w-3 h-3"})}),l.jsx(wc,{checked:e.enabled,onCheckedChange:o=>n(e.id,{enabled:o})})]})]}),l.jsx(xe,{variant:"ghost",size:"sm",className:"text-xs w-full justify-start text-muted-foreground hover:text-foreground",onClick:()=>a(!s),children:s?"▾ Hide Content":"▸ Edit Content"}),s&&(e.slug==="news"?l.jsx(xWe,{categoryId:e.id}):l.jsx(Jfe,{category:e}))]})},OWe=({cat:e,allCategories:t,pages:n,onUpdate:r,onDelete:i,isAeo:s,onAddSubcategory:a})=>{const o=n.filter(f=>f.category_id===e.id).length,c=t.filter(f=>f.parent_id===e.id),[u,d]=C.useState(!1),[h,A]=C.useState(!1);return l.jsxs("div",{className:`border rounded p-4 space-y-3 transition-opacity ${e.enabled?"border-border":"border-border/50 opacity-60"}`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-lg",children:e.icon||"📄"}),l.jsx("span",{className:"font-serif font-medium",children:e.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:()=>i(e,o),children:l.jsx(Ol,{className:"w-3.5 h-3.5"})}),l.jsx(wc,{checked:e.enabled,onCheckedChange:f=>r(e.id,{enabled:f})})]})]}),e.description&&l.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}),s&&l.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[l.jsxs("label",{className:"flex items-center gap-1",children:["Min",l.jsx(Je,{type:"number",className:"w-16 h-7 text-xs",value:e.min_pages,onChange:f=>r(e.id,{min_pages:parseInt(f.target.value)||0})})]}),l.jsx("span",{className:"text-muted-foreground",children:"—"}),l.jsxs("label",{className:"flex items-center gap-1",children:["Max",l.jsx(Je,{type:"number",className:"w-16 h-7 text-xs",value:e.max_pages,onChange:f=>r(e.id,{max_pages:parseInt(f.target.value)||0})})]}),l.jsx("div",{className:"ml-auto",children:IWe(o,e.min_pages,e.max_pages)})]}),(c.length>0||e.enabled)&&l.jsxs(Xw,{open:h,onOpenChange:A,children:[l.jsx(Jw,{asChild:!0,children:l.jsxs(xe,{variant:"ghost",size:"sm",className:"text-xs w-full justify-start text-muted-foreground hover:text-foreground gap-1",children:[l.jsx(yc,{className:`w-3 h-3 transition-transform ${h?"":"-rotate-90"}`}),"Sub-Categories (",c.length,")"]})}),l.jsxs(Zw,{className:"space-y-2 mt-2",children:[c.map(f=>l.jsx(PWe,{sub:f,pages:n,onUpdate:r,onDelete:i},f.id)),l.jsxs(xe,{variant:"outline",size:"sm",className:"text-xs ml-4",onClick:()=>a(e.id),children:[l.jsx(Kp,{className:"w-3 h-3 mr-1"})," Add Sub-Category"]})]})]}),l.jsx(xe,{variant:"ghost",size:"sm",className:"text-xs w-full justify-start text-muted-foreground hover:text-foreground",onClick:()=>d(!u),children:u?"▾ Hide Landing Page Content":"▸ Edit Landing Page Content"}),u&&l.jsx(Jfe,{category:e})]})},FWe=()=>{var N;const{data:e,isLoading:t}=tA(),{data:n}=Nc(),{isAeo:r}=Yhe(),i=Zhe(),s=Nqe(),a=Bqe(),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(null),[f,p]=C.useState(null),[m,g]=C.useState(p_);C.useEffect(()=>{const F="aeo-blueprint-suggestions-seeded";if(localStorage.getItem(F))return;if(p_().length>0){localStorage.setItem(F,"1");return}const U=[{page_title:"What Grand Rapids neighborhoods are best for rental income?",category:"buying",original_question:"Which Grand Rapids neighborhoods currently offer the highest rental yields?",citability_score:4},{page_title:"How Can I Buy a Home in Grand Rapids Remotely?",category:"buying",original_question:"Can you recommend a relocation specialist in Grand Rapids who can help me buy a home remotely?",citability_score:4},{page_title:"How do I find a good real estate agent in Grand Rapids?",category:"buying",original_question:"How do I find and vet local agents who work specifically with first-time buyers in Grand Rapids?",citability_score:4},{page_title:"What are commute times like from nearby Grand Rapids suburbs?",category:"buying",original_question:"Can you connect me with agents who can advise on commute times from East Grand Rapids, Kentwood, or Wyoming?",citability_score:4},{page_title:"What are Grand Rapids investment property cap rates?",category:"buying",original_question:"What are the typical cap rates for different property types in various Grand Rapids neighborhoods?",citability_score:4},{page_title:"What Grand Rapids agents know about suburban commutes?",category:"buying",original_question:"Can you connect me with a Grand Rapids agent who knows commute times to downtown from suburbs?",citability_score:4},{page_title:"What's life like in Grand Rapids neighborhoods?",category:"buying",original_question:"Who is a trusted Grand Rapids realtor to explain what daily life is like in different neighborhoods?",citability_score:4},{page_title:"Where can I find Grand Rapids housing market data?",category:"buying",original_question:"Who can I contact in Grand Rapids to get neighborhood-by-neighborhood cost-of-living and housing market comparisons?",citability_score:4},{page_title:"Who Can Help Me Buy a Home in Grand Rapids Remotely?",category:"buying",original_question:"Can you recommend a Grand Rapids buyer's agent who specializes in out-of-state relocations?",citability_score:4},{page_title:"Who can help me find a Grand Rapids neighborhood for my lifestyle?",category:"buying",original_question:"Who are agents that specialize in relocations for tech professionals?",citability_score:4},{page_title:"Who Can Help Me Find Investment Properties in Grand Rapids?",category:"buying",original_question:"Could you recommend a real estate agent familiar with off-market or foreclosed investment property opportunities?",citability_score:4},{page_title:"Who Can Help Me Relocate to Grand Rapids?",category:"buying",original_question:"Recommend a realtor in Grand Rapids who specializes in helping people relocate from other states.",citability_score:4},{page_title:"Who can help me understand Grand Rapids costs for out-of-staters?",category:"buying",original_question:"Suggest a local expert in Grand Rapids to compare cost of living and home prices for out-of-staters.",citability_score:4},{page_title:"Who Helps Buyers Relocating to Grand Rapids?",category:"buying",original_question:"What agent in Grand Rapids helps with the full remote buying process for interstate moves?",citability_score:4},{page_title:"Who Helps Investors Buy Rental Properties in Grand Rapids?",category:"buying",original_question:"Are there any experienced real estate agents in Grand Rapids who primarily work with out-of-state investors?",citability_score:4},{page_title:"Who Specializes in Distressed Properties in Grand Rapids?",category:"buying",original_question:"I'm interested in understanding the current inventory of distressed properties suitable for renovation and resale.",citability_score:4},{page_title:"Who can help me sell my home in Grand Rapids?",category:"selling",original_question:"Which Grand Rapids realtors are known for getting multiple offers in the North Hill area?",citability_score:4},{page_title:"Who is the best Grand Rapids agent for life changes?",category:"selling",original_question:"Can you recommend a Grand Rapids real estate agent known for their compassionate approach with clients going through life transitions?",citability_score:4},{page_title:"Who can help me sell a home with many possessions in Grand Rapids?",category:"selling",original_question:"Can you suggest a Grand Rapids realtor who has experience with estate sales?",citability_score:4},{page_title:"What extra services do Grand Rapids agents offer?",category:"selling",original_question:"Who is a Grand Rapids agent that offers services beyond just buying and selling?",citability_score:4},{page_title:"What Grand Rapids realtors offer specialized senior services?",category:"selling",original_question:"Which Grand Rapids realtors will provide referrals for aging-in-place remodelers and senior support services?",citability_score:4},{page_title:"What's the best way to sell my Grand Rapids home?",category:"selling",original_question:"Can you suggest Grand Rapids agents who can evaluate whether a cash offer, an as-is sale, or a traditional MLS listing is best?",citability_score:4},{page_title:"Is East Grand Rapids a good place to live?",category:"neighborhoods",original_question:"Is East Grand Rapids a good place to raise a family?",citability_score:4},{page_title:"What's it like to live in Ada (Forest Hills)?",category:"neighborhoods",original_question:"What is it like to live in Ada MI (Forest Hills)?",citability_score:4},{page_title:"What's Forest Hills like for homebuyers?",category:"neighborhoods",original_question:"What are the schools, home styles, and commute times in Forest Hills?",citability_score:4},{page_title:"What's Eastown Grand Rapids Like for Homebuyers?",category:"neighborhoods",original_question:"Is Eastown in Grand Rapids safe and walkable, what are typical home prices?",citability_score:4},{page_title:"What should I know about buying in Heritage Hill?",category:"neighborhoods",original_question:"What should I know about buying and restoring a historic home in Heritage Hill?",citability_score:4},{page_title:"What's the downtown Grand Rapids market like?",category:"neighborhoods",original_question:"What's the downtown Grand Rapids condo market like?",citability_score:4},{page_title:"What's Kentwood like for homebuyers?",category:"neighborhoods",original_question:"How are the schools, neighborhoods, and home values in Kentwood?",citability_score:4},{page_title:"Is Wyoming, MI a good place to live for families?",category:"neighborhoods",original_question:"Is Wyoming MI a good suburban choice for families and affordability?",citability_score:4},{page_title:"Is Grandville a good place to buy a starter home?",category:"neighborhoods",original_question:"Is Grandville a good place to buy a starter home near Grand Rapids?",citability_score:4},{page_title:"What's it like to live in Rockford, MI?",category:"neighborhoods",original_question:"What is it like to live in Rockford MI—schools, downtown vibe, outdoor recreation?",citability_score:4},{page_title:"What's Holland MI like for buyers?",category:"neighborhoods",original_question:"How are the neighborhoods, schools, and commute options in Holland MI?",citability_score:4},{page_title:"Who Can Help Me Find a Home Near Steelcase?",category:"neighborhoods",original_question:"Do you know a specific realtor who has a strong track record of finding homes near Steelcase?",citability_score:4},{page_title:"Who Can Help Me Find a Home Near Major Highways in Grand Rapids?",category:"neighborhoods",original_question:"Can you connect me with a realty professional who specializes in homes with easy access to US-131?",citability_score:4},{page_title:"Which Grand Rapids agent can help me find a home near work?",category:"neighborhoods",original_question:"Which Grand Rapids real estate agent can map out commute times to SpartanNash headquarters?",citability_score:4},{page_title:"Who Helps Beaumont Health Employees Buy Homes?",category:"neighborhoods",original_question:"Which real estate agent specializes in helping Beaumont Health employees find homes?",citability_score:4},{page_title:"What Grand Rapids neighborhoods suit my commute?",category:"neighborhoods",original_question:"Are there Grand Rapids neighborhoods that offer a quick reverse commute to suburban job centers?",citability_score:4},{page_title:"What Grand Rapids neighborhoods are good for commuting to Walker?",category:"neighborhoods",original_question:"Where should I look if I need a 20-30 minute drive to the Meijer corporate campus in Walker?",citability_score:4},{page_title:"Who Sells Luxury Homes in Grand Rapids?",category:"luxury",original_question:"Can you recommend a specialist for off-market luxury homes in Grand Rapids?",citability_score:4},{page_title:"Who Sells Lakefront Homes Near Grand Rapids?",category:"luxury",original_question:"Who is the leading luxury home agent for lakefront properties near Grand Rapids?",citability_score:4},{page_title:"Who is the best agent to sell my Forest Hills home?",category:"luxury",original_question:"Recommend a local agent for selling my high-end home in Forest Hills discreetly.",citability_score:4},{page_title:"Who Sells Luxury Homes in Kent County?",category:"luxury",original_question:"Top luxury realtor for new development estates in Kent County near Grand Rapids?",citability_score:4}];m_(U),g(U),localStorage.setItem(F,"1")},[]),C.useEffect(()=>{const F=()=>g(p_());return window.addEventListener("blueprint-suggestions-updated",F),()=>window.removeEventListener("blueprint-suggestions-updated",F)},[]);const y=C.useCallback(F=>{const L=m.filter((U,H)=>H!==F);m_(L),g(L)},[m]),v=C.useCallback(()=>{m_([]),g([])},[]),x=n||[],b=e||[],w=b.filter(F=>!F.parent_id),k=w.filter(F=>F.enabled),j=(F,L)=>{i.mutate({id:F,...L})},B=(F,L)=>{const H=b.filter(W=>W.parent_id===F.id).reduce((W,$)=>W+x.filter(z=>z.category_id===$.id).length,0);p({cat:F,pageCount:L+H})},E=async()=>{if(f){if(f.pageCount>0){De({title:"Cannot delete",description:"Please delete or reassign all pages in this category first.",variant:"destructive"}),p(null);return}try{await a.mutateAsync(f.cat.id),De({title:`"${f.cat.name}" deleted`})}catch(F){De({title:"Error",description:F.message,variant:"destructive"})}p(null)}},P=async()=>{if(o.trim())try{await s.mutateAsync({name:o.trim(),slug:Hq(o),icon:"📄"}),De({title:"Category created!"}),c("")}catch(F){De({title:"Error",description:F.message,variant:"destructive"})}},T=async()=>{if(!(!u.trim()||!h))try{await s.mutateAsync({name:u.trim(),slug:Hq(u),icon:"📁",parent_id:h}),De({title:"Sub-category created!"}),d(""),A(null)}catch(F){De({title:"Error",description:F.message,variant:"destructive"})}};return t?l.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((F,L)=>l.jsx(ht,{className:"h-24 w-full"},L))}):l.jsxs("div",{className:"space-y-8",children:[l.jsx("div",{className:"flex items-center gap-6 text-sm",children:r?l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:["Total Pages: ",l.jsx("strong",{children:x.length})," of ",w.reduce((F,L)=>F+L.min_pages,0),"–",w.reduce((F,L)=>F+L.max_pages,0)]}),l.jsxs("span",{children:["Categories Active: ",l.jsx("strong",{children:k.length})," of ",w.length]})]}):l.jsxs("span",{children:["Categories Active: ",l.jsx("strong",{children:k.length})," of ",w.length]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:w.map(F=>l.jsx(OWe,{cat:F,allCategories:b,pages:x,onUpdate:j,onDelete:B,isAeo:r,onAddSubcategory:L=>A(L)},F.id))}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Je,{value:o,onChange:F=>c(F.target.value),placeholder:"New category name...",className:"max-w-xs",onKeyDown:F=>F.key==="Enter"&&P()}),l.jsxs(xe,{variant:"outline",onClick:P,disabled:!o.trim(),children:[l.jsx(Kp,{className:"w-4 h-4 mr-1"})," Add Niche"]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-4",children:"Page Hierarchy"}),l.jsx("div",{className:"space-y-3",children:w.map(F=>{const L=b.filter(z=>z.parent_id===F.id),U=x.filter(z=>z.category_id===F.id),H=U.filter(z=>z.is_parent),W=U.filter(z=>!z.is_parent&&!z.parent_id),$=U.length+L.reduce((z,Q)=>z+x.filter(ce=>ce.category_id===Q.id).length,0);return l.jsxs("div",{className:"border border-border rounded p-3",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("span",{children:F.icon||"📄"}),l.jsx(St,{to:`/${F.slug}`,className:"font-serif font-medium text-sm hover:text-accent transition-colors",children:F.name}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[$," page(s)"]})]}),l.jsxs("div",{className:"ml-4 space-y-1",children:[L.map(z=>{const Q=x.filter(ce=>ce.category_id===z.id);return l.jsxs("div",{className:"mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(vc,{className:"w-3 h-3 text-accent"}),l.jsxs(St,{to:`/${F.slug}/${z.slug}`,className:"font-medium hover:text-accent transition-colors",children:[z.icon," ",z.name]}),l.jsx(Yt,{variant:"outline",className:"text-xs",children:"Sub"}),l.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:Q.length})]}),Q.map(ce=>l.jsxs("div",{className:"flex items-center gap-2 text-sm ml-6 text-muted-foreground",children:[l.jsx("span",{className:"w-3 h-px bg-border"}),l.jsx(St,{to:`/${F.slug}/${z.slug}/${ce.slug}`,className:"hover:text-accent transition-colors",children:ce.title}),l.jsx(US,{status:ce.status})]},ce.id))]},z.id)}),H.map(z=>{const Q=U.filter(ce=>ce.parent_id===z.id);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(vc,{className:"w-3 h-3 text-muted-foreground"}),l.jsx(St,{to:`/${F.slug}/${z.slug}`,className:"font-medium hover:text-accent transition-colors",children:z.title}),l.jsx(US,{status:z.status})]}),Q.map(ce=>l.jsxs("div",{className:"flex items-center gap-2 text-sm ml-6 text-muted-foreground",children:[l.jsx("span",{className:"w-3 h-px bg-border"}),l.jsx(St,{to:`/${F.slug}/${ce.slug}`,className:"hover:text-accent transition-colors",children:ce.title}),l.jsx(US,{status:ce.status})]},ce.id))]},z.id)}),W.map(z=>l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(vc,{className:"w-3 h-3 text-muted-foreground"}),l.jsx(St,{to:`/${F.slug}/${z.slug}`,className:"hover:text-accent transition-colors",children:z.title}),l.jsx(US,{status:z.status})]},z.id)),U.length===0&&L.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:r?"No pages yet — use the Page Generator tab to create content.":"No pages yet — landing page content can be edited above."})]})]},F.id)})})]}),m.length>0&&l.jsxs("div",{className:"border border-dashed border-accent rounded-lg p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(b7,{className:"w-4 h-4 text-accent"}),l.jsx("h3",{className:"font-serif text-lg font-medium",children:"Suggested Page Titles"}),l.jsx(Yt,{variant:"outline",className:"text-xs",children:m.length})]}),l.jsx(xe,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:v,children:"Clear All"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Generated FAQ page titles from Prompt Discovery. Use these as starting points when creating new pages."}),l.jsx("div",{className:"divide-y rounded border bg-background",children:m.map((F,L)=>{const U={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",luxury:"bg-amber-100 text-amber-800",general:"bg-muted text-muted-foreground"},H=U[F.category]||U.general;return l.jsxs("div",{className:"px-3 py-2 flex items-center gap-3 text-sm group",children:[l.jsx(b7,{className:"w-3 h-3 text-accent shrink-0"}),l.jsx("span",{className:"font-medium flex-1",children:F.page_title}),l.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[10px] shrink-0 ${H}`,children:F.category}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:()=>y(L),children:l.jsx(ra,{className:"w-3 h-3"})})]},L)})})]}),l.jsx(xB,{open:!!h,onOpenChange:F=>!F&&A(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsx(h1,{children:"Add Sub-Category"}),l.jsxs(f1,{children:["Create a sub-category under ",l.jsx("strong",{children:(N=b.find(F=>F.id===h))==null?void 0:N.name}),". Sub-categories get their own landing page and can contain FAQ pages."]})]}),l.jsx(Je,{value:u,onChange:F=>d(F.target.value),placeholder:"Sub-category name (e.g., Waterfront)",onKeyDown:F=>F.key==="Enter"&&T()}),l.jsxs(d1,{children:[l.jsx(A1,{onClick:()=>d(""),children:"Cancel"}),l.jsx(Ty,{onClick:T,disabled:!u.trim(),children:"Create Sub-Category"})]})]})}),l.jsx(xB,{open:!!f,onOpenChange:F=>!F&&p(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsx(h1,{children:f!=null&&f.pageCount?"Category Has Pages":`Delete "${f==null?void 0:f.cat.name}"?`}),l.jsx(f1,{children:f!=null&&f.pageCount?l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:f.cat.name})," has ",l.jsxs("strong",{children:[f.pageCount," page(s)"]})," attached. Deleting this category will undo all parent-to-children routing and cross-linking for those pages.",l.jsx("br",{}),l.jsx("br",{}),"You must ",l.jsx("strong",{children:"delete or reassign"})," all pages in this category before it can be removed."]}):"This category has no pages and can be safely removed. This action cannot be undone."})]}),l.jsxs(d1,{children:[l.jsx(A1,{children:"Cancel"}),f!=null&&f.pageCount?l.jsx(Ty,{onClick:()=>p(null),children:"Understood"}):l.jsx(Ty,{onClick:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Category"})]})]})})]})},US=({status:e})=>l.jsx("span",{className:`text-xs px-1.5 py-0.5 ml-auto rounded ${e==="published"?"bg-green-100 text-green-800":"bg-muted text-muted-foreground"}`,children:e}),MWe=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),LWe=()=>{const{data:e,isLoading:t}=Nc(),{data:n}=tA(),{configMap:r}=oa(),i=Xhe(),s=p5(),a=Jhe(),[o,c]=C.useState(null),[u,d]=C.useState(null),[h,A]=C.useState(""),[f,p]=C.useState(""),[m,g]=C.useState(null),[y,v]=C.useState(!1),x=N=>N.faq_json&&N.faq_json.length>0||!!N.intro_text,b=(e||[]).filter(N=>N.status==="draft"&&!x(N)),w=(e||[]).filter(N=>N.status==="draft"&&x(N)),k=(e||[]).filter(N=>N.status==="published"),j=async()=>{if(!h.trim()||!f){De({title:"Enter a question and select a category",variant:"destructive"});return}v(!0);try{const N=(n||[]).find(W=>W.id===f),{data:F,error:L}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate",category_slug:(N==null?void 0:N.slug)||"",topic:h.trim(),agent_name:r.agent_name,agent_market:r.agent_market}});if(L)throw L;if(F!=null&&F.error)throw new Error(F.error);const U=F.slug||MWe(h),H=await i.mutateAsync({category_id:f,title:h.trim(),slug:U,h1:F.h1||h.trim(),is_parent:!1,status:"draft",cover_image_id:m});await s.mutateAsync({id:H.id,h1:F.h1,subheadline:F.subheadline,intro_text:F.intro_text,faq_json:F.faq_json,meta_title:F.meta_title,meta_description:F.meta_description,schema_markup:F.schema_markup}),De({title:"Page created & content generated!",description:`Slug: /${N==null?void 0:N.slug}/${U}`}),A(""),p(""),g(null)}catch(N){De({title:"Error",description:N.message,variant:"destructive"})}finally{v(!1)}},B=async N=>{var F;c(N.id);try{const{data:L,error:U}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate",category_slug:((F=N.category)==null?void 0:F.slug)||"",topic:N.title,parent_id:N.parent_id,agent_name:r.agent_name,agent_market:r.agent_market}});if(U)throw U;if(L!=null&&L.error)throw new Error(L.error);await s.mutateAsync({id:N.id,h1:L.h1,intro_text:L.intro_text,body_content:L.body_content,faq_json:L.faq_json,meta_title:L.meta_title,meta_description:L.meta_description,schema_markup:L.schema_markup}),De({title:"Content generated!",description:`"${N.title}" is ready for review.`})}catch(L){De({title:"Generation failed",description:L.message,variant:"destructive"})}finally{c(null)}},E=async N=>{const F=`${N.h1} ${N.intro_text||""} ${N.body_content||""} ${(N.faq_json||[]).map(U=>U.question+" "+U.answer).join(" ")}`,L=Mf(F);if(Nhe(L)){De({title:"Fair Housing Violation Detected",description:`${L.length} issue(s) found. Please review and fix before publishing.`,variant:"destructive"});return}await s.mutateAsync({id:N.id,status:"published",published_at:new Date().toISOString()}),De({title:"Published!",description:`"${N.title}" is now live.`})},P=async N=>{await a.mutateAsync(N),De({title:"Page deleted"})};if(t)return l.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((N,F)=>l.jsx(ht,{className:"h-16 w-full"},F))});const T=({page:N,actions:F})=>{var H;const L=`${N.h1} ${N.intro_text||""} ${N.body_content||""}`,U=N.body_content?Mf(L):[];return l.jsxs("div",{className:"flex items-center justify-between p-4 border border-border",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"text-caption text-accent",children:(H=N.category)==null?void 0:H.name}),N.is_parent&&l.jsx(Yt,{variant:"outline",className:"text-xs",children:"Parent"}),l.jsx(Yt,{variant:N.status==="published"?"default":"secondary",className:"text-xs capitalize",children:N.status==="draft"&&x(N)?"Ready":N.status}),U.length>0&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-destructive",children:[l.jsx(qp,{className:"w-3 h-3"}),U.length," issue(s)"]})]}),l.jsx("p",{className:"font-serif text-sm truncate",children:N.title})]}),l.jsx("div",{className:"flex items-center gap-2 ml-4",children:F})]})};return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"border border-border rounded p-6 space-y-4",children:[l.jsx("h3",{className:"font-serif text-xl",children:"Create New Page"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter a question — it becomes the page title, H1, and drives the AI-generated content."}),l.jsx(Je,{value:h,onChange:N=>A(N.target.value),placeholder:"Your Question (e.g., 'What are the best neighborhoods in Austin?')",className:"text-base"}),h&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"The AI will generate an optimized short slug from your question."}),l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsxs("div",{className:"flex-1 space-y-3",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs(_r,{value:f,onValueChange:N=>{p(N)},children:[l.jsx(fr,{className:"w-48",children:l.jsx(jr,{placeholder:"Category"})}),l.jsxs(Ar,{children:[(n||[]).filter(N=>!N.parent_id).map(N=>l.jsxs(dt,{value:N.id,children:[N.icon," ",N.name]},N.id)),(n||[]).filter(N=>N.parent_id).map(N=>{const F=(n||[]).find(L=>L.id===N.parent_id);return l.jsxs(dt,{value:N.id,children:["  ↳ ",N.icon," ",N.name," ",F?`(${F.name})`:""]},N.id)})]})]})}),l.jsxs(xe,{onClick:j,disabled:!h.trim()||!f||y,className:"btn-gold border-0",children:[l.jsx(Os,{className:"w-4 h-4 mr-2"}),y?"Generating...":"Generate Unique FAQs"]})]}),l.jsx("div",{className:"w-40",children:l.jsx(SB,{selectedId:m,onSelect:g,label:"Cover Image"})})]})]}),b.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Needs Content (",b.length,")"]}),l.jsx("div",{className:"space-y-2",children:b.map(N=>l.jsx(T,{page:N,actions:l.jsxs(l.Fragment,{children:[l.jsxs(xe,{size:"sm",onClick:()=>B(N),disabled:o===N.id,className:"btn-gold border-0 text-xs",children:[l.jsx(Os,{className:"w-3 h-3 mr-1"}),o===N.id?"Generating...":"Generate"]}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>P(N.id),children:l.jsx(Ol,{className:"w-3 h-3"})})]})},N.id))})]}),w.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Ready for Review (",w.length,")"]}),l.jsx("div",{className:"space-y-2",children:w.map(N=>l.jsx(T,{page:N,actions:l.jsxs(l.Fragment,{children:[l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>d(N),children:[l.jsx(Tb,{className:"w-3 h-3 mr-1"})," Preview"]}),l.jsxs(xe,{size:"sm",onClick:()=>E(N),className:"btn-gold border-0 text-xs",children:[l.jsx(w2,{className:"w-3 h-3 mr-1"})," Publish"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>B(N),disabled:o===N.id,className:"text-xs",children:[l.jsx(Os,{className:"w-3 h-3 mr-1"}),o===N.id?"...":"Regenerate"]}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>P(N.id),children:l.jsx(Ol,{className:"w-3 h-3"})})]})},N.id))})]}),k.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Published (",k.length,")"]}),l.jsx("div",{className:"space-y-2",children:k.map(N=>l.jsx(T,{page:N,actions:l.jsxs(l.Fragment,{children:[l.jsx(nU,{className:"w-4 h-4 text-green-600"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>d(N),children:l.jsx(Tb,{className:"w-3 h-3"})})]})},N.id))})]}),(e||[]).length===0&&!h&&l.jsx("p",{className:"text-muted-foreground text-center py-12",children:"No pages yet. Enter a question above to create your first AEO page."}),l.jsx(Fo,{open:!!u,onOpenChange:()=>d(null),children:l.jsxs(Ja,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[l.jsx(Za,{children:l.jsx(eo,{className:"font-serif",children:u==null?void 0:u.h1})}),u&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Meta Title:"})," ",u.meta_title]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Meta Desc:"})," ",u.meta_description]})]}),u.intro_text&&l.jsx("p",{className:"text-muted-foreground italic",children:u.intro_text}),u.body_content&&l.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:u.body_content}}),u.faq_json&&u.faq_json.length>0&&l.jsxs("div",{children:[l.jsx("h4",{className:"font-serif font-medium mb-2",children:"FAQ"}),u.faq_json.map((N,F)=>l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"font-medium text-sm",children:N.question}),l.jsx("p",{className:"text-sm text-muted-foreground",children:N.answer})]},F))]}),l.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[l.jsx("h4",{className:"font-serif font-medium",children:"YouTube Video (optional)"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(Je,{value:u.video_url||"",onChange:N=>d({...u,video_url:N.target.value}),placeholder:"https://www.youtube.com/watch?v=...",className:"flex-1"}),l.jsxs(_r,{value:u.video_orientation||"horizontal",onValueChange:N=>d({...u,video_orientation:N}),children:[l.jsx(fr,{className:"w-[140px] text-sm",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"horizontal",children:"Horizontal"}),l.jsx(dt,{value:"vertical",children:"Vertical (Short)"})]})]})]}),u.video_url&&(()=>{const N=u.video_url.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|shorts\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/),F=N==null?void 0:N[1],L=u.video_orientation==="vertical";return F?l.jsx("div",{className:`relative overflow-hidden rounded-lg mx-auto ${L?"max-w-sm aspect-[9/16]":"w-full aspect-video"}`,children:l.jsx("iframe",{src:`https://www.youtube.com/embed/${F}`,title:"Preview",className:"absolute inset-0 w-full h-full border border-border",allowFullScreen:!0})}):null})(),l.jsx("textarea",{value:u.video_transcript||"",onChange:N=>d({...u,video_transcript:N.target.value}),placeholder:"Paste video transcript here...",rows:4,className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:async()=>{try{await s.mutateAsync({id:u.id,video_url:u.video_url||null,video_transcript:u.video_transcript||null,video_orientation:u.video_orientation||"horizontal"}),De({title:"Video fields saved!"})}catch(N){De({title:"Error saving",description:N.message,variant:"destructive"})}},children:"Save Video Fields"})]})]})]})})]})},RWe=()=>{const[e,t]=C.useState([]),[n,r]=C.useState([]),[i,s]=C.useState(!1),[a,o]=C.useState(!1),[c,u]=C.useState(null),{data:d}=Nc(),h=p5(),A=async()=>{s(!0);try{const{data:g,error:y}=await Me.functions.invoke("scan-cannibalization");if(y)throw y;if(g!=null&&g.error)throw new Error(g.error);t(g.page_results||[]),r(g.faq_results||[]),o(!0),(g.page_results||[]).length===0&&(g.faq_results||[]).length===0&&De({title:"No cannibalization issues found!"})}catch(g){De({title:"Scan failed",description:g.message,variant:"destructive"})}finally{s(!1)}},f=async(g,y)=>{const v=d==null?void 0:d.find(b=>b.id===g);if(!v)return;const x=[...v.faq_json];x.splice(y,1);try{await h.mutateAsync({id:g,faq_json:x}),De({title:"FAQ deleted"}),r(b=>b.filter(w=>!(w.faq_a.page_id===g&&w.faq_a.question_index===y)&&!(w.faq_b.page_id===g&&w.faq_b.question_index===y)))}catch(b){De({title:"Delete failed",description:b.message,variant:"destructive"})}},p=async(g,y,v)=>{const x=d==null?void 0:d.find(b=>b.id===g);if(x){u(v);try{const b=x.faq_json.map(B=>B.question),{data:w,error:k}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"replace-faq",existing_questions:b,page_topic:x.title}});if(k)throw k;if(w!=null&&w.error)throw new Error(w.error);const j=[...x.faq_json];j[y]={question:w.question,answer:w.answer},await h.mutateAsync({id:g,faq_json:j}),De({title:"FAQ replaced with new unique question!"}),r(B=>B.filter((E,P)=>P!==v))}catch(b){De({title:"Replace failed",description:b.message,variant:"destructive"})}finally{u(null)}}},m=a&&!i&&e.length===0&&n.length===0;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"Duplicate Question Scanner"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Find FAQ questions that appear nearly identical across different pages, then remove or replace them."}),l.jsxs(xe,{onClick:A,disabled:i,className:"btn-gold border-0",children:[l.jsx(cE,{className:"w-4 h-4 mr-2"}),i?"Scanning...":"Scan for Duplicates"]})]}),i&&l.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((g,y)=>l.jsx(ht,{className:"h-16 w-full"},y))}),m&&l.jsxs("div",{className:"flex items-center gap-3 p-6 border border-green-200 bg-green-50",children:[l.jsx(nU,{className:"w-5 h-5 text-green-600"}),l.jsx("p",{className:"text-sm text-green-800",children:"No cannibalization issues detected. Your content is well-differentiated!"})]}),e.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h4",{className:"font-serif text-lg",children:"Page-Level Overlap"}),e.map((g,y)=>l.jsx("div",{className:"p-4 border border-border",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(qp,{className:`w-4 h-4 mt-0.5 ${g.similarity>60?"text-destructive":"text-yellow-500"}`}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"flex items-center gap-2 mb-1",children:l.jsxs("span",{className:"font-medium text-sm",children:[g.similarity,"% overlap"]})}),l.jsxs("p",{className:"text-sm text-muted-foreground mb-1",children:[l.jsxs("strong",{children:['"',g.page_a.title,'"']})," vs ",l.jsxs("strong",{children:['"',g.page_b.title,'"']})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:g.recommendation})]})]})},y))]}),n.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h4",{className:"font-serif text-lg",children:"FAQ-Level Duplicates"}),n.map((g,y)=>l.jsxs("div",{className:"p-4 border border-border space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qp,{className:"w-4 h-4 text-yellow-500"}),l.jsxs("span",{className:"font-medium text-sm",children:[g.similarity,"% similar"]})]}),l.jsxs("div",{className:"flex items-start justify-between gap-3 pl-4 border-l-2 border-border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["On: ",g.faq_a.page_title]}),l.jsxs("p",{className:"text-sm font-medium",children:['"',g.faq_a.question,'"']})]}),l.jsxs("div",{className:"flex gap-1 shrink-0",children:[l.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>f(g.faq_a.page_id,g.faq_a.question_index),children:l.jsx(Ol,{className:"w-3.5 h-3.5"})}),l.jsx(xe,{variant:"ghost",size:"sm",disabled:c===y,onClick:()=>p(g.faq_a.page_id,g.faq_a.question_index,y),children:l.jsx(nu,{className:`w-3.5 h-3.5 ${c===y?"animate-spin":""}`})})]})]}),l.jsxs("div",{className:"flex items-start justify-between gap-3 pl-4 border-l-2 border-border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["On: ",g.faq_b.page_title]}),l.jsxs("p",{className:"text-sm font-medium",children:['"',g.faq_b.question,'"']})]}),l.jsxs("div",{className:"flex gap-1 shrink-0",children:[l.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>f(g.faq_b.page_id,g.faq_b.question_index),children:l.jsx(Ol,{className:"w-3.5 h-3.5"})}),l.jsx(xe,{variant:"ghost",size:"sm",disabled:c===y,onClick:()=>p(g.faq_b.page_id,g.faq_b.question_index,y),children:l.jsx(nu,{className:`w-3.5 h-3.5 ${c===y?"animate-spin":""}`})})]})]})]},y))]})]})},DWe=()=>l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[l.jsx(e2e,{className:"w-12 h-12 text-muted-foreground/40 mb-4"}),l.jsx("h3",{className:"font-serif text-xl mb-2",children:"Backups Coming Soon"}),l.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:"Auto-backup scheduling, manual snapshots, and one-click restore will be available here."})]}),Qq=[{value:"all",label:"All"},{value:"logo",label:"Logos & Branding"},{value:"stock_photo",label:"Stock Photos"},{value:"headshot",label:"Agent Headshots"}],UWe=[{value:"cover",label:"Cover Image",description:"Hero banners on category/topic pages"},{value:"content",label:"Content Block",description:"Alternating text+image sections"},{value:"featured",label:"Featured",description:"Priority image for any page"},{value:"headshot",label:"Agent Headshot",description:"Profile photos for contact/about pages"}],HWe=["modern interior","exterior","city shot","aerial","neighborhood","kitchen","bathroom","living room","bedroom","office","grand rapids","west michigan","lakefront","condo","new build","header logo","favicon","footer logo","watermark"],QWe=7,$We=7,zWe=3,$q=({selectedTags:e,onToggle:t,categorySlugs:n})=>{const[r,i]=C.useState("");return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Usage"}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:UWe.map(s=>{const a=e.includes(s.value);return l.jsxs("button",{onClick:()=>t(s.value),title:s.description,className:`text-[10px] px-2 py-1 rounded-full border transition-colors flex items-center gap-1 ${a?"border-accent bg-accent/15 text-accent font-medium":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:[a&&l.jsx(Sl,{className:"w-2.5 h-2.5"}),s.label]},s.value)})})]}),n.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Category"}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:n.map(s=>{const a=e.includes(s);return l.jsxs("button",{onClick:()=>t(s),className:`text-[10px] px-2 py-1 rounded-full border transition-colors flex items-center gap-1 ${a?"border-accent bg-accent/15 text-accent font-medium":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:[a&&l.jsx(Sl,{className:"w-2.5 h-2.5"}),s]},s)})})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Scene"}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:HWe.map(s=>{const a=e.includes(s);return l.jsxs("button",{onClick:()=>t(s),className:`text-[10px] px-2 py-0.5 rounded-full border transition-colors flex items-center gap-1 ${a?"border-accent bg-accent/15 text-accent font-medium":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:[a&&l.jsx(Sl,{className:"w-2.5 h-2.5"}),s]},s)})})]}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx(Je,{value:r,onChange:s=>i(s.target.value),placeholder:"Custom tag...",className:"text-xs h-7 max-w-[140px]",onKeyDown:s=>{if(s.key==="Enter"){s.preventDefault();const a=r.trim().toLowerCase();a&&(t(a),i(""))}}}),l.jsx(xe,{variant:"ghost",size:"sm",className:"h-7 px-2",disabled:!r.trim(),onClick:()=>{const s=r.trim().toLowerCase();s&&(t(s),i(""))},children:l.jsx(Kp,{className:"w-3 h-3"})})]})]})},VWe=({media:e})=>{const t=e.filter(s=>{var a;return(a=s.tags)==null?void 0:a.includes("cover")}).length,n=e.filter(s=>{var a;return(a=s.tags)==null?void 0:a.includes("content")}).length,r=e.filter(s=>{var a;return((a=s.tags)==null?void 0:a.includes("headshot"))||s.media_type==="headshot"}).length,i=({label:s,count:a,min:o})=>{const c=a>=o;return l.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded border text-xs ${c?"border-green-500/30 bg-green-500/5 text-green-700":"border-amber-500/30 bg-amber-500/5 text-amber-700"}`,children:[c?l.jsx(e0,{className:"w-3.5 h-3.5"}):l.jsx(qp,{className:"w-3.5 h-3.5"}),l.jsxs("span",{className:"font-medium",children:[s,":"]}),l.jsxs("span",{children:[a,"/",o]}),!c&&l.jsxs("span",{className:"text-[10px] opacity-70",children:["(",o-a," more needed)"]})]})};return l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(i,{label:"Cover images",count:t,min:QWe}),l.jsx(i,{label:"Content blocks",count:n,min:$We}),l.jsx(i,{label:"Agent headshots",count:r,min:zWe})]})},KWe=()=>{const[e,t]=C.useState("all"),[n,r]=C.useState(""),{data:i,isLoading:s}=A0(e==="all"?void 0:e),{data:a}=tA(),o=(a||[]).filter(H=>H.slug!=="about").map(H=>H.slug),c=vOe(),u=wOe(),d=xOe(),h=C.useRef(null),[A,f]=C.useState("stock_photo"),[p,m]=C.useState([]),[g,y]=C.useState(!1),[v,x]=C.useState(null),[b,w]=C.useState([]),[k,j]=C.useState(""),[B,E]=C.useState(null),P=(i||[]).filter(H=>n?H.tags.some(W=>W.toLowerCase().includes(n.toLowerCase())):!0),T=(H,W)=>{W==="upload"?m($=>$.includes(H)?$.filter(z=>z!==H):[...$,H]):w($=>$.includes(H)?$.filter(z=>z!==H):[...$,H])},N=async H=>{const W=H.target.files;if(!W||W.length===0)return;y(!0);let $=0;for(const z of Array.from(W))try{await c.mutateAsync({file:z,tags:p,mediaType:A}),$++}catch(Q){De({title:`Failed to upload ${z.name}`,description:Q.message,variant:"destructive"})}$>0&&De({title:`${$} file(s) uploaded`}),y(!1),m([]),h.current&&(h.current.value="")},F=async H=>{try{await d.mutateAsync({id:H,tags:b,alt_text:k}),De({title:"Updated"}),x(null)}catch(W){De({title:"Error",description:W.message,variant:"destructive"})}},L=async()=>{if(B){try{await u.mutateAsync({id:B.id,filePath:B.filePath}),De({title:`"${B.name}" deleted`})}catch(H){De({title:"Error",description:H.message,variant:"destructive"})}E(null)}},U=[...new Set((i||[]).flatMap(H=>H.tags))].sort();return l.jsxs("div",{className:"space-y-8",children:[(i||[]).length>0&&l.jsx(VWe,{media:i||[]}),l.jsxs("div",{className:"border border-dashed border-border rounded-lg p-6 space-y-4",children:[l.jsx("h3",{className:"font-serif text-xl",children:"Upload Media"}),l.jsx("div",{className:"flex flex-wrap items-center gap-3",children:l.jsx("div",{className:"flex gap-2",children:Qq.filter(H=>H.value!=="all").map(H=>l.jsx(xe,{variant:A===H.value?"default":"outline",size:"sm",onClick:()=>f(H.value),className:"text-xs",children:H.label},H.value))})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Tags (applied to all uploads in this batch)"}),p.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:p.map(H=>l.jsxs(Yt,{variant:"secondary",className:"text-xs gap-1",children:[H,l.jsx("button",{onClick:()=>T(H,"upload"),children:l.jsx(ra,{className:"w-2.5 h-2.5"})})]},H))}),l.jsx($q,{selectedTags:p,onToggle:H=>T(H,"upload"),categorySlugs:o})]}),l.jsx("input",{ref:h,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:N}),l.jsxs(xe,{onClick:()=>{var H;return(H=h.current)==null?void 0:H.click()},disabled:g,className:"btn-gold border-0",children:[l.jsx(Pre,{className:"w-4 h-4 mr-2"}),g?"Uploading...":"Choose Files"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx("div",{className:"flex gap-1",children:Qq.map(H=>l.jsx(xe,{variant:e===H.value?"default":"ghost",size:"sm",onClick:()=>t(H.value),className:"text-xs",children:H.label},H.value))}),l.jsx(Je,{value:n,onChange:H=>r(H.target.value),placeholder:"Filter by tag...",className:"max-w-[200px] h-8 text-xs"}),U.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1",children:U.slice(0,8).map(H=>l.jsx("button",{onClick:()=>r(n===H?"":H),className:`text-[10px] px-2 py-0.5 rounded-full border transition-colors ${n===H?"border-accent text-accent bg-accent/10":"border-border text-muted-foreground hover:text-foreground"}`,children:H},H))}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[P.length," item(s)"]})]}),s?l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3",children:Array.from({length:6}).map((H,W)=>l.jsx(ht,{className:"aspect-square rounded"},W))}):P.length===0?l.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[l.jsx(iU,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),l.jsx("p",{className:"text-sm",children:"No media yet. Upload images above to build your library."})]}):l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3",children:P.map(H=>{const W=v===H.id;return l.jsxs("div",{className:"group relative border border-border rounded overflow-hidden bg-muted/30",children:[l.jsx("div",{className:"aspect-square",children:l.jsx("img",{src:kc(H.file_path),alt:H.alt_text||H.file_name,className:"w-full h-full object-cover",loading:"lazy"})}),l.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-colors flex items-end",children:l.jsx("div",{className:"w-full p-2 opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsxs("div",{className:"flex gap-1",children:[l.jsxs(xe,{size:"sm",variant:"secondary",className:"h-6 text-[10px] flex-1",onClick:()=>{x(H.id),w([...H.tags]),j(H.alt_text||"")},children:[l.jsx(uE,{className:"w-2.5 h-2.5 mr-0.5"})," Edit"]}),l.jsx(xe,{size:"sm",variant:"destructive",className:"h-6 text-[10px] px-2",onClick:()=>E({id:H.id,filePath:H.file_path,name:H.file_name}),children:l.jsx(Ol,{className:"w-2.5 h-2.5"})})]})})}),l.jsx("div",{className:"absolute top-1 left-1",children:l.jsx(Yt,{variant:"secondary",className:"text-[9px] px-1.5 py-0 bg-background/80 backdrop-blur-sm",children:H.media_type==="logo"?"Logo":"Stock"})}),H.tags.length>0&&l.jsxs("div",{className:"absolute top-1 right-1 flex flex-wrap gap-0.5 justify-end max-w-[70%]",children:[H.tags.slice(0,2).map($=>l.jsx(Yt,{variant:"outline",className:`text-[8px] px-1 py-0 bg-background/80 backdrop-blur-sm ${$==="cover"||$==="content"?"border-accent text-accent font-semibold":"border-accent/30 text-accent"}`,children:$},$)),H.tags.length>2&&l.jsxs(Yt,{variant:"outline",className:"text-[8px] px-1 py-0 bg-background/80 backdrop-blur-sm",children:["+",H.tags.length-2]})]}),W&&l.jsxs("div",{className:"absolute inset-0 bg-background/95 backdrop-blur-sm p-3 flex flex-col gap-2 z-10 overflow-y-auto",children:[l.jsx(Je,{value:k,onChange:$=>j($.target.value),placeholder:"Alt text...",className:"text-xs h-7"}),b.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1",children:b.map($=>l.jsxs(Yt,{variant:"secondary",className:"text-[9px] gap-0.5",children:[$,l.jsx("button",{onClick:()=>T($,"edit"),children:l.jsx(ra,{className:"w-2 h-2"})})]},$))}),l.jsx($q,{selectedTags:b,onToggle:$=>T($,"edit"),categorySlugs:o}),l.jsxs("div",{className:"flex gap-1 mt-auto pt-2",children:[l.jsx(xe,{size:"sm",className:"h-6 text-[10px] flex-1",onClick:()=>F(H.id),children:"Save"}),l.jsx(xe,{size:"sm",variant:"ghost",className:"h-6 text-[10px]",onClick:()=>x(null),children:"Cancel"})]})]})]},H.id)})}),l.jsx(xB,{open:!!B,onOpenChange:H=>!H&&E(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsxs(h1,{children:['Delete "',B==null?void 0:B.name,'"?']}),l.jsx(f1,{children:"This will permanently remove the file from storage. This action cannot be undone."})]}),l.jsxs(d1,{children:[l.jsx(A1,{children:"Cancel"}),l.jsx(Ty,{onClick:L,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})};function VH(){return Br({queryKey:["indexing-status"],queryFn:async()=>{const{data:e,error:t}=await Me.from("page_indexing_status").select("*").order("created_at");if(t)throw t;return e||[]}})}function qWe(){const e=As();return Ms({mutationFn:async t=>{const{data:n}=await Me.from("page_indexing_status").select("id").eq("page_id",t.page_id).maybeSingle();if(n){const{error:r}=await Me.from("page_indexing_status").update({...t,updated_at:new Date().toISOString()}).eq("page_id",t.page_id);if(r)throw r}else{const{error:r}=await Me.from("page_indexing_status").insert(t);if(r)throw r}},onSuccess:()=>e.invalidateQueries({queryKey:["indexing-status"]})})}function fAe(){const{data:e}=tA(),{data:t}=Nc();oa();const{data:n}=VH();return C.useMemo(()=>{const r=e||[],i=t||[],s=i.filter(k=>k.status==="published"),a=n||[],o=r.reduce((k,j)=>k+(j.min_pages||0),0),c=o>0?Math.min(100,i.length/o*100):100,u=s.filter(k=>k.schema_markup),d=s.length>0?u.length/s.length*100:100;let h=0;for(const k of s){const j=[k.intro_text,k.body_content,...Array.isArray(k.faq_json)?k.faq_json.map(B=>`${B.question} ${B.answer}`):[]].filter(Boolean).join(" ");h+=Mf(j).filter(B=>B.severity==="critical").length}const A=Math.max(0,100-h*10),f=100,p=r.filter(k=>k.cover_image_id&&(k.content_image_ids||[]).length>0),m=r.length>0?p.length/r.length*100:100,g=i.filter(k=>k.meta_title&&k.meta_description),y=i.length>0?g.length/i.length*100:100,v=a.filter(k=>k.google_indexed||k.bing_indexed),x=s.length>0?v.length/s.length*100:0,b=[{label:"Pages",weight:15,score:c},{label:"Schema",weight:25,score:d},{label:"Fair Housing",weight:15,score:A},{label:"Cannibalization",weight:10,score:f},{label:"Images",weight:10,score:m},{label:"Meta",weight:15,score:y},{label:"Indexing",weight:10,score:x}],w=b.reduce((k,j)=>k+j.score*j.weight/100,0);return{total:Math.round(w),factors:b}},[e,t,n])}const WWe=()=>{const{total:e,factors:t}=fAe(),n=e>=75?"text-green-600":e>=50?"text-yellow-600":"text-destructive";return l.jsx(xU,{children:l.jsxs("div",{className:"border rounded-lg p-6 space-y-4 bg-card",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Site Readiness Score"}),l.jsxs("span",{className:`text-3xl font-bold ${n}`,children:[e,l.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]})]}),l.jsx(Cv,{value:e,className:"h-3"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-7 gap-3",children:t.map(r=>l.jsxs(wU,{children:[l.jsx(bU,{asChild:!0,children:l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:r.label}),l.jsxs("span",{children:[Math.round(r.score),"%"]})]}),l.jsx(Cv,{value:r.score,className:"h-1.5"})]})}),l.jsx(xE,{children:l.jsxs("p",{children:[r.label,": ",Math.round(r.score),"% (weight ",r.weight,"%)"]})})]},r.label))})]})})};function GWe(e,t){const n=(e.intro_text||"").split(/\n\n+/).filter(Boolean),r=e.faq_json||[],i=t.filter(u=>u.category_id===e.id);i.filter(u=>u.status==="published");const s=[e.intro_text,...r.map(u=>`${u.question} ${u.answer}`)].filter(Boolean).join(" "),o=Mf(s).filter(u=>u.severity==="critical");return[{label:"Intro text with 3+ paragraphs",passed:n.length>=3,fix:"Add at least 3 paragraphs of intro text"},{label:"Section headings assigned",passed:(e.section_headings||[]).length>0,fix:"Add section headings in Blueprint tab"},{label:"Cover image assigned",passed:!!e.cover_image_id,fix:"Pick a cover image in Content editor"},{label:"Content images for paragraphs",passed:(e.content_image_ids||[]).length>=Math.min(n.length,1),fix:"Assign content images in Content editor"},{label:"FAQs (3+ questions)",passed:r.length>=3,fix:"Add at least 3 FAQ items"},{label:"Video + VideoObject schema",passed:!e.video_url||!!e.video_url,fix:e.video_url?"Ensure VideoObject schema is generated":"Optional — add a video URL"},{label:"Child pages created",passed:i.length>0,fix:"Generate sub-pages in Page Generator tab"},{label:"Fair Housing compliance",passed:o.length===0,fix:`${o.length} critical violation(s) — review flagged terms`}]}function YWe(e){const t=e.faq_json||[],n=(e.body_content||"").split(/\n\n+/).filter(Boolean),r=[e.intro_text,e.body_content,...t.map(s=>`${s.question} ${s.answer}`)].filter(Boolean).join(" "),i=Mf(r).filter(s=>s.severity==="critical");return[{label:"Has h1",passed:!!e.h1,fix:"Set the h1 field"},{label:"Has subheadline",passed:!!e.subheadline,fix:"Add a subheadline"},{label:"Has intro text",passed:!!(e.intro_text&&e.intro_text.length>50),fix:"Write intro text (50+ chars)"},{label:"Body content with 2+ sections",passed:n.length>=2,fix:"Add more body content sections"},{label:"FAQs with FAQPage schema",passed:t.length>=2&&!!e.schema_markup,fix:"Add FAQs and generate schema"},{label:"Has schema markup",passed:!!e.schema_markup,fix:"Generate schema in Page Generator"},{label:"Meta title",passed:!!e.meta_title,fix:"Set meta title"},{label:"Meta description",passed:!!e.meta_description,fix:"Set meta description"},{label:"Fair Housing compliance",passed:i.length===0,fix:`${i.length} critical violation(s)`}]}function XWe(e,t){return e==="Home"?[{label:"WebSite schema with SearchAction",passed:!1,fix:"Add WebSite JSON-LD with SearchAction to Home page"},{label:"Organization/RealEstateAgent schema",passed:!!t.agent_name,fix:"Set agent name in Agent Config"},{label:"Has og:image",passed:!1,fix:"Add og:image meta tag to Home"},{label:"Has meta description",passed:!1,fix:"Add meta description to Home"}]:e==="About"?[{label:"RealEstateAgent/Person schema",passed:!!t.agent_name,fix:"Ensure About page has Person schema"},{label:"Has sameAs links",passed:!1,fix:"Add social profile URLs to Agent Config"},{label:"Has BreadcrumbList",passed:!1,fix:"Add BreadcrumbList schema"},{label:"Has og:title and og:description",passed:!1,fix:"Add Open Graph meta tags"}]:e==="Contact"?[{label:"LocalBusiness schema with address",passed:!!t.agent_market,fix:"Add LocalBusiness schema with NAP"},{label:"Has phone/email",passed:!!(t.agent_phone||t.agent_email),fix:"Set phone/email in Agent Config"},{label:"Has BreadcrumbList",passed:!1,fix:"Add BreadcrumbList schema"}]:[]}const d4=({type:e,category:t,page:n,pages:r,staticPageName:i,configMap:s})=>{let a=[];e==="category"&&t&&r?a=GWe(t,r):e==="subpage"&&n?a=YWe(n):e==="static"&&i&&s&&(a=XWe(i,s));const o=a.filter(d=>d.passed).length,c=a.length,u=c>0?Math.round(o/c*100):0;return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:[o,"/",c," checks passed"]}),l.jsxs("span",{className:u===100?"text-green-600 font-medium":u>=60?"text-yellow-600":"text-destructive font-medium",children:[u,"%"]})]}),l.jsx("div",{className:"space-y-1",children:a.map((d,h)=>l.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[d.passed?l.jsx(e0,{className:"w-4 h-4 text-green-500 mt-0.5 shrink-0"}):l.jsx(x2,{className:"w-4 h-4 text-destructive mt-0.5 shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:d.passed?"text-muted-foreground":"text-foreground",children:d.label}),!d.passed&&l.jsx("p",{className:"text-xs text-muted-foreground",children:d.fix})]})]},h))})]})};function JWe(){return Br({queryKey:["site-wins"],queryFn:async()=>{const{data:e,error:t}=await Me.from("site_wins").select("*").order("created_at",{ascending:!1});if(t)throw t;return e||[]}})}function ZWe(){const e=As();return Ms({mutationFn:async t=>{const{error:n}=await Me.from("site_wins").insert(t);if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["site-wins"]})})}const eGe=()=>{const{data:e}=Nc(),{data:t}=VH(),n=qWe(),r=ZWe(),[i,s]=C.useState({}),a=e||[],o=(t||[]).reduce((f,p)=>(f[p.page_id]=p,f),{}),c=(f,p)=>{var m;return i[f]&&p in i[f]?i[f][p]:((m=o[f])==null?void 0:m[p])??(p==="notes"?"":!1)},u=(f,p,m)=>{s(g=>({...g,[f]:{...g[f],[p]:m}}))},d=async(f,p,m)=>{const g=o[f],y=i[f]||{};try{await n.mutateAsync({page_id:f,page_path:p,...y}),y.google_indexed&&!(g!=null&&g.google_indexed)&&await r.mutateAsync({win_type:"indexed",title:`${m} indexed on Google`,page_path:p}),y.bing_indexed&&!(g!=null&&g.bing_indexed)&&await r.mutateAsync({win_type:"indexed",title:`${m} indexed on Bing`,page_path:p}),y.rich_results&&!(g!=null&&g.rich_results)&&await r.mutateAsync({win_type:"rich_results",title:`Rich results detected for ${m}`,page_path:p}),s(v=>{const x={...v};return delete x[f],x}),Ew.success("Saved")}catch{Ew.error("Failed to save")}},A=[...[{id:"static-home",title:"Home",path:"/"},{id:"static-about",title:"About",path:"/about"},{id:"static-contact",title:"Contact",path:"/contact"}].map(f=>({id:f.id,title:f.title,path:f.path,status:"published"})),...a.map(f=>{var p;return{id:f.id,title:f.title,path:`/${((p=f.category)==null?void 0:p.slug)||"page"}/${f.slug}`,status:f.status}})];return l.jsxs("div",{className:"space-y-4",children:[l.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Indexing Tracker"}),l.jsx("div",{className:"border rounded-lg overflow-hidden",children:l.jsxs(Wf,{children:[l.jsx(Gf,{children:l.jsxs(Li,{children:[l.jsx(vn,{className:"w-[200px]",children:"Page"}),l.jsx(vn,{className:"w-[80px]",children:"Status"}),l.jsx(vn,{className:"w-[80px] text-center",children:"Google"}),l.jsx(vn,{className:"w-[80px] text-center",children:"Bing"}),l.jsx(vn,{className:"w-[80px] text-center",children:"Rich"}),l.jsx(vn,{className:"w-[140px]",children:"First Indexed"}),l.jsx(vn,{children:"Notes"}),l.jsx(vn,{className:"w-[60px]"})]})}),l.jsx(Yf,{children:A.map(f=>l.jsxs(Li,{children:[l.jsx(on,{children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-sm",children:f.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:f.path})]})}),l.jsx(on,{children:l.jsx("span",{className:`text-xs uppercase tracking-wider ${f.status==="published"?"text-green-600":"text-muted-foreground"}`,children:f.status})}),l.jsx(on,{className:"text-center",children:l.jsx(wc,{checked:!!c(f.id,"google_indexed"),onCheckedChange:p=>u(f.id,"google_indexed",p)})}),l.jsx(on,{className:"text-center",children:l.jsx(wc,{checked:!!c(f.id,"bing_indexed"),onCheckedChange:p=>u(f.id,"bing_indexed",p)})}),l.jsx(on,{className:"text-center",children:l.jsx(wc,{checked:!!c(f.id,"rich_results"),onCheckedChange:p=>u(f.id,"rich_results",p)})}),l.jsx(on,{children:l.jsx(Je,{type:"date",className:"h-8 text-xs",value:(c(f.id,"first_indexed_at")||"").slice(0,10),onChange:p=>u(f.id,"first_indexed_at",p.target.value?new Date(p.target.value).toISOString():null)})}),l.jsx(on,{children:l.jsx(hi,{className:"h-8 min-h-[2rem] text-xs resize-none",placeholder:"Notes...",value:c(f.id,"notes")||"",onChange:p=>u(f.id,"notes",p.target.value)})}),l.jsx(on,{children:i[f.id]&&l.jsx(xe,{size:"icon",variant:"ghost",onClick:()=>d(f.id,f.path,f.title),children:l.jsx(Ib,{className:"w-4 h-4"})})})]},f.id))})]})})]})};function ar(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function kd(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function tGe(e,t){const n=ar(e);return isNaN(t)?kd(e,NaN):(n.setDate(n.getDate()+t),n)}const AAe=6048e5,nGe=864e5,HS=43200,zq=1440;let rGe={};function H2(){return rGe}function p1(e,t){var o,c,u,d;const n=H2(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=ar(e),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function _B(e){return p1(e,{weekStartsOn:1})}function pAe(e){const t=ar(e),n=t.getFullYear(),r=kd(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=_B(r),s=kd(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=_B(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Vq(e){const t=ar(e);return t.setHours(0,0,0,0),t}function jB(e){const t=ar(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function iGe(e,t){const n=Vq(e),r=Vq(t),i=+n-jB(n),s=+r-jB(r);return Math.round((i-s)/nGe)}function sGe(e){const t=pAe(e),n=kd(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),_B(n)}function g_(e,t){const n=ar(e),r=ar(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function aGe(e){return kd(e,Date.now())}function oGe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function lGe(e){if(!oGe(e)&&typeof e!="number")return!1;const t=ar(e);return!isNaN(Number(t))}function cGe(e,t){const n=ar(e),r=ar(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function uGe(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function dGe(e,t){return+ar(e)-+ar(t)}function hGe(e){const t=ar(e);return t.setHours(23,59,59,999),t}function fGe(e){const t=ar(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function AGe(e){const t=ar(e);return+hGe(t)==+fGe(t)}function pGe(e,t){const n=ar(e),r=ar(t),i=g_(n,r),s=Math.abs(cGe(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let o=g_(n,r)===-i;AGe(ar(e))&&s===1&&g_(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function mGe(e,t,n){const r=dGe(e,t)/1e3;return uGe(n==null?void 0:n.roundingMethod)(r)}function gGe(e){const t=ar(e),n=kd(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const yGe={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"}},vGe=(e,t,n)=>{let r;const i=yGe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function h4(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const xGe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wGe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bGe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CGe={date:h4({formats:xGe,defaultWidth:"full"}),time:h4({formats:wGe,defaultWidth:"full"}),dateTime:h4({formats:bGe,defaultWidth:"full"})},SGe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kGe=(e,t,n,r)=>SGe[e];function Bx(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const _Ge={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jGe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},BGe={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"]},NGe={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"]},EGe={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"}},TGe={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"}},IGe=(e,t)=>{const n=Number(e),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"},PGe={ordinalNumber:IGe,era:Bx({values:_Ge,defaultWidth:"wide"}),quarter:Bx({values:jGe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Bx({values:BGe,defaultWidth:"wide"}),day:Bx({values:NGe,defaultWidth:"wide"}),dayPeriod:Bx({values:EGe,defaultWidth:"wide",formattingValues:TGe,defaultFormattingWidth:"wide"})};function Nx(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?FGe(o,h=>h.test(a)):OGe(o,h=>h.test(a));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function OGe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function FGe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function MGe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const LGe=/^(\d+)(th|st|nd|rd)?/i,RGe=/\d+/i,DGe={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},UGe={any:[/^b/i,/^(a|c)/i]},HGe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},QGe={any:[/1/i,/2/i,/3/i,/4/i]},$Ge={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},zGe={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]},VGe={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},KGe={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]},qGe={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},WGe={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}},GGe={ordinalNumber:MGe({matchPattern:LGe,parsePattern:RGe,valueCallback:e=>parseInt(e,10)}),era:Nx({matchPatterns:DGe,defaultMatchWidth:"wide",parsePatterns:UGe,defaultParseWidth:"any"}),quarter:Nx({matchPatterns:HGe,defaultMatchWidth:"wide",parsePatterns:QGe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nx({matchPatterns:$Ge,defaultMatchWidth:"wide",parsePatterns:zGe,defaultParseWidth:"any"}),day:Nx({matchPatterns:VGe,defaultMatchWidth:"wide",parsePatterns:KGe,defaultParseWidth:"any"}),dayPeriod:Nx({matchPatterns:qGe,defaultMatchWidth:"any",parsePatterns:WGe,defaultParseWidth:"any"})},mAe={code:"en-US",formatDistance:vGe,formatLong:CGe,formatRelative:kGe,localize:PGe,match:GGe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function YGe(e){const t=ar(e);return iGe(t,gGe(t))+1}function XGe(e){const t=ar(e),n=+_B(t)-+sGe(t);return Math.round(n/AAe)+1}function gAe(e,t){var d,h,A,f;const n=ar(e),r=n.getFullYear(),i=H2(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(A=i.locale)==null?void 0:A.options)==null?void 0:f.firstWeekContainsDate)??1,a=kd(e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=p1(a,t),c=kd(e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const u=p1(c,t);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function JGe(e,t){var o,c,u,d;const n=H2(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=gAe(e,t),s=kd(e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),p1(s,t)}function ZGe(e,t){const n=ar(e),r=+p1(n,t)-+JGe(n,t);return Math.round(r/AAe)+1}function Jn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ah={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Jn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Jn(n+1,2)},d(e,t){return Jn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t){return Jn(e.getHours()%12||12,t.length)},H(e,t){return Jn(e.getHours(),t.length)},m(e,t){return Jn(e.getMinutes(),t.length)},s(e,t){return Jn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Jn(i,t.length)}},fg={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kq={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){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(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return ah.y(e,t)},Y:function(e,t,n,r){const i=gAe(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Jn(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Jn(s,t.length)},R:function(e,t){const n=pAe(e);return Jn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Jn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Jn(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(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Jn(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(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ah.M(e,t);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(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Jn(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(e,t,n,r){const i=ZGe(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Jn(i,t.length)},I:function(e,t,n){const r=XGe(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Jn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ah.d(e,t)},D:function(e,t,n){const r=YGe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Jn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){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(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Jn(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Jn(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Jn(i,t.length);case"io":return n.ordinalNumber(i,{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(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=fg.noon:r===0?i=fg.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=fg.evening:r>=12?i=fg.afternoon:r>=4?i=fg.morning:i=fg.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ah.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ah.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ah.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ah.s(e,t)},S:function(e,t){return ah.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Wq(r);case"XXXX":case"XX":return RA(r);case"XXXXX":case"XXX":default:return RA(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Wq(r);case"xxxx":case"xx":return RA(r);case"xxxxx":case"xxx":default:return RA(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+qq(r,":");case"OOOO":default:return"GMT"+RA(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+qq(r,":");case"zzzz":default:return"GMT"+RA(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Jn(r,t.length)},T:function(e,t,n){const r=e.getTime();return Jn(r,t.length)}};function qq(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Jn(s,2)}function Wq(e,t){return e%60===0?(e>0?"-":"+")+Jn(Math.abs(e)/60,2):RA(e,t)}function RA(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Jn(Math.trunc(r/60),2),s=Jn(r%60,2);return n+i+t+s}const Gq=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},yAe=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},eYe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Gq(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Gq(r,t)).replace("{{time}}",yAe(i,t))},tYe={p:yAe,P:eYe},nYe=/^D+$/,rYe=/^Y+$/,iYe=["D","DD","YY","YYYY"];function sYe(e){return nYe.test(e)}function aYe(e){return rYe.test(e)}function oYe(e,t,n){const r=lYe(e,t,n);if(console.warn(r),iYe.includes(e))throw new RangeError(r)}function lYe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const cYe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uYe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dYe=/^'([^]*?)'?$/,hYe=/''/g,fYe=/[a-zA-Z]/;function AYe(e,t,n){var d,h,A,f;const r=H2(),i=r.locale??mAe,s=r.firstWeekContainsDate??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=r.weekStartsOn??((f=(A=r.locale)==null?void 0:A.options)==null?void 0:f.weekStartsOn)??0,o=ar(e);if(!lGe(o))throw new RangeError("Invalid time value");let c=t.match(uYe).map(p=>{const m=p[0];if(m==="p"||m==="P"){const g=tYe[m];return g(p,i.formatLong)}return p}).join("").match(cYe).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:pYe(p)};if(Kq[m])return{isToken:!0,value:p};if(m.match(fYe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(c=i.localize.preprocessor(o,c));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return c.map(p=>{if(!p.isToken)return p.value;const m=p.value;(aYe(m)||sYe(m))&&oYe(m,t,String(e));const g=Kq[m[0]];return g(o,m,i.localize,u)}).join("")}function pYe(e){const t=e.match(dYe);return t?t[1].replace(hYe,"'"):e}function mYe(e,t,n){const r=H2(),i=(n==null?void 0:n.locale)??r.locale??mAe,s=2520,a=g_(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:a});let c,u;a>0?(c=ar(t),u=ar(e)):(c=ar(e),u=ar(t));const d=mGe(u,c),h=(jB(u)-jB(c))/1e3,A=Math.round((d-h)/60);let f;if(A<2)return n!=null&&n.includeSeconds?d<5?i.formatDistance("lessThanXSeconds",5,o):d<10?i.formatDistance("lessThanXSeconds",10,o):d<20?i.formatDistance("lessThanXSeconds",20,o):d<40?i.formatDistance("halfAMinute",0,o):d<60?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",1,o):A===0?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",A,o);if(A<45)return i.formatDistance("xMinutes",A,o);if(A<90)return i.formatDistance("aboutXHours",1,o);if(A<zq){const p=Math.round(A/60);return i.formatDistance("aboutXHours",p,o)}else{if(A<s)return i.formatDistance("xDays",1,o);if(A<HS){const p=Math.round(A/zq);return i.formatDistance("xDays",p,o)}else if(A<HS*2)return f=Math.round(A/HS),i.formatDistance("aboutXMonths",f,o)}if(f=pGe(u,c),f<12){const p=Math.round(A/HS);return i.formatDistance("xMonths",p,o)}else{const p=f%12,m=Math.trunc(f/12);return p<3?i.formatDistance("aboutXYears",m,o):p<9?i.formatDistance("overXYears",m,o):i.formatDistance("almostXYears",m+1,o)}}function Iy(e,t){return mYe(e,aGe(e),t)}const gYe={indexed:l.jsx(w2,{className:"w-4 h-4 text-green-500"}),rich_results:l.jsx(Os,{className:"w-4 h-4 text-yellow-500"}),published:l.jsx(r2e,{className:"w-4 h-4 text-blue-500"}),schema:l.jsx(Ire,{className:"w-4 h-4 text-purple-500"})},yYe=()=>{const{data:e}=JWe(),{data:t}=VH(),{data:n}=Nc(),{total:r}=fAe(),i=(n||[]).filter(c=>c.status==="published").length,s=(t||[]).filter(c=>c.google_indexed||c.bing_indexed).length,a=(t||[]).filter(c=>c.rich_results).length,o=r>=75?"text-green-600":r>=50?"text-yellow-600":"text-destructive";return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[l.jsx("div",{className:`text-6xl font-bold ${o}`,children:r}),l.jsx("p",{className:"text-sm text-muted-foreground uppercase tracking-wider",children:"Site Readiness Score"}),l.jsx(Cv,{value:r,className:"h-3 w-64"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[l.jsx("p",{className:"text-2xl font-bold",children:i}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Published"})]}),l.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[l.jsx("p",{className:"text-2xl font-bold",children:s}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Indexed"})]}),l.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[l.jsx("p",{className:"text-2xl font-bold",children:a}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Rich Results"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Recent Wins"}),(!e||e.length===0)&&l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No wins yet — they'll appear here as pages get indexed and milestones are hit."}),l.jsx("div",{className:"space-y-2",children:(e||[]).map(c=>l.jsxs("div",{className:"flex items-start gap-3 border rounded-lg p-3 bg-card",children:[l.jsx("div",{className:"mt-0.5",children:gYe[c.win_type]||l.jsx(Ire,{className:"w-4 h-4 text-muted-foreground"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium",children:c.title}),c.description&&l.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),l.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:AYe(new Date(c.created_at),"MMM d")})]},c.id))})]})]})},vYe=()=>{const{data:e}=tA(),{data:t}=Nc(),{configMap:n}=oa(),[r,i]=C.useState("admin"),s=e||[],a=t||[];return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>i("admin"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded text-xs uppercase tracking-wider font-medium transition-colors ${r==="admin"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:[l.jsx(sU,{className:"w-3.5 h-3.5"}),"Admin"]}),l.jsxs("button",{onClick:()=>i("client"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded text-xs uppercase tracking-wider font-medium transition-colors ${r==="client"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:[l.jsx(Tb,{className:"w-3.5 h-3.5"}),"Client"]})]}),r==="client"?l.jsx(yYe,{}):l.jsxs("div",{className:"space-y-8",children:[l.jsx(WWe,{}),l.jsxs(ym,{defaultValue:"categories",className:"space-y-4",children:[l.jsxs(Kf,{className:"bg-muted/50 p-1",children:[l.jsx($n,{value:"categories",className:"text-xs uppercase tracking-wider",children:"Categories"}),l.jsx($n,{value:"subpages",className:"text-xs uppercase tracking-wider",children:"Sub-Pages"}),l.jsx($n,{value:"static",className:"text-xs uppercase tracking-wider",children:"Static Pages"}),l.jsx($n,{value:"indexing",className:"text-xs uppercase tracking-wider",children:"Indexing"})]}),l.jsxs(zn,{value:"categories",className:"space-y-3",children:[s.map(o=>l.jsxs(Xw,{children:[l.jsxs(Jw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[l.jsx("span",{className:"text-sm font-medium",children:o.name}),l.jsx(yc,{className:"w-4 h-4 text-muted-foreground"})]}),l.jsx(Zw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:l.jsx(d4,{type:"category",category:o,pages:a})})]},o.id)),s.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No categories created yet."})]}),l.jsxs(zn,{value:"subpages",className:"space-y-3",children:[a.filter(o=>!o.is_parent).map(o=>l.jsxs(Xw,{children:[l.jsxs(Jw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[l.jsxs("div",{className:"text-left",children:[l.jsx("span",{className:"text-sm font-medium",children:o.title}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["(",o.status,")"]})]}),l.jsx(yc,{className:"w-4 h-4 text-muted-foreground"})]}),l.jsx(Zw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:l.jsx(d4,{type:"subpage",page:o})})]},o.id)),a.filter(o=>!o.is_parent).length===0&&l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No sub-pages created yet."})]}),l.jsx(zn,{value:"static",className:"space-y-3",children:["Home","About","Contact"].map(o=>l.jsxs(Xw,{children:[l.jsxs(Jw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[l.jsx("span",{className:"text-sm font-medium",children:o}),l.jsx(yc,{className:"w-4 h-4 text-muted-foreground"})]}),l.jsx(Zw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:l.jsx(d4,{type:"static",staticPageName:o,configMap:n})})]},o))}),l.jsx(zn,{value:"indexing",children:l.jsx(eGe,{})})]})]})]})};function Ag({value:e,label:t}){return e===null?l.jsxs("span",{title:`${t}: N/A`,className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:t}),l.jsx(xre,{size:14,className:"text-muted-foreground/40"})]}):l.jsxs("span",{title:`${t}: ${e?"Pass":"Fail"}`,className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:t}),e?l.jsx(e0,{size:14,className:"text-emerald-500"}):l.jsx(x2,{size:14,className:"text-red-500"})]})}function Yq({label:e,state:t,onClick:n}){const r={none:"text-red-500",submitted:"text-yellow-500",indexed:"text-emerald-500"},i={none:"Not submitted",submitted:"Submitted (pending)",indexed:"Indexed"},s=t==="indexed"?e0:t==="submitted"?rU:x2;return l.jsxs("button",{onClick:n,title:`${e}: ${i[t]} — Click to advance`,className:"inline-flex items-center gap-1 hover:opacity-80 transition-opacity",children:[l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:e}),l.jsx(s,{size:14,className:r[t],fill:t==="submitted"?"currentColor":"none"})]})}function Xq(e,t){return t?"indexed":e?"submitted":"none"}function Jq(e){return e==="none"?{submitted:!0,indexed:!1}:e==="submitted"?{submitted:!0,indexed:!0}:{submitted:!1,indexed:!1}}const BB=["/idx","/home-valuation"];function Ex({entry:e,onToggleIndex:t}){const n=e.scan,r=["aeo","category","subcategory"].includes(e.page_type),i=BB.includes(e.page_path),s=BB.includes(e.page_path),a=Xq((n==null?void 0:n.google_submitted)??!1,(n==null?void 0:n.google_indexed)??!1),o=Xq((n==null?void 0:n.bing_submitted)??!1,(n==null?void 0:n.bing_indexed)??!1);return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b border-border/40 hover:bg-muted/30 transition-colors",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-mono text-sm truncate",children:e.page_path}),l.jsx(Yt,{variant:"outline",className:"text-[10px] uppercase tracking-wider shrink-0",children:e.page_type})]}),e.page_title&&l.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:e.page_title})]}),l.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 flex-wrap justify-end",children:[l.jsx(Yq,{label:"G",state:a,onClick:()=>t(e.page_path,"google",Jq(a))}),l.jsx(Yq,{label:"B",state:o,onClick:()=>t(e.page_path,"bing",Jq(o))}),l.jsx(Ag,{value:n?i?null:n.has_schema:null,label:"S"}),l.jsx(Ag,{value:n&&r?n.faq_schema_matches:null,label:"F"}),l.jsx(Ag,{value:n?n.has_meta_title&&n.has_meta_description:null,label:"M"}),l.jsx(Ag,{value:(n==null?void 0:n.in_sitemap)??null,label:"SM"}),l.jsx(Ag,{value:n?s?null:n.in_aeo_sitemap??!1:null,label:"AEO"}),l.jsx(Ag,{value:(n==null?void 0:n.in_llms_txt)??null,label:"LLM"})]})]})}function QS({title:e,count:t}){return l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted/50 border-b border-border",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:e}),l.jsx(Yt,{variant:"secondary",className:"text-[10px]",children:t})]})}const Zq=[{path:"/",title:"Home"},{path:"/about",title:"About"},{path:"/about/testimonials",title:"Testimonials"},{path:"/contact",title:"Contact"},{path:"/idx",title:"Home Search"},{path:"/home-valuation",title:"Home Valuation"},{path:"/privacy-policy",title:"Privacy Policy"},{path:"/terms-of-service",title:"Terms of Service"},{path:"/accessibility",title:"Accessibility"}],vAe=[{path:"/blog",title:"Blog"},{path:"/properties",title:"Properties"}];vAe.map(e=>e.path);function xYe(){var x;const e=As(),{data:t,isLoading:n}=Br({queryKey:["crawl-scan-results"],queryFn:async()=>{const{data:b,error:w}=await Me.from("crawl_scan_results").select("*").order("page_type").order("page_path");if(w)throw w;return b||[]}}),{data:r,isLoading:i}=tA(),{data:s,isLoading:a}=Nc(),o=n||i||a,c=C.useMemo(()=>{const b={};for(const w of t||[])b[w.page_path]=w;return b},[t]),u=C.useMemo(()=>{const b=[],w=new Set;for(const T of Zq)b.push({page_path:T.path,page_title:T.title,page_type:"static",scan:c[T.path]}),w.add(T.path);const k=new Set(Zq.map(T=>T.path)),j=(r||[]).filter(T=>T.enabled),B={};for(const T of j)B[T.id]=T;const E=j.filter(T=>!T.parent_id),P=j.filter(T=>T.parent_id);for(const T of E){const N=`/${T.slug}`;w.has(N)||k.has(N)||(b.push({page_path:N,page_title:T.name,page_type:"category",scan:c[N]}),w.add(N))}for(const T of P){const N=B[T.parent_id];if(!N)continue;const F=`/${N.slug}/${T.slug}`;w.has(F)||k.has(F)||(b.push({page_path:F,page_title:T.name,page_type:"subcategory",scan:c[F]}),w.add(F))}for(const T of s||[]){const N=(r||[]).find(L=>L.id===T.category_id);if(!(N!=null&&N.enabled))continue;let F;if(N.parent_id){const L=B[N.parent_id];F=L?`/${L.slug}/${N.slug}/${T.slug}`:`/${N.slug}/${T.slug}`}else F=`/${N.slug}/${T.slug}`;w.has(F)||(b.push({page_path:F,page_title:T.title,page_type:"aeo",scan:c[F]}),w.add(F))}for(const T of vAe)w.has(T.path)||(b.push({page_path:T.path,page_title:T.title,page_type:"dormant",scan:c[T.path]}),w.add(T.path));return b},[t,r,s,c]),d=Ms({mutationFn:async({page_path:b,field:w,next:k})=>{const j={};j[`${w}_submitted`]=k.submitted,j[`${w}_indexed`]=k.indexed;const{data:B}=await Me.from("crawl_scan_results").select("id").eq("page_path",b).maybeSingle();if(B){const{error:E}=await Me.from("crawl_scan_results").update(j).eq("page_path",b);if(E)throw E}else{const E=u.find(T=>T.page_path===b),{error:P}=await Me.from("crawl_scan_results").insert({page_path:b,page_title:(E==null?void 0:E.page_title)||b,page_type:(E==null?void 0:E.page_type)==="dormant"?"static":(E==null?void 0:E.page_type)||"static",...j});if(P)throw P}},onSuccess:()=>e.invalidateQueries({queryKey:["crawl-scan-results"]}),onError:b=>Ew.error(`Update failed: ${b.message}`)}),h=(b,w,k)=>{d.mutate({page_path:b,field:w,next:k})},A=Ms({mutationFn:async()=>{const{data:{session:b}}=await Me.auth.getSession();if(!b)throw new Error("Not authenticated");const w=await Me.functions.invoke("run-crawl-scan",{headers:{Authorization:`Bearer ${b.access_token}`}});if(w.error)throw w.error;return w.data},onSuccess:b=>{e.invalidateQueries({queryKey:["crawl-scan-results"]});const w=b.cleaned>0?` · ${b.cleaned} orphan(s) removed`:"";Ew.success(`Scan complete: ${b.scanned} pages checked${w}`)},onError:b=>Ew.error(`Scan failed: ${b.message}`)}),f=u.filter(b=>b.page_type!=="dormant"),p=u.filter(b=>b.page_type==="dormant"),m={static:f.filter(b=>b.page_type==="static"),category:f.filter(b=>b.page_type==="category"||b.page_type==="subcategory"),aeo:f.filter(b=>b.page_type==="aeo"),blog:f.filter(b=>b.page_type==="blog")},g=f.filter(b=>{if(!b.scan)return!1;const w=b.scan,j=!BB.includes(b.page_path)?w.has_schema:!0,B=w.has_meta_title&&w.has_meta_description,E=w.in_sitemap||w.in_aeo_sitemap,T=!BB.includes(b.page_path)&&b.page_path!=="/"?w.has_shadow_html:!0;return j&&B&&E&&T}).length,y=f.length,v=(x=t==null?void 0:t[0])==null?void 0:x.scan_timestamp;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:"Crawlability Map"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"3-layer AEO visibility: Schema · Sitemaps · Shadow HTML · LLMs.txt"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[v&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last scan: ",new Date(v).toLocaleString()]}),l.jsxs(xe,{onClick:()=>A.mutate(),disabled:A.isPending,className:"gap-2",children:[A.isPending?l.jsx(Ea,{size:16,className:"animate-spin"}):l.jsx(nu,{size:16}),"Run Full Scan"]})]})]}),y>0&&l.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-muted/30 border",children:[l.jsxs("div",{className:"text-center",children:[l.jsxs("div",{className:"text-3xl font-bold",children:[g,"/",y]}),l.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Pages Healthy"})]}),l.jsx("div",{className:"flex-1 h-3 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all",style:{width:`${y>0?g/y*100:0}%`}})}),l.jsxs("div",{className:"text-sm font-medium",children:[y>0?Math.round(g/y*100):0,"%"]})]}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted-foreground p-3 rounded-md bg-muted/20 border",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"G"})," Google"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"B"})," Bing"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"S"})," JSON-LD Schema"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"F"})," FAQ Schema"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"M"})," Meta Tags"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"SM"})," Sitemap"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"AEO"})," AEO Sitemap / Shadow HTML"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"LLM"})," In llms.txt"]}),l.jsxs("span",{className:"flex items-center gap-1.5 ml-2 border-l pl-3 border-border",children:[l.jsx(x2,{size:12,className:"text-red-500"})," Not Submitted",l.jsx(rU,{size:12,className:"text-yellow-500 fill-yellow-500"})," Submitted",l.jsx(e0,{size:12,className:"text-emerald-500"})," Indexed / Pass",l.jsx(xre,{size:12,className:"text-muted-foreground/40"})," N/A"]})]}),o?l.jsx("div",{className:"flex items-center justify-center py-16",children:l.jsx(Ea,{className:"animate-spin text-muted-foreground",size:24})}):l.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[m.static.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(QS,{title:"Static Pages",count:m.static.length}),m.static.map(b=>l.jsx(Ex,{entry:b,onToggleIndex:h},b.page_path))]}),m.category.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(QS,{title:"Category Pages",count:m.category.length}),m.category.map(b=>l.jsx(Ex,{entry:b,onToggleIndex:h},b.page_path))]}),m.aeo.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(QS,{title:"AEO / FAQ Pages",count:m.aeo.length}),m.aeo.map(b=>l.jsx(Ex,{entry:b,onToggleIndex:h},b.page_path))]}),m.blog.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(QS,{title:"Blog Posts",count:m.blog.length}),m.blog.map(b=>l.jsx(Ex,{entry:b,onToggleIndex:h},b.page_path))]}),p.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted/30 border-b border-border",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground/60",children:"Dormant Pages"}),l.jsx(Yt,{variant:"outline",className:"text-[10px] text-muted-foreground/60",children:p.length})]}),p.map(b=>l.jsx("div",{className:"opacity-50",children:l.jsx(Ex,{entry:b,onToggleIndex:h})},b.page_path))]})]})]})}const wYe=()=>{const{configMap:e,isLoading:t}=oa(),{data:n,isLoading:r}=Nc(),i=(n||[]).filter(u=>u.status==="published"),s=i.filter(u=>u.schema_markup),a=C.useMemo(()=>{if(!n||i.length===0)return{clean:!0,count:0};let u=0;for(const d of i){const h=[d.intro_text,d.body_content,...Array.isArray(d.faq_json)?d.faq_json.map(A=>`${A.question} ${A.answer}`):[]].filter(Boolean).join(" ");u+=Mf(h).filter(A=>A.severity==="critical").length}return{clean:u===0,count:u}},[n,i]);if(t||r)return null;const o=[{label:"Config",healthy:!!(e.agent_name&&e.agent_market),tooltip:e.agent_name&&e.agent_market?"Agent name and market are configured":"Set agent name and market in Agent Config tab"},{label:"Pages",healthy:(n||[]).length>0,tooltip:(n||[]).length>0?`${(n||[]).length} page(s) created`:"No AEO pages created yet"},{label:"Schema",healthy:i.length===0||s.length===i.length,tooltip:i.length===0?"No published pages to check":`${s.length}/${i.length} published pages have schema markup`},{label:"Fair Housing",healthy:a.clean,tooltip:a.clean?"All published content passes Fair Housing compliance":`${a.count} critical Fair Housing issue(s) found in published content`}],c=o.every(u=>u.healthy);return l.jsx(xU,{children:l.jsxs("div",{className:`flex items-center gap-6 px-4 py-2.5 border rounded text-xs tracking-wider uppercase ${c?"border-border bg-muted/30":"border-destructive/30 bg-destructive/5"}`,children:[l.jsx("span",{className:"font-medium text-muted-foreground",children:"Site Health"}),o.map(u=>l.jsxs(wU,{children:[l.jsx(bU,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-1.5 cursor-default",children:[l.jsx("span",{className:`w-2 h-2 rounded-full ${u.healthy?"bg-green-500":"bg-destructive"}`}),l.jsx("span",{className:"text-muted-foreground",children:u.label})]})}),l.jsx(xE,{children:l.jsx("p",{children:u.tooltip})})]},u.label))]})})},bYe=({open:e,onOpenChange:t,syncReport:n,setSyncReport:r,isSyncing:i})=>{const[s,a]=C.useState(!1),[o,c]=C.useState(!1),[u,d]=C.useState(!1),[h,A]=C.useState(null),f="khmmwvmdbhaplcfcndjx",p="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",m=async()=>{var w,k;a(!0);try{const j=(w=n==null?void 0:n.audit)==null?void 0:w.some(N=>{var F,L;return((F=N.contentSync)==null?void 0:F.includes("llms"))||((L=N.contentSync)==null?void 0:L.includes("both"))}),B=(k=n==null?void 0:n.audit)==null?void 0:k.some(N=>{var F,L;return((F=N.contentSync)==null?void 0:F.includes("html"))||((L=N.contentSync)==null?void 0:L.includes("both"))}),P=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content?fix=${j&&B?"all":j?"llms":B?"html":"all"}`,{headers:{apikey:p}});if(!P.ok)throw new Error(await P.text());const T=await P.json();r(T),De({title:"Content mismatches fixed",description:`${T.summary.content_mismatches} remaining mismatches`})}catch(j){De({title:"Fix failed",description:j.message,variant:"destructive"})}finally{a(!1)}},g=async()=>{c(!0);try{const w=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content?fix=html`,{headers:{apikey:p}});if(!w.ok)throw new Error(await w.text());const k=await w.json();r(k),De({title:"HTML issues fixed",description:`${k.summary.html_issues||0} remaining issues`})}catch(w){De({title:"Fix failed",description:w.message,variant:"destructive"})}finally{c(!1)}},y=async()=>{d(!0);try{await fetch(`https://${f}.supabase.co/functions/v1/sitemap`,{headers:{apikey:p}});const w=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content?fix=all`,{headers:{apikey:p}});if(!w.ok)throw new Error(await w.text());const k=await w.json();r(k),De({title:"All issues fixed",description:"Sitemaps rebuilt, HTML & llms files regenerated."})}catch(w){De({title:"Fix All failed",description:w.message,variant:"destructive"})}finally{d(!1)}},v=async w=>{const k=w.path;A(k);try{const j=w.sourceId?`&id=${w.sourceId}`:"",B=w.type==="core"?"core":"aeo";await fetch(`https://${f}.supabase.co/functions/v1/generate-static-html?type=${B}${j}`,{headers:{apikey:p}}),await Promise.all([fetch(`https://${f}.supabase.co/functions/v1/generate-llms-txt?type=index&rebuild=true`,{headers:{apikey:p}}),fetch(`https://${f}.supabase.co/functions/v1/generate-llms-txt?type=full&rebuild=true`,{headers:{apikey:p}})]),De({title:`Regenerated assets for "${w.title}"`});const E=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content`,{headers:{apikey:p}});if(E.ok){const P=await E.json();r(P)}}catch(j){De({title:"Row fix failed",description:j.message,variant:"destructive"})}finally{A(null)}},x=w=>{var k,j;return w.llmsIndex==="❌"||w.llmsFull==="❌"||w.staticHtml==="❌"||w.redirect==="❌"||((k=w.contentSync)==null?void 0:k.includes("❌"))||((j=w.contentSync)==null?void 0:j.includes("⚠️"))},b=n?(n.summary.has_gaps||0)+(n.summary.html_issues||0)+(n.summary.content_mismatches||0):0;return l.jsx(Fo,{open:e,onOpenChange:t,children:l.jsxs(Ja,{className:"max-w-4xl max-h-[85vh] overflow-y-auto",children:[l.jsx(Za,{children:l.jsx(eo,{children:"Site Sync & Coverage Audit"})}),i?l.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-muted-foreground gap-4",children:[l.jsx(nu,{className:"w-8 h-8 animate-spin text-primary"}),l.jsx("p",{children:"Synchronizing sitemap, static HTML files, and AI models text..."})]}):n?l.jsxs("div",{className:"space-y-6 mt-4",children:[l.jsxs("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-4",children:[l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:"text-2xl font-bold",children:n.summary.total_pages}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Total Pages"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:"text-2xl font-bold text-green-600",children:n.summary.fully_covered}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Covered"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:`text-2xl font-bold ${n.summary.has_gaps>0?"text-destructive":"text-green-600"}`,children:n.summary.has_gaps}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Missing Items"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:"text-2xl font-bold",children:n.summary.generated_html_files}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"HTML Files"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:`text-2xl font-bold ${(n.summary.html_issues||0)>0?"text-destructive":"text-green-600"}`,children:n.summary.html_issues||0}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"HTML Issues"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:`text-2xl font-bold ${n.summary.content_mismatches>0?"text-destructive":"text-green-600"}`,children:n.summary.content_mismatches}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Content Mismatches"})]})]}),b>0&&l.jsxs("div",{className:"flex items-center gap-3 p-4 bg-primary/10 border border-primary/20 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-sm font-medium",children:[b," total issue",b!==1?"s":""," detected across all checks"]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Rebuilds sitemaps, regenerates all HTML files, and refreshes llms.txt files in one pass."})]}),l.jsxs(xe,{size:"sm",onClick:y,disabled:u,children:[l.jsx(S7,{className:`w-3.5 h-3.5 mr-1.5 ${u?"animate-spin":""}`}),u?"Fixing Everything...":"Fix All Issues"]})]}),n.summary.content_mismatches>0&&l.jsxs("div",{className:"flex items-center gap-3 p-4 bg-destructive/10 border border-destructive/20 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-sm font-medium",children:[n.summary.content_mismatches," content mismatch",n.summary.content_mismatches!==1?"es":""," detected"]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"The database (source of truth) will be used to regenerate stale llms and/or HTML files."})]}),l.jsxs(xe,{size:"sm",variant:"destructive",onClick:m,disabled:s,children:[l.jsx(nu,{className:`w-3.5 h-3.5 mr-1.5 ${s?"animate-spin":""}`}),s?"Fixing...":"Fix Mismatches"]})]}),(n.summary.html_issues||0)>0&&l.jsxs("div",{className:"flex items-center gap-3 p-4 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-sm font-medium",children:[n.summary.html_issues," HTML issue",n.summary.html_issues!==1?"s":""," detected"]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[n.summary.missing_html>0&&`${n.summary.missing_html} missing file${n.summary.missing_html!==1?"s":""}`,n.summary.missing_html>0&&n.summary.missing_redirects>0&&" · ",n.summary.missing_redirects>0&&`${n.summary.missing_redirects} missing redirect${n.summary.missing_redirects!==1?"s":""}`," — ","Regenerating will create missing files and inject redirect scripts."]})]}),l.jsxs(xe,{size:"sm",variant:"outline",className:"border-amber-500/30 hover:bg-amber-500/10",onClick:g,disabled:o,children:[l.jsx(nu,{className:`w-3.5 h-3.5 mr-1.5 ${o?"animate-spin":""}`}),o?"Fixing...":"Fix All HTML Issues"]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium mb-3",children:"Coverage Audit"}),l.jsx("div",{className:"border rounded-md overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-muted",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-3 text-left font-medium",children:"Page Title"}),l.jsx("th",{className:"p-3 text-left font-medium",children:"Path"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Sitemap"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"AEO Sitemap"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"llms.txt"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"llms-full"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"HTML"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Redirect"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Content Sync"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Fix"})]})}),l.jsx("tbody",{className:"divide-y",children:n.audit.map((w,k)=>l.jsxs("tr",{className:"hover:bg-muted/50",children:[l.jsx("td",{className:"p-3 font-medium",children:w.title}),l.jsx("td",{className:"p-3 text-muted-foreground font-mono text-xs",children:w.path}),l.jsx("td",{className:"p-3 text-center",children:w.sitemap}),l.jsx("td",{className:"p-3 text-center",children:w.sitemapAeo||"—"}),l.jsx("td",{className:"p-3 text-center",title:w.llmsIndexDetail||"",children:w.llmsIndex}),l.jsx("td",{className:"p-3 text-center",title:w.llmsFullDetail||"",children:w.llmsFull}),l.jsx("td",{className:"p-3 text-center",children:w.staticHtml}),l.jsx("td",{className:"p-3 text-center",children:w.redirect}),l.jsx("td",{className:"p-3 text-center",title:w.contentDetail||"",children:w.contentSync}),l.jsx("td",{className:"p-3 text-center",children:x(w)?l.jsx(xe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>v(w),disabled:h===w.path,title:`Fix ${w.title}`,children:h===w.path?l.jsx(nu,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(S7,{className:"w-3.5 h-3.5"})}):l.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})})]},k))})]})})]})]}):null]})})};var CYe=Array.isArray,ho=CYe,SYe=typeof Qh=="object"&&Qh&&Qh.Object===Object&&Qh,xAe=SYe,kYe=xAe,_Ye=typeof self=="object"&&self&&self.Object===Object&&self,jYe=kYe||_Ye||Function("return this")(),Cu=jYe,BYe=Cu,NYe=BYe.Symbol,Q2=NYe,eW=Q2,wAe=Object.prototype,EYe=wAe.hasOwnProperty,TYe=wAe.toString,Tx=eW?eW.toStringTag:void 0;function IYe(e){var t=EYe.call(e,Tx),n=e[Tx];try{e[Tx]=void 0;var r=!0}catch{}var i=TYe.call(e);return r&&(t?e[Tx]=n:delete e[Tx]),i}var PYe=IYe,OYe=Object.prototype,FYe=OYe.toString;function MYe(e){return FYe.call(e)}var LYe=MYe,tW=Q2,RYe=PYe,DYe=LYe,UYe="[object Null]",HYe="[object Undefined]",nW=tW?tW.toStringTag:void 0;function QYe(e){return e==null?e===void 0?HYe:UYe:nW&&nW in Object(e)?RYe(e):DYe(e)}var Ld=QYe;function $Ye(e){return e!=null&&typeof e=="object"}var Rd=$Ye,zYe=Ld,VYe=Rd,KYe="[object Symbol]";function qYe(e){return typeof e=="symbol"||VYe(e)&&zYe(e)==KYe}var x0=qYe,WYe=ho,GYe=x0,YYe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,XYe=/^\w*$/;function JYe(e,t){if(WYe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||GYe(e)?!0:XYe.test(e)||!YYe.test(e)||t!=null&&e in Object(t)}var KH=JYe;function ZYe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var iA=ZYe;const w0=Mn(iA);var eXe=Ld,tXe=iA,nXe="[object AsyncFunction]",rXe="[object Function]",iXe="[object GeneratorFunction]",sXe="[object Proxy]";function aXe(e){if(!tXe(e))return!1;var t=eXe(e);return t==rXe||t==iXe||t==nXe||t==sXe}var qH=aXe;const yn=Mn(qH);var oXe=Cu,lXe=oXe["__core-js_shared__"],cXe=lXe,f4=cXe,rW=function(){var e=/[^.]+$/.exec(f4&&f4.keys&&f4.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function uXe(e){return!!rW&&rW in e}var dXe=uXe,hXe=Function.prototype,fXe=hXe.toString;function AXe(e){if(e!=null){try{return fXe.call(e)}catch{}try{return e+""}catch{}}return""}var bAe=AXe,pXe=qH,mXe=dXe,gXe=iA,yXe=bAe,vXe=/[\\^$.*+?()[\]{}|]/g,xXe=/^\[object .+?Constructor\]$/,wXe=Function.prototype,bXe=Object.prototype,CXe=wXe.toString,SXe=bXe.hasOwnProperty,kXe=RegExp("^"+CXe.call(SXe).replace(vXe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _Xe(e){if(!gXe(e)||mXe(e))return!1;var t=pXe(e)?kXe:xXe;return t.test(yXe(e))}var jXe=_Xe;function BXe(e,t){return e==null?void 0:e[t]}var NXe=BXe,EXe=jXe,TXe=NXe;function IXe(e,t){var n=TXe(e,t);return EXe(n)?n:void 0}var Cm=IXe,PXe=Cm,OXe=PXe(Object,"create"),b5=OXe,iW=b5;function FXe(){this.__data__=iW?iW(null):{},this.size=0}var MXe=FXe;function LXe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var RXe=LXe,DXe=b5,UXe="__lodash_hash_undefined__",HXe=Object.prototype,QXe=HXe.hasOwnProperty;function $Xe(e){var t=this.__data__;if(DXe){var n=t[e];return n===UXe?void 0:n}return QXe.call(t,e)?t[e]:void 0}var zXe=$Xe,VXe=b5,KXe=Object.prototype,qXe=KXe.hasOwnProperty;function WXe(e){var t=this.__data__;return VXe?t[e]!==void 0:qXe.call(t,e)}var GXe=WXe,YXe=b5,XXe="__lodash_hash_undefined__";function JXe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=YXe&&t===void 0?XXe:t,this}var ZXe=JXe,eJe=MXe,tJe=RXe,nJe=zXe,rJe=GXe,iJe=ZXe;function b0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}b0.prototype.clear=eJe;b0.prototype.delete=tJe;b0.prototype.get=nJe;b0.prototype.has=rJe;b0.prototype.set=iJe;var sJe=b0;function aJe(){this.__data__=[],this.size=0}var oJe=aJe;function lJe(e,t){return e===t||e!==e&&t!==t}var WH=lJe,cJe=WH;function uJe(e,t){for(var n=e.length;n--;)if(cJe(e[n][0],t))return n;return-1}var C5=uJe,dJe=C5,hJe=Array.prototype,fJe=hJe.splice;function AJe(e){var t=this.__data__,n=dJe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():fJe.call(t,n,1),--this.size,!0}var pJe=AJe,mJe=C5;function gJe(e){var t=this.__data__,n=mJe(t,e);return n<0?void 0:t[n][1]}var yJe=gJe,vJe=C5;function xJe(e){return vJe(this.__data__,e)>-1}var wJe=xJe,bJe=C5;function CJe(e,t){var n=this.__data__,r=bJe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var SJe=CJe,kJe=oJe,_Je=pJe,jJe=yJe,BJe=wJe,NJe=SJe;function C0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}C0.prototype.clear=kJe;C0.prototype.delete=_Je;C0.prototype.get=jJe;C0.prototype.has=BJe;C0.prototype.set=NJe;var S5=C0,EJe=Cm,TJe=Cu,IJe=EJe(TJe,"Map"),GH=IJe,sW=sJe,PJe=S5,OJe=GH;function FJe(){this.size=0,this.__data__={hash:new sW,map:new(OJe||PJe),string:new sW}}var MJe=FJe;function LJe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var RJe=LJe,DJe=RJe;function UJe(e,t){var n=e.__data__;return DJe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var k5=UJe,HJe=k5;function QJe(e){var t=HJe(this,e).delete(e);return this.size-=t?1:0,t}var $Je=QJe,zJe=k5;function VJe(e){return zJe(this,e).get(e)}var KJe=VJe,qJe=k5;function WJe(e){return qJe(this,e).has(e)}var GJe=WJe,YJe=k5;function XJe(e,t){var n=YJe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var JJe=XJe,ZJe=MJe,eZe=$Je,tZe=KJe,nZe=GJe,rZe=JJe;function S0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}S0.prototype.clear=ZJe;S0.prototype.delete=eZe;S0.prototype.get=tZe;S0.prototype.has=nZe;S0.prototype.set=rZe;var YH=S0,CAe=YH,iZe="Expected a function";function XH(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(iZe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(XH.Cache||CAe),n}XH.Cache=CAe;var SAe=XH;const sZe=Mn(SAe);var aZe=SAe,oZe=500;function lZe(e){var t=aZe(e,function(r){return n.size===oZe&&n.clear(),r}),n=t.cache;return t}var cZe=lZe,uZe=cZe,dZe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hZe=/\\(\\)?/g,fZe=uZe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dZe,function(n,r,i,s){t.push(i?s.replace(hZe,"$1"):r||n)}),t}),AZe=fZe;function pZe(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var JH=pZe,aW=Q2,mZe=JH,gZe=ho,yZe=x0,vZe=1/0,oW=aW?aW.prototype:void 0,lW=oW?oW.toString:void 0;function kAe(e){if(typeof e=="string")return e;if(gZe(e))return mZe(e,kAe)+"";if(yZe(e))return lW?lW.call(e):"";var t=e+"";return t=="0"&&1/e==-vZe?"-0":t}var xZe=kAe,wZe=xZe;function bZe(e){return e==null?"":wZe(e)}var _Ae=bZe,CZe=ho,SZe=KH,kZe=AZe,_Ze=_Ae;function jZe(e,t){return CZe(e)?e:SZe(e,t)?[e]:kZe(_Ze(e))}var jAe=jZe,BZe=x0,NZe=1/0;function EZe(e){if(typeof e=="string"||BZe(e))return e;var t=e+"";return t=="0"&&1/e==-NZe?"-0":t}var _5=EZe,TZe=jAe,IZe=_5;function PZe(e,t){t=TZe(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[IZe(t[n++])];return n&&n==r?e:void 0}var ZH=PZe,OZe=ZH;function FZe(e,t,n){var r=e==null?void 0:OZe(e,t);return r===void 0?n:r}var BAe=FZe;const El=Mn(BAe);function MZe(e){return e==null}var LZe=MZe;const _n=Mn(LZe);var RZe=Ld,DZe=ho,UZe=Rd,HZe="[object String]";function QZe(e){return typeof e=="string"||!DZe(e)&&UZe(e)&&RZe(e)==HZe}var $Ze=QZe;const $2=Mn($Ze);var NAe={exports:{}},tr={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var eQ=Symbol.for("react.element"),tQ=Symbol.for("react.portal"),j5=Symbol.for("react.fragment"),B5=Symbol.for("react.strict_mode"),N5=Symbol.for("react.profiler"),E5=Symbol.for("react.provider"),T5=Symbol.for("react.context"),zZe=Symbol.for("react.server_context"),I5=Symbol.for("react.forward_ref"),P5=Symbol.for("react.suspense"),O5=Symbol.for("react.suspense_list"),F5=Symbol.for("react.memo"),M5=Symbol.for("react.lazy"),VZe=Symbol.for("react.offscreen"),EAe;EAe=Symbol.for("react.module.reference");function Dl(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case eQ:switch(e=e.type,e){case j5:case N5:case B5:case P5:case O5:return e;default:switch(e=e&&e.$$typeof,e){case zZe:case T5:case I5:case M5:case F5:case E5:return e;default:return t}}case tQ:return t}}}tr.ContextConsumer=T5;tr.ContextProvider=E5;tr.Element=eQ;tr.ForwardRef=I5;tr.Fragment=j5;tr.Lazy=M5;tr.Memo=F5;tr.Portal=tQ;tr.Profiler=N5;tr.StrictMode=B5;tr.Suspense=P5;tr.SuspenseList=O5;tr.isAsyncMode=function(){return!1};tr.isConcurrentMode=function(){return!1};tr.isContextConsumer=function(e){return Dl(e)===T5};tr.isContextProvider=function(e){return Dl(e)===E5};tr.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===eQ};tr.isForwardRef=function(e){return Dl(e)===I5};tr.isFragment=function(e){return Dl(e)===j5};tr.isLazy=function(e){return Dl(e)===M5};tr.isMemo=function(e){return Dl(e)===F5};tr.isPortal=function(e){return Dl(e)===tQ};tr.isProfiler=function(e){return Dl(e)===N5};tr.isStrictMode=function(e){return Dl(e)===B5};tr.isSuspense=function(e){return Dl(e)===P5};tr.isSuspenseList=function(e){return Dl(e)===O5};tr.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===j5||e===N5||e===B5||e===P5||e===O5||e===VZe||typeof e=="object"&&e!==null&&(e.$$typeof===M5||e.$$typeof===F5||e.$$typeof===E5||e.$$typeof===T5||e.$$typeof===I5||e.$$typeof===EAe||e.getModuleId!==void 0)};tr.typeOf=Dl;NAe.exports=tr;var KZe=NAe.exports,qZe=Ld,WZe=Rd,GZe="[object Number]";function YZe(e){return typeof e=="number"||WZe(e)&&qZe(e)==GZe}var TAe=YZe;const XZe=Mn(TAe);var JZe=TAe;function ZZe(e){return JZe(e)&&e!=+e}var eet=ZZe;const z2=Mn(eet);var pc=function(t){return t===0?0:t>0?1:-1},sp=function(t){return $2(t)&&t.indexOf("%")===t.length-1},tt=function(t){return XZe(t)&&!z2(t)},Ji=function(t){return tt(t)||$2(t)},tet=0,V2=function(t){var n=++tet;return"".concat(t||"").concat(n)},am=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!tt(t)&&!$2(t))return r;var s;if(sp(t)){var a=t.indexOf("%");s=n*parseFloat(t.slice(0,a))/100}else s=+t;return z2(s)&&(s=r),i&&s>n&&(s=n),s},Eh=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},net=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},uc=function(t,n){return tt(t)&&tt(n)?function(r){return t+r*(n-t)}:function(){return n}};function NB(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):El(r,t))===n})}function Py(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function zM(e){"@babel/helpers - typeof";return zM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zM(e)}var ret=["viewBox","children"],iet=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],cW=["points","pathLength"],A4={svg:ret,polygon:cW,polyline:cW},nQ=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],EB=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(C.isValidElement(t)&&(r=t.props),!w0(r))return null;var i={};return Object.keys(r).forEach(function(s){nQ.includes(s)&&(i[s]=n||function(a){return r[s](r,a)})}),i},set=function(t,n,r){return function(i){return t(n,r,i),null}},TB=function(t,n,r){if(!w0(t)||zM(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(s){var a=t[s];nQ.includes(s)&&typeof a=="function"&&(i||(i={}),i[s]=set(a,n,r))}),i},aet=["children"],oet=["children"];function uW(e,t){if(e==null)return{};var n=cet(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cet(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function VM(e){"@babel/helpers - typeof";return VM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},VM(e)}var dW={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},hd=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},hW=null,p4=null,rQ=function e(t){if(t===hW&&Array.isArray(p4))return p4;var n=[];return C.Children.forEach(t,function(r){_n(r)||(KZe.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),p4=n,hW=t,n};function Tl(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return hd(i)}):r=[hd(t)],rQ(e).forEach(function(i){var s=El(i,"type.displayName")||El(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function Eo(e,t){var n=Tl(e,t);return n&&n[0]}var fW=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!tt(r)||r<=0||!tt(i)||i<=0)},uet=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],det=function(t){return t&&t.type&&$2(t.type)&&uet.indexOf(t.type)>=0},het=function(t){return t&&VM(t)==="object"&&"clipDot"in t},fet=function(t,n,r,i){var s,a=(s=A4==null?void 0:A4[i])!==null&&s!==void 0?s:[];return!yn(t)&&(i&&a.includes(n)||iet.includes(n))||r&&nQ.includes(n)},Tn=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(C.isValidElement(t)&&(i=t.props),!w0(i))return null;var s={};return Object.keys(i).forEach(function(a){var o;fet((o=i)===null||o===void 0?void 0:o[a],a,n,r)&&(s[a]=i[a])}),s},KM=function e(t,n){if(t===n)return!0;var r=C.Children.count(t);if(r!==C.Children.count(n))return!1;if(r===0)return!0;if(r===1)return AW(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var s=t[i],a=n[i];if(Array.isArray(s)||Array.isArray(a)){if(!e(s,a))return!1}else if(!AW(s,a))return!1}return!0},AW=function(t,n){if(_n(t)&&_n(n))return!0;if(!_n(t)&&!_n(n)){var r=t.props||{},i=r.children,s=uW(r,aet),a=n.props||{},o=a.children,c=uW(a,oet);return i&&o?Py(s,c)&&KM(i,o):!i&&!o?Py(s,c):!1}return!1},pW=function(t,n){var r=[],i={};return rQ(t).forEach(function(s,a){if(det(s))r.push(s);else if(s){var o=hd(s.type),c=n[o]||{},u=c.handler,d=c.once;if(u&&(!d||!i[o])){var h=u(s,o,a);r.push(h),i[o]=!0}}}),r},Aet=function(t){var n=t&&t.type;return n&&dW[n]?dW[n]:null},pet=function(t,n){return rQ(n).indexOf(t)},met=["children","width","height","viewBox","className","style","title","desc"];function qM(){return qM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qM.apply(this,arguments)}function get(e,t){if(e==null)return{};var n=yet(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yet(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function WM(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,s=e.className,a=e.style,o=e.title,c=e.desc,u=get(e,met),d=i||{width:n,height:r,x:0,y:0},h=Fn("recharts-surface",s);return re.createElement("svg",qM({},Tn(u,!0,"svg"),{className:h,width:n,height:r,style:a,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),re.createElement("title",null,o),re.createElement("desc",null,c),t)}var vet=["children","className"];function GM(){return GM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GM.apply(this,arguments)}function xet(e,t){if(e==null)return{};var n=wet(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wet(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Si=re.forwardRef(function(e,t){var n=e.children,r=e.className,i=xet(e,vet),s=Fn("recharts-layer",r);return re.createElement("g",GM({className:s},Tn(i,!0),{ref:t}),n)}),fd=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s]};function bet(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}var Cet=bet,ket=Cet;function _et(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:ket(e,t,n)}var jet=_et,Bet="\\ud800-\\udfff",Net="\\u0300-\\u036f",Eet="\\ufe20-\\ufe2f",Tet="\\u20d0-\\u20ff",Iet=Net+Eet+Tet,Pet="\\ufe0e\\ufe0f",Oet="\\u200d",Fet=RegExp("["+Oet+Bet+Iet+Pet+"]");function Met(e){return Fet.test(e)}var IAe=Met;function Let(e){return e.split("")}var Ret=Let,PAe="\\ud800-\\udfff",Det="\\u0300-\\u036f",Uet="\\ufe20-\\ufe2f",Het="\\u20d0-\\u20ff",Qet=Det+Uet+Het,$et="\\ufe0e\\ufe0f",zet="["+PAe+"]",YM="["+Qet+"]",XM="\\ud83c[\\udffb-\\udfff]",Vet="(?:"+YM+"|"+XM+")",OAe="[^"+PAe+"]",FAe="(?:\\ud83c[\\udde6-\\uddff]){2}",MAe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ket="\\u200d",LAe=Vet+"?",RAe="["+$et+"]?",qet="(?:"+Ket+"(?:"+[OAe,FAe,MAe].join("|")+")"+RAe+LAe+")*",Wet=RAe+LAe+qet,Get="(?:"+[OAe+YM+"?",YM,FAe,MAe,zet].join("|")+")",Yet=RegExp(XM+"(?="+XM+")|"+Get+Wet,"g");function Xet(e){return e.match(Yet)||[]}var Jet=Xet,Zet=Ret,ett=IAe,ttt=Jet;function ntt(e){return ett(e)?ttt(e):Zet(e)}var rtt=ntt,itt=jet,stt=IAe,att=rtt,ott=_Ae;function ltt(e){return function(t){t=ott(t);var n=stt(t)?att(t):void 0,r=n?n[0]:t.charAt(0),i=n?itt(n,1).join(""):t.slice(1);return r[e]()+i}}var ctt=ltt,utt=ctt,dtt=utt("toUpperCase"),htt=dtt;const L5=Mn(htt);function Cr(e){return function(){return e}}const DAe=Math.cos,IB=Math.sin,Ec=Math.sqrt,PB=Math.PI,R5=2*PB,JM=Math.PI,ZM=2*JM,DA=1e-6,ftt=ZM-DA;function UAe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Att(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return UAe;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class ptt{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?UAe:Att(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,c=r-t,u=i-n,d=a-t,h=o-n,A=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(A>DA)if(!(Math.abs(h*c-u*d)>DA)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,m=c*c+u*u,g=f*f+p*p,y=Math.sqrt(m),v=Math.sqrt(A),x=s*Math.tan((JM-Math.acos((m+A-g)/(2*y*v)))/2),b=x/v,w=x/y;Math.abs(b-1)>DA&&this._append`L${t+b*d},${n+b*h}`,this._append`A${s},${s},0,0,${+(h*f>d*p)},${this._x1=t+w*c},${this._y1=n+w*u}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),c=r*Math.sin(i),u=t+o,d=n+c,h=1^a,A=a?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>DA||Math.abs(this._y1-d)>DA)&&this._append`L${u},${d}`,r&&(A<0&&(A=A%ZM+ZM),A>ftt?this._append`A${r},${r},0,1,${h},${t-o},${n-c}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:A>DA&&this._append`A${r},${r},0,${+(A>=JM)},${h},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function iQ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new ptt(t)}function sQ(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function HAe(e){this._context=e}HAe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function D5(e){return new HAe(e)}function QAe(e){return e[0]}function $Ae(e){return e[1]}function zAe(e,t){var n=Cr(!0),r=null,i=D5,s=null,a=iQ(o);e=typeof e=="function"?e:e===void 0?QAe:Cr(e),t=typeof t=="function"?t:t===void 0?$Ae:Cr(t);function o(c){var u,d=(c=sQ(c)).length,h,A=!1,f;for(r==null&&(s=i(f=a())),u=0;u<=d;++u)!(u<d&&n(h=c[u],u,c))===A&&((A=!A)?s.lineStart():s.lineEnd()),A&&s.point(+e(h,u,c),+t(h,u,c));if(f)return s=null,f+""||null}return o.x=function(c){return arguments.length?(e=typeof c=="function"?c:Cr(+c),o):e},o.y=function(c){return arguments.length?(t=typeof c=="function"?c:Cr(+c),o):t},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Cr(!!c),o):n},o.curve=function(c){return arguments.length?(i=c,r!=null&&(s=i(r)),o):i},o.context=function(c){return arguments.length?(c==null?r=s=null:s=i(r=c),o):r},o}function $S(e,t,n){var r=null,i=Cr(!0),s=null,a=D5,o=null,c=iQ(u);e=typeof e=="function"?e:e===void 0?QAe:Cr(+e),t=typeof t=="function"?t:Cr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?$Ae:Cr(+n);function u(h){var A,f,p,m=(h=sQ(h)).length,g,y=!1,v,x=new Array(m),b=new Array(m);for(s==null&&(o=a(v=c())),A=0;A<=m;++A){if(!(A<m&&i(g=h[A],A,h))===y)if(y=!y)f=A,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=A-1;p>=f;--p)o.point(x[p],b[p]);o.lineEnd(),o.areaEnd()}y&&(x[A]=+e(g,A,h),b[A]=+t(g,A,h),o.point(r?+r(g,A,h):x[A],n?+n(g,A,h):b[A]))}if(v)return o=null,v+""||null}function d(){return zAe().defined(i).curve(a).context(s)}return u.x=function(h){return arguments.length?(e=typeof h=="function"?h:Cr(+h),r=null,u):e},u.x0=function(h){return arguments.length?(e=typeof h=="function"?h:Cr(+h),u):e},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Cr(+h),u):r},u.y=function(h){return arguments.length?(t=typeof h=="function"?h:Cr(+h),n=null,u):t},u.y0=function(h){return arguments.length?(t=typeof h=="function"?h:Cr(+h),u):t},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Cr(+h),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:Cr(!!h),u):i},u.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),u):a},u.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),u):s},u}class VAe{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function mtt(e){return new VAe(e,!0)}function gtt(e){return new VAe(e,!1)}const aQ={draw(e,t){const n=Ec(t/PB);e.moveTo(n,0),e.arc(0,0,n,0,R5)}},ytt={draw(e,t){const n=Ec(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},KAe=Ec(1/3),vtt=KAe*2,xtt={draw(e,t){const n=Ec(t/vtt),r=n*KAe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},wtt={draw(e,t){const n=Ec(t),r=-n/2;e.rect(r,r,n,n)}},btt=.8908130915292852,qAe=IB(PB/10)/IB(7*PB/10),Ctt=IB(R5/10)*qAe,Stt=-DAe(R5/10)*qAe,ktt={draw(e,t){const n=Ec(t*btt),r=Ctt*n,i=Stt*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const a=R5*s/5,o=DAe(a),c=IB(a);e.lineTo(c*n,-o*n),e.lineTo(o*r-c*i,c*r+o*i)}e.closePath()}},m4=Ec(3),_tt={draw(e,t){const n=-Ec(t/(m4*3));e.moveTo(0,n*2),e.lineTo(-m4*n,-n),e.lineTo(m4*n,-n),e.closePath()}},Zo=-.5,el=Ec(3)/2,eL=1/Ec(12),jtt=(eL/2+1)*3,Btt={draw(e,t){const n=Ec(t/jtt),r=n/2,i=n*eL,s=r,a=n*eL+n,o=-s,c=a;e.moveTo(r,i),e.lineTo(s,a),e.lineTo(o,c),e.lineTo(Zo*r-el*i,el*r+Zo*i),e.lineTo(Zo*s-el*a,el*s+Zo*a),e.lineTo(Zo*o-el*c,el*o+Zo*c),e.lineTo(Zo*r+el*i,Zo*i-el*r),e.lineTo(Zo*s+el*a,Zo*a-el*s),e.lineTo(Zo*o+el*c,Zo*c-el*o),e.closePath()}};function Ntt(e,t){let n=null,r=iQ(i);e=typeof e=="function"?e:Cr(e||aQ),t=typeof t=="function"?t:Cr(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:Cr(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:Cr(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function OB(){}function FB(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function WAe(e){this._context=e}WAe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:FB(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:FB(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ett(e){return new WAe(e)}function GAe(e){this._context=e}GAe.prototype={areaStart:OB,areaEnd:OB,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:FB(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ttt(e){return new GAe(e)}function YAe(e){this._context=e}YAe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:FB(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Itt(e){return new YAe(e)}function XAe(e){this._context=e}XAe.prototype={areaStart:OB,areaEnd:OB,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Ptt(e){return new XAe(e)}function mW(e){return e<0?-1:1}function gW(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(mW(s)+mW(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function yW(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function g4(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function MB(e){this._context=e}MB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:g4(this,this._t0,yW(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,g4(this,yW(this,n=gW(this,e,t)),n);break;default:g4(this,this._t0,n=gW(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function JAe(e){this._context=new ZAe(e)}(JAe.prototype=Object.create(MB.prototype)).point=function(e,t){MB.prototype.point.call(this,t,e)};function ZAe(e){this._context=e}ZAe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function Ott(e){return new MB(e)}function Ftt(e){return new JAe(e)}function epe(e){this._context=e}epe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=vW(e),i=vW(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function vW(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function Mtt(e){return new epe(e)}function U5(e,t){this._context=e,this._t=t}U5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Ltt(e){return new U5(e,.5)}function Rtt(e){return new U5(e,0)}function Dtt(e){return new U5(e,1)}function Sv(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function tL(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Utt(e,t){return e[t]}function Htt(e){const t=[];return t.key=e,t}function Qtt(){var e=Cr([]),t=tL,n=Sv,r=Utt;function i(s){var a=Array.from(e.apply(this,arguments),Htt),o,c=a.length,u=-1,d;for(const h of s)for(o=0,++u;o<c;++o)(a[o][u]=[0,+r(h,a[o].key,u,s)]).data=h;for(o=0,d=sQ(t(a));o<c;++o)a[d[o]].index=o;return n(a,d),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Cr(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Cr(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?tL:typeof s=="function"?s:Cr(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Sv,i):n},i}function $tt(e,t){if((r=e.length)>0){for(var n,r,i=0,s=e[0].length,a;i<s;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Sv(e,t)}}function ztt(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,s=r.length;n<s;++n){for(var a=0,o=0;a<i;++a)o+=e[a][n][1]||0;r[n][1]+=r[n][0]=-o/2}Sv(e,t)}}function Vtt(e,t){if(!(!((a=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,a;r<s;++r){for(var o=0,c=0,u=0;o<a;++o){for(var d=e[t[o]],h=d[r][1]||0,A=d[r-1][1]||0,f=(h-A)/2,p=0;p<o;++p){var m=e[t[p]],g=m[r][1]||0,y=m[r-1][1]||0;f+=g-y}c+=h,u+=f*h}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,Sv(e,t)}}function m1(e){"@babel/helpers - typeof";return m1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m1(e)}var Ktt=["type","size","sizeType"];function nL(){return nL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nL.apply(this,arguments)}function xW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xW(Object(n),!0).forEach(function(r){qtt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qtt(e,t,n){return t=Wtt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wtt(e){var t=Gtt(e,"string");return m1(t)=="symbol"?t:t+""}function Gtt(e,t){if(m1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(m1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ytt(e,t){if(e==null)return{};var n=Xtt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xtt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var tpe={symbolCircle:aQ,symbolCross:ytt,symbolDiamond:xtt,symbolSquare:wtt,symbolStar:ktt,symbolTriangle:_tt,symbolWye:Btt},Jtt=Math.PI/180,Ztt=function(t){var n="symbol".concat(L5(t));return tpe[n]||aQ},ent=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Jtt;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},tnt=function(t,n){tpe["symbol".concat(L5(t))]=n},oQ=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,s=i===void 0?64:i,a=t.sizeType,o=a===void 0?"area":a,c=Ytt(t,Ktt),u=wW(wW({},c),{},{type:r,size:s,sizeType:o}),d=function(){var g=Ztt(r),y=Ntt().type(g).size(ent(s,o,r));return y()},h=u.className,A=u.cx,f=u.cy,p=Tn(u,!0);return A===+A&&f===+f&&s===+s?re.createElement("path",nL({},p,{className:Fn("recharts-symbols",h),transform:"translate(".concat(A,", ").concat(f,")"),d:d()})):null};oQ.registerSymbol=tnt;function kv(e){"@babel/helpers - typeof";return kv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kv(e)}function rL(){return rL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rL.apply(this,arguments)}function bW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nnt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bW(Object(n),!0).forEach(function(r){g1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rnt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function int(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rpe(r.key),r)}}function snt(e,t,n){return t&&int(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ant(e,t,n){return t=LB(t),ont(e,npe()?Reflect.construct(t,n||[],LB(e).constructor):t.apply(e,n))}function ont(e,t){if(t&&(kv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lnt(e)}function lnt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function npe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(npe=function(){return!!e})()}function LB(e){return LB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},LB(e)}function cnt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iL(e,t)}function iL(e,t){return iL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},iL(e,t)}function g1(e,t,n){return t=rpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rpe(e){var t=unt(e,"string");return kv(t)=="symbol"?t:t+""}function unt(e,t){if(kv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tl=32,lQ=function(e){function t(){return rnt(this,t),ant(this,t,arguments)}return cnt(t,e),snt(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,s=tl/2,a=tl/6,o=tl/3,c=r.inactive?i:r.color;if(r.type==="plainline")return re.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:s,x2:tl,y2:s,className:"recharts-legend-icon"});if(r.type==="line")return re.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(s,`
            H`).concat(tl,"M").concat(2*o,",").concat(s,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(s),className:"recharts-legend-icon"});if(r.type==="rect")return re.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(tl/8,"h").concat(tl,"v").concat(tl*3/4,"h").concat(-tl,"z"),className:"recharts-legend-icon"});if(re.isValidElement(r.legendIcon)){var u=nnt({},r);return delete u.legendIcon,re.cloneElement(r.legendIcon,u)}return re.createElement(oQ,{fill:c,cx:s,cy:s,size:tl,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,s=i.payload,a=i.iconSize,o=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:tl,height:tl},h={display:o==="horizontal"?"inline-block":"block",marginRight:10},A={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(f,p){var m=f.formatter||c,g=Fn(g1(g1({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",f.inactive));if(f.type==="none")return null;var y=yn(f.value)?null:f.value;fd(!yn(f.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var v=f.inactive?u:f.color;return re.createElement("li",rL({className:g,style:h,key:"legend-item-".concat(p)},TB(r.props,f,p)),re.createElement(WM,{width:a,height:a,viewBox:d,style:A},r.renderIcon(f)),re.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},m?m(y,f,p):y))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,a=r.align;if(!i||!i.length)return null;var o={padding:0,margin:0,textAlign:s==="horizontal"?a:"left"};return re.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])}(C.PureComponent);g1(lQ,"displayName","Legend");g1(lQ,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var dnt=S5;function hnt(){this.__data__=new dnt,this.size=0}var fnt=hnt;function Ant(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var pnt=Ant;function mnt(e){return this.__data__.get(e)}var gnt=mnt;function ynt(e){return this.__data__.has(e)}var vnt=ynt,xnt=S5,wnt=GH,bnt=YH,Cnt=200;function Snt(e,t){var n=this.__data__;if(n instanceof xnt){var r=n.__data__;if(!wnt||r.length<Cnt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bnt(r)}return n.set(e,t),this.size=n.size,this}var knt=Snt,_nt=S5,jnt=fnt,Bnt=pnt,Nnt=gnt,Ent=vnt,Tnt=knt;function k0(e){var t=this.__data__=new _nt(e);this.size=t.size}k0.prototype.clear=jnt;k0.prototype.delete=Bnt;k0.prototype.get=Nnt;k0.prototype.has=Ent;k0.prototype.set=Tnt;var ipe=k0,Int="__lodash_hash_undefined__";function Pnt(e){return this.__data__.set(e,Int),this}var Ont=Pnt;function Fnt(e){return this.__data__.has(e)}var Mnt=Fnt,Lnt=YH,Rnt=Ont,Dnt=Mnt;function RB(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Lnt;++t<n;)this.add(e[t])}RB.prototype.add=RB.prototype.push=Rnt;RB.prototype.has=Dnt;var spe=RB;function Unt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var ape=Unt;function Hnt(e,t){return e.has(t)}var ope=Hnt,Qnt=spe,$nt=ape,znt=ope,Vnt=1,Knt=2;function qnt(e,t,n,r,i,s){var a=n&Vnt,o=e.length,c=t.length;if(o!=c&&!(a&&c>o))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var h=-1,A=!0,f=n&Knt?new Qnt:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(r)var g=a?r(m,p,h,t,e,s):r(p,m,h,e,t,s);if(g!==void 0){if(g)continue;A=!1;break}if(f){if(!$nt(t,function(y,v){if(!znt(f,v)&&(p===y||i(p,y,n,r,s)))return f.push(v)})){A=!1;break}}else if(!(p===m||i(p,m,n,r,s))){A=!1;break}}return s.delete(e),s.delete(t),A}var lpe=qnt,Wnt=Cu,Gnt=Wnt.Uint8Array,Ynt=Gnt;function Xnt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var Jnt=Xnt;function Znt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var cQ=Znt,CW=Q2,SW=Ynt,ert=WH,trt=lpe,nrt=Jnt,rrt=cQ,irt=1,srt=2,art="[object Boolean]",ort="[object Date]",lrt="[object Error]",crt="[object Map]",urt="[object Number]",drt="[object RegExp]",hrt="[object Set]",frt="[object String]",Art="[object Symbol]",prt="[object ArrayBuffer]",mrt="[object DataView]",kW=CW?CW.prototype:void 0,y4=kW?kW.valueOf:void 0;function grt(e,t,n,r,i,s,a){switch(n){case mrt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case prt:return!(e.byteLength!=t.byteLength||!s(new SW(e),new SW(t)));case art:case ort:case urt:return ert(+e,+t);case lrt:return e.name==t.name&&e.message==t.message;case drt:case frt:return e==t+"";case crt:var o=nrt;case hrt:var c=r&irt;if(o||(o=rrt),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=srt,a.set(e,t);var d=trt(o(e),o(t),r,i,s,a);return a.delete(e),d;case Art:if(y4)return y4.call(e)==y4.call(t)}return!1}var yrt=grt;function vrt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var cpe=vrt,xrt=cpe,wrt=ho;function brt(e,t,n){var r=t(e);return wrt(e)?r:xrt(r,n(e))}var Crt=brt;function Srt(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}var krt=Srt;function _rt(){return[]}var jrt=_rt,Brt=krt,Nrt=jrt,Ert=Object.prototype,Trt=Ert.propertyIsEnumerable,_W=Object.getOwnPropertySymbols,Irt=_W?function(e){return e==null?[]:(e=Object(e),Brt(_W(e),function(t){return Trt.call(e,t)}))}:Nrt,Prt=Irt;function Ort(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Frt=Ort,Mrt=Ld,Lrt=Rd,Rrt="[object Arguments]";function Drt(e){return Lrt(e)&&Mrt(e)==Rrt}var Urt=Drt,jW=Urt,Hrt=Rd,upe=Object.prototype,Qrt=upe.hasOwnProperty,$rt=upe.propertyIsEnumerable,zrt=jW(function(){return arguments}())?jW:function(e){return Hrt(e)&&Qrt.call(e,"callee")&&!$rt.call(e,"callee")},uQ=zrt,DB={exports:{}};function Vrt(){return!1}var Krt=Vrt;DB.exports;(function(e,t){var n=Cu,r=Krt,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?n.Buffer:void 0,c=o?o.isBuffer:void 0,u=c||r;e.exports=u})(DB,DB.exports);var dpe=DB.exports,qrt=9007199254740991,Wrt=/^(?:0|[1-9]\d*)$/;function Grt(e,t){var n=typeof e;return t=t??qrt,!!t&&(n=="number"||n!="symbol"&&Wrt.test(e))&&e>-1&&e%1==0&&e<t}var dQ=Grt,Yrt=9007199254740991;function Xrt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Yrt}var hQ=Xrt,Jrt=Ld,Zrt=hQ,eit=Rd,tit="[object Arguments]",nit="[object Array]",rit="[object Boolean]",iit="[object Date]",sit="[object Error]",ait="[object Function]",oit="[object Map]",lit="[object Number]",cit="[object Object]",uit="[object RegExp]",dit="[object Set]",hit="[object String]",fit="[object WeakMap]",Ait="[object ArrayBuffer]",pit="[object DataView]",mit="[object Float32Array]",git="[object Float64Array]",yit="[object Int8Array]",vit="[object Int16Array]",xit="[object Int32Array]",wit="[object Uint8Array]",bit="[object Uint8ClampedArray]",Cit="[object Uint16Array]",Sit="[object Uint32Array]",Or={};Or[mit]=Or[git]=Or[yit]=Or[vit]=Or[xit]=Or[wit]=Or[bit]=Or[Cit]=Or[Sit]=!0;Or[tit]=Or[nit]=Or[Ait]=Or[rit]=Or[pit]=Or[iit]=Or[sit]=Or[ait]=Or[oit]=Or[lit]=Or[cit]=Or[uit]=Or[dit]=Or[hit]=Or[fit]=!1;function kit(e){return eit(e)&&Zrt(e.length)&&!!Or[Jrt(e)]}var _it=kit;function jit(e){return function(t){return e(t)}}var hpe=jit,UB={exports:{}};UB.exports;(function(e,t){var n=xAe,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s&&n.process,o=function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o})(UB,UB.exports);var Bit=UB.exports,Nit=_it,Eit=hpe,BW=Bit,NW=BW&&BW.isTypedArray,Tit=NW?Eit(NW):Nit,fpe=Tit,Iit=Frt,Pit=uQ,Oit=ho,Fit=dpe,Mit=dQ,Lit=fpe,Rit=Object.prototype,Dit=Rit.hasOwnProperty;function Uit(e,t){var n=Oit(e),r=!n&&Pit(e),i=!n&&!r&&Fit(e),s=!n&&!r&&!i&&Lit(e),a=n||r||i||s,o=a?Iit(e.length,String):[],c=o.length;for(var u in e)(t||Dit.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Mit(u,c)))&&o.push(u);return o}var Hit=Uit,Qit=Object.prototype;function $it(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Qit;return e===n}var zit=$it;function Vit(e,t){return function(n){return e(t(n))}}var Ape=Vit,Kit=Ape,qit=Kit(Object.keys,Object),Wit=qit,Git=zit,Yit=Wit,Xit=Object.prototype,Jit=Xit.hasOwnProperty;function Zit(e){if(!Git(e))return Yit(e);var t=[];for(var n in Object(e))Jit.call(e,n)&&n!="constructor"&&t.push(n);return t}var est=Zit,tst=qH,nst=hQ;function rst(e){return e!=null&&nst(e.length)&&!tst(e)}var K2=rst,ist=Hit,sst=est,ast=K2;function ost(e){return ast(e)?ist(e):sst(e)}var H5=ost,lst=Crt,cst=Prt,ust=H5;function dst(e){return lst(e,ust,cst)}var hst=dst,EW=hst,fst=1,Ast=Object.prototype,pst=Ast.hasOwnProperty;function mst(e,t,n,r,i,s){var a=n&fst,o=EW(e),c=o.length,u=EW(t),d=u.length;if(c!=d&&!a)return!1;for(var h=c;h--;){var A=o[h];if(!(a?A in t:pst.call(t,A)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<c;){A=o[h];var y=e[A],v=t[A];if(r)var x=a?r(v,y,A,t,e,s):r(y,v,A,e,t,s);if(!(x===void 0?y===v||i(y,v,n,r,s):x)){m=!1;break}g||(g=A=="constructor")}if(m&&!g){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof w=="function"&&w instanceof w)&&(m=!1)}return s.delete(e),s.delete(t),m}var gst=mst,yst=Cm,vst=Cu,xst=yst(vst,"DataView"),wst=xst,bst=Cm,Cst=Cu,Sst=bst(Cst,"Promise"),kst=Sst,_st=Cm,jst=Cu,Bst=_st(jst,"Set"),ppe=Bst,Nst=Cm,Est=Cu,Tst=Nst(Est,"WeakMap"),Ist=Tst,sL=wst,aL=GH,oL=kst,lL=ppe,cL=Ist,mpe=Ld,_0=bAe,TW="[object Map]",Pst="[object Object]",IW="[object Promise]",PW="[object Set]",OW="[object WeakMap]",FW="[object DataView]",Ost=_0(sL),Fst=_0(aL),Mst=_0(oL),Lst=_0(lL),Rst=_0(cL),UA=mpe;(sL&&UA(new sL(new ArrayBuffer(1)))!=FW||aL&&UA(new aL)!=TW||oL&&UA(oL.resolve())!=IW||lL&&UA(new lL)!=PW||cL&&UA(new cL)!=OW)&&(UA=function(e){var t=mpe(e),n=t==Pst?e.constructor:void 0,r=n?_0(n):"";if(r)switch(r){case Ost:return FW;case Fst:return TW;case Mst:return IW;case Lst:return PW;case Rst:return OW}return t});var Dst=UA,v4=ipe,Ust=lpe,Hst=yrt,Qst=gst,MW=Dst,LW=ho,RW=dpe,$st=fpe,zst=1,DW="[object Arguments]",UW="[object Array]",zS="[object Object]",Vst=Object.prototype,HW=Vst.hasOwnProperty;function Kst(e,t,n,r,i,s){var a=LW(e),o=LW(t),c=a?UW:MW(e),u=o?UW:MW(t);c=c==DW?zS:c,u=u==DW?zS:u;var d=c==zS,h=u==zS,A=c==u;if(A&&RW(e)){if(!RW(t))return!1;a=!0,d=!1}if(A&&!d)return s||(s=new v4),a||$st(e)?Ust(e,t,n,r,i,s):Hst(e,t,c,n,r,i,s);if(!(n&zst)){var f=d&&HW.call(e,"__wrapped__"),p=h&&HW.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new v4),i(m,g,n,r,s)}}return A?(s||(s=new v4),Qst(e,t,n,r,i,s)):!1}var qst=Kst,Wst=qst,QW=Rd;function gpe(e,t,n,r,i){return e===t?!0:e==null||t==null||!QW(e)&&!QW(t)?e!==e&&t!==t:Wst(e,t,n,r,gpe,i)}var fQ=gpe,Gst=ipe,Yst=fQ,Xst=1,Jst=2;function Zst(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var c=o[0],u=e[c],d=o[1];if(a&&o[2]){if(u===void 0&&!(c in e))return!1}else{var h=new Gst;if(r)var A=r(u,d,c,e,t,h);if(!(A===void 0?Yst(d,u,Xst|Jst,r,h):A))return!1}}return!0}var eat=Zst,tat=iA;function nat(e){return e===e&&!tat(e)}var ype=nat,rat=ype,iat=H5;function sat(e){for(var t=iat(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,rat(i)]}return t}var aat=sat;function oat(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var vpe=oat,lat=eat,cat=aat,uat=vpe;function dat(e){var t=cat(e);return t.length==1&&t[0][2]?uat(t[0][0],t[0][1]):function(n){return n===e||lat(n,e,t)}}var hat=dat;function fat(e,t){return e!=null&&t in Object(e)}var Aat=fat,pat=jAe,mat=uQ,gat=ho,yat=dQ,vat=hQ,xat=_5;function wat(e,t,n){t=pat(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=xat(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&vat(i)&&yat(a,i)&&(gat(e)||mat(e)))}var bat=wat,Cat=Aat,Sat=bat;function kat(e,t){return e!=null&&Sat(e,t,Cat)}var _at=kat,jat=fQ,Bat=BAe,Nat=_at,Eat=KH,Tat=ype,Iat=vpe,Pat=_5,Oat=1,Fat=2;function Mat(e,t){return Eat(e)&&Tat(t)?Iat(Pat(e),t):function(n){var r=Bat(n,e);return r===void 0&&r===t?Nat(n,e):jat(t,r,Oat|Fat)}}var Lat=Mat;function Rat(e){return e}var j0=Rat;function Dat(e){return function(t){return t==null?void 0:t[e]}}var Uat=Dat,Hat=ZH;function Qat(e){return function(t){return Hat(t,e)}}var $at=Qat,zat=Uat,Vat=$at,Kat=KH,qat=_5;function Wat(e){return Kat(e)?zat(qat(e)):Vat(e)}var Gat=Wat,Yat=hat,Xat=Lat,Jat=j0,Zat=ho,eot=Gat;function tot(e){return typeof e=="function"?e:e==null?Jat:typeof e=="object"?Zat(e)?Xat(e[0],e[1]):Yat(e):eot(e)}var sA=tot;function not(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var xpe=not;function rot(e){return e!==e}var iot=rot;function sot(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var aot=sot,oot=xpe,lot=iot,cot=aot;function uot(e,t,n){return t===t?cot(e,t,n):oot(e,lot,n)}var dot=uot,hot=dot;function fot(e,t){var n=e==null?0:e.length;return!!n&&hot(e,t,0)>-1}var Aot=fot;function pot(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var mot=pot;function got(){}var yot=got,x4=ppe,vot=yot,xot=cQ,wot=1/0,bot=x4&&1/xot(new x4([,-0]))[1]==wot?function(e){return new x4(e)}:vot,Cot=bot,Sot=spe,kot=Aot,_ot=mot,jot=ope,Bot=Cot,Not=cQ,Eot=200;function Tot(e,t,n){var r=-1,i=kot,s=e.length,a=!0,o=[],c=o;if(n)a=!1,i=_ot;else if(s>=Eot){var u=t?null:Bot(e);if(u)return Not(u);a=!1,i=jot,c=new Sot}else c=t?[]:o;e:for(;++r<s;){var d=e[r],h=t?t(d):d;if(d=n||d!==0?d:0,a&&h===h){for(var A=c.length;A--;)if(c[A]===h)continue e;t&&c.push(h),o.push(d)}else i(c,h,n)||(c!==o&&c.push(h),o.push(d))}return o}var Iot=Tot,Pot=sA,Oot=Iot;function Fot(e,t){return e&&e.length?Oot(e,Pot(t)):[]}var Mot=Fot;const $W=Mn(Mot);function wpe(e,t,n){return t===!0?$W(e,n):yn(t)?$W(e,t):e}function _v(e){"@babel/helpers - typeof";return _v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_v(e)}var Lot=["ref"];function zW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zW(Object(n),!0).forEach(function(r){Q5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VW(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cpe(r.key),r)}}function Dot(e,t,n){return t&&VW(e.prototype,t),n&&VW(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uot(e,t,n){return t=HB(t),Hot(e,bpe()?Reflect.construct(t,n||[],HB(e).constructor):t.apply(e,n))}function Hot(e,t){if(t&&(_v(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qot(e)}function Qot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bpe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bpe=function(){return!!e})()}function HB(e){return HB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},HB(e)}function $ot(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uL(e,t)}function uL(e,t){return uL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},uL(e,t)}function Q5(e,t,n){return t=Cpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cpe(e){var t=zot(e,"string");return _v(t)=="symbol"?t:t+""}function zot(e,t){if(_v(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_v(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vot(e,t){if(e==null)return{};var n=Kot(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Kot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qot(e){return e.value}function Wot(e,t){if(re.isValidElement(e))return re.cloneElement(e,t);if(typeof e=="function")return re.createElement(e,t);t.ref;var n=Vot(t,Lot);return re.createElement(lQ,n)}var KW=1,Pp=function(e){function t(){var n;Rot(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=Uot(this,t,[].concat(i)),Q5(n,"lastBoundingBox",{width:-1,height:-1}),n}return $ot(t,e),Dot(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>KW||Math.abs(i.height-this.lastBoundingBox.height)>KW)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Qu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,a=i.align,o=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,h,A;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&s==="vertical"){var f=this.getBBoxSnapshot();h={left:((u||0)-f.width)/2}}else h=a==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(o==="middle"){var p=this.getBBoxSnapshot();A={top:((d||0)-p.height)/2}}else A=o==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Qu(Qu({},h),A)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,a=i.width,o=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,h=Qu(Qu({position:"absolute",width:a||"auto",height:o||"auto"},this.getDefaultPosition(c)),c);return re.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(f){r.wrapperNode=f}},Wot(s,Qu(Qu({},this.props),{},{payload:wpe(d,u,qot)})))}}],[{key:"getWithHeight",value:function(r,i){var s=Qu(Qu({},this.defaultProps),r.props),a=s.layout;return a==="vertical"&&tt(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(C.PureComponent);Q5(Pp,"displayName","Legend");Q5(Pp,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var qW=Q2,Got=uQ,Yot=ho,WW=qW?qW.isConcatSpreadable:void 0;function Xot(e){return Yot(e)||Got(e)||!!(WW&&e&&e[WW])}var Jot=Xot,Zot=cpe,elt=Jot;function Spe(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=elt),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Spe(o,t-1,n,r,i):Zot(i,o):r||(i[i.length]=o)}return i}var kpe=Spe;function tlt(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var c=a[e?o:++i];if(n(s[c],c,s)===!1)break}return t}}var nlt=tlt,rlt=nlt,ilt=rlt(),slt=ilt,alt=slt,olt=H5;function llt(e,t){return e&&alt(e,t,olt)}var _pe=llt,clt=K2;function ult(e,t){return function(n,r){if(n==null)return n;if(!clt(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var dlt=ult,hlt=_pe,flt=dlt,Alt=flt(hlt),AQ=Alt,plt=AQ,mlt=K2;function glt(e,t){var n=-1,r=mlt(e)?Array(e.length):[];return plt(e,function(i,s,a){r[++n]=t(i,s,a)}),r}var jpe=glt;function ylt(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var vlt=ylt,GW=x0;function xlt(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,s=GW(e),a=t!==void 0,o=t===null,c=t===t,u=GW(t);if(!o&&!u&&!s&&e>t||s&&a&&c&&!o&&!u||r&&a&&c||!n&&c||!i)return 1;if(!r&&!s&&!u&&e<t||u&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!c)return-1}return 0}var wlt=xlt,blt=wlt;function Clt(e,t,n){for(var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;++r<a;){var c=blt(i[r],s[r]);if(c){if(r>=o)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var Slt=Clt,w4=JH,klt=ZH,_lt=sA,jlt=jpe,Blt=vlt,Nlt=hpe,Elt=Slt,Tlt=j0,Ilt=ho;function Plt(e,t,n){t.length?t=w4(t,function(s){return Ilt(s)?function(a){return klt(a,s.length===1?s[0]:s)}:s}):t=[Tlt];var r=-1;t=w4(t,Nlt(_lt));var i=jlt(e,function(s,a,o){var c=w4(t,function(u){return u(s)});return{criteria:c,index:++r,value:s}});return Blt(i,function(s,a){return Elt(s,a,n)})}var Olt=Plt;function Flt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Mlt=Flt,Llt=Mlt,YW=Math.max;function Rlt(e,t,n){return t=YW(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=YW(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),Llt(e,this,o)}}var Dlt=Rlt;function Ult(e){return function(){return e}}var Hlt=Ult,Qlt=Cm,$lt=function(){try{var e=Qlt(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Bpe=$lt,zlt=Hlt,XW=Bpe,Vlt=j0,Klt=XW?function(e,t){return XW(e,"toString",{configurable:!0,enumerable:!1,value:zlt(t),writable:!0})}:Vlt,qlt=Klt,Wlt=800,Glt=16,Ylt=Date.now;function Xlt(e){var t=0,n=0;return function(){var r=Ylt(),i=Glt-(r-n);if(n=r,i>0){if(++t>=Wlt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Jlt=Xlt,Zlt=qlt,ect=Jlt,tct=ect(Zlt),nct=tct,rct=j0,ict=Dlt,sct=nct;function act(e,t){return sct(ict(e,t,rct),e+"")}var oct=act,lct=WH,cct=K2,uct=dQ,dct=iA;function hct(e,t,n){if(!dct(n))return!1;var r=typeof t;return(r=="number"?cct(n)&&uct(t,n.length):r=="string"&&t in n)?lct(n[t],e):!1}var $5=hct,fct=kpe,Act=Olt,pct=oct,JW=$5,mct=pct(function(e,t){if(e==null)return[];var n=t.length;return n>1&&JW(e,t[0],t[1])?t=[]:n>2&&JW(t[0],t[1],t[2])&&(t=[t[0]]),Act(e,fct(t,1),[])}),gct=mct;const pQ=Mn(gct);function y1(e){"@babel/helpers - typeof";return y1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y1(e)}function dL(){return dL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dL.apply(this,arguments)}function yct(e,t){return bct(e)||wct(e,t)||xct(e,t)||vct()}function vct(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xct(e,t){if(e){if(typeof e=="string")return ZW(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZW(e,t)}}function ZW(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wct(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function bct(e){if(Array.isArray(e))return e}function eG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function b4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eG(Object(n),!0).forEach(function(r){Cct(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cct(e,t,n){return t=Sct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sct(e){var t=kct(e,"string");return y1(t)=="symbol"?t:t+""}function kct(e,t){if(y1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(y1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _ct(e){return Array.isArray(e)&&Ji(e[0])&&Ji(e[1])?e.join(" ~ "):e}var jct=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,s=i===void 0?{}:i,a=t.itemStyle,o=a===void 0?{}:a,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,h=t.formatter,A=t.itemSorter,f=t.wrapperClassName,p=t.labelClassName,m=t.label,g=t.labelFormatter,y=t.accessibilityLayer,v=y===void 0?!1:y,x=function(){if(d&&d.length){var N={padding:0,margin:0},F=(A?pQ(d,A):d).map(function(L,U){if(L.type==="none")return null;var H=b4({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},o),W=L.formatter||h||_ct,$=L.value,z=L.name,Q=$,ce=z;if(W&&Q!=null&&ce!=null){var R=W($,z,L,U,d);if(Array.isArray(R)){var M=yct(R,2);Q=M[0],ce=M[1]}else Q=R}return re.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:H},Ji(ce)?re.createElement("span",{className:"recharts-tooltip-item-name"},ce):null,Ji(ce)?re.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,re.createElement("span",{className:"recharts-tooltip-item-value"},Q),re.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return re.createElement("ul",{className:"recharts-tooltip-item-list",style:N},F)}return null},b=b4({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),w=b4({margin:0},u),k=!_n(m),j=k?m:"",B=Fn("recharts-default-tooltip",f),E=Fn("recharts-tooltip-label",p);k&&g&&d!==void 0&&d!==null&&(j=g(m,d));var P=v?{role:"status","aria-live":"assertive"}:{};return re.createElement("div",dL({className:B,style:b},P),re.createElement("p",{className:E,style:w},re.isValidElement(j)?j:"".concat(j)),x())};function v1(e){"@babel/helpers - typeof";return v1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v1(e)}function VS(e,t,n){return t=Bct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bct(e){var t=Nct(e,"string");return v1(t)=="symbol"?t:t+""}function Nct(e,t){if(v1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(v1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ix="recharts-tooltip-wrapper",Ect={visibility:"hidden"};function Tct(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Fn(Ix,VS(VS(VS(VS({},"".concat(Ix,"-right"),tt(n)&&t&&tt(t.x)&&n>=t.x),"".concat(Ix,"-left"),tt(n)&&t&&tt(t.x)&&n<t.x),"".concat(Ix,"-bottom"),tt(r)&&t&&tt(t.y)&&r>=t.y),"".concat(Ix,"-top"),tt(r)&&t&&tt(t.y)&&r<t.y))}function tG(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&tt(s[r]))return s[r];var d=n[r]-o-i,h=n[r]+i;if(t[r])return a[r]?d:h;if(a[r]){var A=d,f=c[r];return A<f?Math.max(h,c[r]):Math.max(d,c[r])}var p=h+o,m=c[r]+u;return p>m?Math.max(d,c[r]):Math.max(h,c[r])}function Ict(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Pct(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,s=e.reverseDirection,a=e.tooltipBox,o=e.useTranslate3d,c=e.viewBox,u,d,h;return a.height>0&&a.width>0&&n?(d=tG({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:a.width,viewBox:c,viewBoxDimension:c.width}),h=tG({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:a.height,viewBox:c,viewBoxDimension:c.height}),u=Ict({translateX:d,translateY:h,useTranslate3d:o})):u=Ect,{cssProperties:u,cssClasses:Tct({translateX:d,translateY:h,coordinate:n})}}function jv(e){"@babel/helpers - typeof";return jv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jv(e)}function nG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nG(Object(n),!0).forEach(function(r){fL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Epe(r.key),r)}}function Mct(e,t,n){return t&&Fct(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lct(e,t,n){return t=QB(t),Rct(e,Npe()?Reflect.construct(t,n||[],QB(e).constructor):t.apply(e,n))}function Rct(e,t){if(t&&(jv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dct(e)}function Dct(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Npe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Npe=function(){return!!e})()}function QB(e){return QB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},QB(e)}function Uct(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hL(e,t)}function hL(e,t){return hL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},hL(e,t)}function fL(e,t,n){return t=Epe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Epe(e){var t=Hct(e,"string");return jv(t)=="symbol"?t:t+""}function Hct(e,t){if(jv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(jv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iG=1,Qct=function(e){function t(){var n;Oct(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=Lct(this,t,[].concat(i)),fL(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),fL(n,"handleKeyDown",function(a){if(a.key==="Escape"){var o,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&o!==void 0?o:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return Uct(t,e),Mct(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>iG||Math.abs(r.height-this.state.lastBoundingBox.height)>iG)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,h=i.hasPayload,A=i.isAnimationActive,f=i.offset,p=i.position,m=i.reverseDirection,g=i.useTranslate3d,y=i.viewBox,v=i.wrapperStyle,x=Pct({allowEscapeViewBox:a,coordinate:d,offsetTopLeft:f,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:y}),b=x.cssClasses,w=x.cssProperties,k=rG(rG({transition:A&&s?"transform ".concat(o,"ms ").concat(c):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&h?"visible":"hidden",position:"absolute",top:0,left:0},v);return re.createElement("div",{tabIndex:-1,className:b,style:k,ref:function(B){r.wrapperNode=B}},u)}}])}(C.PureComponent),$ct=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ad={isSsr:$ct(),get:function(t){return Ad[t]},set:function(t,n){if(typeof t=="string")Ad[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(i){Ad[i]=t[i]})}}};function Bv(e){"@babel/helpers - typeof";return Bv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bv(e)}function sG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sG(Object(n),!0).forEach(function(r){mQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ipe(r.key),r)}}function Kct(e,t,n){return t&&Vct(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qct(e,t,n){return t=$B(t),Wct(e,Tpe()?Reflect.construct(t,n||[],$B(e).constructor):t.apply(e,n))}function Wct(e,t){if(t&&(Bv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gct(e)}function Gct(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tpe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tpe=function(){return!!e})()}function $B(e){return $B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$B(e)}function Yct(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&AL(e,t)}function AL(e,t){return AL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},AL(e,t)}function mQ(e,t,n){return t=Ipe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ipe(e){var t=Xct(e,"string");return Bv(t)=="symbol"?t:t+""}function Xct(e,t){if(Bv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Bv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jct(e){return e.dataKey}function Zct(e,t){return re.isValidElement(e)?re.cloneElement(e,t):typeof e=="function"?re.createElement(e,t):re.createElement(jct,t)}var ul=function(e){function t(){return zct(this,t),qct(this,t,arguments)}return Yct(t,e),Kct(t,[{key:"render",value:function(){var r=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,h=i.filterNull,A=i.isAnimationActive,f=i.offset,p=i.payload,m=i.payloadUniqBy,g=i.position,y=i.reverseDirection,v=i.useTranslate3d,x=i.viewBox,b=i.wrapperStyle,w=p??[];h&&w.length&&(w=wpe(p.filter(function(j){return j.value!=null&&(j.hide!==!0||r.props.includeHidden)}),m,Jct));var k=w.length>0;return re.createElement(Qct,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:A,active:s,coordinate:d,hasPayload:k,offset:f,position:g,reverseDirection:y,useTranslate3d:v,viewBox:x,wrapperStyle:b},Zct(u,aG(aG({},this.props),{},{payload:w})))}}])}(C.PureComponent);mQ(ul,"displayName","Tooltip");mQ(ul,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ad.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var eut=Cu,tut=function(){return eut.Date.now()},nut=tut,rut=/\s/;function iut(e){for(var t=e.length;t--&&rut.test(e.charAt(t)););return t}var sut=iut,aut=sut,out=/^\s+/;function lut(e){return e&&e.slice(0,aut(e)+1).replace(out,"")}var cut=lut,uut=cut,oG=iA,dut=x0,lG=NaN,hut=/^[-+]0x[0-9a-f]+$/i,fut=/^0b[01]+$/i,Aut=/^0o[0-7]+$/i,put=parseInt;function mut(e){if(typeof e=="number")return e;if(dut(e))return lG;if(oG(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=oG(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=uut(e);var n=fut.test(e);return n||Aut.test(e)?put(e.slice(2),n?2:8):hut.test(e)?lG:+e}var Ppe=mut,gut=iA,C4=nut,cG=Ppe,yut="Expected a function",vut=Math.max,xut=Math.min;function wut(e,t,n){var r,i,s,a,o,c,u=0,d=!1,h=!1,A=!0;if(typeof e!="function")throw new TypeError(yut);t=cG(t)||0,gut(n)&&(d=!!n.leading,h="maxWait"in n,s=h?vut(cG(n.maxWait)||0,t):s,A="trailing"in n?!!n.trailing:A);function f(k){var j=r,B=i;return r=i=void 0,u=k,a=e.apply(B,j),a}function p(k){return u=k,o=setTimeout(y,t),d?f(k):a}function m(k){var j=k-c,B=k-u,E=t-j;return h?xut(E,s-B):E}function g(k){var j=k-c,B=k-u;return c===void 0||j>=t||j<0||h&&B>=s}function y(){var k=C4();if(g(k))return v(k);o=setTimeout(y,m(k))}function v(k){return o=void 0,A&&r?f(k):(r=i=void 0,a)}function x(){o!==void 0&&clearTimeout(o),u=0,r=c=i=o=void 0}function b(){return o===void 0?a:v(C4())}function w(){var k=C4(),j=g(k);if(r=arguments,i=this,c=k,j){if(o===void 0)return p(c);if(h)return clearTimeout(o),o=setTimeout(y,t),f(c)}return o===void 0&&(o=setTimeout(y,t)),a}return w.cancel=x,w.flush=b,w}var but=wut,Cut=but,Sut=iA,kut="Expected a function";function _ut(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(kut);return Sut(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Cut(e,t,{leading:r,maxWait:t,trailing:i})}var jut=_ut;const Ope=Mn(jut);function x1(e){"@babel/helpers - typeof";return x1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x1(e)}function uG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uG(Object(n),!0).forEach(function(r){But(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function But(e,t,n){return t=Nut(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nut(e){var t=Eut(e,"string");return x1(t)=="symbol"?t:t+""}function Eut(e,t){if(x1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(x1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tut(e,t){return Fut(e)||Out(e,t)||Put(e,t)||Iut()}function Iut(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Put(e,t){if(e){if(typeof e=="string")return dG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dG(e,t)}}function dG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Out(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Fut(e){if(Array.isArray(e))return e}var gQ=C.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,s=e.width,a=s===void 0?"100%":s,o=e.height,c=o===void 0?"100%":o,u=e.minWidth,d=u===void 0?0:u,h=e.minHeight,A=e.maxHeight,f=e.children,p=e.debounce,m=p===void 0?0:p,g=e.id,y=e.className,v=e.onResize,x=e.style,b=x===void 0?{}:x,w=C.useRef(null),k=C.useRef();k.current=v,C.useImperativeHandle(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var j=C.useState({containerWidth:i.width,containerHeight:i.height}),B=Tut(j,2),E=B[0],P=B[1],T=C.useCallback(function(F,L){P(function(U){var H=Math.round(F),W=Math.round(L);return U.containerWidth===H&&U.containerHeight===W?U:{containerWidth:H,containerHeight:W}})},[]);C.useEffect(function(){var F=function(z){var Q,ce=z[0].contentRect,R=ce.width,M=ce.height;T(R,M),(Q=k.current)===null||Q===void 0||Q.call(k,R,M)};m>0&&(F=Ope(F,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(F),U=w.current.getBoundingClientRect(),H=U.width,W=U.height;return T(H,W),L.observe(w.current),function(){L.disconnect()}},[T,m]);var N=C.useMemo(function(){var F=E.containerWidth,L=E.containerHeight;if(F<0||L<0)return null;fd(sp(a)||sp(c),`The width(%s) and height(%s) are both fixed numbers,
       maybe you don't need to use a ResponsiveContainer.`,a,c),fd(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=sp(a)?F:a,H=sp(c)?L:c;n&&n>0&&(U?H=U/n:H&&(U=H*n),A&&H>A&&(H=A)),fd(U>0||H>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,U,H,a,c,d,h,n);var W=!Array.isArray(f)&&hd(f.type).endsWith("Chart");return re.Children.map(f,function($){return re.isValidElement($)?C.cloneElement($,KS({width:U,height:H},W?{style:KS({height:"100%",width:"100%",maxHeight:H,maxWidth:U},$.props.style)}:{})):$})},[n,f,c,A,h,d,E,a]);return re.createElement("div",{id:g?"".concat(g):void 0,className:Fn("recharts-responsive-container",y),style:KS(KS({},b),{},{width:a,height:c,minWidth:d,minHeight:h,maxHeight:A}),ref:w},N)}),Fpe=function(t){return null};Fpe.displayName="Cell";function w1(e){"@babel/helpers - typeof";return w1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w1(e)}function hG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hG(Object(n),!0).forEach(function(r){Mut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mut(e,t,n){return t=Lut(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lut(e){var t=Rut(e,"string");return w1(t)=="symbol"?t:t+""}function Rut(e,t){if(w1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(w1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pg={widthCache:{},cacheCount:0},Dut=2e3,Uut={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},fG="recharts_measurement_span";function Hut(e){var t=pL({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var eb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ad.isSsr)return{width:0,height:0};var r=Hut(n),i=JSON.stringify({text:t,copyStyle:r});if(pg.widthCache[i])return pg.widthCache[i];try{var s=document.getElementById(fG);s||(s=document.createElement("span"),s.setAttribute("id",fG),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var a=pL(pL({},Uut),r);Object.assign(s.style,a),s.textContent="".concat(t);var o=s.getBoundingClientRect(),c={width:o.width,height:o.height};return pg.widthCache[i]=c,++pg.cacheCount>Dut&&(pg.cacheCount=0,pg.widthCache={}),c}catch{return{width:0,height:0}}},Qut=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function b1(e){"@babel/helpers - typeof";return b1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b1(e)}function zB(e,t){return Kut(e)||Vut(e,t)||zut(e,t)||$ut()}function $ut(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zut(e,t){if(e){if(typeof e=="string")return AG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AG(e,t)}}function AG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vut(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Kut(e){if(Array.isArray(e))return e}function qut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gut(r.key),r)}}function Wut(e,t,n){return t&&pG(e.prototype,t),n&&pG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gut(e){var t=Yut(e,"string");return b1(t)=="symbol"?t:t+""}function Yut(e,t){if(b1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(b1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Xut=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Jut=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Mpe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Zut=Object.keys(Mpe),ay="NaN";function edt(e,t){return e*Mpe[t]}var qS=function(){function e(t,n){qut(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Xut.test(n)&&(this.num=NaN,this.unit=""),Zut.includes(n)&&(this.num=edt(t,n),this.unit="px")}return Wut(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=Jut.exec(n))!==null&&r!==void 0?r:[],s=zB(i,3),a=s[1],o=s[2];return new e(parseFloat(a),o??"")}}])}();function Lpe(e){if(e.includes(ay))return ay;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=mG.exec(t))!==null&&n!==void 0?n:[],i=zB(r,4),s=i[1],a=i[2],o=i[3],c=qS.parse(s??""),u=qS.parse(o??""),d=a==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return ay;t=t.replace(mG,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,A=(h=gG.exec(t))!==null&&h!==void 0?h:[],f=zB(A,4),p=f[1],m=f[2],g=f[3],y=qS.parse(p??""),v=qS.parse(g??""),x=m==="+"?y.add(v):y.subtract(v);if(x.isNaN())return ay;t=t.replace(gG,x.toString())}return t}var yG=/\(([^()]*)\)/;function tdt(e){for(var t=e;t.includes("(");){var n=yG.exec(t),r=zB(n,2),i=r[1];t=t.replace(yG,Lpe(i))}return t}function ndt(e){var t=e.replace(/\s+/g,"");return t=tdt(t),t=Lpe(t),t}function rdt(e){try{return ndt(e)}catch{return ay}}function S4(e){var t=rdt(e.slice(5,-1));return t===ay?"":t}var idt=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],sdt=["dx","dy","angle","className","breakAll"];function mL(){return mL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mL.apply(this,arguments)}function vG(e,t){if(e==null)return{};var n=adt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function adt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function xG(e,t){return udt(e)||cdt(e,t)||ldt(e,t)||odt()}function odt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ldt(e,t){if(e){if(typeof e=="string")return wG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wG(e,t)}}function wG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cdt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function udt(e){if(Array.isArray(e))return e}var Rpe=/[ \f\n\r\t\v\u2028\u2029]+/,Dpe=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var s=[];_n(n)||(r?s=n.toString().split(""):s=n.toString().split(Rpe));var a=s.map(function(c){return{word:c,width:eb(c,i).width}}),o=r?0:eb(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}},ddt=function(t,n,r,i,s){var a=t.maxLines,o=t.children,c=t.style,u=t.breakAll,d=tt(a),h=o,A=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(H,W){var $=W.word,z=W.width,Q=H[H.length-1];if(Q&&(i==null||s||Q.width+z+r<Number(i)))Q.words.push($),Q.width+=z+r;else{var ce={words:[$],width:z};H.push(ce)}return H},[])},f=A(n),p=function(U){return U.reduce(function(H,W){return H.width>W.width?H:W})};if(!d)return f;for(var m="…",g=function(U){var H=h.slice(0,U),W=Dpe({breakAll:u,style:c,children:H+m}).wordsWithComputedWidth,$=A(W),z=$.length>a||p($).width>Number(i);return[z,$]},y=0,v=h.length-1,x=0,b;y<=v&&x<=h.length-1;){var w=Math.floor((y+v)/2),k=w-1,j=g(k),B=xG(j,2),E=B[0],P=B[1],T=g(w),N=xG(T,1),F=N[0];if(!E&&!F&&(y=w+1),E&&F&&(v=w-1),!E&&F){b=P;break}x++}return b||f},bG=function(t){var n=_n(t)?[]:t.toString().split(Rpe);return[{words:n}]},hdt=function(t){var n=t.width,r=t.scaleToFit,i=t.children,s=t.style,a=t.breakAll,o=t.maxLines;if((n||r)&&!Ad.isSsr){var c,u,d=Dpe({breakAll:a,children:i,style:s});if(d){var h=d.wordsWithComputedWidth,A=d.spaceWidth;c=h,u=A}else return bG(i);return ddt({breakAll:a,children:i,maxLines:o,style:s},c,u,n,r)}return bG(i)},CG="#808080",VB=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,a=t.lineHeight,o=a===void 0?"1em":a,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,h=d===void 0?!1:d,A=t.textAnchor,f=A===void 0?"start":A,p=t.verticalAnchor,m=p===void 0?"end":p,g=t.fill,y=g===void 0?CG:g,v=vG(t,idt),x=C.useMemo(function(){return hdt({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:h,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,h,v.style,v.width]),b=v.dx,w=v.dy,k=v.angle,j=v.className,B=v.breakAll,E=vG(v,sdt);if(!Ji(r)||!Ji(s))return null;var P=r+(tt(b)?b:0),T=s+(tt(w)?w:0),N;switch(m){case"start":N=S4("calc(".concat(u,")"));break;case"middle":N=S4("calc(".concat((x.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:N=S4("calc(".concat(x.length-1," * -").concat(o,")"));break}var F=[];if(h){var L=x[0].width,U=v.width;F.push("scale(".concat((tt(U)?U/L:1)/L,")"))}return k&&F.push("rotate(".concat(k,", ").concat(P,", ").concat(T,")")),F.length&&(E.transform=F.join(" ")),re.createElement("text",mL({},Tn(E,!0),{x:P,y:T,className:Fn("recharts-text",j),textAnchor:f,fill:y.includes("url")?CG:y}),x.map(function(H,W){var $=H.words.join(B?"":" ");return re.createElement("tspan",{x:P,dy:W===0?N:o,key:"".concat($,"-").concat(W)},$)}))};function xf(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fdt(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function yQ(e){let t,n,r;e.length!==2?(t=xf,n=(o,c)=>xf(e(o),c),r=(o,c)=>e(o)-c):(t=e===xf||e===fdt?e:Adt,n=e,r=e);function i(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(o[h],c)<0?u=h+1:d=h}while(u<d)}return u}function s(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(o[h],c)<=0?u=h+1:d=h}while(u<d)}return u}function a(o,c,u=0,d=o.length){const h=i(o,c,u,d-1);return h>u&&r(o[h-1],c)>-r(o[h],c)?h-1:h}return{left:i,center:a,right:s}}function Adt(){return 0}function Upe(e){return e===null?NaN:+e}function*pdt(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const mdt=yQ(xf),q2=mdt.right;yQ(Upe).center;class SG extends Map{constructor(t,n=vdt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(kG(this,t))}has(t){return super.has(kG(this,t))}set(t,n){return super.set(gdt(this,t),n)}delete(t){return super.delete(ydt(this,t))}}function kG({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function gdt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ydt({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function vdt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xdt(e=xf){if(e===xf)return Hpe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Hpe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const wdt=Math.sqrt(50),bdt=Math.sqrt(10),Cdt=Math.sqrt(2);function KB(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=wdt?10:s>=bdt?5:s>=Cdt?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(e*u),c=Math.round(t*u),o/u<e&&++o,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*a,o=Math.round(e/u),c=Math.round(t/u),o*u<e&&++o,c*u>t&&--c),c<o&&.5<=n&&n<2?KB(e,t,n*2):[o,c,u]}function gL(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?KB(t,e,n):KB(e,t,n);if(!(s>=i))return[];const o=s-i+1,c=new Array(o);if(r)if(a<0)for(let u=0;u<o;++u)c[u]=(s-u)/-a;else for(let u=0;u<o;++u)c[u]=(s-u)*a;else if(a<0)for(let u=0;u<o;++u)c[u]=(i+u)/-a;else for(let u=0;u<o;++u)c[u]=(i+u)*a;return c}function yL(e,t,n){return t=+t,e=+e,n=+n,KB(e,t,n)[2]}function vL(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?yL(t,e,n):yL(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function _G(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function jG(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Qpe(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Hpe:xdt(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),h=.5*Math.exp(2*d/3),A=.5*Math.sqrt(d*h*(c-h)/c)*(u-c/2<0?-1:1),f=Math.max(n,Math.floor(t-u*h/c+A)),p=Math.min(r,Math.floor(t+(c-u)*h/c+A));Qpe(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Px(e,n,t),i(e[r],s)>0&&Px(e,n,r);a<o;){for(Px(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Px(e,n,o):(++o,Px(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Px(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Sdt(e,t,n){if(e=Float64Array.from(pdt(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return jG(e);if(t>=1)return _G(e);var r,i=(r-1)*t,s=Math.floor(i),a=_G(Qpe(e,s).subarray(0,s+1)),o=jG(e.subarray(s+1));return a+(o-a)*(i-s)}}function kdt(e,t,n=Upe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),a=+n(e[s],s,e),o=+n(e[s+1],s+1,e);return a+(o-a)*(i-s)}}function _dt(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function Ul(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Dd(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const xL=Symbol("implicit");function vQ(){var e=new SG,t=[],n=[],r=xL;function i(s){let a=e.get(s);if(a===void 0){if(r!==xL)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new SG;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return vQ(t,n).unknown(r)},Ul.apply(i,arguments),i}function C1(){var e=vQ().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,c=0,u=0,d=.5;delete e.unknown;function h(){var A=t().length,f=i<r,p=f?i:r,m=f?r:i;s=(m-p)/Math.max(1,A-c+u*2),o&&(s=Math.floor(s)),p+=(m-p-s*(A-c))*d,a=s*(1-c),o&&(p=Math.round(p),a=Math.round(a));var g=_dt(A).map(function(y){return p+s*y});return n(f?g.reverse():g)}return e.domain=function(A){return arguments.length?(t(A),h()):t()},e.range=function(A){return arguments.length?([r,i]=A,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(A){return[r,i]=A,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(A){return arguments.length?(o=!!A,h()):o},e.padding=function(A){return arguments.length?(c=Math.min(1,u=+A),h()):c},e.paddingInner=function(A){return arguments.length?(c=Math.min(1,A),h()):c},e.paddingOuter=function(A){return arguments.length?(u=+A,h()):u},e.align=function(A){return arguments.length?(d=Math.max(0,Math.min(1,A)),h()):d},e.copy=function(){return C1(t(),[r,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},Ul.apply(h(),arguments)}function $pe(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return $pe(t())},e}function tb(){return $pe(C1.apply(null,arguments).paddingInner(1))}function xQ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zpe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function W2(){}var S1=.7,qB=1/S1,Oy="\\s*([+-]?\\d+)\\s*",k1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",du="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jdt=/^#([0-9a-f]{3,8})$/,Bdt=new RegExp(`^rgb\\(${Oy},${Oy},${Oy}\\)$`),Ndt=new RegExp(`^rgb\\(${du},${du},${du}\\)$`),Edt=new RegExp(`^rgba\\(${Oy},${Oy},${Oy},${k1}\\)$`),Tdt=new RegExp(`^rgba\\(${du},${du},${du},${k1}\\)$`),Idt=new RegExp(`^hsl\\(${k1},${du},${du}\\)$`),Pdt=new RegExp(`^hsla\\(${k1},${du},${du},${k1}\\)$`),BG={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};xQ(W2,_1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:NG,formatHex:NG,formatHex8:Odt,formatHsl:Fdt,formatRgb:EG,toString:EG});function NG(){return this.rgb().formatHex()}function Odt(){return this.rgb().formatHex8()}function Fdt(){return Vpe(this).formatHsl()}function EG(){return this.rgb().formatRgb()}function _1(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=jdt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?TG(t):n===3?new to(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?WS(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?WS(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Bdt.exec(e))?new to(t[1],t[2],t[3],1):(t=Ndt.exec(e))?new to(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Edt.exec(e))?WS(t[1],t[2],t[3],t[4]):(t=Tdt.exec(e))?WS(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Idt.exec(e))?OG(t[1],t[2]/100,t[3]/100,1):(t=Pdt.exec(e))?OG(t[1],t[2]/100,t[3]/100,t[4]):BG.hasOwnProperty(e)?TG(BG[e]):e==="transparent"?new to(NaN,NaN,NaN,0):null}function TG(e){return new to(e>>16&255,e>>8&255,e&255,1)}function WS(e,t,n,r){return r<=0&&(e=t=n=NaN),new to(e,t,n,r)}function Mdt(e){return e instanceof W2||(e=_1(e)),e?(e=e.rgb(),new to(e.r,e.g,e.b,e.opacity)):new to}function wL(e,t,n,r){return arguments.length===1?Mdt(e):new to(e,t,n,r??1)}function to(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}xQ(to,wL,zpe(W2,{brighter(e){return e=e==null?qB:Math.pow(qB,e),new to(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?S1:Math.pow(S1,e),new to(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new to(Op(this.r),Op(this.g),Op(this.b),WB(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:IG,formatHex:IG,formatHex8:Ldt,formatRgb:PG,toString:PG}));function IG(){return`#${ap(this.r)}${ap(this.g)}${ap(this.b)}`}function Ldt(){return`#${ap(this.r)}${ap(this.g)}${ap(this.b)}${ap((isNaN(this.opacity)?1:this.opacity)*255)}`}function PG(){const e=WB(this.opacity);return`${e===1?"rgb(":"rgba("}${Op(this.r)}, ${Op(this.g)}, ${Op(this.b)}${e===1?")":`, ${e})`}`}function WB(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Op(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ap(e){return e=Op(e),(e<16?"0":"")+e.toString(16)}function OG(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hc(e,t,n,r)}function Vpe(e){if(e instanceof hc)return new hc(e.h,e.s,e.l,e.opacity);if(e instanceof W2||(e=_1(e)),!e)return new hc;if(e instanceof hc)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,c=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=c<.5?s+i:2-s-i,a*=60):o=c>0&&c<1?0:a,new hc(a,o,c,e.opacity)}function Rdt(e,t,n,r){return arguments.length===1?Vpe(e):new hc(e,t,n,r??1)}function hc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}xQ(hc,Rdt,zpe(W2,{brighter(e){return e=e==null?qB:Math.pow(qB,e),new hc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?S1:Math.pow(S1,e),new hc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new to(k4(e>=240?e-240:e+120,i,r),k4(e,i,r),k4(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new hc(FG(this.h),GS(this.s),GS(this.l),WB(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=WB(this.opacity);return`${e===1?"hsl(":"hsla("}${FG(this.h)}, ${GS(this.s)*100}%, ${GS(this.l)*100}%${e===1?")":`, ${e})`}`}}));function FG(e){return e=(e||0)%360,e<0?e+360:e}function GS(e){return Math.max(0,Math.min(1,e||0))}function k4(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const wQ=e=>()=>e;function Ddt(e,t){return function(n){return e+n*t}}function Udt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Hdt(e){return(e=+e)==1?Kpe:function(t,n){return n-t?Udt(t,n,e):wQ(isNaN(t)?n:t)}}function Kpe(e,t){var n=t-e;return n?Ddt(e,n):wQ(isNaN(e)?t:e)}const MG=function e(t){var n=Hdt(t);function r(i,s){var a=n((i=wL(i)).r,(s=wL(s)).r),o=n(i.g,s.g),c=n(i.b,s.b),u=Kpe(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function Qdt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function $dt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function zdt(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=B0(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function Vdt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function GB(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Kdt(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=B0(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var bL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_4=new RegExp(bL.source,"g");function qdt(e){return function(){return e}}function Wdt(e){return function(t){return e(t)+""}}function Gdt(e,t){var n=bL.lastIndex=_4.lastIndex=0,r,i,s,a=-1,o=[],c=[];for(e=e+"",t=t+"";(r=bL.exec(e))&&(i=_4.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,c.push({i:a,x:GB(r,i)})),n=_4.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?c[0]?Wdt(c[0].x):qdt(t):(t=c.length,function(u){for(var d=0,h;d<t;++d)o[(h=c[d]).i]=h.x(u);return o.join("")})}function B0(e,t){var n=typeof t,r;return t==null||n==="boolean"?wQ(t):(n==="number"?GB:n==="string"?(r=_1(t))?(t=r,MG):Gdt:t instanceof _1?MG:t instanceof Date?Vdt:$dt(t)?Qdt:Array.isArray(t)?zdt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Kdt:GB)(e,t)}function bQ(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Ydt(e,t){t===void 0&&(t=e,e=B0);for(var n=0,r=t.length-1,i=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(i,i=t[++n]);return function(a){var o=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return s[o](a-o)}}function Xdt(e){return function(){return e}}function YB(e){return+e}var LG=[0,1];function ja(e){return e}function CL(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Xdt(isNaN(t)?NaN:.5)}function Jdt(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Zdt(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=CL(i,r),s=n(a,s)):(r=CL(r,i),s=n(s,a)),function(o){return s(r(o))}}function eht(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=CL(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var c=q2(e,o,1,r)-1;return s[c](i[c](o))}}function G2(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function z5(){var e=LG,t=LG,n=B0,r,i,s,a=ja,o,c,u;function d(){var A=Math.min(e.length,t.length);return a!==ja&&(a=Jdt(e[0],e[A-1])),o=A>2?eht:Zdt,c=u=null,h}function h(A){return A==null||isNaN(A=+A)?s:(c||(c=o(e.map(r),t,n)))(r(a(A)))}return h.invert=function(A){return a(i((u||(u=o(t,e.map(r),GB)))(A)))},h.domain=function(A){return arguments.length?(e=Array.from(A,YB),d()):e.slice()},h.range=function(A){return arguments.length?(t=Array.from(A),d()):t.slice()},h.rangeRound=function(A){return t=Array.from(A),n=bQ,d()},h.clamp=function(A){return arguments.length?(a=A?!0:ja,d()):a!==ja},h.interpolate=function(A){return arguments.length?(n=A,d()):n},h.unknown=function(A){return arguments.length?(s=A,h):s},function(A,f){return r=A,i=f,d()}}function CQ(){return z5()(ja,ja)}function tht(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function XB(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Nv(e){return e=XB(Math.abs(e)),e?e[1]:NaN}function nht(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),s.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function rht(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var iht=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function j1(e){if(!(t=iht.exec(e)))throw new Error("invalid format: "+e);var t;return new SQ({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}j1.prototype=SQ.prototype;function SQ(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}SQ.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sht(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var qpe;function aht(e,t){var n=XB(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(qpe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+XB(e,Math.max(0,t+s-1))[0]}function RG(e,t){var n=XB(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const DG={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:tht,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>RG(e*100,t),r:RG,s:aht,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function UG(e){return e}var HG=Array.prototype.map,QG=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oht(e){var t=e.grouping===void 0||e.thousands===void 0?UG:nht(HG.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?UG:rht(HG.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(h){h=j1(h);var A=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,y=h.width,v=h.comma,x=h.precision,b=h.trim,w=h.type;w==="n"?(v=!0,w="g"):DG[w]||(x===void 0&&(x=12),b=!0,w="g"),(g||A==="0"&&f==="=")&&(g=!0,A="0",f="=");var k=m==="$"?n:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",j=m==="$"?r:/[%p]/.test(w)?a:"",B=DG[w],E=/[defgprs%]/.test(w);x=x===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function P(T){var N=k,F=j,L,U,H;if(w==="c")F=B(T)+F,T="";else{T=+T;var W=T<0||1/T<0;if(T=isNaN(T)?c:B(Math.abs(T),x),b&&(T=sht(T)),W&&+T==0&&p!=="+"&&(W=!1),N=(W?p==="("?p:o:p==="-"||p==="("?"":p)+N,F=(w==="s"?QG[8+qpe/3]:"")+F+(W&&p==="("?")":""),E){for(L=-1,U=T.length;++L<U;)if(H=T.charCodeAt(L),48>H||H>57){F=(H===46?i+T.slice(L+1):T.slice(L))+F,T=T.slice(0,L);break}}}v&&!g&&(T=t(T,1/0));var $=N.length+T.length+F.length,z=$<y?new Array(y-$+1).join(A):"";switch(v&&g&&(T=t(z+T,z.length?y-F.length:1/0),z=""),f){case"<":T=N+T+F+z;break;case"=":T=N+z+T+F;break;case"^":T=z.slice(0,$=z.length>>1)+N+T+F+z.slice($);break;default:T=z+N+T+F;break}return s(T)}return P.toString=function(){return h+""},P}function d(h,A){var f=u((h=j1(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(Nv(A)/3)))*3,m=Math.pow(10,-p),g=QG[8+p/3];return function(y){return f(m*y)+g}}return{format:u,formatPrefix:d}}var YS,kQ,Wpe;lht({thousands:",",grouping:[3],currency:["$",""]});function lht(e){return YS=oht(e),kQ=YS.format,Wpe=YS.formatPrefix,YS}function cht(e){return Math.max(0,-Nv(Math.abs(e)))}function uht(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nv(t)/3)))*3-Nv(Math.abs(e)))}function dht(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Nv(t)-Nv(e))+1}function Gpe(e,t,n,r){var i=vL(e,t,n),s;switch(r=j1(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=uht(i,a))&&(r.precision=s),Wpe(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=dht(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=cht(i))&&(r.precision=s-(r.type==="%")*2);break}}return kQ(r)}function aA(e){var t=e.domain;return e.ticks=function(n){var r=t();return gL(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Gpe(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],c,u,d=10;for(o<a&&(u=a,a=o,o=u,u=i,i=s,s=u);d-- >0;){if(u=yL(a,o,n),u===c)return r[i]=a,r[s]=o,t(r);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;c=u}return e},e}function JB(){var e=CQ();return e.copy=function(){return G2(e,JB())},Ul.apply(e,arguments),aA(e)}function Ype(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,YB),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Ype(e).unknown(t)},e=arguments.length?Array.from(e,YB):[0,1],aA(n)}function Xpe(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function $G(e){return Math.log(e)}function zG(e){return Math.exp(e)}function hht(e){return-Math.log(-e)}function fht(e){return-Math.exp(-e)}function Aht(e){return isFinite(e)?+("1e"+e):e<0?0:e}function pht(e){return e===10?Aht:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mht(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function VG(e){return(t,n)=>-e(-t,n)}function _Q(e){const t=e($G,zG),n=t.domain;let r=10,i,s;function a(){return i=mht(r),s=pht(r),n()[0]<0?(i=VG(i),s=VG(s),e(hht,fht)):e($G,zG),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const c=n();let u=c[0],d=c[c.length-1];const h=d<u;h&&([u,d]=[d,u]);let A=i(u),f=i(d),p,m;const g=o==null?10:+o;let y=[];if(!(r%1)&&f-A<g){if(A=Math.floor(A),f=Math.ceil(f),u>0){for(;A<=f;++A)for(p=1;p<r;++p)if(m=A<0?p/s(-A):p*s(A),!(m<u)){if(m>d)break;y.push(m)}}else for(;A<=f;++A)for(p=r-1;p>=1;--p)if(m=A>0?p/s(-A):p*s(A),!(m<u)){if(m>d)break;y.push(m)}y.length*2<g&&(y=gL(u,d,g))}else y=gL(A,f,Math.min(f-A,g)).map(s);return h?y.reverse():y},t.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=j1(c)).precision==null&&(c.trim=!0),c=kQ(c)),o===1/0)return c;const u=Math.max(1,r*o/t.ticks().length);return d=>{let h=d/s(Math.round(i(d)));return h*r<r-.5&&(h*=r),h<=u?c(d):""}},t.nice=()=>n(Xpe(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Jpe(){const e=_Q(z5()).domain([1,10]);return e.copy=()=>G2(e,Jpe()).base(e.base()),Ul.apply(e,arguments),e}function KG(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qG(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jQ(e){var t=1,n=e(KG(t),qG(t));return n.constant=function(r){return arguments.length?e(KG(t=+r),qG(t)):t},aA(n)}function Zpe(){var e=jQ(z5());return e.copy=function(){return G2(e,Zpe()).constant(e.constant())},Ul.apply(e,arguments)}function WG(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ght(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function yht(e){return e<0?-e*e:e*e}function BQ(e){var t=e(ja,ja),n=1;function r(){return n===1?e(ja,ja):n===.5?e(ght,yht):e(WG(n),WG(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},aA(t)}function NQ(){var e=BQ(z5());return e.copy=function(){return G2(e,NQ()).exponent(e.exponent())},Ul.apply(e,arguments),e}function vht(){return NQ.apply(null,arguments).exponent(.5)}function GG(e){return Math.sign(e)*e*e}function xht(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function eme(){var e=CQ(),t=[0,1],n=!1,r;function i(s){var a=xht(e(s));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(s){return e.invert(GG(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,YB)).map(GG)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return eme(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ul.apply(i,arguments),aA(i)}function tme(){var e=[],t=[],n=[],r;function i(){var a=0,o=Math.max(1,t.length);for(n=new Array(o-1);++a<o;)n[a-1]=kdt(e,a/o);return s}function s(a){return a==null||isNaN(a=+a)?r:t[q2(n,a)]}return s.invertExtent=function(a){var o=t.indexOf(a);return o<0?[NaN,NaN]:[o>0?n[o-1]:e[0],o<n.length?n[o]:e[e.length-1]]},s.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let o of a)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(xf),i()},s.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return tme().domain(e).range(t).unknown(r)},Ul.apply(s,arguments)}function nme(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(c){return c!=null&&c<=c?i[q2(r,c,0,n)]:s}function o(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return a}return a.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,o()):[e,t]},a.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,o()):i.slice()},a.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(c){return arguments.length&&(s=c),a},a.thresholds=function(){return r.slice()},a.copy=function(){return nme().domain([e,t]).range(i).unknown(s)},Ul.apply(aA(a),arguments)}function rme(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[q2(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var a=t.indexOf(s);return[e[a-1],e[a]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return rme().domain(e).range(t).unknown(n)},Ul.apply(i,arguments)}const j4=new Date,B4=new Date;function ts(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const c=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return c;let u;do c.push(u=new Date(+s)),t(s,o),e(s);while(u<s&&s<a);return c},i.filter=s=>ts(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(j4.setTime(+s),B4.setTime(+a),e(j4),e(B4),Math.floor(n(j4,B4))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const ZB=ts(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ZB.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ts(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ZB);ZB.range;const od=1e3,vl=od*60,ld=vl*60,_d=ld*24,EQ=_d*7,YG=_d*30,N4=_d*365,op=ts(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*od)},(e,t)=>(t-e)/od,e=>e.getUTCSeconds());op.range;const TQ=ts(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*od)},(e,t)=>{e.setTime(+e+t*vl)},(e,t)=>(t-e)/vl,e=>e.getMinutes());TQ.range;const IQ=ts(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*vl)},(e,t)=>(t-e)/vl,e=>e.getUTCMinutes());IQ.range;const PQ=ts(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*od-e.getMinutes()*vl)},(e,t)=>{e.setTime(+e+t*ld)},(e,t)=>(t-e)/ld,e=>e.getHours());PQ.range;const OQ=ts(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ld)},(e,t)=>(t-e)/ld,e=>e.getUTCHours());OQ.range;const Y2=ts(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*vl)/_d,e=>e.getDate()-1);Y2.range;const V5=ts(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_d,e=>e.getUTCDate()-1);V5.range;const ime=ts(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_d,e=>Math.floor(e/_d));ime.range;function Sm(e){return ts(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vl)/EQ)}const K5=Sm(0),eN=Sm(1),wht=Sm(2),bht=Sm(3),Ev=Sm(4),Cht=Sm(5),Sht=Sm(6);K5.range;eN.range;wht.range;bht.range;Ev.range;Cht.range;Sht.range;function km(e){return ts(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/EQ)}const q5=km(0),tN=km(1),kht=km(2),_ht=km(3),Tv=km(4),jht=km(5),Bht=km(6);q5.range;tN.range;kht.range;_ht.range;Tv.range;jht.range;Bht.range;const FQ=ts(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());FQ.range;const MQ=ts(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());MQ.range;const jd=ts(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());jd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ts(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});jd.range;const Bd=ts(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Bd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ts(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Bd.range;function sme(e,t,n,r,i,s){const a=[[op,1,od],[op,5,5*od],[op,15,15*od],[op,30,30*od],[s,1,vl],[s,5,5*vl],[s,15,15*vl],[s,30,30*vl],[i,1,ld],[i,3,3*ld],[i,6,6*ld],[i,12,12*ld],[r,1,_d],[r,2,2*_d],[n,1,EQ],[t,1,YG],[t,3,3*YG],[e,1,N4]];function o(u,d,h){const A=d<u;A&&([u,d]=[d,u]);const f=h&&typeof h.range=="function"?h:c(u,d,h),p=f?f.range(u,+d+1):[];return A?p.reverse():p}function c(u,d,h){const A=Math.abs(d-u)/h,f=yQ(([,,g])=>g).right(a,A);if(f===a.length)return e.every(vL(u/N4,d/N4,h));if(f===0)return ZB.every(Math.max(vL(u,d,h),1));const[p,m]=a[A/a[f-1][2]<a[f][2]/A?f-1:f];return p.every(m)}return[o,c]}const[Nht,Eht]=sme(Bd,MQ,q5,ime,OQ,IQ),[Tht,Iht]=sme(jd,FQ,K5,Y2,PQ,TQ);function E4(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function T4(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ox(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Pht(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,c=e.shortMonths,u=Fx(i),d=Mx(i),h=Fx(s),A=Mx(s),f=Fx(a),p=Mx(a),m=Fx(o),g=Mx(o),y=Fx(c),v=Mx(c),x={a:W,A:$,b:z,B:Q,c:null,d:nY,e:nY,f:nft,g:hft,G:Aft,H:Zht,I:eft,j:tft,L:ame,m:rft,M:ift,p:ce,q:R,Q:sY,s:aY,S:sft,u:aft,U:oft,V:lft,w:cft,W:uft,x:null,X:null,y:dft,Y:fft,Z:pft,"%":iY},b={a:M,A:Y,b:X,B:V,c:null,d:rY,e:rY,f:vft,g:Nft,G:Tft,H:mft,I:gft,j:yft,L:lme,m:xft,M:wft,p:Z,q:de,Q:sY,s:aY,S:bft,u:Cft,U:Sft,V:kft,w:_ft,W:jft,x:null,X:null,y:Bft,Y:Eft,Z:Ift,"%":iY},w={a:P,A:T,b:N,B:F,c:L,d:eY,e:eY,f:Ght,g:ZG,G:JG,H:tY,I:tY,j:Vht,L:Wht,m:zht,M:Kht,p:E,q:$ht,Q:Xht,s:Jht,S:qht,u:Rht,U:Dht,V:Uht,w:Lht,W:Hht,x:U,X:H,y:ZG,Y:JG,Z:Qht,"%":Yht};x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),b.x=k(n,b),b.X=k(r,b),b.c=k(t,b);function k(ue,se){return function(he){var ie=[],Ce=-1,Ie=0,te=ue.length,je,nt,rt;for(he instanceof Date||(he=new Date(+he));++Ce<te;)ue.charCodeAt(Ce)===37&&(ie.push(ue.slice(Ie,Ce)),(nt=XG[je=ue.charAt(++Ce)])!=null?je=ue.charAt(++Ce):nt=je==="e"?" ":"0",(rt=se[je])&&(je=rt(he,nt)),ie.push(je),Ie=Ce+1);return ie.push(ue.slice(Ie,Ce)),ie.join("")}}function j(ue,se){return function(he){var ie=Ox(1900,void 0,1),Ce=B(ie,ue,he+="",0),Ie,te;if(Ce!=he.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(se&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Ie=T4(Ox(ie.y,0,1)),te=Ie.getUTCDay(),Ie=te>4||te===0?tN.ceil(Ie):tN(Ie),Ie=V5.offset(Ie,(ie.V-1)*7),ie.y=Ie.getUTCFullYear(),ie.m=Ie.getUTCMonth(),ie.d=Ie.getUTCDate()+(ie.w+6)%7):(Ie=E4(Ox(ie.y,0,1)),te=Ie.getDay(),Ie=te>4||te===0?eN.ceil(Ie):eN(Ie),Ie=Y2.offset(Ie,(ie.V-1)*7),ie.y=Ie.getFullYear(),ie.m=Ie.getMonth(),ie.d=Ie.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),te="Z"in ie?T4(Ox(ie.y,0,1)).getUTCDay():E4(Ox(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(te+5)%7:ie.w+ie.U*7-(te+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,T4(ie)):E4(ie)}}function B(ue,se,he,ie){for(var Ce=0,Ie=se.length,te=he.length,je,nt;Ce<Ie;){if(ie>=te)return-1;if(je=se.charCodeAt(Ce++),je===37){if(je=se.charAt(Ce++),nt=w[je in XG?se.charAt(Ce++):je],!nt||(ie=nt(ue,he,ie))<0)return-1}else if(je!=he.charCodeAt(ie++))return-1}return ie}function E(ue,se,he){var ie=u.exec(se.slice(he));return ie?(ue.p=d.get(ie[0].toLowerCase()),he+ie[0].length):-1}function P(ue,se,he){var ie=f.exec(se.slice(he));return ie?(ue.w=p.get(ie[0].toLowerCase()),he+ie[0].length):-1}function T(ue,se,he){var ie=h.exec(se.slice(he));return ie?(ue.w=A.get(ie[0].toLowerCase()),he+ie[0].length):-1}function N(ue,se,he){var ie=y.exec(se.slice(he));return ie?(ue.m=v.get(ie[0].toLowerCase()),he+ie[0].length):-1}function F(ue,se,he){var ie=m.exec(se.slice(he));return ie?(ue.m=g.get(ie[0].toLowerCase()),he+ie[0].length):-1}function L(ue,se,he){return B(ue,t,se,he)}function U(ue,se,he){return B(ue,n,se,he)}function H(ue,se,he){return B(ue,r,se,he)}function W(ue){return a[ue.getDay()]}function $(ue){return s[ue.getDay()]}function z(ue){return c[ue.getMonth()]}function Q(ue){return o[ue.getMonth()]}function ce(ue){return i[+(ue.getHours()>=12)]}function R(ue){return 1+~~(ue.getMonth()/3)}function M(ue){return a[ue.getUTCDay()]}function Y(ue){return s[ue.getUTCDay()]}function X(ue){return c[ue.getUTCMonth()]}function V(ue){return o[ue.getUTCMonth()]}function Z(ue){return i[+(ue.getUTCHours()>=12)]}function de(ue){return 1+~~(ue.getUTCMonth()/3)}return{format:function(ue){var se=k(ue+="",x);return se.toString=function(){return ue},se},parse:function(ue){var se=j(ue+="",!1);return se.toString=function(){return ue},se},utcFormat:function(ue){var se=k(ue+="",b);return se.toString=function(){return ue},se},utcParse:function(ue){var se=j(ue+="",!0);return se.toString=function(){return ue},se}}}var XG={"-":"",_:" ",0:"0"},ps=/^\s*\d+/,Oht=/^%/,Fht=/[\\^$*+?|[\]().{}]/g;function Un(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function Mht(e){return e.replace(Fht,"\\$&")}function Fx(e){return new RegExp("^(?:"+e.map(Mht).join("|")+")","i")}function Mx(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Lht(e,t,n){var r=ps.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Rht(e,t,n){var r=ps.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Dht(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Uht(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Hht(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function JG(e,t,n){var r=ps.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ZG(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Qht(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $ht(e,t,n){var r=ps.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function zht(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function eY(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Vht(e,t,n){var r=ps.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tY(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Kht(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function qht(e,t,n){var r=ps.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Wht(e,t,n){var r=ps.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ght(e,t,n){var r=ps.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Yht(e,t,n){var r=Oht.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Xht(e,t,n){var r=ps.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Jht(e,t,n){var r=ps.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function nY(e,t){return Un(e.getDate(),t,2)}function Zht(e,t){return Un(e.getHours(),t,2)}function eft(e,t){return Un(e.getHours()%12||12,t,2)}function tft(e,t){return Un(1+Y2.count(jd(e),e),t,3)}function ame(e,t){return Un(e.getMilliseconds(),t,3)}function nft(e,t){return ame(e,t)+"000"}function rft(e,t){return Un(e.getMonth()+1,t,2)}function ift(e,t){return Un(e.getMinutes(),t,2)}function sft(e,t){return Un(e.getSeconds(),t,2)}function aft(e){var t=e.getDay();return t===0?7:t}function oft(e,t){return Un(K5.count(jd(e)-1,e),t,2)}function ome(e){var t=e.getDay();return t>=4||t===0?Ev(e):Ev.ceil(e)}function lft(e,t){return e=ome(e),Un(Ev.count(jd(e),e)+(jd(e).getDay()===4),t,2)}function cft(e){return e.getDay()}function uft(e,t){return Un(eN.count(jd(e)-1,e),t,2)}function dft(e,t){return Un(e.getFullYear()%100,t,2)}function hft(e,t){return e=ome(e),Un(e.getFullYear()%100,t,2)}function fft(e,t){return Un(e.getFullYear()%1e4,t,4)}function Aft(e,t){var n=e.getDay();return e=n>=4||n===0?Ev(e):Ev.ceil(e),Un(e.getFullYear()%1e4,t,4)}function pft(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Un(t/60|0,"0",2)+Un(t%60,"0",2)}function rY(e,t){return Un(e.getUTCDate(),t,2)}function mft(e,t){return Un(e.getUTCHours(),t,2)}function gft(e,t){return Un(e.getUTCHours()%12||12,t,2)}function yft(e,t){return Un(1+V5.count(Bd(e),e),t,3)}function lme(e,t){return Un(e.getUTCMilliseconds(),t,3)}function vft(e,t){return lme(e,t)+"000"}function xft(e,t){return Un(e.getUTCMonth()+1,t,2)}function wft(e,t){return Un(e.getUTCMinutes(),t,2)}function bft(e,t){return Un(e.getUTCSeconds(),t,2)}function Cft(e){var t=e.getUTCDay();return t===0?7:t}function Sft(e,t){return Un(q5.count(Bd(e)-1,e),t,2)}function cme(e){var t=e.getUTCDay();return t>=4||t===0?Tv(e):Tv.ceil(e)}function kft(e,t){return e=cme(e),Un(Tv.count(Bd(e),e)+(Bd(e).getUTCDay()===4),t,2)}function _ft(e){return e.getUTCDay()}function jft(e,t){return Un(tN.count(Bd(e)-1,e),t,2)}function Bft(e,t){return Un(e.getUTCFullYear()%100,t,2)}function Nft(e,t){return e=cme(e),Un(e.getUTCFullYear()%100,t,2)}function Eft(e,t){return Un(e.getUTCFullYear()%1e4,t,4)}function Tft(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Tv(e):Tv.ceil(e),Un(e.getUTCFullYear()%1e4,t,4)}function Ift(){return"+0000"}function iY(){return"%"}function sY(e){return+e}function aY(e){return Math.floor(+e/1e3)}var mg,ume,dme;Pft({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Pft(e){return mg=Pht(e),ume=mg.format,mg.parse,dme=mg.utcFormat,mg.utcParse,mg}function Oft(e){return new Date(e)}function Fft(e){return e instanceof Date?+e:+new Date(+e)}function LQ(e,t,n,r,i,s,a,o,c,u){var d=CQ(),h=d.invert,A=d.domain,f=u(".%L"),p=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),v=u("%b %d"),x=u("%B"),b=u("%Y");function w(k){return(c(k)<k?f:o(k)<k?p:a(k)<k?m:s(k)<k?g:r(k)<k?i(k)<k?y:v:n(k)<k?x:b)(k)}return d.invert=function(k){return new Date(h(k))},d.domain=function(k){return arguments.length?A(Array.from(k,Fft)):A().map(Oft)},d.ticks=function(k){var j=A();return e(j[0],j[j.length-1],k??10)},d.tickFormat=function(k,j){return j==null?w:u(j)},d.nice=function(k){var j=A();return(!k||typeof k.range!="function")&&(k=t(j[0],j[j.length-1],k??10)),k?A(Xpe(j,k)):d},d.copy=function(){return G2(d,LQ(e,t,n,r,i,s,a,o,c,u))},d}function Mft(){return Ul.apply(LQ(Tht,Iht,jd,FQ,K5,Y2,PQ,TQ,op,ume).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Lft(){return Ul.apply(LQ(Nht,Eht,Bd,MQ,q5,V5,OQ,IQ,op,dme).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function W5(){var e=0,t=1,n,r,i,s,a=ja,o=!1,c;function u(h){return h==null||isNaN(h=+h)?c:a(i===0?.5:(h=(s(h)-n)*i,o?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([e,t]=h,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(h){return arguments.length?(o=!!h,u):o},u.interpolator=function(h){return arguments.length?(a=h,u):a};function d(h){return function(A){var f,p;return arguments.length?([f,p]=A,a=h(f,p),u):[a(0),a(1)]}}return u.range=d(B0),u.rangeRound=d(bQ),u.unknown=function(h){return arguments.length?(c=h,u):c},function(h){return s=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),u}}function oA(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function hme(){var e=aA(W5()(ja));return e.copy=function(){return oA(e,hme())},Dd.apply(e,arguments)}function fme(){var e=_Q(W5()).domain([1,10]);return e.copy=function(){return oA(e,fme()).base(e.base())},Dd.apply(e,arguments)}function Ame(){var e=jQ(W5());return e.copy=function(){return oA(e,Ame()).constant(e.constant())},Dd.apply(e,arguments)}function RQ(){var e=BQ(W5());return e.copy=function(){return oA(e,RQ()).exponent(e.exponent())},Dd.apply(e,arguments)}function Rft(){return RQ.apply(null,arguments).exponent(.5)}function pme(){var e=[],t=ja;function n(r){if(r!=null&&!isNaN(r=+r))return t((q2(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(xf),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>Sdt(e,s/r))},n.copy=function(){return pme(t).domain(e)},Dd.apply(n,arguments)}function G5(){var e=0,t=.5,n=1,r=1,i,s,a,o,c,u=ja,d,h=!1,A;function f(m){return isNaN(m=+m)?A:(m=.5+((m=+d(m))-s)*(r*m<r*s?o:c),u(h?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t,n]=m,i=d(e=+e),s=d(t=+t),a=d(n=+n),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),r=s<i?-1:1,f):[e,t,n]},f.clamp=function(m){return arguments.length?(h=!!m,f):h},f.interpolator=function(m){return arguments.length?(u=m,f):u};function p(m){return function(g){var y,v,x;return arguments.length?([y,v,x]=g,u=Ydt(m,[y,v,x]),f):[u(0),u(.5),u(1)]}}return f.range=p(B0),f.rangeRound=p(bQ),f.unknown=function(m){return arguments.length?(A=m,f):A},function(m){return d=m,i=m(e),s=m(t),a=m(n),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),r=s<i?-1:1,f}}function mme(){var e=aA(G5()(ja));return e.copy=function(){return oA(e,mme())},Dd.apply(e,arguments)}function gme(){var e=_Q(G5()).domain([.1,1,10]);return e.copy=function(){return oA(e,gme()).base(e.base())},Dd.apply(e,arguments)}function yme(){var e=jQ(G5());return e.copy=function(){return oA(e,yme()).constant(e.constant())},Dd.apply(e,arguments)}function DQ(){var e=BQ(G5());return e.copy=function(){return oA(e,DQ()).exponent(e.exponent())},Dd.apply(e,arguments)}function Dft(){return DQ.apply(null,arguments).exponent(.5)}const oY=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:C1,scaleDiverging:mme,scaleDivergingLog:gme,scaleDivergingPow:DQ,scaleDivergingSqrt:Dft,scaleDivergingSymlog:yme,scaleIdentity:Ype,scaleImplicit:xL,scaleLinear:JB,scaleLog:Jpe,scaleOrdinal:vQ,scalePoint:tb,scalePow:NQ,scaleQuantile:tme,scaleQuantize:nme,scaleRadial:eme,scaleSequential:hme,scaleSequentialLog:fme,scaleSequentialPow:RQ,scaleSequentialQuantile:pme,scaleSequentialSqrt:Rft,scaleSequentialSymlog:Ame,scaleSqrt:vht,scaleSymlog:Zpe,scaleThreshold:rme,scaleTime:Mft,scaleUtc:Lft,tickFormat:Gpe},Symbol.toStringTag,{value:"Module"}));var Uft=x0;function Hft(e,t,n){for(var r=-1,i=e.length;++r<i;){var s=e[r],a=t(s);if(a!=null&&(o===void 0?a===a&&!Uft(a):n(a,o)))var o=a,c=s}return c}var vme=Hft;function Qft(e,t){return e>t}var $ft=Qft,zft=vme,Vft=$ft,Kft=j0;function qft(e){return e&&e.length?zft(e,Kft,Vft):void 0}var Wft=qft;const Y5=Mn(Wft);function Gft(e,t){return e<t}var Yft=Gft,Xft=vme,Jft=Yft,Zft=j0;function eAt(e){return e&&e.length?Xft(e,Zft,Jft):void 0}var tAt=eAt;const X5=Mn(tAt);var nAt=JH,rAt=sA,iAt=jpe,sAt=ho;function aAt(e,t){var n=sAt(e)?nAt:iAt;return n(e,rAt(t))}var oAt=aAt,lAt=kpe,cAt=oAt;function uAt(e,t){return lAt(cAt(e,t),1)}var dAt=uAt;const hAt=Mn(dAt);var fAt=fQ;function AAt(e,t){return fAt(e,t)}var pAt=AAt;const J5=Mn(pAt);var N0=1e9,mAt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},HQ,Vr=!0,Fl="[DecimalError] ",Fp=Fl+"Invalid argument: ",UQ=Fl+"Exponent out of range: ",E0=Math.floor,HA=Math.pow,gAt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Po,ss=1e7,Mr=7,xme=9007199254740991,nN=E0(xme/Mr),vt={};vt.absoluteValue=vt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};vt.comparedTo=vt.cmp=function(e){var t,n,r,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};vt.decimalPlaces=vt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Mr;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};vt.dividedBy=vt.div=function(e){return pd(this,new this.constructor(e))};vt.dividedToIntegerBy=vt.idiv=function(e){var t=this,n=t.constructor;return pr(pd(t,new n(e),0,1),n.precision)};vt.equals=vt.eq=function(e){return!this.cmp(e)};vt.exponent=function(){return Ri(this)};vt.greaterThan=vt.gt=function(e){return this.cmp(e)>0};vt.greaterThanOrEqualTo=vt.gte=function(e){return this.cmp(e)>=0};vt.isInteger=vt.isint=function(){return this.e>this.d.length-2};vt.isNegative=vt.isneg=function(){return this.s<0};vt.isPositive=vt.ispos=function(){return this.s>0};vt.isZero=function(){return this.s===0};vt.lessThan=vt.lt=function(e){return this.cmp(e)<0};vt.lessThanOrEqualTo=vt.lte=function(e){return this.cmp(e)<1};vt.logarithm=vt.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Po))throw Error(Fl+"NaN");if(n.s<1)throw Error(Fl+(n.s?"NaN":"-Infinity"));return n.eq(Po)?new r(0):(Vr=!1,t=pd(B1(n,s),B1(e,s),s),Vr=!0,pr(t,i))};vt.minus=vt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Cme(t,e):wme(t,(e.s=-e.s,e))};vt.modulo=vt.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Fl+"NaN");return n.s?(Vr=!1,t=pd(n,e,0,1).times(e),Vr=!0,n.minus(t)):pr(new r(n),i)};vt.naturalExponential=vt.exp=function(){return bme(this)};vt.naturalLogarithm=vt.ln=function(){return B1(this)};vt.negated=vt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};vt.plus=vt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?wme(t,e):Cme(t,(e.s=-e.s,e))};vt.precision=vt.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Fp+e);if(t=Ri(i)+1,r=i.d.length-1,n=r*Mr+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};vt.squareRoot=vt.sqrt=function(){var e,t,n,r,i,s,a,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(Fl+"NaN")}for(e=Ri(o),Vr=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=iu(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=E0((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=a=n+3;;)if(s=r,r=s.plus(pd(o,s,a+2)).times(.5),iu(s.d).slice(0,a)===(t=iu(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(pr(s,n+1,0),s.times(s).eq(o)){r=s;break}}else if(t!="9999")break;a+=4}return Vr=!0,pr(r,n)};vt.times=vt.mul=function(e){var t,n,r,i,s,a,o,c,u,d=this,h=d.constructor,A=d.d,f=(e=new h(e)).d;if(!d.s||!e.s)return new h(0);for(e.s*=d.s,n=d.e+e.e,c=A.length,u=f.length,c<u&&(s=A,A=f,f=s,a=c,c=u,u=a),s=[],a=c+u,r=a;r--;)s.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)o=s[i]+f[r]*A[i-r-1]+t,s[i--]=o%ss|0,t=o/ss|0;s[i]=(s[i]+t)%ss|0}for(;!s[--a];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,Vr?pr(e,h.precision):e};vt.toDecimalPlaces=vt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(vu(e,0,N0),t===void 0?t=r.rounding:vu(t,0,8),pr(n,e+Ri(n)+1,t))};vt.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=om(r,!0):(vu(e,0,N0),t===void 0?t=i.rounding:vu(t,0,8),r=pr(new i(r),e+1,t),n=om(r,!0,e+1)),n};vt.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?om(i):(vu(e,0,N0),t===void 0?t=s.rounding:vu(t,0,8),r=pr(new s(i),e+Ri(i)+1,t),n=om(r.abs(),!1,e+Ri(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};vt.toInteger=vt.toint=function(){var e=this,t=e.constructor;return pr(new t(e),Ri(e)+1,t.rounding)};vt.toNumber=function(){return+this};vt.toPower=vt.pow=function(e){var t,n,r,i,s,a,o=this,c=o.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Po);if(o=new c(o),!o.s){if(e.s<1)throw Error(Fl+"Infinity");return o}if(o.eq(Po))return o;if(r=c.precision,e.eq(Po))return pr(o,r);if(t=e.e,n=e.d.length-1,a=t>=n,s=o.s,a){if((n=d<0?-d:d)<=xme){for(i=new c(Po),t=Math.ceil(r/Mr+4),Vr=!1;n%2&&(i=i.times(o),cY(i.d,t)),n=E0(n/2),n!==0;)o=o.times(o),cY(o.d,t);return Vr=!0,e.s<0?new c(Po).div(i):pr(i,r)}}else if(s<0)throw Error(Fl+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,o.s=1,Vr=!1,i=e.times(B1(o,r+u)),Vr=!0,i=bme(i),i.s=s,i};vt.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=Ri(i),r=om(i,n<=s.toExpNeg||n>=s.toExpPos)):(vu(e,1,N0),t===void 0?t=s.rounding:vu(t,0,8),i=pr(new s(i),e,t),n=Ri(i),r=om(i,e<=n||n<=s.toExpNeg,e)),r};vt.toSignificantDigits=vt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(vu(e,1,N0),t===void 0?t=r.rounding:vu(t,0,8)),pr(new r(n),e,t)};vt.toString=vt.valueOf=vt.val=vt.toJSON=vt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ri(e),n=e.constructor;return om(e,t<=n.toExpNeg||t>=n.toExpPos)};function wme(e,t){var n,r,i,s,a,o,c,u,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Vr?pr(t,h):t;if(c=e.d,u=t.d,a=e.e,i=t.e,c=c.slice(),s=a-i,s){for(s<0?(r=c,s=-s,o=u.length):(r=u,i=a,o=c.length),a=Math.ceil(h/Mr),o=a>o?a+1:o+1,s>o&&(s=o,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(o=c.length,s=u.length,o-s<0&&(s=o,r=u,u=c,c=r),n=0;s;)n=(c[--s]=c[s]+u[s]+n)/ss|0,c[s]%=ss;for(n&&(c.unshift(n),++i),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=i,Vr?pr(t,h):t}function vu(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Fp+e)}function iu(e){var t,n,r,i=e.length-1,s="",a=e[0];if(i>0){for(s+=a,t=1;t<i;t++)r=e[t]+"",n=Mr-r.length,n&&(s+=Ch(n)),s+=r;a=e[t],r=a+"",n=Mr-r.length,n&&(s+=Ch(n))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var pd=function(){function e(r,i){var s,a=0,o=r.length;for(r=r.slice();o--;)s=r[o]*i+a,r[o]=s%ss|0,a=s/ss|0;return a&&r.unshift(a),r}function t(r,i,s,a){var o,c;if(s!=a)c=s>a?1:-1;else for(o=c=0;o<s;o++)if(r[o]!=i[o]){c=r[o]>i[o]?1:-1;break}return c}function n(r,i,s){for(var a=0;s--;)r[s]-=a,a=r[s]<i[s]?1:0,r[s]=a*ss+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,a){var o,c,u,d,h,A,f,p,m,g,y,v,x,b,w,k,j,B,E=r.constructor,P=r.s==i.s?1:-1,T=r.d,N=i.d;if(!r.s)return new E(r);if(!i.s)throw Error(Fl+"Division by zero");for(c=r.e-i.e,j=N.length,w=T.length,f=new E(P),p=f.d=[],u=0;N[u]==(T[u]||0);)++u;if(N[u]>(T[u]||0)&&--c,s==null?v=s=E.precision:a?v=s+(Ri(r)-Ri(i))+1:v=s,v<0)return new E(0);if(v=v/Mr+2|0,u=0,j==1)for(d=0,N=N[0],v++;(u<w||d)&&v--;u++)x=d*ss+(T[u]||0),p[u]=x/N|0,d=x%N|0;else{for(d=ss/(N[0]+1)|0,d>1&&(N=e(N,d),T=e(T,d),j=N.length,w=T.length),b=j,m=T.slice(0,j),g=m.length;g<j;)m[g++]=0;B=N.slice(),B.unshift(0),k=N[0],N[1]>=ss/2&&++k;do d=0,o=t(N,m,j,g),o<0?(y=m[0],j!=g&&(y=y*ss+(m[1]||0)),d=y/k|0,d>1?(d>=ss&&(d=ss-1),h=e(N,d),A=h.length,g=m.length,o=t(h,m,A,g),o==1&&(d--,n(h,j<A?B:N,A))):(d==0&&(o=d=1),h=N.slice()),A=h.length,A<g&&h.unshift(0),n(m,h,g),o==-1&&(g=m.length,o=t(N,m,j,g),o<1&&(d++,n(m,j<g?B:N,g))),g=m.length):o===0&&(d++,m=[0]),p[u++]=d,o&&m[0]?m[g++]=T[b]||0:(m=[T[b]],g=1);while((b++<w||m[0]!==void 0)&&v--)}return p[0]||p.shift(),f.e=c,pr(f,a?s+Ri(f)+1:s)}}();function bme(e,t){var n,r,i,s,a,o,c=0,u=0,d=e.constructor,h=d.precision;if(Ri(e)>16)throw Error(UQ+Ri(e));if(!e.s)return new d(Po);for(t==null?(Vr=!1,o=h):o=t,a=new d(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(r=Math.log(HA(2,u))/Math.LN10*2+5|0,o+=r,n=i=s=new d(Po),d.precision=o;;){if(i=pr(i.times(e),o),n=n.times(++c),a=s.plus(pd(i,n,o)),iu(a.d).slice(0,o)===iu(s.d).slice(0,o)){for(;u--;)s=pr(s.times(s),o);return d.precision=h,t==null?(Vr=!0,pr(s,h)):s}s=a}}function Ri(e){for(var t=e.e*Mr,n=e.d[0];n>=10;n/=10)t++;return t}function I4(e,t,n){if(t>e.LN10.sd())throw Vr=!0,n&&(e.precision=n),Error(Fl+"LN10 precision limit exceeded");return pr(new e(e.LN10),t)}function Ch(e){for(var t="";e--;)t+="0";return t}function B1(e,t){var n,r,i,s,a,o,c,u,d,h=1,A=10,f=e,p=f.d,m=f.constructor,g=m.precision;if(f.s<1)throw Error(Fl+(f.s?"NaN":"-Infinity"));if(f.eq(Po))return new m(0);if(t==null?(Vr=!1,u=g):u=t,f.eq(10))return t==null&&(Vr=!0),I4(m,u);if(u+=A,m.precision=u,n=iu(p),r=n.charAt(0),s=Ri(f),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)f=f.times(e),n=iu(f.d),r=n.charAt(0),h++;s=Ri(f),r>1?(f=new m("0."+n),s++):f=new m(r+"."+n.slice(1))}else return c=I4(m,u+2,g).times(s+""),f=B1(new m(r+"."+n.slice(1)),u-A).plus(c),m.precision=g,t==null?(Vr=!0,pr(f,g)):f;for(o=a=f=pd(f.minus(Po),f.plus(Po),u),d=pr(f.times(f),u),i=3;;){if(a=pr(a.times(d),u),c=o.plus(pd(a,new m(i),u)),iu(c.d).slice(0,u)===iu(o.d).slice(0,u))return o=o.times(2),s!==0&&(o=o.plus(I4(m,u+2,g).times(s+""))),o=pd(o,new m(h),u),m.precision=g,t==null?(Vr=!0,pr(o,g)):o;o=c,i+=2}}function lY(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=E0(n/Mr),e.d=[],r=(n+1)%Mr,n<0&&(r+=Mr),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Mr;r<i;)e.d.push(+t.slice(r,r+=Mr));t=t.slice(r),r=Mr-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Vr&&(e.e>nN||e.e<-nN))throw Error(UQ+n)}else e.s=0,e.e=0,e.d=[0];return e}function pr(e,t,n){var r,i,s,a,o,c,u,d,h=e.d;for(a=1,s=h[0];s>=10;s/=10)a++;if(r=t-a,r<0)r+=Mr,i=t,u=h[d=0];else{if(d=Math.ceil((r+1)/Mr),s=h.length,d>=s)return e;for(u=s=h[d],a=1;s>=10;s/=10)a++;r%=Mr,i=r-Mr+a}if(n!==void 0&&(s=HA(10,a-i-1),o=u/s%10|0,c=t<0||h[d+1]!==void 0||u%s,c=n<4?(o||c)&&(n==0||n==(e.s<0?3:2)):o>5||o==5&&(n==4||c||n==6&&(r>0?i>0?u/HA(10,a-i):0:h[d-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return c?(s=Ri(e),h.length=1,t=t-s-1,h[0]=HA(10,(Mr-t%Mr)%Mr),e.e=E0(-t/Mr)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(r==0?(h.length=d,s=1,d--):(h.length=d+1,s=HA(10,Mr-r),h[d]=i>0?(u/HA(10,a-i)%HA(10,i)|0)*s:0),c)for(;;)if(d==0){(h[0]+=s)==ss&&(h[0]=1,++e.e);break}else{if(h[d]+=s,h[d]!=ss)break;h[d--]=0,s=1}for(r=h.length;h[--r]===0;)h.pop();if(Vr&&(e.e>nN||e.e<-nN))throw Error(UQ+Ri(e));return e}function Cme(e,t){var n,r,i,s,a,o,c,u,d,h,A=e.constructor,f=A.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new A(e),Vr?pr(t,f):t;if(c=e.d,h=t.d,r=t.e,u=e.e,c=c.slice(),a=u-r,a){for(d=a<0,d?(n=c,a=-a,o=h.length):(n=h,r=u,o=c.length),i=Math.max(Math.ceil(f/Mr),o)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=c.length,o=h.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){d=c[i]<h[i];break}a=0}for(d&&(n=c,c=h,h=n,t.s=-t.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>a;){if(c[--i]<h[i]){for(s=i;s&&c[--s]===0;)c[s]=ss-1;--c[s],c[i]+=ss}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Vr?pr(t,f):t):new A(0)}function om(e,t,n){var r,i=Ri(e),s=iu(e.d),a=s.length;return t?(n&&(r=n-a)>0?s=s.charAt(0)+"."+s.slice(1)+Ch(r):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Ch(-i-1)+s,n&&(r=n-a)>0&&(s+=Ch(r))):i>=a?(s+=Ch(i+1-a),n&&(r=n-i-1)>0&&(s=s+"."+Ch(r))):((r=i+1)<a&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(s+="."),s+=Ch(r))),e.s<0?"-"+s:s}function cY(e,t){if(e.length>t)return e.length=t,!0}function Sme(e){var t,n,r;function i(s){var a=this;if(!(a instanceof i))return new i(s);if(a.constructor=i,s instanceof i){a.s=s.s,a.e=s.e,a.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Fp+s);if(s>0)a.s=1;else if(s<0)s=-s,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(s===~~s&&s<1e7){a.e=0,a.d=[s];return}return lY(a,s.toString())}else if(typeof s!="string")throw Error(Fp+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,gAt.test(s))lY(a,s);else throw Error(Fp+s)}if(i.prototype=vt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Sme,i.config=i.set=yAt,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function yAt(e){if(!e||typeof e!="object")throw Error(Fl+"Object expected");var t,n,r,i=["precision",1,N0,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(E0(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Fp+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Fp+n+": "+r);return this}var HQ=Sme(mAt);Po=new HQ(1);const ir=HQ;function vAt(e){return CAt(e)||bAt(e)||wAt(e)||xAt()}function xAt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wAt(e,t){if(e){if(typeof e=="string")return SL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SL(e,t)}}function bAt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function CAt(e){if(Array.isArray(e))return SL(e)}function SL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var SAt=function(t){return t},kme={"@@functional/placeholder":!0},_me=function(t){return t===kme},uY=function(t){return function n(){return arguments.length===0||arguments.length===1&&_me(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},kAt=function e(t,n){return t===1?n:uY(function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var a=i.filter(function(o){return o!==kme}).length;return a>=t?n.apply(void 0,i):e(t-a,uY(function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];var d=i.map(function(h){return _me(h)?c.shift():h});return n.apply(void 0,vAt(d).concat(c))}))})},Z5=function(t){return kAt(t.length,t)},kL=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},_At=Z5(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),jAt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return SAt;var i=n.reverse(),s=i[0],a=i.slice(1);return function(){return a.reduce(function(o,c){return c(o)},s.apply(void 0,arguments))}},_L=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},jme=function(t){var n=null,r=null;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return n&&s.every(function(o,c){return o===n[c]})||(n=s,r=t.apply(void 0,s)),r}};function BAt(e){var t;return e===0?t=1:t=Math.floor(new ir(e).abs().log(10).toNumber())+1,t}function NAt(e,t,n){for(var r=new ir(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var EAt=Z5(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),TAt=Z5(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),IAt=Z5(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const eT={rangeStep:NAt,getDigitCount:BAt,interpolateNumber:EAt,uninterpolateNumber:TAt,uninterpolateTruncation:IAt};function jL(e){return FAt(e)||OAt(e)||Bme(e)||PAt()}function PAt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OAt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function FAt(e){if(Array.isArray(e))return BL(e)}function N1(e,t){return RAt(e)||LAt(e,t)||Bme(e,t)||MAt()}function MAt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bme(e,t){if(e){if(typeof e=="string")return BL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BL(e,t)}}function BL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LAt(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,s=void 0;try{for(var a=e[Symbol.iterator](),o;!(r=(o=a.next()).done)&&(n.push(o.value),!(t&&n.length===t));r=!0);}catch(c){i=!0,s=c}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw s}}return n}}function RAt(e){if(Array.isArray(e))return e}function Nme(e){var t=N1(e,2),n=t[0],r=t[1],i=n,s=r;return n>r&&(i=r,s=n),[i,s]}function Eme(e,t,n){if(e.lte(0))return new ir(0);var r=eT.getDigitCount(e.toNumber()),i=new ir(10).pow(r),s=e.div(i),a=r!==1?.05:.1,o=new ir(Math.ceil(s.div(a).toNumber())).add(n).mul(a),c=o.mul(i);return t?c:new ir(Math.ceil(c))}function DAt(e,t,n){var r=1,i=new ir(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new ir(10).pow(eT.getDigitCount(e)-1),i=new ir(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new ir(Math.floor(e)))}else e===0?i=new ir(Math.floor((t-1)/2)):n||(i=new ir(Math.floor(e)));var a=Math.floor((t-1)/2),o=jAt(_At(function(c){return i.add(new ir(c-a).mul(r)).toNumber()}),kL);return o(0,t)}function Tme(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new ir(0),tickMin:new ir(0),tickMax:new ir(0)};var s=Eme(new ir(t).sub(e).div(n-1),r,i),a;e<=0&&t>=0?a=new ir(0):(a=new ir(e).add(t).div(2),a=a.sub(new ir(a).mod(s)));var o=Math.ceil(a.sub(e).div(s).toNumber()),c=Math.ceil(new ir(t).sub(a).div(s).toNumber()),u=o+c+1;return u>n?Tme(e,t,n,r,i+1):(u<n&&(c=t>0?c+(n-u):c,o=t>0?o:o+(n-u)),{step:s,tickMin:a.sub(new ir(o).mul(s)),tickMax:a.add(new ir(c).mul(s))})}function UAt(e){var t=N1(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),o=Nme([n,r]),c=N1(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var h=d===1/0?[u].concat(jL(kL(0,i-1).map(function(){return 1/0}))):[].concat(jL(kL(0,i-1).map(function(){return-1/0})),[d]);return n>r?_L(h):h}if(u===d)return DAt(u,i,s);var A=Tme(u,d,a,s),f=A.step,p=A.tickMin,m=A.tickMax,g=eT.rangeStep(p,m.add(new ir(.1).mul(f)),f);return n>r?_L(g):g}function HAt(e,t){var n=N1(e,2),r=n[0],i=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Nme([r,i]),o=N1(a,2),c=o[0],u=o[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(t,2),h=Eme(new ir(u).sub(c).div(d-1),s,0),A=[].concat(jL(eT.rangeStep(new ir(c),new ir(u).sub(new ir(.99).mul(h)),h)),[u]);return r>i?_L(A):A}var QAt=jme(UAt),$At=jme(HAt),zAt="Invariant failed";function lm(e,t){throw new Error(zAt)}var VAt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Iv(e){"@babel/helpers - typeof";return Iv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iv(e)}function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rN.apply(this,arguments)}function KAt(e,t){return YAt(e)||GAt(e,t)||WAt(e,t)||qAt()}function qAt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WAt(e,t){if(e){if(typeof e=="string")return dY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dY(e,t)}}function dY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GAt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function YAt(e){if(Array.isArray(e))return e}function XAt(e,t){if(e==null)return{};var n=JAt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JAt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ZAt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ept(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ome(r.key),r)}}function tpt(e,t,n){return t&&ept(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function npt(e,t,n){return t=iN(t),rpt(e,Ime()?Reflect.construct(t,n||[],iN(e).constructor):t.apply(e,n))}function rpt(e,t){if(t&&(Iv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ipt(e)}function ipt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ime(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ime=function(){return!!e})()}function iN(e){return iN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},iN(e)}function spt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NL(e,t)}function NL(e,t){return NL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},NL(e,t)}function Pme(e,t,n){return t=Ome(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ome(e){var t=apt(e,"string");return Iv(t)=="symbol"?t:t+""}function apt(e,t){if(Iv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Iv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var X2=function(e){function t(){return ZAt(this,t),npt(this,t,arguments)}return spt(t,e),tpt(t,[{key:"render",value:function(){var r=this.props,i=r.offset,s=r.layout,a=r.width,o=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,h=r.yAxis,A=XAt(r,VAt),f=Tn(A,!1);this.props.direction==="x"&&d.type!=="number"&&lm();var p=c.map(function(m){var g=u(m,o),y=g.x,v=g.y,x=g.value,b=g.errorVal;if(!b)return null;var w=[],k,j;if(Array.isArray(b)){var B=KAt(b,2);k=B[0],j=B[1]}else k=j=b;if(s==="vertical"){var E=d.scale,P=v+i,T=P+a,N=P-a,F=E(x-k),L=E(x+j);w.push({x1:L,y1:T,x2:L,y2:N}),w.push({x1:F,y1:P,x2:L,y2:P}),w.push({x1:F,y1:T,x2:F,y2:N})}else if(s==="horizontal"){var U=h.scale,H=y+i,W=H-a,$=H+a,z=U(x-k),Q=U(x+j);w.push({x1:W,y1:Q,x2:$,y2:Q}),w.push({x1:H,y1:z,x2:H,y2:Q}),w.push({x1:W,y1:z,x2:$,y2:z})}return re.createElement(Si,rN({className:"recharts-errorBar",key:"bar-".concat(w.map(function(ce){return"".concat(ce.x1,"-").concat(ce.x2,"-").concat(ce.y1,"-").concat(ce.y2)}))},f),w.map(function(ce){return re.createElement("line",rN({},ce,{key:"line-".concat(ce.x1,"-").concat(ce.x2,"-").concat(ce.y1,"-").concat(ce.y2)}))}))});return re.createElement(Si,{className:"recharts-errorBars"},p)}}])}(re.Component);Pme(X2,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});Pme(X2,"displayName","ErrorBar");function E1(e){"@babel/helpers - typeof";return E1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E1(e)}function hY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hY(Object(n),!0).forEach(function(r){opt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function opt(e,t,n){return t=lpt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lpt(e){var t=cpt(e,"string");return E1(t)=="symbol"?t:t+""}function cpt(e,t){if(E1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(E1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fme=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,s=t.legendContent,a=Eo(n,Pp);if(!a)return null;var o=Pp.defaultProps,c=o!==void 0?EA(EA({},o),a.props):{},u;return a.props&&a.props.payload?u=a.props&&a.props.payload:s==="children"?u=(r||[]).reduce(function(d,h){var A=h.item,f=h.props,p=f.sectors||f.data||[];return d.concat(p.map(function(m){return{type:a.props.iconType||A.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var h=d.item,A=h.type.defaultProps,f=A!==void 0?EA(EA({},A),h.props):{},p=f.dataKey,m=f.name,g=f.legendType,y=f.hide;return{inactive:y,dataKey:p,type:c.iconType||g||"square",color:QQ(h),value:m||p,payload:f}}),EA(EA(EA({},c),Pp.getWithHeight(a,i)),{},{payload:u,item:a})};function T1(e){"@babel/helpers - typeof";return T1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T1(e)}function fY(e){return fpt(e)||hpt(e)||dpt(e)||upt()}function upt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dpt(e,t){if(e){if(typeof e=="string")return EL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EL(e,t)}}function hpt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fpt(e){if(Array.isArray(e))return EL(e)}function EL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function AY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AY(Object(n),!0).forEach(function(r){Fy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fy(e,t,n){return t=Apt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Apt(e){var t=ppt(e,"string");return T1(t)=="symbol"?t:t+""}function ppt(e,t){if(T1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(T1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zo(e,t,n){return _n(e)||_n(t)?n:Ji(t)?El(e,t,n):yn(t)?t(e):n}function nb(e,t,n,r){var i=hAt(e,function(o){return zo(o,t)});if(n==="number"){var s=i.filter(function(o){return tt(o)||parseFloat(o)});return s.length?[X5(s),Y5(s)]:[1/0,-1/0]}var a=r?i.filter(function(o){return!_n(o)}):i;return a.map(function(o){return Ji(o)||o instanceof Date?o:""})}var mpt=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,a=-1,o=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(o<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<o;u++){var d=u>0?i[u-1].coordinate:i[o-1].coordinate,h=i[u].coordinate,A=u>=o-1?i[0].coordinate:i[u+1].coordinate,f=void 0;if(pc(h-d)!==pc(A-h)){var p=[];if(pc(A-h)===pc(c[1]-c[0])){f=A;var m=h+c[1]-c[0];p[0]=Math.min(m,(m+d)/2),p[1]=Math.max(m,(m+d)/2)}else{f=d;var g=A+c[1]-c[0];p[0]=Math.min(h,(g+h)/2),p[1]=Math.max(h,(g+h)/2)}var y=[Math.min(h,(f+h)/2),Math.max(h,(f+h)/2)];if(t>y[0]&&t<=y[1]||t>=p[0]&&t<=p[1]){a=i[u].index;break}}else{var v=Math.min(d,A),x=Math.max(d,A);if(t>(v+h)/2&&t<=(x+h)/2){a=i[u].index;break}}}else for(var b=0;b<o;b++)if(b===0&&t<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<o-1&&t>(r[b].coordinate+r[b-1].coordinate)/2&&t<=(r[b].coordinate+r[b+1].coordinate)/2||b===o-1&&t>(r[b].coordinate+r[b-1].coordinate)/2){a=r[b].index;break}return a},QQ=function(t){var n,r=t,i=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?ui(ui({},t.type.defaultProps),t.props):t.props,a=s.stroke,o=s.fill,c;switch(i){case"Line":c=a;break;case"Area":case"Radar":c=a&&a!=="none"?a:o;break;default:c=o;break}return c},gpt=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var a={},o=Object.keys(s),c=0,u=o.length;c<u;c++)for(var d=s[o[c]].stackGroups,h=Object.keys(d),A=0,f=h.length;A<f;A++){var p=d[h[A]],m=p.items,g=p.cateAxisId,y=m.filter(function(j){return hd(j.type).indexOf("Bar")>=0});if(y&&y.length){var v=y[0].type.defaultProps,x=v!==void 0?ui(ui({},v),y[0].props):y[0].props,b=x.barSize,w=x[g];a[w]||(a[w]=[]);var k=_n(b)?n:b;a[w].push({item:y[0],stackList:y.slice(1),barSize:_n(k)?void 0:am(k,r,0)})}}return a},ypt=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,s=t.sizeList,a=s===void 0?[]:s,o=t.maxBarSize,c=a.length;if(c<1)return null;var u=am(n,i,0,!0),d,h=[];if(a[0].barSize===+a[0].barSize){var A=!1,f=i/c,p=a.reduce(function(b,w){return b+w.barSize||0},0);p+=(c-1)*u,p>=i&&(p-=(c-1)*u,u=0),p>=i&&f>0&&(A=!0,f*=.9,p=c*f);var m=(i-p)/2>>0,g={offset:m-u,size:0};d=a.reduce(function(b,w){var k={item:w.item,position:{offset:g.offset+g.size+u,size:A?f:w.barSize}},j=[].concat(fY(b),[k]);return g=j[j.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(B){j.push({item:B,position:g})}),j},h)}else{var y=am(r,i,0,!0);i-2*y-(c-1)*u<=0&&(u=0);var v=(i-2*y-(c-1)*u)/c;v>1&&(v>>=0);var x=o===+o?Math.min(v,o):v;d=a.reduce(function(b,w,k){var j=[].concat(fY(b),[{item:w.item,position:{offset:y+(v+u)*k+(v-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(B){j.push({item:B,position:j[j.length-1].position})}),j},h)}return d},vpt=function(t,n,r,i){var s=r.children,a=r.width,o=r.margin,c=a-(o.left||0)-(o.right||0),u=Fme({children:s,legendWidth:c});if(u){var d=i||{},h=d.width,A=d.height,f=u.align,p=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&f!=="center"&&tt(t[f]))return ui(ui({},t),{},Fy({},f,t[f]+(h||0)));if((m==="horizontal"||m==="vertical"&&f==="center")&&p!=="middle"&&tt(t[p]))return ui(ui({},t),{},Fy({},p,t[p]+(A||0)))}return t},xpt=function(t,n,r){return _n(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Mme=function(t,n,r,i,s){var a=n.props.children,o=Tl(a,X2).filter(function(u){return xpt(i,s,u.props.direction)});if(o&&o.length){var c=o.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var h=zo(d,r);if(_n(h))return u;var A=Array.isArray(h)?[X5(h),Y5(h)]:[h,h],f=c.reduce(function(p,m){var g=zo(d,m,0),y=A[0]-Math.abs(Array.isArray(g)?g[0]:g),v=A[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(y,p[0]),Math.max(v,p[1])]},[1/0,-1/0]);return[Math.min(f[0],u[0]),Math.max(f[1],u[1])]},[1/0,-1/0])}return null},wpt=function(t,n,r,i,s){var a=n.map(function(o){return Mme(t,o,r,s,i)}).filter(function(o){return!_n(o)});return a&&a.length?a.reduce(function(o,c){return[Math.min(o[0],c[0]),Math.max(o[1],c[1])]},[1/0,-1/0]):null},Lme=function(t,n,r,i,s){var a=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&Mme(t,c,u,i)||nb(t,u,r,s)});if(r==="number")return a.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var o={};return a.reduce(function(c,u){for(var d=0,h=u.length;d<h;d++)o[u[d]]||(o[u[d]]=!0,c.push(u[d]));return c},[])},Rme=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Dme=function(t,n,r,i){if(i)return t.map(function(c){return c.coordinate});var s,a,o=t.map(function(c){return c.coordinate===n&&(s=!0),c.coordinate===r&&(a=!0),c.coordinate});return s||o.push(n),a||o.push(r),o},cd=function(t,n,r){if(!t)return null;var i=t.scale,s=t.duplicateDomain,a=t.type,o=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&a==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(o==null?void 0:o.length)>=2?pc(o[0]-o[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(h){var A=s?s.indexOf(h):h;return{coordinate:i(A)+u,value:h,offset:u}});return d.filter(function(h){return!z2(h.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(h,A){return{coordinate:i(h)+u,value:h,index:A,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(h){return{coordinate:i(h)+u,value:h,offset:u}}):i.domain().map(function(h,A){return{coordinate:i(h)+u,value:s?s[h]:h,index:A,offset:u}})},P4=new WeakMap,XS=function(t,n){if(typeof n!="function")return t;P4.has(t)||P4.set(t,new WeakMap);var r=P4.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},bpt=function(t,n,r){var i=t.scale,s=t.type,a=t.layout,o=t.axisType;if(i==="auto")return a==="radial"&&o==="radiusAxis"?{scale:C1(),realScaleType:"band"}:a==="radial"&&o==="angleAxis"?{scale:JB(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:tb(),realScaleType:"point"}:s==="category"?{scale:C1(),realScaleType:"band"}:{scale:JB(),realScaleType:"linear"};if($2(i)){var c="scale".concat(L5(i));return{scale:(oY[c]||tb)(),realScaleType:oY[c]?c:"point"}}return yn(i)?{scale:i}:{scale:tb(),realScaleType:"point"}},pY=1e-4,Cpt=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),s=Math.min(i[0],i[1])-pY,a=Math.max(i[0],i[1])+pY,o=t(n[0]),c=t(n[r-1]);(o<s||o>a||c<s||c>a)&&t.domain([n[0],n[r-1]])}},Spt=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},kpt=function(t,n){if(!n||n.length!==2||!tt(n[0])||!tt(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),s=[t[0],t[1]];return(!tt(t[0])||t[0]<r)&&(s[0]=r),(!tt(t[1])||t[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<r&&(s[1]=r),s},_pt=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var s=0,a=0,o=0;o<n;++o){var c=z2(t[o][r][1])?t[o][r][0]:t[o][r][1];c>=0?(t[o][r][0]=s,t[o][r][1]=s+c,s=t[o][r][1]):(t[o][r][0]=a,t[o][r][1]=a+c,a=t[o][r][1])}},jpt=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var s=0,a=0;a<n;++a){var o=z2(t[a][r][1])?t[a][r][0]:t[a][r][1];o>=0?(t[a][r][0]=s,t[a][r][1]=s+o,s=t[a][r][1]):(t[a][r][0]=0,t[a][r][1]=0)}},Bpt={sign:_pt,expand:$tt,none:Sv,silhouette:ztt,wiggle:Vtt,positive:jpt},Npt=function(t,n,r){var i=n.map(function(o){return o.props.dataKey}),s=Bpt[r],a=Qtt().keys(i).value(function(o,c){return+zo(o,c,0)}).order(tL).offset(s);return a(t)},Ept=function(t,n,r,i,s,a){if(!t)return null;var o=a?n.reverse():n,c={},u=o.reduce(function(h,A){var f,p=(f=A.type)!==null&&f!==void 0&&f.defaultProps?ui(ui({},A.type.defaultProps),A.props):A.props,m=p.stackId,g=p.hide;if(g)return h;var y=p[r],v=h[y]||{hasStack:!1,stackGroups:{}};if(Ji(m)){var x=v.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(A),v.hasStack=!0,v.stackGroups[m]=x}else v.stackGroups[V2("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[A]};return ui(ui({},h),{},Fy({},y,v))},c),d={};return Object.keys(u).reduce(function(h,A){var f=u[A];if(f.hasStack){var p={};f.stackGroups=Object.keys(f.stackGroups).reduce(function(m,g){var y=f.stackGroups[g];return ui(ui({},m),{},Fy({},g,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:Npt(t,y.items,s)}))},p)}return ui(ui({},h),{},Fy({},A,f))},d)},Tpt=function(t,n){var r=n.realScaleType,i=n.type,s=n.tickCount,a=n.originalDomain,o=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=QAt(u,s,o);return t.domain([X5(d),Y5(d)]),{niceTicks:d}}if(s&&i==="number"){var h=t.domain(),A=$At(h,s,o);return{niceTicks:A}}return null};function mY(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,s=e.index,a=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!_n(i[t.dataKey])){var o=NB(n,"value",i[t.dataKey]);if(o)return o.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var c=zo(i,_n(a)?t.dataKey:a);return _n(c)?null:t.scale(c)}var gY=function(t){var n=t.axis,r=t.ticks,i=t.offset,s=t.bandSize,a=t.entry,o=t.index;if(n.type==="category")return r[o]?r[o].coordinate+i:null;var c=zo(a,n.dataKey,n.domain[o]);return _n(c)?null:n.scale(c)-s/2+i},Ipt=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return i<=0&&s>=0?0:s<0?s:i}return r[0]},Ppt=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?ui(ui({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Ji(s)){var a=n[s];if(a){var o=a.items.indexOf(t);return o>=0?a.stackedData[o]:null}}return null},Opt=function(t){return t.reduce(function(n,r){return[X5(r.concat([n[0]]).filter(tt)),Y5(r.concat([n[1]]).filter(tt))]},[1/0,-1/0])},Ume=function(t,n,r){return Object.keys(t).reduce(function(i,s){var a=t[s],o=a.stackedData,c=o.reduce(function(u,d){var h=Opt(d.slice(n,r+1));return[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},yY=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vY=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,TL=function(t,n,r){if(yn(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(tt(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(yY.test(t[0])){var s=+yY.exec(t[0])[1];i[0]=n[0]-s}else yn(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(tt(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(vY.test(t[1])){var a=+vY.exec(t[1])[1];i[1]=n[1]+a}else yn(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},sN=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var s=pQ(n,function(h){return h.coordinate}),a=1/0,o=1,c=s.length;o<c;o++){var u=s[o],d=s[o-1];a=Math.min((u.coordinate||0)-(d.coordinate||0),a)}return a===1/0?0:a}return r?void 0:0},xY=function(t,n,r){return!t||!t.length||J5(t,El(r,"type.defaultProps.domain"))?n:t},Hme=function(t,n){var r=t.type.defaultProps?ui(ui({},t.type.defaultProps),t.props):t.props,i=r.dataKey,s=r.name,a=r.unit,o=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return ui(ui({},Tn(t,!1)),{},{dataKey:i,unit:a,formatter:o,name:s||i,color:QQ(t),value:zo(n,i),type:c,payload:n,chartType:u,hide:d})};function I1(e){"@babel/helpers - typeof";return I1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I1(e)}function wY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wY(Object(n),!0).forEach(function(r){Fpt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fpt(e,t,n){return t=Mpt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mpt(e){var t=Lpt(e,"string");return I1(t)=="symbol"?t:t+""}function Lpt(e,t){if(I1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(I1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aN=Math.PI/180,Rpt=function(t){return t*180/Math.PI},Ts=function(t,n,r,i){return{x:t+Math.cos(-aN*i)*r,y:n+Math.sin(-aN*i)*r}},Dpt=function(t,n){var r=t.x,i=t.y,s=n.x,a=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(i-a,2))},Upt=function(t,n){var r=t.x,i=t.y,s=n.cx,a=n.cy,o=Dpt({x:r,y:i},{x:s,y:a});if(o<=0)return{radius:o};var c=(r-s)/o,u=Math.acos(c);return i>a&&(u=2*Math.PI-u),{radius:o,angle:Rpt(u),angleInRadian:u}},Hpt=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),s=Math.floor(r/360),a=Math.min(i,s);return{startAngle:n-a*360,endAngle:r-a*360}},Qpt=function(t,n){var r=n.startAngle,i=n.endAngle,s=Math.floor(r/360),a=Math.floor(i/360),o=Math.min(s,a);return t+o*360},CY=function(t,n){var r=t.x,i=t.y,s=Upt({x:r,y:i},n),a=s.radius,o=s.angle,c=n.innerRadius,u=n.outerRadius;if(a<c||a>u)return!1;if(a===0)return!0;var d=Hpt(n),h=d.startAngle,A=d.endAngle,f=o,p;if(h<=A){for(;f>A;)f-=360;for(;f<h;)f+=360;p=f>=h&&f<=A}else{for(;f>h;)f-=360;for(;f<A;)f+=360;p=f>=A&&f<=h}return p?bY(bY({},n),{},{radius:a,angle:Qpt(f,n)}):null};function P1(e){"@babel/helpers - typeof";return P1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P1(e)}var $pt=["offset"];function zpt(e){return Wpt(e)||qpt(e)||Kpt(e)||Vpt()}function Vpt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kpt(e,t){if(e){if(typeof e=="string")return IL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IL(e,t)}}function qpt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wpt(e){if(Array.isArray(e))return IL(e)}function IL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gpt(e,t){if(e==null)return{};var n=Ypt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ypt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function SY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SY(Object(n),!0).forEach(function(r){Xpt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xpt(e,t,n){return t=Jpt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jpt(e){var t=Zpt(e,"string");return P1(t)=="symbol"?t:t+""}function Zpt(e,t){if(P1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(P1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function O1(){return O1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O1.apply(this,arguments)}var emt=function(t){var n=t.value,r=t.formatter,i=_n(t.children)?n:t.children;return yn(r)?r(i):i},tmt=function(t,n){var r=pc(n-t),i=Math.min(Math.abs(n-t),360);return r*i},nmt=function(t,n,r){var i=t.position,s=t.viewBox,a=t.offset,o=t.className,c=s,u=c.cx,d=c.cy,h=c.innerRadius,A=c.outerRadius,f=c.startAngle,p=c.endAngle,m=c.clockWise,g=(h+A)/2,y=tmt(f,p),v=y>=0?1:-1,x,b;i==="insideStart"?(x=f+v*a,b=m):i==="insideEnd"?(x=p-v*a,b=!m):i==="end"&&(x=p+v*a,b=m),b=y<=0?b:!b;var w=Ts(u,d,g,x),k=Ts(u,d,g,x+(b?1:-1)*359),j="M".concat(w.x,",").concat(w.y,`
    A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
    `).concat(k.x,",").concat(k.y),B=_n(t.id)?V2("recharts-radial-line-"):t.id;return re.createElement("text",O1({},r,{dominantBaseline:"central",className:Fn("recharts-radial-bar-label",o)}),re.createElement("defs",null,re.createElement("path",{id:B,d:j})),re.createElement("textPath",{xlinkHref:"#".concat(B)},n))},rmt=function(t){var n=t.viewBox,r=t.offset,i=t.position,s=n,a=s.cx,o=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,h=s.endAngle,A=(d+h)/2;if(i==="outside"){var f=Ts(a,o,u+r,A),p=f.x,m=f.y;return{x:p,y:m,textAnchor:p>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"end"};var g=(c+u)/2,y=Ts(a,o,g,A),v=y.x,x=y.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},imt=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,s=t.position,a=n,o=a.x,c=a.y,u=a.width,d=a.height,h=d>=0?1:-1,A=h*i,f=h>0?"end":"start",p=h>0?"start":"end",m=u>=0?1:-1,g=m*i,y=m>0?"end":"start",v=m>0?"start":"end";if(s==="top"){var x={x:o+u/2,y:c-h*i,textAnchor:"middle",verticalAnchor:f};return zi(zi({},x),r?{height:Math.max(c-r.y,0),width:u}:{})}if(s==="bottom"){var b={x:o+u/2,y:c+d+A,textAnchor:"middle",verticalAnchor:p};return zi(zi({},b),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(s==="left"){var w={x:o-g,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return zi(zi({},w),r?{width:Math.max(w.x-r.x,0),height:d}:{})}if(s==="right"){var k={x:o+u+g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return zi(zi({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:d}:{})}var j=r?{width:u,height:d}:{};return s==="insideLeft"?zi({x:o+g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},j):s==="insideRight"?zi({x:o+u-g,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},j):s==="insideTop"?zi({x:o+u/2,y:c+A,textAnchor:"middle",verticalAnchor:p},j):s==="insideBottom"?zi({x:o+u/2,y:c+d-A,textAnchor:"middle",verticalAnchor:f},j):s==="insideTopLeft"?zi({x:o+g,y:c+A,textAnchor:v,verticalAnchor:p},j):s==="insideTopRight"?zi({x:o+u-g,y:c+A,textAnchor:y,verticalAnchor:p},j):s==="insideBottomLeft"?zi({x:o+g,y:c+d-A,textAnchor:v,verticalAnchor:f},j):s==="insideBottomRight"?zi({x:o+u-g,y:c+d-A,textAnchor:y,verticalAnchor:f},j):w0(s)&&(tt(s.x)||sp(s.x))&&(tt(s.y)||sp(s.y))?zi({x:o+am(s.x,u),y:c+am(s.y,d),textAnchor:"end",verticalAnchor:"end"},j):zi({x:o+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},j)},smt=function(t){return"cx"in t&&tt(t.cx)};function Zs(e){var t=e.offset,n=t===void 0?5:t,r=Gpt(e,$pt),i=zi({offset:n},r),s=i.viewBox,a=i.position,o=i.value,c=i.children,u=i.content,d=i.className,h=d===void 0?"":d,A=i.textBreakAll;if(!s||_n(o)&&_n(c)&&!C.isValidElement(u)&&!yn(u))return null;if(C.isValidElement(u))return C.cloneElement(u,i);var f;if(yn(u)){if(f=C.createElement(u,i),C.isValidElement(f))return f}else f=emt(i);var p=smt(s),m=Tn(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return nmt(i,f,m);var g=p?rmt(i):imt(i);return re.createElement(VB,O1({className:Fn("recharts-label",h)},m,g,{breakAll:A}),f)}Zs.displayName="Label";var Qme=function(t){var n=t.cx,r=t.cy,i=t.angle,s=t.startAngle,a=t.endAngle,o=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,h=t.x,A=t.y,f=t.top,p=t.left,m=t.width,g=t.height,y=t.clockWise,v=t.labelViewBox;if(v)return v;if(tt(m)&&tt(g)){if(tt(h)&&tt(A))return{x:h,y:A,width:m,height:g};if(tt(f)&&tt(p))return{x:f,y:p,width:m,height:g}}return tt(h)&&tt(A)?{x:h,y:A,width:0,height:0}:tt(n)&&tt(r)?{cx:n,cy:r,startAngle:s||i||0,endAngle:a||i||0,innerRadius:u||0,outerRadius:d||c||o||0,clockWise:y}:t.viewBox?t.viewBox:{}},amt=function(t,n){return t?t===!0?re.createElement(Zs,{key:"label-implicit",viewBox:n}):Ji(t)?re.createElement(Zs,{key:"label-implicit",viewBox:n,value:t}):C.isValidElement(t)?t.type===Zs?C.cloneElement(t,{key:"label-implicit",viewBox:n}):re.createElement(Zs,{key:"label-implicit",content:t,viewBox:n}):yn(t)?re.createElement(Zs,{key:"label-implicit",content:t,viewBox:n}):w0(t)?re.createElement(Zs,O1({viewBox:n},t,{key:"label-implicit"})):null:null},omt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,s=Qme(t),a=Tl(i,Zs).map(function(c,u){return C.cloneElement(c,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return a;var o=amt(t.label,n||s);return[o].concat(zpt(a))};Zs.parseViewBox=Qme;Zs.renderCallByParent=omt;function lmt(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var cmt=lmt;const umt=Mn(cmt);function F1(e){"@babel/helpers - typeof";return F1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F1(e)}var dmt=["valueAccessor"],hmt=["data","dataKey","clockWise","id","textBreakAll"];function fmt(e){return gmt(e)||mmt(e)||pmt(e)||Amt()}function Amt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pmt(e,t){if(e){if(typeof e=="string")return PL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PL(e,t)}}function mmt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gmt(e){if(Array.isArray(e))return PL(e)}function PL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oN(){return oN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oN.apply(this,arguments)}function kY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kY(Object(n),!0).forEach(function(r){ymt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ymt(e,t,n){return t=vmt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vmt(e){var t=xmt(e,"string");return F1(t)=="symbol"?t:t+""}function xmt(e,t){if(F1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(F1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jY(e,t){if(e==null)return{};var n=wmt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wmt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var bmt=function(t){return Array.isArray(t.value)?umt(t.value):t.value};function wf(e){var t=e.valueAccessor,n=t===void 0?bmt:t,r=jY(e,dmt),i=r.data,s=r.dataKey,a=r.clockWise,o=r.id,c=r.textBreakAll,u=jY(r,hmt);return!i||!i.length?null:re.createElement(Si,{className:"recharts-label-list"},i.map(function(d,h){var A=_n(s)?n(d,h):zo(d&&d.payload,s),f=_n(o)?{}:{id:"".concat(o,"-").concat(h)};return re.createElement(Zs,oN({},Tn(d,!0),u,f,{parentViewBox:d.parentViewBox,value:A,textBreakAll:c,viewBox:Zs.parseViewBox(_n(a)?d:_Y(_Y({},d),{},{clockWise:a})),key:"label-".concat(h),index:h}))}))}wf.displayName="LabelList";function Cmt(e,t){return e?e===!0?re.createElement(wf,{key:"labelList-implicit",data:t}):re.isValidElement(e)||yn(e)?re.createElement(wf,{key:"labelList-implicit",data:t,content:e}):w0(e)?re.createElement(wf,oN({data:t},e,{key:"labelList-implicit"})):null:null}function Smt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Tl(r,wf).map(function(a,o){return C.cloneElement(a,{data:t,key:"labelList-".concat(o)})});if(!n)return i;var s=Cmt(e.label,t);return[s].concat(fmt(i))}wf.renderCallByParent=Smt;function M1(e){"@babel/helpers - typeof";return M1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M1(e)}function OL(){return OL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OL.apply(this,arguments)}function BY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BY(Object(n),!0).forEach(function(r){kmt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kmt(e,t,n){return t=_mt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _mt(e){var t=jmt(e,"string");return M1(t)=="symbol"?t:t+""}function jmt(e,t){if(M1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(M1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bmt=function(t,n){var r=pc(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},JS=function(t){var n=t.cx,r=t.cy,i=t.radius,s=t.angle,a=t.sign,o=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(o?1:-1)+i,h=Math.asin(c/d)/aN,A=u?s:s+a*h,f=Ts(n,r,d,A),p=Ts(n,r,i,A),m=u?s-a*h:s,g=Ts(n,r,d*Math.cos(h*aN),m);return{center:f,circleTangency:p,lineTangency:g,theta:h}},$me=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,a=t.startAngle,o=t.endAngle,c=Bmt(a,o),u=a+c,d=Ts(n,r,s,a),h=Ts(n,r,s,u),A="M ".concat(d.x,",").concat(d.y,`
    A `).concat(s,",").concat(s,`,0,
    `).concat(+(Math.abs(c)>180),",").concat(+(a>u),`,
    `).concat(h.x,",").concat(h.y,`
  `);if(i>0){var f=Ts(n,r,i,a),p=Ts(n,r,i,u);A+="L ".concat(p.x,",").concat(p.y,`
            A `).concat(i,",").concat(i,`,0,
            `).concat(+(Math.abs(c)>180),",").concat(+(a<=u),`,
            `).concat(f.x,",").concat(f.y," Z")}else A+="L ".concat(n,",").concat(r," Z");return A},Nmt=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,a=t.cornerRadius,o=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,h=pc(d-u),A=JS({cx:n,cy:r,radius:s,angle:u,sign:h,cornerRadius:a,cornerIsExternal:c}),f=A.circleTangency,p=A.lineTangency,m=A.theta,g=JS({cx:n,cy:r,radius:s,angle:d,sign:-h,cornerRadius:a,cornerIsExternal:c}),y=g.circleTangency,v=g.lineTangency,x=g.theta,b=c?Math.abs(u-d):Math.abs(u-d)-m-x;if(b<0)return o?"M ".concat(p.x,",").concat(p.y,`
        a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0
        a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0
      `):$me({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d});var w="M ".concat(p.x,",").concat(p.y,`
    A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(f.x,",").concat(f.y,`
    A`).concat(s,",").concat(s,",0,").concat(+(b>180),",").concat(+(h<0),",").concat(y.x,",").concat(y.y,`
    A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(v.x,",").concat(v.y,`
  `);if(i>0){var k=JS({cx:n,cy:r,radius:i,angle:u,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),j=k.circleTangency,B=k.lineTangency,E=k.theta,P=JS({cx:n,cy:r,radius:i,angle:d,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),T=P.circleTangency,N=P.lineTangency,F=P.theta,L=c?Math.abs(u-d):Math.abs(u-d)-E-F;if(L<0&&a===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(N.x,",").concat(N.y,`
      A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(T.x,",").concat(T.y,`
      A`).concat(i,",").concat(i,",0,").concat(+(L>180),",").concat(+(h>0),",").concat(j.x,",").concat(j.y,`
      A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(B.x,",").concat(B.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},Emt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},zme=function(t){var n=NY(NY({},Emt),t),r=n.cx,i=n.cy,s=n.innerRadius,a=n.outerRadius,o=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,h=n.endAngle,A=n.className;if(a<s||d===h)return null;var f=Fn("recharts-sector",A),p=a-s,m=am(o,p,0,!0),g;return m>0&&Math.abs(d-h)<360?g=Nmt({cx:r,cy:i,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:h}):g=$me({cx:r,cy:i,innerRadius:s,outerRadius:a,startAngle:d,endAngle:h}),re.createElement("path",OL({},Tn(n,!0),{className:f,d:g,role:"img"}))};function L1(e){"@babel/helpers - typeof";return L1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L1(e)}function FL(){return FL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FL.apply(this,arguments)}function EY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EY(Object(n),!0).forEach(function(r){Tmt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tmt(e,t,n){return t=Imt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Imt(e){var t=Pmt(e,"string");return L1(t)=="symbol"?t:t+""}function Pmt(e,t){if(L1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(L1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IY={curveBasisClosed:Ttt,curveBasisOpen:Itt,curveBasis:Ett,curveBumpX:mtt,curveBumpY:gtt,curveLinearClosed:Ptt,curveLinear:D5,curveMonotoneX:Ott,curveMonotoneY:Ftt,curveNatural:Mtt,curveStep:Ltt,curveStepAfter:Dtt,curveStepBefore:Rtt},ZS=function(t){return t.x===+t.x&&t.y===+t.y},Lx=function(t){return t.x},Rx=function(t){return t.y},Omt=function(t,n){if(yn(t))return t;var r="curve".concat(L5(t));return(r==="curveMonotone"||r==="curveBump")&&n?IY["".concat(r).concat(n==="vertical"?"Y":"X")]:IY[r]||D5},Fmt=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,s=i===void 0?[]:i,a=t.baseLine,o=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=Omt(r,o),h=u?s.filter(function(m){return ZS(m)}):s,A;if(Array.isArray(a)){var f=u?a.filter(function(m){return ZS(m)}):a,p=h.map(function(m,g){return TY(TY({},m),{},{base:f[g]})});return o==="vertical"?A=$S().y(Rx).x1(Lx).x0(function(m){return m.base.x}):A=$S().x(Lx).y1(Rx).y0(function(m){return m.base.y}),A.defined(ZS).curve(d),A(p)}return o==="vertical"&&tt(a)?A=$S().y(Rx).x1(Lx).x0(a):tt(a)?A=$S().x(Lx).y1(Rx).y0(a):A=zAe().x(Lx).y(Rx),A.defined(ZS).curve(d),A(h)},ML=function(t){var n=t.className,r=t.points,i=t.path,s=t.pathRef;if((!r||!r.length)&&!i)return null;var a=r&&r.length?Fmt(t):i;return re.createElement("path",FL({},Tn(t,!1),EB(t),{className:Fn("recharts-curve",n),d:a,ref:s}))},Vme={exports:{}},Mmt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Lmt=Mmt,Rmt=Lmt;function Kme(){}function qme(){}qme.resetWarningCache=Kme;var Dmt=function(){function e(r,i,s,a,o,c){if(c!==Rmt){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:qme,resetWarningCache:Kme};return n.PropTypes=n,n};Vme.exports=Dmt();var Umt=Vme.exports;const Kn=Mn(Umt);function Hmt(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function PY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(s){n<0&&(n=s),s-n>t?(e(s),n=-1):Hmt(i)};requestAnimationFrame(r)}function LL(e){"@babel/helpers - typeof";return LL=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},LL(e)}function Qmt(e){return Kmt(e)||Vmt(e)||zmt(e)||$mt()}function $mt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zmt(e,t){if(e){if(typeof e=="string")return OY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OY(e,t)}}function OY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vmt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kmt(e){if(Array.isArray(e))return e}function qmt(){var e={},t=function(){return null},n=!1,r=function i(s){if(!n){if(Array.isArray(s)){if(!s.length)return;var a=s,o=Qmt(a),c=o[0],u=o.slice(1);if(typeof c=="number"){PY(i.bind(null,u),c);return}i(c),PY(i.bind(null,u));return}LL(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){n=!0},start:function(s){n=!1,r(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function R1(e){"@babel/helpers - typeof";return R1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R1(e)}function FY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FY(Object(n),!0).forEach(function(r){Wme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wme(e,t,n){return t=Wmt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wmt(e){var t=Gmt(e,"string");return R1(t)==="symbol"?t:String(t)}function Gmt(e,t){if(R1(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(R1(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ymt=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(s){return i.includes(s)})})},Xmt=function(t){return t},Jmt=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},rb=function(t,n){return Object.keys(n).reduce(function(r,i){return MY(MY({},r),{},Wme({},i,t(i,n[i])))},{})},LY=function(t,n,r){return t.map(function(i){return"".concat(Jmt(i)," ").concat(n,"ms ").concat(r)}).join(",")};function Zmt(e,t){return ngt(e)||tgt(e,t)||Gme(e,t)||egt()}function egt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tgt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function ngt(e){if(Array.isArray(e))return e}function rgt(e){return agt(e)||sgt(e)||Gme(e)||igt()}function igt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gme(e,t){if(e){if(typeof e=="string")return RL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RL(e,t)}}function sgt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function agt(e){if(Array.isArray(e))return RL(e)}function RL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lN=1e-4,Yme=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},Xme=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},RY=function(t,n){return function(r){var i=Yme(t,n);return Xme(i,r)}},ogt=function(t,n){return function(r){var i=Yme(t,n),s=[].concat(rgt(i.map(function(a,o){return a*o}).slice(1)),[0]);return Xme(s,r)}},DY=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],s=n[1],a=n[2],o=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,s=0,a=1,o=1;break;case"ease":i=.25,s=.1,a=.25,o=1;break;case"ease-in":i=.42,s=0,a=1,o=1;break;case"ease-out":i=.42,s=0,a=.58,o=1;break;case"ease-in-out":i=0,s=0,a=.58,o=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(g){return parseFloat(g)}),d=Zmt(u,4);i=d[0],s=d[1],a=d[2],o=d[3]}}}var h=RY(i,a),A=RY(s,o),f=ogt(i,a),p=function(y){return y>1?1:y<0?0:y},m=function(y){for(var v=y>1?1:y,x=v,b=0;b<8;++b){var w=h(x)-v,k=f(x);if(Math.abs(w-v)<lN||k<lN)return A(x);x=p(x-w/k)}return A(x)};return m.isStepper=!1,m},lgt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,s=i===void 0?8:i,a=t.dt,o=a===void 0?17:a,c=function(d,h,A){var f=-(d-h)*r,p=A*s,m=A+(f-p)*o/1e3,g=A*o/1e3+d;return Math.abs(g-h)<lN&&Math.abs(m)<lN?[h,0]:[g,m]};return c.isStepper=!0,c.dt=o,c},cgt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return DY(i);case"spring":return lgt();default:if(i.split("(")[0]==="cubic-bezier")return DY(i)}return typeof i=="function"?i:null};function D1(e){"@babel/helpers - typeof";return D1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D1(e)}function UY(e){return hgt(e)||dgt(e)||Jme(e)||ugt()}function ugt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dgt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hgt(e){if(Array.isArray(e))return UL(e)}function HY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HY(Object(n),!0).forEach(function(r){DL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DL(e,t,n){return t=fgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fgt(e){var t=Agt(e,"string");return D1(t)==="symbol"?t:String(t)}function Agt(e,t){if(D1(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(D1(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pgt(e,t){return ygt(e)||ggt(e,t)||Jme(e,t)||mgt()}function mgt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jme(e,t){if(e){if(typeof e=="string")return UL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UL(e,t)}}function UL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ggt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function ygt(e){if(Array.isArray(e))return e}var cN=function(t,n,r){return t+(n-t)*r},HL=function(t){var n=t.from,r=t.to;return n!==r},vgt=function e(t,n,r){var i=rb(function(s,a){if(HL(a)){var o=t(a.from,a.to,a.velocity),c=pgt(o,2),u=c[0],d=c[1];return bs(bs({},a),{},{from:u,velocity:d})}return a},n);return r<1?rb(function(s,a){return HL(a)?bs(bs({},a),{},{velocity:cN(a.velocity,i[s].velocity,r),from:cN(a.from,i[s].from,r)}):a},n):e(t,i,r-1)};const xgt=function(e,t,n,r,i){var s=Ymt(e,t),a=s.reduce(function(g,y){return bs(bs({},g),{},DL({},y,[e[y],t[y]]))},{}),o=s.reduce(function(g,y){return bs(bs({},g),{},DL({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,h=function(){return null},A=function(){return rb(function(y,v){return v.from},o)},f=function(){return!Object.values(o).filter(HL).length},p=function(y){u||(u=y);var v=y-u,x=v/n.dt;o=vgt(n,o,x),i(bs(bs(bs({},e),t),A())),u=y,f()||(c=requestAnimationFrame(h))},m=function(y){d||(d=y);var v=(y-d)/r,x=rb(function(w,k){return cN.apply(void 0,UY(k).concat([n(v)]))},a);if(i(bs(bs(bs({},e),t),x)),v<1)c=requestAnimationFrame(h);else{var b=rb(function(w,k){return cN.apply(void 0,UY(k).concat([n(1)]))},a);i(bs(bs(bs({},e),t),b))}};return h=n.isStepper?p:m,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(c)}}};function Pv(e){"@babel/helpers - typeof";return Pv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pv(e)}var wgt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function bgt(e,t){if(e==null)return{};var n=Cgt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cgt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function O4(e){return jgt(e)||_gt(e)||kgt(e)||Sgt()}function Sgt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kgt(e,t){if(e){if(typeof e=="string")return QL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QL(e,t)}}function _gt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jgt(e){if(Array.isArray(e))return QL(e)}function QL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QY(Object(n),!0).forEach(function(r){uw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uw(e,t,n){return t=Zme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bgt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ngt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zme(r.key),r)}}function Egt(e,t,n){return t&&Ngt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zme(e){var t=Tgt(e,"string");return Pv(t)==="symbol"?t:String(t)}function Tgt(e,t){if(Pv(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Pv(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Igt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$L(e,t)}function $L(e,t){return $L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$L(e,t)}function Pgt(e){var t=Ogt();return function(){var r=uN(e),i;if(t){var s=uN(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return zL(this,i)}}function zL(e,t){if(t&&(Pv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VL(e)}function VL(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ogt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uN(e){return uN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uN(e)}var Nd=function(e){Igt(n,e);var t=Pgt(n);function n(r,i){var s;Bgt(this,n),s=t.call(this,r,i);var a=s.props,o=a.isActive,c=a.attributeName,u=a.from,d=a.to,h=a.steps,A=a.children,f=a.duration;if(s.handleStyleChange=s.handleStyleChange.bind(VL(s)),s.changeStyle=s.changeStyle.bind(VL(s)),!o||f<=0)return s.state={style:{}},typeof A=="function"&&(s.state={style:d}),zL(s);if(h&&h.length)s.state={style:h[0].style};else if(u){if(typeof A=="function")return s.state={style:u},zL(s);s.state={style:c?uw({},c,u):u}}else s.state={style:{}};return s}return Egt(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,a=i.canBegin;this.mounted=!0,!(!s||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,a=s.isActive,o=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,h=s.from,A=this.state.style;if(o){if(!a){var f={style:c?uw({},c,d):d};this.state&&A&&(c&&A[c]!==d||!c&&A!==d)&&this.setState(f);return}if(!(Mde(i.to,d)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=p||u?h:i.to;if(this.state&&A){var g={style:c?uw({},c,m):m};(c&&A[c]!==m||!c&&A!==m)&&this.setState(g)}this.runAnimation(Yl(Yl({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,a=i.from,o=i.to,c=i.duration,u=i.easing,d=i.begin,h=i.onAnimationEnd,A=i.onAnimationStart,f=xgt(a,o,cgt(u),c,this.changeStyle),p=function(){s.stopJSAnimation=f()};this.manager.start([A,d,p,c,h])}},{key:"runStepAnimation",value:function(i){var s=this,a=i.steps,o=i.begin,c=i.onAnimationStart,u=a[0],d=u.style,h=u.duration,A=h===void 0?0:h,f=function(m,g,y){if(y===0)return m;var v=g.duration,x=g.easing,b=x===void 0?"ease":x,w=g.style,k=g.properties,j=g.onAnimationEnd,B=y>0?a[y-1]:g,E=k||Object.keys(w);if(typeof b=="function"||b==="spring")return[].concat(O4(m),[s.runJSAnimation.bind(s,{from:B.style,to:w,duration:v,easing:b}),v]);var P=LY(E,v,b),T=Yl(Yl(Yl({},B.style),w),{},{transition:P});return[].concat(O4(m),[T,v,j]).filter(Xmt)};return this.manager.start([c].concat(O4(a.reduce(f,[d,Math.max(A,o)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=qmt());var s=i.begin,a=i.duration,o=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,h=i.onAnimationEnd,A=i.steps,f=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof u=="function"||typeof f=="function"||u==="spring"){this.runJSAnimation(i);return}if(A.length>1){this.runStepAnimation(i);return}var m=o?uw({},o,c):c,g=LY(Object.keys(m),a,u);p.start([d,s,Yl(Yl({},m),{},{transition:g}),a,h])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var o=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=bgt(i,wgt),u=C.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!o||u===0||a<=0)return s;var h=function(f){var p=f.props,m=p.style,g=m===void 0?{}:m,y=p.className,v=C.cloneElement(f,Yl(Yl({},c),{},{style:Yl(Yl({},g),d),className:y}));return v};return u===1?h(C.Children.only(s)):re.createElement("div",null,C.Children.map(s,function(A){return h(A)}))}}]),n}(C.PureComponent);Nd.displayName="Animate";Nd.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Nd.propTypes={from:Kn.oneOfType([Kn.object,Kn.string]),to:Kn.oneOfType([Kn.object,Kn.string]),attributeName:Kn.string,duration:Kn.number,begin:Kn.number,easing:Kn.oneOfType([Kn.string,Kn.func]),steps:Kn.arrayOf(Kn.shape({duration:Kn.number.isRequired,style:Kn.object.isRequired,easing:Kn.oneOfType([Kn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Kn.func]),properties:Kn.arrayOf("string"),onAnimationEnd:Kn.func})),children:Kn.oneOfType([Kn.node,Kn.func]),isActive:Kn.bool,canBegin:Kn.bool,onAnimationEnd:Kn.func,shouldReAnimate:Kn.bool,onAnimationStart:Kn.func,onAnimationReStart:Kn.func};function U1(e){"@babel/helpers - typeof";return U1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U1(e)}function dN(){return dN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dN.apply(this,arguments)}function Fgt(e,t){return Dgt(e)||Rgt(e,t)||Lgt(e,t)||Mgt()}function Mgt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lgt(e,t){if(e){if(typeof e=="string")return $Y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $Y(e,t)}}function $Y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rgt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Dgt(e){if(Array.isArray(e))return e}function zY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function VY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zY(Object(n),!0).forEach(function(r){Ugt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ugt(e,t,n){return t=Hgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hgt(e){var t=Qgt(e,"string");return U1(t)=="symbol"?t:t+""}function Qgt(e,t){if(U1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(U1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var KY=function(t,n,r,i,s){var a=Math.min(Math.abs(r)/2,Math.abs(i)/2),o=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(a>0&&s instanceof Array){for(var h=[0,0,0,0],A=0,f=4;A<f;A++)h[A]=s[A]>a?a:s[A];d="M".concat(t,",").concat(n+o*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(t+c*h[0],",").concat(n)),d+="L ".concat(t+r-c*h[1],",").concat(n),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`,
        `).concat(t+r,",").concat(n+o*h[1])),d+="L ".concat(t+r,",").concat(n+i-o*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`,
        `).concat(t+r-c*h[2],",").concat(n+i)),d+="L ".concat(t+c*h[3],",").concat(n+i),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`,
        `).concat(t,",").concat(n+i-o*h[3])),d+="Z"}else if(a>0&&s===+s&&s>0){var p=Math.min(a,s);d="M ".concat(t,",").concat(n+o*p,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+c*p,",").concat(n,`
            L `).concat(t+r-c*p,",").concat(n,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r,",").concat(n+o*p,`
            L `).concat(t+r,",").concat(n+i-o*p,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r-c*p,",").concat(n+i,`
            L `).concat(t+c*p,",").concat(n+i,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t,",").concat(n+i-o*p," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},$gt=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,s=n.x,a=n.y,o=n.width,c=n.height;if(Math.abs(o)>0&&Math.abs(c)>0){var u=Math.min(s,s+o),d=Math.max(s,s+o),h=Math.min(a,a+c),A=Math.max(a,a+c);return r>=u&&r<=d&&i>=h&&i<=A}return!1},zgt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$Q=function(t){var n=VY(VY({},zgt),t),r=C.useRef(),i=C.useState(-1),s=Fgt(i,2),a=s[0],o=s[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&o(b)}catch{}},[]);var c=n.x,u=n.y,d=n.width,h=n.height,A=n.radius,f=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,y=n.isAnimationActive,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||d===0||h===0)return null;var x=Fn("recharts-rectangle",f);return v?re.createElement(Nd,{canBegin:a>0,from:{width:d,height:h,x:c,y:u},to:{width:d,height:h,x:c,y:u},duration:m,animationEasing:p,isActive:v},function(b){var w=b.width,k=b.height,j=b.x,B=b.y;return re.createElement(Nd,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,isActive:y,easing:p},re.createElement("path",dN({},Tn(n,!0),{className:x,d:KY(j,B,w,k,A),ref:r})))}):re.createElement("path",dN({},Tn(n,!0),{className:x,d:KY(c,u,d,h,A)}))};function KL(){return KL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KL.apply(this,arguments)}var zQ=function(t){var n=t.cx,r=t.cy,i=t.r,s=t.className,a=Fn("recharts-dot",s);return n===+n&&r===+r&&i===+i?re.createElement("circle",KL({},Tn(t,!1),EB(t),{className:a,cx:n,cy:r,r:i})):null};function H1(e){"@babel/helpers - typeof";return H1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H1(e)}var Vgt=["x","y","top","left","width","height","className"];function qL(){return qL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qL.apply(this,arguments)}function qY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kgt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qY(Object(n),!0).forEach(function(r){qgt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qgt(e,t,n){return t=Wgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wgt(e){var t=Ggt(e,"string");return H1(t)=="symbol"?t:t+""}function Ggt(e,t){if(H1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(H1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ygt(e,t){if(e==null)return{};var n=Xgt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xgt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Jgt=function(t,n,r,i,s,a){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},Zgt=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,a=t.top,o=a===void 0?0:a,c=t.left,u=c===void 0?0:c,d=t.width,h=d===void 0?0:d,A=t.height,f=A===void 0?0:A,p=t.className,m=Ygt(t,Vgt),g=Kgt({x:r,y:s,top:o,left:u,width:h,height:f},m);return!tt(r)||!tt(s)||!tt(h)||!tt(f)||!tt(o)||!tt(u)?null:re.createElement("path",qL({},Tn(g,!0),{className:Fn("recharts-cross",p),d:Jgt(r,s,h,f,o,u)}))},eyt=Ape,tyt=eyt(Object.getPrototypeOf,Object),nyt=tyt,ryt=Ld,iyt=nyt,syt=Rd,ayt="[object Object]",oyt=Function.prototype,lyt=Object.prototype,ege=oyt.toString,cyt=lyt.hasOwnProperty,uyt=ege.call(Object);function dyt(e){if(!syt(e)||ryt(e)!=ayt)return!1;var t=iyt(e);if(t===null)return!0;var n=cyt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ege.call(n)==uyt}var hyt=dyt;const fyt=Mn(hyt);var Ayt=Ld,pyt=Rd,myt="[object Boolean]";function gyt(e){return e===!0||e===!1||pyt(e)&&Ayt(e)==myt}var yyt=gyt;const vyt=Mn(yyt);function Q1(e){"@babel/helpers - typeof";return Q1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q1(e)}function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hN.apply(this,arguments)}function xyt(e,t){return Syt(e)||Cyt(e,t)||byt(e,t)||wyt()}function wyt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function byt(e,t){if(e){if(typeof e=="string")return WY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WY(e,t)}}function WY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cyt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Syt(e){if(Array.isArray(e))return e}function GY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function YY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GY(Object(n),!0).forEach(function(r){kyt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kyt(e,t,n){return t=_yt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _yt(e){var t=jyt(e,"string");return Q1(t)=="symbol"?t:t+""}function jyt(e,t){if(Q1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Q1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XY=function(t,n,r,i,s){var a=r-i,o;return o="M ".concat(t,",").concat(n),o+="L ".concat(t+r,",").concat(n),o+="L ".concat(t+r-a/2,",").concat(n+s),o+="L ".concat(t+r-a/2-i,",").concat(n+s),o+="L ".concat(t,",").concat(n," Z"),o},Byt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Nyt=function(t){var n=YY(YY({},Byt),t),r=C.useRef(),i=C.useState(-1),s=xyt(i,2),a=s[0],o=s[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&o(x)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,h=n.lowerWidth,A=n.height,f=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||A!==+A||d===0&&h===0||A===0)return null;var v=Fn("recharts-trapezoid",f);return y?re.createElement(Nd,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:A,x:c,y:u},to:{upperWidth:d,lowerWidth:h,height:A,x:c,y:u},duration:m,animationEasing:p,isActive:y},function(x){var b=x.upperWidth,w=x.lowerWidth,k=x.height,j=x.x,B=x.y;return re.createElement(Nd,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,easing:p},re.createElement("path",hN({},Tn(n,!0),{className:v,d:XY(j,B,b,w,k),ref:r})))}):re.createElement("g",null,re.createElement("path",hN({},Tn(n,!0),{className:v,d:XY(c,u,d,h,A)})))},Eyt=["option","shapeType","propTransformer","activeClassName","isActive"];function $1(e){"@babel/helpers - typeof";return $1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$1(e)}function Tyt(e,t){if(e==null)return{};var n=Iyt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Iyt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function JY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JY(Object(n),!0).forEach(function(r){Pyt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pyt(e,t,n){return t=Oyt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oyt(e){var t=Fyt(e,"string");return $1(t)=="symbol"?t:t+""}function Fyt(e,t){if($1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Myt(e,t){return fN(fN({},t),e)}function Lyt(e,t){return e==="symbols"}function ZY(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return re.createElement($Q,n);case"trapezoid":return re.createElement(Nyt,n);case"sector":return re.createElement(zme,n);case"symbols":if(Lyt(t))return re.createElement(oQ,n);break;default:return null}}function Ryt(e){return C.isValidElement(e)?e.props:e}function Dyt(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?Myt:r,s=e.activeClassName,a=s===void 0?"recharts-active-shape":s,o=e.isActive,c=Tyt(e,Eyt),u;if(C.isValidElement(t))u=C.cloneElement(t,fN(fN({},c),Ryt(t)));else if(yn(t))u=t(c);else if(fyt(t)&&!vyt(t)){var d=i(t,c);u=re.createElement(ZY,{shapeType:n,elementProps:d})}else{var h=c;u=re.createElement(ZY,{shapeType:n,elementProps:h})}return o?re.createElement(Si,{className:a},u):u}function tT(e,t){return t!=null&&"trapezoids"in e.props}function nT(e,t){return t!=null&&"sectors"in e.props}function z1(e,t){return t!=null&&"points"in e.props}function Uyt(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,s=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&s}function Hyt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Qyt(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function $yt(e,t){var n;return tT(e,t)?n=Uyt:nT(e,t)?n=Hyt:z1(e,t)&&(n=Qyt),n}function zyt(e,t){var n;return tT(e,t)?n="trapezoids":nT(e,t)?n="sectors":z1(e,t)&&(n="points"),n}function Vyt(e,t){if(tT(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(nT(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return z1(e,t)?t.payload:{}}function Kyt(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=zyt(n,t),s=Vyt(n,t),a=r.filter(function(c,u){var d=J5(s,c),h=n.props[i].filter(function(p){var m=$yt(n,t);return m(p,t)}),A=n.props[i].indexOf(h[h.length-1]),f=u===A;return d&&f}),o=r.indexOf(a[a.length-1]);return o}var qyt=Math.ceil,Wyt=Math.max;function Gyt(e,t,n,r){for(var i=-1,s=Wyt(qyt((t-e)/(n||1)),0),a=Array(s);s--;)a[r?s:++i]=e,e+=n;return a}var Yyt=Gyt,Xyt=Ppe,eX=1/0,Jyt=17976931348623157e292;function Zyt(e){if(!e)return e===0?e:0;if(e=Xyt(e),e===eX||e===-eX){var t=e<0?-1:1;return t*Jyt}return e===e?e:0}var tge=Zyt,evt=Yyt,tvt=$5,F4=tge;function nvt(e){return function(t,n,r){return r&&typeof r!="number"&&tvt(t,n,r)&&(n=r=void 0),t=F4(t),n===void 0?(n=t,t=0):n=F4(n),r=r===void 0?t<n?1:-1:F4(r),evt(t,n,r,e)}}var rvt=nvt,ivt=rvt,svt=ivt(),avt=svt;const AN=Mn(avt);function V1(e){"@babel/helpers - typeof";return V1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V1(e)}function tX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tX(Object(n),!0).forEach(function(r){nge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nge(e,t,n){return t=ovt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ovt(e){var t=lvt(e,"string");return V1(t)=="symbol"?t:t+""}function lvt(e,t){if(V1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(V1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cvt=["Webkit","Moz","O","ms"],uvt=function(t,n){var r=t.replace(/(\w)/,function(s){return s.toUpperCase()}),i=cvt.reduce(function(s,a){return nX(nX({},s),{},nge({},a+r,n))},{});return i[t]=n,i};function Ov(e){"@babel/helpers - typeof";return Ov=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ov(e)}function pN(){return pN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pN.apply(this,arguments)}function rX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function M4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rX(Object(n),!0).forEach(function(r){jo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dvt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ige(r.key),r)}}function hvt(e,t,n){return t&&iX(e.prototype,t),n&&iX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fvt(e,t,n){return t=mN(t),Avt(e,rge()?Reflect.construct(t,n||[],mN(e).constructor):t.apply(e,n))}function Avt(e,t){if(t&&(Ov(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pvt(e)}function pvt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rge=function(){return!!e})()}function mN(e){return mN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mN(e)}function mvt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WL(e,t)}function WL(e,t){return WL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},WL(e,t)}function jo(e,t,n){return t=ige(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ige(e){var t=gvt(e,"string");return Ov(t)=="symbol"?t:t+""}function gvt(e,t){if(Ov(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ov(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yvt=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,s=t.x,a=t.width,o=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=tb().domain(AN(0,c)).range([s,s+a-o]),d=u.domain().map(function(h){return u(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:d}},sX=function(t){return t.changedTouches&&!!t.changedTouches.length},Fv=function(e){function t(n){var r;return dvt(this,t),r=fvt(this,t,[n]),jo(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),jo(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),jo(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,s=i.endIndex,a=i.onDragEnd,o=i.startIndex;a==null||a({endIndex:s,startIndex:o})}),r.detachDragEndListener()}),jo(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),jo(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),jo(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),jo(r,"handleSlideDragStart",function(i){var s=sX(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return mvt(t,e),hvt(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,s=r.endX,a=this.state.scaleValues,o=this.props,c=o.gap,u=o.data,d=u.length-1,h=Math.min(i,s),A=Math.max(i,s),f=t.getIndexInRange(a,h),p=t.getIndexInRange(a,A);return{startIndex:f-f%c,endIndex:p===d?d:p-p%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,s=i.data,a=i.tickFormatter,o=i.dataKey,c=zo(s[r],o,r);return yn(a)?a(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,s=i.slideMoveStartX,a=i.startX,o=i.endX,c=this.props,u=c.x,d=c.width,h=c.travellerWidth,A=c.startIndex,f=c.endIndex,p=c.onChange,m=r.pageX-s;m>0?m=Math.min(m,u+d-h-o,u+d-h-a):m<0&&(m=Math.max(m,u-a,u-o));var g=this.getIndex({startX:a+m,endX:o+m});(g.startIndex!==A||g.endIndex!==f)&&p&&p(g),this.setState({startX:a+m,endX:o+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var s=sX(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,s=i.brushMoveStartX,a=i.movingTravellerId,o=i.endX,c=i.startX,u=this.state[a],d=this.props,h=d.x,A=d.width,f=d.travellerWidth,p=d.onChange,m=d.gap,g=d.data,y={startX:this.state.startX,endX:this.state.endX},v=r.pageX-s;v>0?v=Math.min(v,h+A-f-u):v<0&&(v=Math.max(v,h-u)),y[a]=u+v;var x=this.getIndex(y),b=x.startIndex,w=x.endIndex,k=function(){var B=g.length-1;return a==="startX"&&(o>c?b%m===0:w%m===0)||o<c&&w===B||a==="endX"&&(o>c?w%m===0:b%m===0)||o>c&&w===B};this.setState(jo(jo({},a,u+v),"brushMoveStartX",r.pageX),function(){p&&k()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var s=this,a=this.state,o=a.scaleValues,c=a.startX,u=a.endX,d=this.state[i],h=o.indexOf(d);if(h!==-1){var A=h+r;if(!(A===-1||A>=o.length)){var f=o[A];i==="startX"&&f>=u||i==="endX"&&f<=c||this.setState(jo({},i,f),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,s=r.y,a=r.width,o=r.height,c=r.fill,u=r.stroke;return re.createElement("rect",{stroke:u,fill:c,x:i,y:s,width:a,height:o})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,s=r.y,a=r.width,o=r.height,c=r.data,u=r.children,d=r.padding,h=C.Children.only(u);return h?re.cloneElement(h,{x:i,y:s,width:a,height:o,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var s,a,o=this,c=this.props,u=c.y,d=c.travellerWidth,h=c.height,A=c.traveller,f=c.ariaLabel,p=c.data,m=c.startIndex,g=c.endIndex,y=Math.max(r,this.props.x),v=M4(M4({},Tn(this.props,!1)),{},{x:y,y:u,width:d,height:h}),x=f||"Min value: ".concat((s=p[m])===null||s===void 0?void 0:s.name,", Max value: ").concat((a=p[g])===null||a===void 0?void 0:a.name);return re.createElement(Si,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),o.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(A,v))}},{key:"renderSlide",value:function(r,i){var s=this.props,a=s.y,o=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(r,i)+u,h=Math.max(Math.abs(i-r)-u,0);return re.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:a,width:h,height:o})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,s=r.endIndex,a=r.y,o=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,h=d.startX,A=d.endX,f=5,p={pointerEvents:"none",fill:u};return re.createElement(Si,{className:"recharts-brush-texts"},re.createElement(VB,pN({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,A)-f,y:a+o/2},p),this.getTextOfTick(i)),re.createElement(VB,pN({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,A)+c+f,y:a+o/2},p),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,i=r.data,s=r.className,a=r.children,o=r.x,c=r.y,u=r.width,d=r.height,h=r.alwaysShowText,A=this.state,f=A.startX,p=A.endX,m=A.isTextActive,g=A.isSlideMoving,y=A.isTravellerMoving,v=A.isTravellerFocused;if(!i||!i.length||!tt(o)||!tt(c)||!tt(u)||!tt(d)||u<=0||d<=0)return null;var x=Fn("recharts-brush",s),b=re.Children.count(a)===1,w=uvt("userSelect","none");return re.createElement(Si,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(f,p),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(p,"endX"),(m||g||y||v||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,s=r.y,a=r.width,o=r.height,c=r.stroke,u=Math.floor(s+o/2)-1;return re.createElement(re.Fragment,null,re.createElement("rect",{x:i,y:s,width:a,height:o,fill:c,stroke:"none"}),re.createElement("line",{x1:i+1,y1:u,x2:i+a-1,y2:u,fill:"none",stroke:"#fff"}),re.createElement("line",{x1:i+1,y1:u+2,x2:i+a-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var s;return re.isValidElement(r)?s=re.cloneElement(r,i):yn(r)?s=r(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(r,i){var s=r.data,a=r.width,o=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,h=r.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return M4({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a},s&&s.length?yvt({data:s,width:a,x:o,travellerWidth:c,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||o!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([o,o+a-c]);var A=i.scale.domain().map(function(f){return i.scale(f)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:A}}return null}},{key:"getIndexInRange",value:function(r,i){for(var s=r.length,a=0,o=s-1;o-a>1;){var c=Math.floor((a+o)/2);r[c]>i?o=c:a=c}return i>=r[o]?o:a}}])}(C.PureComponent);jo(Fv,"displayName","Brush");jo(Fv,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var vvt=AQ;function xvt(e,t){var n;return vvt(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}var wvt=xvt,bvt=ape,Cvt=sA,Svt=wvt,kvt=ho,_vt=$5;function jvt(e,t,n){var r=kvt(e)?bvt:Svt;return n&&_vt(e,t,n)&&(t=void 0),r(e,Cvt(t))}var Bvt=jvt;const Nvt=Mn(Bvt);var hu=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},aX=Bpe;function Evt(e,t,n){t=="__proto__"&&aX?aX(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Tvt=Evt,Ivt=Tvt,Pvt=_pe,Ovt=sA;function Fvt(e,t){var n={};return t=Ovt(t),Pvt(e,function(r,i,s){Ivt(n,i,t(r,i,s))}),n}var Mvt=Fvt;const Lvt=Mn(Mvt);function Rvt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var Dvt=Rvt,Uvt=AQ;function Hvt(e,t){var n=!0;return Uvt(e,function(r,i,s){return n=!!t(r,i,s),n}),n}var Qvt=Hvt,$vt=Dvt,zvt=Qvt,Vvt=sA,Kvt=ho,qvt=$5;function Wvt(e,t,n){var r=Kvt(e)?$vt:zvt;return n&&qvt(e,t,n)&&(t=void 0),r(e,Vvt(t))}var Gvt=Wvt;const sge=Mn(Gvt);var Yvt=["x","y"];function K1(e){"@babel/helpers - typeof";return K1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K1(e)}function GL(){return GL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GL.apply(this,arguments)}function oX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oX(Object(n),!0).forEach(function(r){Xvt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xvt(e,t,n){return t=Jvt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jvt(e){var t=Zvt(e,"string");return K1(t)=="symbol"?t:t+""}function Zvt(e,t){if(K1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(K1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function e0t(e,t){if(e==null)return{};var n=t0t(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function t0t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function n0t(e,t){var n=e.x,r=e.y,i=e0t(e,Yvt),s="".concat(n),a=parseInt(s,10),o="".concat(r),c=parseInt(o,10),u="".concat(t.height||i.height),d=parseInt(u,10),h="".concat(t.width||i.width),A=parseInt(h,10);return Dx(Dx(Dx(Dx(Dx({},t),i),a?{x:a}:{}),c?{y:c}:{}),{},{height:d,width:A,name:t.name,radius:t.radius})}function lX(e){return re.createElement(Dyt,GL({shapeType:"rectangle",propTransformer:n0t,activeClassName:"recharts-active-bar"},e))}var r0t=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var s=typeof r=="number";return s?t(r,i):(s||lm(),n)}},i0t=["value","background"],age;function Mv(e){"@babel/helpers - typeof";return Mv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mv(e)}function s0t(e,t){if(e==null)return{};var n=a0t(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function a0t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gN(){return gN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gN.apply(this,arguments)}function cX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cX(Object(n),!0).forEach(function(r){Yh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lge(r.key),r)}}function l0t(e,t,n){return t&&uX(e.prototype,t),n&&uX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c0t(e,t,n){return t=yN(t),u0t(e,oge()?Reflect.construct(t,n||[],yN(e).constructor):t.apply(e,n))}function u0t(e,t){if(t&&(Mv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d0t(e)}function d0t(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oge=function(){return!!e})()}function yN(e){return yN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},yN(e)}function h0t(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YL(e,t)}function YL(e,t){return YL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},YL(e,t)}function Yh(e,t,n){return t=lge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lge(e){var t=f0t(e,"string");return Mv(t)=="symbol"?t:t+""}function f0t(e,t){if(Mv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _m=function(e){function t(){var n;o0t(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=c0t(this,t,[].concat(i)),Yh(n,"state",{isAnimationFinished:!1}),Yh(n,"id",V2("recharts-bar-")),Yh(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),a&&a()}),Yh(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),a&&a()}),n}return h0t(t,e),l0t(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,s=this.props,a=s.shape,o=s.dataKey,c=s.activeIndex,u=s.activeBar,d=Tn(this.props,!1);return r&&r.map(function(h,A){var f=A===c,p=f?u:a,m=Ti(Ti(Ti({},d),h),{},{isActive:f,option:p,index:A,dataKey:o,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return re.createElement(Si,gN({className:"recharts-bar-rectangle"},TB(i.props,h,A),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value)}),re.createElement(lX,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,s=i.data,a=i.layout,o=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,h=i.animationId,A=this.state.prevData;return re.createElement(Nd,{begin:c,duration:u,isActive:o,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(f){var p=f.t,m=s.map(function(g,y){var v=A&&A[y];if(v){var x=uc(v.x,g.x),b=uc(v.y,g.y),w=uc(v.width,g.width),k=uc(v.height,g.height);return Ti(Ti({},g),{},{x:x(p),y:b(p),width:w(p),height:k(p)})}if(a==="horizontal"){var j=uc(0,g.height),B=j(p);return Ti(Ti({},g),{},{y:g.y+g.height-B,height:B})}var E=uc(0,g.width),P=E(p);return Ti(Ti({},g),{},{width:P})});return re.createElement(Si,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,s=r.isAnimationActive,a=this.state.prevData;return s&&i&&i.length&&(!a||!J5(a,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,s=i.data,a=i.dataKey,o=i.activeIndex,c=Tn(this.props.background,!1);return s.map(function(u,d){u.value;var h=u.background,A=s0t(u,i0t);if(!h)return null;var f=Ti(Ti(Ti(Ti(Ti({},A),{},{fill:"#eee"},h),c),TB(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:a,index:d,className:"recharts-bar-background-rectangle"});return re.createElement(lX,gN({key:"background-bar-".concat(d),option:r.props.background,isActive:d===o},f))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.data,o=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,h=Tl(d,X2);if(!h)return null;var A=u==="vertical"?a[0].height/2:a[0].width/2,f=function(g,y){var v=Array.isArray(g.value)?g.value[1]:g.value;return{x:g.x,y:g.y,value:v,errorVal:zo(g,y)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return re.createElement(Si,p,h.map(function(m){return re.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:a,xAxis:o,yAxis:c,layout:u,offset:A,dataPointFormatter:f})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,s=r.data,a=r.className,o=r.xAxis,c=r.yAxis,u=r.left,d=r.top,h=r.width,A=r.height,f=r.isAnimationActive,p=r.background,m=r.id;if(i||!s||!s.length)return null;var g=this.state.isAnimationFinished,y=Fn("recharts-bar",a),v=o&&o.allowDataOverflow,x=c&&c.allowDataOverflow,b=v||x,w=_n(m)?this.id:m;return re.createElement(Si,{className:y},v||x?re.createElement("defs",null,re.createElement("clipPath",{id:"clipPath-".concat(w)},re.createElement("rect",{x:v?u:u-h/2,y:x?d:d-A/2,width:v?h:h*2,height:x?A:A*2}))):null,re.createElement(Si,{className:"recharts-bar-rectangles",clipPath:b?"url(#clipPath-".concat(w,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(b,w),(!f||g)&&wf.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(C.PureComponent);age=_m;Yh(_m,"displayName","Bar");Yh(_m,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Ad.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Yh(_m,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,s=e.xAxis,a=e.yAxis,o=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,h=e.displayedData,A=e.offset,f=Spt(r,n);if(!f)return null;var p=t.layout,m=n.type.defaultProps,g=m!==void 0?Ti(Ti({},m),n.props):n.props,y=g.dataKey,v=g.children,x=g.minPointSize,b=p==="horizontal"?a:s,w=u?b.scale.domain():null,k=Ipt({numericAxis:b}),j=Tl(v,Fpe),B=h.map(function(E,P){var T,N,F,L,U,H;u?T=kpt(u[d+P],w):(T=zo(E,y),Array.isArray(T)||(T=[k,T]));var W=r0t(x,age.defaultProps.minPointSize)(T[1],P);if(p==="horizontal"){var $,z=[a.scale(T[0]),a.scale(T[1])],Q=z[0],ce=z[1];N=gY({axis:s,ticks:o,bandSize:i,offset:f.offset,entry:E,index:P}),F=($=ce??Q)!==null&&$!==void 0?$:void 0,L=f.size;var R=Q-ce;if(U=Number.isNaN(R)?0:R,H={x:N,y:a.y,width:L,height:a.height},Math.abs(W)>0&&Math.abs(U)<Math.abs(W)){var M=pc(U||W)*(Math.abs(W)-Math.abs(U));F-=M,U+=M}}else{var Y=[s.scale(T[0]),s.scale(T[1])],X=Y[0],V=Y[1];if(N=X,F=gY({axis:a,ticks:c,bandSize:i,offset:f.offset,entry:E,index:P}),L=V-X,U=f.size,H={x:s.x,y:F,width:s.width,height:U},Math.abs(W)>0&&Math.abs(L)<Math.abs(W)){var Z=pc(L||W)*(Math.abs(W)-Math.abs(L));L+=Z}}return Ti(Ti(Ti({},E),{},{x:N,y:F,width:L,height:U,value:u?T:T[1],payload:E,background:H},j&&j[P]&&j[P].props),{},{tooltipPayload:[Hme(n,E)],tooltipPosition:{x:N+L/2,y:F+U/2}})});return Ti({data:B,layout:p},A)});function q1(e){"@babel/helpers - typeof";return q1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q1(e)}function A0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cge(r.key),r)}}function p0t(e,t,n){return t&&dX(e.prototype,t),n&&dX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hX(Object(n),!0).forEach(function(r){rT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rT(e,t,n){return t=cge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cge(e){var t=m0t(e,"string");return q1(t)=="symbol"?t:t+""}function m0t(e,t){if(q1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(q1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uge=function(t,n,r,i,s){var a=t.width,o=t.height,c=t.layout,u=t.children,d=Object.keys(n),h={left:r.left,leftMirror:r.left,right:a-r.right,rightMirror:a-r.right,top:r.top,topMirror:r.top,bottom:o-r.bottom,bottomMirror:o-r.bottom},A=!!Eo(u,_m);return d.reduce(function(f,p){var m=n[p],g=m.orientation,y=m.domain,v=m.padding,x=v===void 0?{}:v,b=m.mirror,w=m.reversed,k="".concat(g).concat(b?"Mirror":""),j,B,E,P,T;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var N=y[1]-y[0],F=1/0,L=m.categoricalDomain.sort();if(L.forEach(function(Y,X){X>0&&(F=Math.min((Y||0)-(L[X-1]||0),F))}),Number.isFinite(F)){var U=F/N,H=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(j=U*H/2),m.padding==="no-gap"){var W=am(t.barCategoryGap,U*H),$=U*H/2;j=$-W-($-W)/H*W}}}i==="xAxis"?B=[r.left+(x.left||0)+(j||0),r.left+r.width-(x.right||0)-(j||0)]:i==="yAxis"?B=c==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(j||0),r.top+r.height-(x.bottom||0)-(j||0)]:B=m.range,w&&(B=[B[1],B[0]]);var z=bpt(m,s,A),Q=z.scale,ce=z.realScaleType;Q.domain(y).range(B),Cpt(Q);var R=Tpt(Q,oc(oc({},m),{},{realScaleType:ce}));i==="xAxis"?(T=g==="top"&&!b||g==="bottom"&&b,E=r.left,P=h[k]-T*m.height):i==="yAxis"&&(T=g==="left"&&!b||g==="right"&&b,E=h[k]-T*m.width,P=r.top);var M=oc(oc(oc({},m),R),{},{realScaleType:ce,x:E,y:P,scale:Q,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return M.bandSize=sN(M,R),!m.hide&&i==="xAxis"?h[k]+=(T?-1:1)*M.height:m.hide||(h[k]+=(T?-1:1)*M.width),oc(oc({},f),{},rT({},p,M))},{})},dge=function(t,n){var r=t.x,i=t.y,s=n.x,a=n.y;return{x:Math.min(r,s),y:Math.min(i,a),width:Math.abs(s-r),height:Math.abs(a-i)}},g0t=function(t){var n=t.x1,r=t.y1,i=t.x2,s=t.y2;return dge({x:n,y:r},{x:i,y:s})},hge=function(){function e(t){A0t(this,e),this.scale=t}return p0t(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(n)+o}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],s=r[r.length-1];return i<=s?n>=i&&n<=s:n>=s&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();rT(hge,"EPS",1e-4);var VQ=function(t){var n=Object.keys(t).reduce(function(r,i){return oc(oc({},r),{},rT({},i,hge.create(t[i])))},{});return oc(oc({},n),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=s.bandAware,o=s.position;return Lvt(i,function(c,u){return n[u].apply(c,{bandAware:a,position:o})})},isInRange:function(i){return sge(i,function(s,a){return n[a].isInRange(s)})}})};function y0t(e){return(e%180+180)%180}var v0t=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=y0t(i),a=s*Math.PI/180,o=Math.atan(r/n),c=a>o&&a<Math.PI-o?r/Math.sin(a):n/Math.cos(a);return Math.abs(c)},x0t=sA,w0t=K2,b0t=H5;function C0t(e){return function(t,n,r){var i=Object(t);if(!w0t(t)){var s=x0t(n);t=b0t(t),n=function(o){return s(i[o],o,i)}}var a=e(t,n,r);return a>-1?i[s?t[a]:a]:void 0}}var S0t=C0t,k0t=tge;function _0t(e){var t=k0t(e),n=t%1;return t===t?n?t-n:t:0}var j0t=_0t,B0t=xpe,N0t=sA,E0t=j0t,T0t=Math.max;function I0t(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:E0t(n);return i<0&&(i=T0t(r+i,0)),B0t(e,N0t(t),i)}var P0t=I0t,O0t=S0t,F0t=P0t,M0t=O0t(F0t),L0t=M0t;const R0t=Mn(L0t);var D0t=sZe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),KQ=C.createContext(void 0),qQ=C.createContext(void 0),fge=C.createContext(void 0),Age=C.createContext({}),pge=C.createContext(void 0),mge=C.createContext(0),gge=C.createContext(0),fX=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,s=n.offset,a=t.clipPathId,o=t.children,c=t.width,u=t.height,d=D0t(s);return re.createElement(KQ.Provider,{value:r},re.createElement(qQ.Provider,{value:i},re.createElement(Age.Provider,{value:s},re.createElement(fge.Provider,{value:d},re.createElement(pge.Provider,{value:a},re.createElement(mge.Provider,{value:u},re.createElement(gge.Provider,{value:c},o)))))))},U0t=function(){return C.useContext(pge)},yge=function(t){var n=C.useContext(KQ);n==null&&lm();var r=n[t];return r==null&&lm(),r},H0t=function(){var t=C.useContext(KQ);return Eh(t)},Q0t=function(){var t=C.useContext(qQ),n=R0t(t,function(r){return sge(r.domain,Number.isFinite)});return n||Eh(t)},vge=function(t){var n=C.useContext(qQ);n==null&&lm();var r=n[t];return r==null&&lm(),r},$0t=function(){var t=C.useContext(fge);return t},z0t=function(){return C.useContext(Age)},WQ=function(){return C.useContext(gge)},GQ=function(){return C.useContext(mge)};function Lv(e){"@babel/helpers - typeof";return Lv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lv(e)}function V0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K0t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wge(r.key),r)}}function q0t(e,t,n){return t&&K0t(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function W0t(e,t,n){return t=vN(t),G0t(e,xge()?Reflect.construct(t,n||[],vN(e).constructor):t.apply(e,n))}function G0t(e,t){if(t&&(Lv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y0t(e)}function Y0t(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xge=function(){return!!e})()}function vN(e){return vN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vN(e)}function X0t(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XL(e,t)}function XL(e,t){return XL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},XL(e,t)}function AX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AX(Object(n),!0).forEach(function(r){YQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YQ(e,t,n){return t=wge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wge(e){var t=J0t(e,"string");return Lv(t)=="symbol"?t:t+""}function J0t(e,t){if(Lv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Lv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z0t(e,t){return rxt(e)||nxt(e,t)||txt(e,t)||ext()}function ext(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function txt(e,t){if(e){if(typeof e=="string")return mX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mX(e,t)}}function mX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nxt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function rxt(e){if(Array.isArray(e))return e}function JL(){return JL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JL.apply(this,arguments)}var ixt=function(t,n){var r;return re.isValidElement(t)?r=re.cloneElement(t,n):yn(t)?r=t(n):r=re.createElement("line",JL({},n,{className:"recharts-reference-line-line"})),r},sxt=function(t,n,r,i,s,a,o,c,u){var d=s.x,h=s.y,A=s.width,f=s.height;if(r){var p=u.y,m=t.y.apply(p,{position:a});if(hu(u,"discard")&&!t.y.isInRange(m))return null;var g=[{x:d+A,y:m},{x:d,y:m}];return c==="left"?g.reverse():g}if(n){var y=u.x,v=t.x.apply(y,{position:a});if(hu(u,"discard")&&!t.x.isInRange(v))return null;var x=[{x:v,y:h+f},{x:v,y:h}];return o==="top"?x.reverse():x}if(i){var b=u.segment,w=b.map(function(k){return t.apply(k,{position:a})});return hu(u,"discard")&&Nvt(w,function(k){return!t.isInRange(k)})?null:w}return null};function axt(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,s=e.yAxisId,a=e.shape,o=e.className,c=e.alwaysShow,u=U0t(),d=yge(i),h=vge(s),A=$0t();if(!u||!A)return null;fd(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=VQ({x:d.scale,y:h.scale}),p=Ji(t),m=Ji(n),g=r&&r.length===2,y=sxt(f,p,m,g,A,e.position,d.orientation,h.orientation,e);if(!y)return null;var v=Z0t(y,2),x=v[0],b=x.x,w=x.y,k=v[1],j=k.x,B=k.y,E=hu(e,"hidden")?"url(#".concat(u,")"):void 0,P=pX(pX({clipPath:E},Tn(e,!0)),{},{x1:b,y1:w,x2:j,y2:B});return re.createElement(Si,{className:Fn("recharts-reference-line",o)},ixt(a,P),Zs.renderCallByParent(e,g0t({x1:b,y1:w,x2:j,y2:B})))}var XQ=function(e){function t(){return V0t(this,t),W0t(this,t,arguments)}return X0t(t,e),q0t(t,[{key:"render",value:function(){return re.createElement(axt,this.props)}}])}(re.Component);YQ(XQ,"displayName","ReferenceLine");YQ(XQ,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ZL(){return ZL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZL.apply(this,arguments)}function Rv(e){"@babel/helpers - typeof";return Rv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rv(e)}function gX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gX(Object(n),!0).forEach(function(r){iT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lxt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cge(r.key),r)}}function cxt(e,t,n){return t&&lxt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function uxt(e,t,n){return t=xN(t),dxt(e,bge()?Reflect.construct(t,n||[],xN(e).constructor):t.apply(e,n))}function dxt(e,t){if(t&&(Rv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hxt(e)}function hxt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bge=function(){return!!e})()}function xN(e){return xN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xN(e)}function fxt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eR(e,t)}function eR(e,t){return eR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},eR(e,t)}function iT(e,t,n){return t=Cge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cge(e){var t=Axt(e,"string");return Rv(t)=="symbol"?t:t+""}function Axt(e,t){if(Rv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pxt=function(t){var n=t.x,r=t.y,i=t.xAxis,s=t.yAxis,a=VQ({x:i.scale,y:s.scale}),o=a.apply({x:n,y:r},{bandAware:!0});return hu(t,"discard")&&!a.isInRange(o)?null:o},sT=function(e){function t(){return oxt(this,t),uxt(this,t,arguments)}return fxt(t,e),cxt(t,[{key:"render",value:function(){var r=this.props,i=r.x,s=r.y,a=r.r,o=r.alwaysShow,c=r.clipPathId,u=Ji(i),d=Ji(s);if(fd(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var h=pxt(this.props);if(!h)return null;var A=h.x,f=h.y,p=this.props,m=p.shape,g=p.className,y=hu(this.props,"hidden")?"url(#".concat(c,")"):void 0,v=yX(yX({clipPath:y},Tn(this.props,!0)),{},{cx:A,cy:f});return re.createElement(Si,{className:Fn("recharts-reference-dot",g)},t.renderDot(m,v),Zs.renderCallByParent(this.props,{x:A-a,y:f-a,width:2*a,height:2*a}))}}])}(re.Component);iT(sT,"displayName","ReferenceDot");iT(sT,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});iT(sT,"renderDot",function(e,t){var n;return re.isValidElement(e)?n=re.cloneElement(e,t):yn(e)?n=e(t):n=re.createElement(zQ,ZL({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function tR(){return tR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tR.apply(this,arguments)}function Dv(e){"@babel/helpers - typeof";return Dv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dv(e)}function vX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vX(Object(n),!0).forEach(function(r){aT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gxt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kge(r.key),r)}}function yxt(e,t,n){return t&&gxt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vxt(e,t,n){return t=wN(t),xxt(e,Sge()?Reflect.construct(t,n||[],wN(e).constructor):t.apply(e,n))}function xxt(e,t){if(t&&(Dv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wxt(e)}function wxt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Sge=function(){return!!e})()}function wN(e){return wN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wN(e)}function bxt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nR(e,t)}function nR(e,t){return nR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},nR(e,t)}function aT(e,t,n){return t=kge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kge(e){var t=Cxt(e,"string");return Dv(t)=="symbol"?t:t+""}function Cxt(e,t){if(Dv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sxt=function(t,n,r,i,s){var a=s.x1,o=s.x2,c=s.y1,u=s.y2,d=s.xAxis,h=s.yAxis;if(!d||!h)return null;var A=VQ({x:d.scale,y:h.scale}),f={x:t?A.x.apply(a,{position:"start"}):A.x.rangeMin,y:r?A.y.apply(c,{position:"start"}):A.y.rangeMin},p={x:n?A.x.apply(o,{position:"end"}):A.x.rangeMax,y:i?A.y.apply(u,{position:"end"}):A.y.rangeMax};return hu(s,"discard")&&(!A.isInRange(f)||!A.isInRange(p))?null:dge(f,p)},oT=function(e){function t(){return mxt(this,t),vxt(this,t,arguments)}return bxt(t,e),yxt(t,[{key:"render",value:function(){var r=this.props,i=r.x1,s=r.x2,a=r.y1,o=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;fd(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Ji(i),A=Ji(s),f=Ji(a),p=Ji(o),m=this.props.shape;if(!h&&!A&&!f&&!p&&!m)return null;var g=Sxt(h,A,f,p,this.props);if(!g&&!m)return null;var y=hu(this.props,"hidden")?"url(#".concat(d,")"):void 0;return re.createElement(Si,{className:Fn("recharts-reference-area",c)},t.renderRect(m,xX(xX({clipPath:y},Tn(this.props,!0)),g)),Zs.renderCallByParent(this.props,g))}}])}(re.Component);aT(oT,"displayName","ReferenceArea");aT(oT,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});aT(oT,"renderRect",function(e,t){var n;return re.isValidElement(e)?n=re.cloneElement(e,t):yn(e)?n=e(t):n=re.createElement($Q,tR({},t,{className:"recharts-reference-area-rect"})),n});function _ge(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function kxt(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return v0t(r,n)}function _xt(e,t,n){var r=n==="width",i=e.x,s=e.y,a=e.width,o=e.height;return t===1?{start:r?i:s,end:r?i+a:s+o}:{start:r?i+a:s+o,end:r?i:s}}function bN(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function jxt(e,t){return _ge(e,t+1)}function Bxt(e,t,n,r,i){for(var s=(r||[]).slice(),a=t.start,o=t.end,c=0,u=1,d=a,h=function(){var p=r==null?void 0:r[c];if(p===void 0)return{v:_ge(r,u)};var m=c,g,y=function(){return g===void 0&&(g=n(p,m)),g},v=p.coordinate,x=c===0||bN(e,v,y,d,o);x||(c=0,d=a,u+=1),x&&(d=v+e*(y()/2+i),c+=u)},A;u<=s.length;)if(A=h(),A)return A.v;return[]}function W1(e){"@babel/helpers - typeof";return W1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W1(e)}function wX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ys(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wX(Object(n),!0).forEach(function(r){Nxt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nxt(e,t,n){return t=Ext(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ext(e){var t=Txt(e,"string");return W1(t)=="symbol"?t:t+""}function Txt(e,t){if(W1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(W1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ixt(e,t,n,r,i){for(var s=(r||[]).slice(),a=s.length,o=t.start,c=t.end,u=function(A){var f=s[A],p,m=function(){return p===void 0&&(p=n(f,A)),p};if(A===a-1){var g=e*(f.coordinate+e*m()/2-c);s[A]=f=Ys(Ys({},f),{},{tickCoord:g>0?f.coordinate-g*e:f.coordinate})}else s[A]=f=Ys(Ys({},f),{},{tickCoord:f.coordinate});var y=bN(e,f.tickCoord,m,o,c);y&&(c=f.tickCoord-e*(m()/2+i),s[A]=Ys(Ys({},f),{},{isShow:!0}))},d=a-1;d>=0;d--)u(d);return s}function Pxt(e,t,n,r,i,s){var a=(r||[]).slice(),o=a.length,c=t.start,u=t.end;if(s){var d=r[o-1],h=n(d,o-1),A=e*(d.coordinate+e*h/2-u);a[o-1]=d=Ys(Ys({},d),{},{tickCoord:A>0?d.coordinate-A*e:d.coordinate});var f=bN(e,d.tickCoord,function(){return h},c,u);f&&(u=d.tickCoord-e*(h/2+i),a[o-1]=Ys(Ys({},d),{},{isShow:!0}))}for(var p=s?o-1:o,m=function(v){var x=a[v],b,w=function(){return b===void 0&&(b=n(x,v)),b};if(v===0){var k=e*(x.coordinate-e*w()/2-c);a[v]=x=Ys(Ys({},x),{},{tickCoord:k<0?x.coordinate-k*e:x.coordinate})}else a[v]=x=Ys(Ys({},x),{},{tickCoord:x.coordinate});var j=bN(e,x.tickCoord,w,c,u);j&&(c=x.tickCoord+e*(w()/2+i),a[v]=Ys(Ys({},x),{},{isShow:!0}))},g=0;g<p;g++)m(g);return a}function JQ(e,t,n){var r=e.tick,i=e.ticks,s=e.viewBox,a=e.minTickGap,o=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,h=e.angle;if(!i||!i.length||!r)return[];if(tt(c)||Ad.isSsr)return jxt(i,typeof c=="number"&&tt(c)?c:0);var A=[],f=o==="top"||o==="bottom"?"width":"height",p=d&&f==="width"?eb(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,b){var w=yn(u)?u(x.value,b):x.value;return f==="width"?kxt(eb(w,{fontSize:t,letterSpacing:n}),p,h):eb(w,{fontSize:t,letterSpacing:n})[f]},g=i.length>=2?pc(i[1].coordinate-i[0].coordinate):1,y=_xt(s,g,f);return c==="equidistantPreserveStart"?Bxt(g,y,m,i,a):(c==="preserveStart"||c==="preserveStartEnd"?A=Pxt(g,y,m,i,a,c==="preserveStartEnd"):A=Ixt(g,y,m,i,a),A.filter(function(v){return v.isShow}))}var Oxt=["viewBox"],Fxt=["viewBox"],Mxt=["ticks"];function Uv(e){"@babel/helpers - typeof";return Uv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uv(e)}function oy(){return oy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oy.apply(this,arguments)}function bX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bX(Object(n),!0).forEach(function(r){ZQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function L4(e,t){if(e==null)return{};var n=Lxt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lxt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Rxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Bge(r.key),r)}}function Dxt(e,t,n){return t&&CX(e.prototype,t),n&&CX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uxt(e,t,n){return t=CN(t),Hxt(e,jge()?Reflect.construct(t,n||[],CN(e).constructor):t.apply(e,n))}function Hxt(e,t){if(t&&(Uv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qxt(e)}function Qxt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jge=function(){return!!e})()}function CN(e){return CN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},CN(e)}function $xt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rR(e,t)}function rR(e,t){return rR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},rR(e,t)}function ZQ(e,t,n){return t=Bge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bge(e){var t=zxt(e,"string");return Uv(t)=="symbol"?t:t+""}function zxt(e,t){if(Uv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Uv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T0=function(e){function t(n){var r;return Rxt(this,t),r=Uxt(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return $xt(t,e),Dxt(t,[{key:"shouldComponentUpdate",value:function(r,i){var s=r.viewBox,a=L4(r,Oxt),o=this.props,c=o.viewBox,u=L4(o,Fxt);return!Py(s,c)||!Py(a,u)||!Py(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,s=i.x,a=i.y,o=i.width,c=i.height,u=i.orientation,d=i.tickSize,h=i.mirror,A=i.tickMargin,f,p,m,g,y,v,x=h?-1:1,b=r.tickSize||d,w=tt(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":f=p=r.coordinate,g=a+ +!h*c,m=g-x*b,v=m-x*A,y=w;break;case"left":m=g=r.coordinate,p=s+ +!h*o,f=p-x*b,y=f-x*A,v=w;break;case"right":m=g=r.coordinate,p=s+ +h*o,f=p+x*b,y=f+x*A,v=w;break;default:f=p=r.coordinate,g=a+ +h*c,m=g+x*b,v=m+x*A,y=w;break}return{line:{x1:f,y1:m,x2:p,y2:g},tick:{x:y,y:v}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,s=r.mirror,a;switch(i){case"left":a=s?"start":"end";break;case"right":a=s?"end":"start";break;default:a="middle";break}return a}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,s=r.mirror,a="end";switch(i){case"left":case"right":a="middle";break;case"top":a=s?"start":"end";break;default:a=s?"end":"start";break}return a}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,s=r.y,a=r.width,o=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,h=pa(pa(pa({},Tn(this.props,!1)),Tn(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var A=+(c==="top"&&!u||c==="bottom"&&u);h=pa(pa({},h),{},{x1:i,y1:s+A*o,x2:i+a,y2:s+A*o})}else{var f=+(c==="left"&&!u||c==="right"&&u);h=pa(pa({},h),{},{x1:i+f*a,y1:s,x2:i+f*a,y2:s+o})}return re.createElement("line",oy({},h,{className:Fn("recharts-cartesian-axis-line",El(d,"className"))}))}},{key:"renderTicks",value:function(r,i,s){var a=this,o=this.props,c=o.tickLine,u=o.stroke,d=o.tick,h=o.tickFormatter,A=o.unit,f=JQ(pa(pa({},this.props),{},{ticks:r}),i,s),p=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),g=Tn(this.props,!1),y=Tn(d,!1),v=pa(pa({},g),{},{fill:"none"},Tn(c,!1)),x=f.map(function(b,w){var k=a.getTickLineCoord(b),j=k.line,B=k.tick,E=pa(pa(pa(pa({textAnchor:p,verticalAnchor:m},g),{},{stroke:"none",fill:u},y),B),{},{index:w,payload:b,visibleTicksCount:f.length,tickFormatter:h});return re.createElement(Si,oy({className:"recharts-cartesian-axis-tick",key:"tick-".concat(b.value,"-").concat(b.coordinate,"-").concat(b.tickCoord)},TB(a.props,b,w)),c&&re.createElement("line",oy({},v,j,{className:Fn("recharts-cartesian-axis-tick-line",El(c,"className"))})),d&&t.renderTickItem(d,E,"".concat(yn(h)?h(b.value,w):b.value).concat(A||"")))});return re.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,s=i.axisLine,a=i.width,o=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var h=this.props,A=h.ticks,f=L4(h,Mxt),p=A;return yn(c)&&(p=A&&A.length>0?c(this.props):c(f)),a<=0||o<=0||!p||!p.length?null:re.createElement(Si,{className:Fn("recharts-cartesian-axis",u),ref:function(g){r.layerReference=g}},s&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Zs.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,s){var a;return re.isValidElement(r)?a=re.cloneElement(r,i):yn(r)?a=r(i):a=re.createElement(VB,oy({},i,{className:"recharts-cartesian-axis-tick-value"}),s),a}}])}(C.Component);ZQ(T0,"displayName","CartesianAxis");ZQ(T0,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Vxt=["x1","y1","x2","y2","key"],Kxt=["offset"];function cm(e){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cm(e)}function SX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SX(Object(n),!0).forEach(function(r){qxt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qxt(e,t,n){return t=Wxt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wxt(e){var t=Gxt(e,"string");return cm(t)=="symbol"?t:t+""}function Gxt(e,t){if(cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lp.apply(this,arguments)}function kX(e,t){if(e==null)return{};var n=Yxt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yxt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Xxt=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,s=t.y,a=t.width,o=t.height,c=t.ry;return re.createElement("rect",{x:i,y:s,ry:c,width:a,height:o,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Nge(e,t){var n;if(re.isValidElement(e))n=re.cloneElement(e,t);else if(yn(e))n=e(t);else{var r=t.x1,i=t.y1,s=t.x2,a=t.y2,o=t.key,c=kX(t,Vxt),u=Tn(c,!1);u.offset;var d=kX(u,Kxt);n=re.createElement("line",lp({},d,{x1:r,y1:i,x2:s,y2:a,fill:"none",key:o}))}return n}function Jxt(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=ea(ea({},e),{},{x1:t,y1:o,x2:t+n,y2:o,key:"line-".concat(c),index:c});return Nge(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function Zxt(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,s=e.verticalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=ea(ea({},e),{},{x1:o,y1:t,x2:o,y2:t+n,key:"line-".concat(c),index:c});return Nge(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function ewt(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,s=e.width,a=e.height,o=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=o.map(function(A){return Math.round(A+i-i)}).sort(function(A,f){return A-f});i!==d[0]&&d.unshift(0);var h=d.map(function(A,f){var p=!d[f+1],m=p?i+a-A:d[f+1]-A;if(m<=0)return null;var g=f%t.length;return re.createElement("rect",{key:"react-".concat(f),y:A,x:r,height:m,width:s,stroke:"none",fill:t[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return re.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function twt(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,s=e.x,a=e.y,o=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(A){return Math.round(A+s-s)}).sort(function(A,f){return A-f});s!==d[0]&&d.unshift(0);var h=d.map(function(A,f){var p=!d[f+1],m=p?s+o-A:d[f+1]-A;if(m<=0)return null;var g=f%r.length;return re.createElement("rect",{key:"react-".concat(f),x:A,y:a,width:m,height:c,stroke:"none",fill:r[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return re.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var nwt=function(t,n){var r=t.xAxis,i=t.width,s=t.height,a=t.offset;return Dme(JQ(ea(ea(ea({},T0.defaultProps),r),{},{ticks:cd(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.left,a.left+a.width,n)},rwt=function(t,n){var r=t.yAxis,i=t.width,s=t.height,a=t.offset;return Dme(JQ(ea(ea(ea({},T0.defaultProps),r),{},{ticks:cd(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.top,a.top+a.height,n)},gg={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function lT(e){var t,n,r,i,s,a,o=WQ(),c=GQ(),u=z0t(),d=ea(ea({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:gg.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:gg.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:gg.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:gg.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:gg.vertical,verticalFill:(a=e.verticalFill)!==null&&a!==void 0?a:gg.verticalFill,x:tt(e.x)?e.x:u.left,y:tt(e.y)?e.y:u.top,width:tt(e.width)?e.width:u.width,height:tt(e.height)?e.height:u.height}),h=d.x,A=d.y,f=d.width,p=d.height,m=d.syncWithTicks,g=d.horizontalValues,y=d.verticalValues,v=H0t(),x=Q0t();if(!tt(f)||f<=0||!tt(p)||p<=0||!tt(h)||h!==+h||!tt(A)||A!==+A)return null;var b=d.verticalCoordinatesGenerator||nwt,w=d.horizontalCoordinatesGenerator||rwt,k=d.horizontalPoints,j=d.verticalPoints;if((!k||!k.length)&&yn(w)){var B=g&&g.length,E=w({yAxis:x?ea(ea({},x),{},{ticks:B?g:x.ticks}):void 0,width:o,height:c,offset:u},B?!0:m);fd(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(cm(E),"]")),Array.isArray(E)&&(k=E)}if((!j||!j.length)&&yn(b)){var P=y&&y.length,T=b({xAxis:v?ea(ea({},v),{},{ticks:P?y:v.ticks}):void 0,width:o,height:c,offset:u},P?!0:m);fd(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(cm(T),"]")),Array.isArray(T)&&(j=T)}return re.createElement("g",{className:"recharts-cartesian-grid"},re.createElement(Xxt,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),re.createElement(Jxt,lp({},d,{offset:u,horizontalPoints:k,xAxis:v,yAxis:x})),re.createElement(Zxt,lp({},d,{offset:u,verticalPoints:j,xAxis:v,yAxis:x})),re.createElement(ewt,lp({},d,{horizontalPoints:k})),re.createElement(twt,lp({},d,{verticalPoints:j})))}lT.displayName="CartesianGrid";var iwt=["type","layout","connectNulls","ref"],swt=["key"];function Hv(e){"@babel/helpers - typeof";return Hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hv(e)}function _X(e,t){if(e==null)return{};var n=awt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function awt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ib(){return ib=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ib.apply(this,arguments)}function jX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ko(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jX(Object(n),!0).forEach(function(r){lc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yg(e){return uwt(e)||cwt(e)||lwt(e)||owt()}function owt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lwt(e,t){if(e){if(typeof e=="string")return iR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iR(e,t)}}function cwt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uwt(e){if(Array.isArray(e))return iR(e)}function iR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Tge(r.key),r)}}function hwt(e,t,n){return t&&BX(e.prototype,t),n&&BX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fwt(e,t,n){return t=SN(t),Awt(e,Ege()?Reflect.construct(t,n||[],SN(e).constructor):t.apply(e,n))}function Awt(e,t){if(t&&(Hv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pwt(e)}function pwt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ege(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ege=function(){return!!e})()}function SN(e){return SN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},SN(e)}function mwt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sR(e,t)}function sR(e,t){return sR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},sR(e,t)}function lc(e,t,n){return t=Tge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tge(e){var t=gwt(e,"string");return Hv(t)=="symbol"?t:t+""}function gwt(e,t){if(Hv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var I0=function(e){function t(){var n;dwt(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=fwt(this,t,[].concat(i)),lc(n,"state",{isAnimationFinished:!0,totalLength:0}),lc(n,"generateSimpleStrokeDasharray",function(a,o){return"".concat(o,"px ").concat(a-o,"px")}),lc(n,"getStrokeDasharray",function(a,o,c){var u=c.reduce(function(y,v){return y+v});if(!u)return n.generateSimpleStrokeDasharray(o,a);for(var d=Math.floor(a/u),h=a%u,A=o-a,f=[],p=0,m=0;p<c.length;m+=c[p],++p)if(m+c[p]>h){f=[].concat(yg(c.slice(0,p)),[h-m]);break}var g=f.length%2===0?[0,A]:[A];return[].concat(yg(t.repeat(c,d)),yg(f),g).map(function(y){return"".concat(y,"px")}).join(", ")}),lc(n,"id",V2("recharts-line-")),lc(n,"pathRef",function(a){n.mainCurve=a}),lc(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),lc(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return mwt(t,e),hwt(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.points,o=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,h=Tl(d,X2);if(!h)return null;var A=function(m,g){return{x:m.x,y:m.y,value:m.value,errorVal:zo(m.payload,g)}},f={clipPath:r?"url(#clipPath-".concat(i,")"):null};return re.createElement(Si,f,h.map(function(p){return re.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:a,xAxis:o,yAxis:c,layout:u,dataPointFormatter:A})}))}},{key:"renderDots",value:function(r,i,s){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var o=this.props,c=o.dot,u=o.points,d=o.dataKey,h=Tn(this.props,!1),A=Tn(c,!0),f=u.map(function(m,g){var y=ko(ko(ko({key:"dot-".concat(g),r:3},h),A),{},{value:m.value,dataKey:d,cx:m.x,cy:m.y,index:g,payload:m.payload});return t.renderDotItem(c,y)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return re.createElement(Si,ib({className:"recharts-line-dots",key:"dots"},p),f)}},{key:"renderCurveStatically",value:function(r,i,s,a){var o=this.props,c=o.type,u=o.layout,d=o.connectNulls;o.ref;var h=_X(o,iwt),A=ko(ko(ko({},Tn(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:r},a),{},{type:c,layout:u,connectNulls:d});return re.createElement(ML,ib({},A,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var s=this,a=this.props,o=a.points,c=a.strokeDasharray,u=a.isAnimationActive,d=a.animationBegin,h=a.animationDuration,A=a.animationEasing,f=a.animationId,p=a.animateNewValues,m=a.width,g=a.height,y=this.state,v=y.prevPoints,x=y.totalLength;return re.createElement(Nd,{begin:d,duration:h,isActive:u,easing:A,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var w=b.t;if(v){var k=v.length/o.length,j=o.map(function(N,F){var L=Math.floor(F*k);if(v[L]){var U=v[L],H=uc(U.x,N.x),W=uc(U.y,N.y);return ko(ko({},N),{},{x:H(w),y:W(w)})}if(p){var $=uc(m*2,N.x),z=uc(g/2,N.y);return ko(ko({},N),{},{x:$(w),y:z(w)})}return ko(ko({},N),{},{x:N.x,y:N.y})});return s.renderCurveStatically(j,r,i)}var B=uc(0,x),E=B(w),P;if(c){var T="".concat(c).split(/[,\s]+/gim).map(function(N){return parseFloat(N)});P=s.getStrokeDasharray(E,x,T)}else P=s.generateSimpleStrokeDasharray(x,E);return s.renderCurveStatically(o,r,i,{strokeDasharray:P})})}},{key:"renderCurve",value:function(r,i){var s=this.props,a=s.points,o=s.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return o&&a&&a.length&&(!u&&d>0||!J5(u,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,a=i.dot,o=i.points,c=i.className,u=i.xAxis,d=i.yAxis,h=i.top,A=i.left,f=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(s||!o||!o.length)return null;var y=this.state.isAnimationFinished,v=o.length===1,x=Fn("recharts-line",c),b=u&&u.allowDataOverflow,w=d&&d.allowDataOverflow,k=b||w,j=_n(g)?this.id:g,B=(r=Tn(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=B.r,P=E===void 0?3:E,T=B.strokeWidth,N=T===void 0?2:T,F=het(a)?a:{},L=F.clipDot,U=L===void 0?!0:L,H=P*2+N;return re.createElement(Si,{className:x},b||w?re.createElement("defs",null,re.createElement("clipPath",{id:"clipPath-".concat(j)},re.createElement("rect",{x:b?A:A-f/2,y:w?h:h-p/2,width:b?f:f*2,height:w?p:p*2})),!U&&re.createElement("clipPath",{id:"clipPath-dots-".concat(j)},re.createElement("rect",{x:A-H/2,y:h-H/2,width:f+H,height:p+H}))):null,!v&&this.renderCurve(k,j),this.renderErrorBar(k,j),(v||a)&&this.renderDots(k,U,j),(!m||y)&&wf.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var s=r.length%2!==0?[].concat(yg(r),[0]):r,a=[],o=0;o<i;++o)a=[].concat(yg(a),yg(s));return a}},{key:"renderDotItem",value:function(r,i){var s;if(re.isValidElement(r))s=re.cloneElement(r,i);else if(yn(r))s=r(i);else{var a=i.key,o=_X(i,swt),c=Fn("recharts-line-dot",typeof r!="boolean"?r.className:"");s=re.createElement(zQ,ib({key:a},o,{className:c}))}return s}}])}(C.PureComponent);lc(I0,"displayName","Line");lc(I0,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Ad.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});lc(I0,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,a=e.dataKey,o=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,h=c.map(function(A,f){var p=zo(A,a);return d==="horizontal"?{x:mY({axis:n,ticks:i,bandSize:o,entry:A,index:f}),y:_n(p)?null:r.scale(p),value:p,payload:A}:{x:_n(p)?null:n.scale(p),y:mY({axis:r,ticks:s,bandSize:o,entry:A,index:f}),value:p,payload:A}});return ko({points:h,layout:d},u)});function Qv(e){"@babel/helpers - typeof";return Qv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qv(e)}function ywt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vwt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Oge(r.key),r)}}function xwt(e,t,n){return t&&vwt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wwt(e,t,n){return t=kN(t),bwt(e,Ige()?Reflect.construct(t,n||[],kN(e).constructor):t.apply(e,n))}function bwt(e,t){if(t&&(Qv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cwt(e)}function Cwt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ige(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ige=function(){return!!e})()}function kN(e){return kN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kN(e)}function Swt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aR(e,t)}function aR(e,t){return aR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},aR(e,t)}function Pge(e,t,n){return t=Oge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oge(e){var t=kwt(e,"string");return Qv(t)=="symbol"?t:t+""}function kwt(e,t){if(Qv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oR(){return oR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oR.apply(this,arguments)}function _wt(e){var t=e.xAxisId,n=WQ(),r=GQ(),i=yge(t);return i==null?null:re.createElement(T0,oR({},i,{className:Fn("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(a){return cd(a,!0)}}))}var jm=function(e){function t(){return ywt(this,t),wwt(this,t,arguments)}return Swt(t,e),xwt(t,[{key:"render",value:function(){return re.createElement(_wt,this.props)}}])}(re.Component);Pge(jm,"displayName","XAxis");Pge(jm,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function $v(e){"@babel/helpers - typeof";return $v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$v(e)}function jwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bwt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lge(r.key),r)}}function Nwt(e,t,n){return t&&Bwt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ewt(e,t,n){return t=_N(t),Twt(e,Fge()?Reflect.construct(t,n||[],_N(e).constructor):t.apply(e,n))}function Twt(e,t){if(t&&($v(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Iwt(e)}function Iwt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fge=function(){return!!e})()}function _N(e){return _N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_N(e)}function Pwt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lR(e,t)}function lR(e,t){return lR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},lR(e,t)}function Mge(e,t,n){return t=Lge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lge(e){var t=Owt(e,"string");return $v(t)=="symbol"?t:t+""}function Owt(e,t){if($v(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($v(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cR(){return cR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cR.apply(this,arguments)}var Fwt=function(t){var n=t.yAxisId,r=WQ(),i=GQ(),s=vge(n);return s==null?null:re.createElement(T0,cR({},s,{className:Fn("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(o){return cd(o,!0)}}))},Bm=function(e){function t(){return jwt(this,t),Ewt(this,t,arguments)}return Pwt(t,e),Nwt(t,[{key:"render",value:function(){return re.createElement(Fwt,this.props)}}])}(re.Component);Mge(Bm,"displayName","YAxis");Mge(Bm,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function NX(e){return Dwt(e)||Rwt(e)||Lwt(e)||Mwt()}function Mwt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lwt(e,t){if(e){if(typeof e=="string")return uR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uR(e,t)}}function Rwt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dwt(e){if(Array.isArray(e))return uR(e)}function uR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dR=function(t,n,r,i,s){var a=Tl(t,XQ),o=Tl(t,sT),c=[].concat(NX(a),NX(o)),u=Tl(t,oT),d="".concat(i,"Id"),h=i[0],A=n;if(c.length&&(A=c.reduce(function(m,g){if(g.props[d]===r&&hu(g.props,"extendDomain")&&tt(g.props[h])){var y=g.props[h];return[Math.min(m[0],y),Math.max(m[1],y)]}return m},A)),u.length){var f="".concat(h,"1"),p="".concat(h,"2");A=u.reduce(function(m,g){if(g.props[d]===r&&hu(g.props,"extendDomain")&&tt(g.props[f])&&tt(g.props[p])){var y=g.props[f],v=g.props[p];return[Math.min(m[0],y,v),Math.max(m[1],y,v)]}return m},A)}return s&&s.length&&(A=s.reduce(function(m,g){return tt(g)?[Math.min(m[0],g),Math.max(m[1],g)]:m},A)),A},Rge={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,h,A){if(typeof d!="function")throw new TypeError("The listener must be a function");var f=new i(d,h||c,A),p=n?n+u:u;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],f]:c._events[p].push(f):(c._events[p]=f,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],d,h;if(this._eventsCount===0)return u;for(h in d=this._events)t.call(d,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},o.prototype.listeners=function(u){var d=n?n+u:u,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var A=0,f=h.length,p=new Array(f);A<f;A++)p[A]=h[A].fn;return p},o.prototype.listenerCount=function(u){var d=n?n+u:u,h=this._events[d];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,d,h,A,f,p){var m=n?n+u:u;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,v,x;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,h),!0;case 4:return g.fn.call(g.context,d,h,A),!0;case 5:return g.fn.call(g.context,d,h,A,f),!0;case 6:return g.fn.call(g.context,d,h,A,f,p),!0}for(x=1,v=new Array(y-1);x<y;x++)v[x-1]=arguments[x];g.fn.apply(g.context,v)}else{var b=g.length,w;for(x=0;x<b;x++)switch(g[x].once&&this.removeListener(u,g[x].fn,void 0,!0),y){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,d);break;case 3:g[x].fn.call(g[x].context,d,h);break;case 4:g[x].fn.call(g[x].context,d,h,A);break;default:if(!v)for(w=1,v=new Array(y-1);w<y;w++)v[w-1]=arguments[w];g[x].fn.apply(g[x].context,v)}}return!0},o.prototype.on=function(u,d,h){return s(this,u,d,h,!1)},o.prototype.once=function(u,d,h){return s(this,u,d,h,!0)},o.prototype.removeListener=function(u,d,h,A){var f=n?n+u:u;if(!this._events[f])return this;if(!d)return a(this,f),this;var p=this._events[f];if(p.fn)p.fn===d&&(!A||p.once)&&(!h||p.context===h)&&a(this,f);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==d||A&&!p[m].once||h&&p[m].context!==h)&&g.push(p[m]);g.length?this._events[f]=g.length===1?g[0]:g:a(this,f)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&a(this,d)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o})(Rge);var Uwt=Rge.exports;const Hwt=Mn(Uwt);var R4=new Hwt,D4="recharts.syncMouseEvents";function G1(e){"@babel/helpers - typeof";return G1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G1(e)}function Qwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $wt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dge(r.key),r)}}function zwt(e,t,n){return t&&$wt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function U4(e,t,n){return t=Dge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dge(e){var t=Vwt(e,"string");return G1(t)=="symbol"?t:t+""}function Vwt(e,t){if(G1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(G1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Kwt=function(){function e(){Qwt(this,e),U4(this,"activeIndex",0),U4(this,"coordinateList",[]),U4(this,"layout","horizontal")}return zwt(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,s=i===void 0?null:i,a=n.container,o=a===void 0?null:a,c=n.layout,u=c===void 0?null:c,d=n.offset,h=d===void 0?null:d,A=n.mouseHandlerCallback,f=A===void 0?null:A;this.coordinateList=(r=s??this.coordinateList)!==null&&r!==void 0?r:[],this.container=o??this.container,this.layout=u??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=f??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,a=i.y,o=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,h=s+c+u,A=a+this.offset.top+o/2+d;this.mouseHandlerCallback({pageX:h,pageY:A})}}}])}();function qwt(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&tt(r)&&tt(i))return!0}return!1}function Wwt(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function Uge(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,s=e.endAngle,a=Ts(t,n,r,i),o=Ts(t,n,r,s);return{points:[a,o],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}function Gwt(e,t,n){var r,i,s,a;if(e==="horizontal")r=t.x,s=r,i=n.top,a=n.top+n.height;else if(e==="vertical")i=t.y,a=i,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var o=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,h=t.angle,A=Ts(o,c,u,h),f=Ts(o,c,d,h);r=A.x,i=A.y,s=f.x,a=f.y}else return Uge(t);return[{x:r,y:i},{x:s,y:a}]}function Y1(e){"@babel/helpers - typeof";return Y1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y1(e)}function EX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ek(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EX(Object(n),!0).forEach(function(r){Ywt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ywt(e,t,n){return t=Xwt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xwt(e){var t=Jwt(e,"string");return Y1(t)=="symbol"?t:t+""}function Jwt(e,t){if(Y1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Y1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zwt(e){var t,n,r=e.element,i=e.tooltipEventType,s=e.isActive,a=e.activeCoordinate,o=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,h=e.layout,A=e.chartName,f=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!f||!s||!a||A!=="ScatterChart"&&i!=="axis")return null;var p,m=ML;if(A==="ScatterChart")p=a,m=Zgt;else if(A==="BarChart")p=Wwt(h,a,c,d),m=$Q;else if(h==="radial"){var g=Uge(a),y=g.cx,v=g.cy,x=g.radius,b=g.startAngle,w=g.endAngle;p={cx:y,cy:v,startAngle:b,endAngle:w,innerRadius:x,outerRadius:x},m=zme}else p={points:Gwt(h,a,c)},m=ML;var k=ek(ek(ek(ek({stroke:"#ccc",pointerEvents:"none"},c),p),Tn(f,!1)),{},{payload:o,payloadIndex:u,className:Fn("recharts-tooltip-cursor",f.className)});return C.isValidElement(f)?C.cloneElement(f,k):C.createElement(m,k)}var ebt=["item"],tbt=["children","className","width","height","style","compact","title","desc"];function zv(e){"@babel/helpers - typeof";return zv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zv(e)}function ly(){return ly=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ly.apply(this,arguments)}function TX(e,t){return ibt(e)||rbt(e,t)||Qge(e,t)||nbt()}function nbt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rbt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function ibt(e){if(Array.isArray(e))return e}function IX(e,t){if(e==null)return{};var n=sbt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sbt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function abt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function obt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$ge(r.key),r)}}function lbt(e,t,n){return t&&obt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cbt(e,t,n){return t=jN(t),ubt(e,Hge()?Reflect.construct(t,n||[],jN(e).constructor):t.apply(e,n))}function ubt(e,t){if(t&&(zv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dbt(e)}function dbt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hge=function(){return!!e})()}function jN(e){return jN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jN(e)}function hbt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hR(e,t)}function hR(e,t){return hR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},hR(e,t)}function Vv(e){return pbt(e)||Abt(e)||Qge(e)||fbt()}function fbt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qge(e,t){if(e){if(typeof e=="string")return fR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fR(e,t)}}function Abt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pbt(e){if(Array.isArray(e))return fR(e)}function fR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PX(Object(n),!0).forEach(function(r){Vt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vt(e,t,n){return t=$ge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ge(e){var t=mbt(e,"string");return zv(t)=="symbol"?t:t+""}function mbt(e,t){if(zv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gbt={xAxis:["bottom","top"],yAxis:["left","right"]},ybt={width:"100%",height:"100%"},zge={x:0,y:0};function tk(e){return e}var vbt=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},xbt=function(t,n,r,i){var s=n.find(function(d){return d&&d.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:s.coordinate};if(t==="centric"){var a=s.coordinate,o=i.radius;return Pe(Pe(Pe({},i),Ts(i.cx,i.cy,o,a)),{},{angle:a,radius:o})}var c=s.coordinate,u=i.angle;return Pe(Pe(Pe({},i),Ts(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return zge},cT=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,s=n.dataEndIndex,a=(r??[]).reduce(function(o,c){var u=c.props.data;return u&&u.length?[].concat(Vv(o),Vv(u)):o},[]);return a.length>0?a:t&&t.length&&tt(i)&&tt(s)?t.slice(i,s+1):[]};function Vge(e){return e==="number"?[0,"auto"]:void 0}var AR=function(t,n,r,i){var s=t.graphicalItems,a=t.tooltipAxis,o=cT(n,t);return r<0||!s||!s.length||r>=o.length?null:s.reduce(function(c,u){var d,h=(d=u.props.data)!==null&&d!==void 0?d:n;h&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(h=h.slice(t.dataStartIndex,t.dataEndIndex+1));var A;if(a.dataKey&&!a.allowDuplicatedCategory){var f=h===void 0?o:h;A=NB(f,a.dataKey,i)}else A=h&&h[r]||o[r];return A?[].concat(Vv(c),[Hme(u,A)]):c},[])},OX=function(t,n,r,i){var s=i||{x:t.chartX,y:t.chartY},a=vbt(s,r),o=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=mpt(a,o,u,c);if(d>=0&&u){var h=u[d]&&u[d].value,A=AR(t,n,d,h),f=xbt(r,o,d,s);return{activeTooltipIndex:d,activeLabel:h,activePayload:A,activeCoordinate:f}}return null},wbt=function(t,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,a=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,A=t.stackOffset,f=Rme(d,s);return r.reduce(function(p,m){var g,y=m.type.defaultProps!==void 0?Pe(Pe({},m.type.defaultProps),m.props):m.props,v=y.type,x=y.dataKey,b=y.allowDataOverflow,w=y.allowDuplicatedCategory,k=y.scale,j=y.ticks,B=y.includeHidden,E=y[a];if(p[E])return p;var P=cT(t.data,{graphicalItems:i.filter(function(R){var M,Y=a in R.props?R.props[a]:(M=R.type.defaultProps)===null||M===void 0?void 0:M[a];return Y===E}),dataStartIndex:c,dataEndIndex:u}),T=P.length,N,F,L;qwt(y.domain,b,v)&&(N=TL(y.domain,null,b),f&&(v==="number"||k!=="auto")&&(L=nb(P,x,"category")));var U=Vge(v);if(!N||N.length===0){var H,W=(H=y.domain)!==null&&H!==void 0?H:U;if(x){if(N=nb(P,x,v),v==="category"&&f){var $=net(N);w&&$?(F=N,N=AN(0,T)):w||(N=xY(W,N,m).reduce(function(R,M){return R.indexOf(M)>=0?R:[].concat(Vv(R),[M])},[]))}else if(v==="category")w?N=N.filter(function(R){return R!==""&&!_n(R)}):N=xY(W,N,m).reduce(function(R,M){return R.indexOf(M)>=0||M===""||_n(M)?R:[].concat(Vv(R),[M])},[]);else if(v==="number"){var z=wpt(P,i.filter(function(R){var M,Y,X=a in R.props?R.props[a]:(M=R.type.defaultProps)===null||M===void 0?void 0:M[a],V="hide"in R.props?R.props.hide:(Y=R.type.defaultProps)===null||Y===void 0?void 0:Y.hide;return X===E&&(B||!V)}),x,s,d);z&&(N=z)}f&&(v==="number"||k!=="auto")&&(L=nb(P,x,"category"))}else f?N=AN(0,T):o&&o[E]&&o[E].hasStack&&v==="number"?N=A==="expand"?[0,1]:Ume(o[E].stackGroups,c,u):N=Lme(P,i.filter(function(R){var M=a in R.props?R.props[a]:R.type.defaultProps[a],Y="hide"in R.props?R.props.hide:R.type.defaultProps.hide;return M===E&&(B||!Y)}),v,d,!0);if(v==="number")N=dR(h,N,E,s,j),W&&(N=TL(W,N,b));else if(v==="category"&&W){var Q=W,ce=N.every(function(R){return Q.indexOf(R)>=0});ce&&(N=Q)}}return Pe(Pe({},p),{},Vt({},E,Pe(Pe({},y),{},{axisType:s,domain:N,categoricalDomain:L,duplicateDomain:F,originalDomain:(g=y.domain)!==null&&g!==void 0?g:U,isCategorical:f,layout:d})))},{})},bbt=function(t,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,a=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,A=cT(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),f=A.length,p=Rme(d,s),m=-1;return r.reduce(function(g,y){var v=y.type.defaultProps!==void 0?Pe(Pe({},y.type.defaultProps),y.props):y.props,x=v[a],b=Vge("number");if(!g[x]){m++;var w;return p?w=AN(0,f):o&&o[x]&&o[x].hasStack?(w=Ume(o[x].stackGroups,c,u),w=dR(h,w,x,s)):(w=TL(b,Lme(A,r.filter(function(k){var j,B,E=a in k.props?k.props[a]:(j=k.type.defaultProps)===null||j===void 0?void 0:j[a],P="hide"in k.props?k.props.hide:(B=k.type.defaultProps)===null||B===void 0?void 0:B.hide;return E===x&&!P}),"number",d),i.defaultProps.allowDataOverflow),w=dR(h,w,x,s)),Pe(Pe({},g),{},Vt({},x,Pe(Pe({axisType:s},i.defaultProps),{},{hide:!0,orientation:El(gbt,"".concat(s,".").concat(m%2),null),domain:w,originalDomain:b,isCategorical:p,layout:d})))}return g},{})},Cbt=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,a=n.graphicalItems,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,h="".concat(i,"Id"),A=Tl(d,s),f={};return A&&A.length?f=wbt(t,{axes:A,graphicalItems:a,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:c,dataEndIndex:u}):a&&a.length&&(f=bbt(t,{Axis:s,graphicalItems:a,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:c,dataEndIndex:u})),f},Sbt=function(t){var n=Eh(t),r=cd(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:pQ(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:sN(n,r)}},FX=function(t){var n=t.children,r=t.defaultShowTooltip,i=Eo(n,Fv),s=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},kbt=function(t){return!t||!t.length?!1:t.some(function(n){var r=hd(n&&n.type);return r&&r.indexOf("Bar")>=0})},MX=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},_bt=function(t,n){var r=t.props,i=t.graphicalItems,s=t.xAxisMap,a=s===void 0?{}:s,o=t.yAxisMap,c=o===void 0?{}:o,u=r.width,d=r.height,h=r.children,A=r.margin||{},f=Eo(h,Fv),p=Eo(h,Pp),m=Object.keys(c).reduce(function(w,k){var j=c[k],B=j.orientation;return!j.mirror&&!j.hide?Pe(Pe({},w),{},Vt({},B,w[B]+j.width)):w},{left:A.left||0,right:A.right||0}),g=Object.keys(a).reduce(function(w,k){var j=a[k],B=j.orientation;return!j.mirror&&!j.hide?Pe(Pe({},w),{},Vt({},B,El(w,"".concat(B))+j.height)):w},{top:A.top||0,bottom:A.bottom||0}),y=Pe(Pe({},g),m),v=y.bottom;f&&(y.bottom+=f.props.height||Fv.defaultProps.height),p&&n&&(y=vpt(y,i,r,n));var x=u-y.left-y.right,b=d-y.top-y.bottom;return Pe(Pe({brushBottom:v},y),{},{width:Math.max(x,0),height:Math.max(b,0)})},jbt=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Kge=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,a=t.validateTooltipEventTypes,o=a===void 0?["axis"]:a,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,h=t.defaultProps,A=function(y,v){var x=v.graphicalItems,b=v.stackGroups,w=v.offset,k=v.updateId,j=v.dataStartIndex,B=v.dataEndIndex,E=y.barSize,P=y.layout,T=y.barGap,N=y.barCategoryGap,F=y.maxBarSize,L=MX(P),U=L.numericAxisName,H=L.cateAxisName,W=kbt(x),$=[];return x.forEach(function(z,Q){var ce=cT(y.data,{graphicalItems:[z],dataStartIndex:j,dataEndIndex:B}),R=z.type.defaultProps!==void 0?Pe(Pe({},z.type.defaultProps),z.props):z.props,M=R.dataKey,Y=R.maxBarSize,X=R["".concat(U,"Id")],V=R["".concat(H,"Id")],Z={},de=c.reduce(function(we,He){var Ve=v["".concat(He.axisType,"Map")],Dt=R["".concat(He.axisType,"Id")];Ve&&Ve[Dt]||He.axisType==="zAxis"||lm();var pt=Ve[Dt];return Pe(Pe({},we),{},Vt(Vt({},He.axisType,pt),"".concat(He.axisType,"Ticks"),cd(pt)))},Z),ue=de[H],se=de["".concat(H,"Ticks")],he=b&&b[X]&&b[X].hasStack&&Ppt(z,b[X].stackGroups),ie=hd(z.type).indexOf("Bar")>=0,Ce=sN(ue,se),Ie=[],te=W&&gpt({barSize:E,stackGroups:b,totalSize:jbt(de,H)});if(ie){var je,nt,rt=_n(Y)?F:Y,Ne=(je=(nt=sN(ue,se,!0))!==null&&nt!==void 0?nt:rt)!==null&&je!==void 0?je:0;Ie=ypt({barGap:T,barCategoryGap:N,bandSize:Ne!==Ce?Ne:Ce,sizeList:te[V],maxBarSize:rt}),Ne!==Ce&&(Ie=Ie.map(function(we){return Pe(Pe({},we),{},{position:Pe(Pe({},we.position),{},{offset:we.position.offset-Ne/2})})}))}var st=z&&z.type&&z.type.getComposedData;st&&$.push({props:Pe(Pe({},st(Pe(Pe({},de),{},{displayedData:ce,props:y,dataKey:M,item:z,bandSize:Ce,barPosition:Ie,offset:w,stackedData:he,layout:P,dataStartIndex:j,dataEndIndex:B}))),{},Vt(Vt(Vt({key:z.key||"item-".concat(Q)},U,de[U]),H,de[H]),"animationId",k)),childIndex:pet(z,y.children),item:z})}),$},f=function(y,v){var x=y.props,b=y.dataStartIndex,w=y.dataEndIndex,k=y.updateId;if(!fW({props:x}))return null;var j=x.children,B=x.layout,E=x.stackOffset,P=x.data,T=x.reverseStackOrder,N=MX(B),F=N.numericAxisName,L=N.cateAxisName,U=Tl(j,r),H=Ept(P,U,"".concat(F,"Id"),"".concat(L,"Id"),E,T),W=c.reduce(function(R,M){var Y="".concat(M.axisType,"Map");return Pe(Pe({},R),{},Vt({},Y,Cbt(x,Pe(Pe({},M),{},{graphicalItems:U,stackGroups:M.axisType===F&&H,dataStartIndex:b,dataEndIndex:w}))))},{}),$=_bt(Pe(Pe({},W),{},{props:x,graphicalItems:U}),v==null?void 0:v.legendBBox);Object.keys(W).forEach(function(R){W[R]=d(x,W[R],$,R.replace("Map",""),n)});var z=W["".concat(L,"Map")],Q=Sbt(z),ce=A(x,Pe(Pe({},W),{},{dataStartIndex:b,dataEndIndex:w,updateId:k,graphicalItems:U,stackGroups:H,offset:$}));return Pe(Pe({formattedGraphicalItems:ce,graphicalItems:U,offset:$,stackGroups:H},Q),W)},p=function(g){function y(v){var x,b,w;return abt(this,y),w=cbt(this,y,[v]),Vt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Vt(w,"accessibilityManager",new Kwt),Vt(w,"handleLegendBBoxUpdate",function(k){if(k){var j=w.state,B=j.dataStartIndex,E=j.dataEndIndex,P=j.updateId;w.setState(Pe({legendBBox:k},f({props:w.props,dataStartIndex:B,dataEndIndex:E,updateId:P},Pe(Pe({},w.state),{},{legendBBox:k}))))}}),Vt(w,"handleReceiveSyncEvent",function(k,j,B){if(w.props.syncId===k){if(B===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(j)}}),Vt(w,"handleBrushChange",function(k){var j=k.startIndex,B=k.endIndex;if(j!==w.state.dataStartIndex||B!==w.state.dataEndIndex){var E=w.state.updateId;w.setState(function(){return Pe({dataStartIndex:j,dataEndIndex:B},f({props:w.props,dataStartIndex:j,dataEndIndex:B,updateId:E},w.state))}),w.triggerSyncEvent({dataStartIndex:j,dataEndIndex:B})}}),Vt(w,"handleMouseEnter",function(k){var j=w.getMouseInfo(k);if(j){var B=Pe(Pe({},j),{},{isTooltipActive:!0});w.setState(B),w.triggerSyncEvent(B);var E=w.props.onMouseEnter;yn(E)&&E(B,k)}}),Vt(w,"triggeredAfterMouseMove",function(k){var j=w.getMouseInfo(k),B=j?Pe(Pe({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(B),w.triggerSyncEvent(B);var E=w.props.onMouseMove;yn(E)&&E(B,k)}),Vt(w,"handleItemMouseEnter",function(k){w.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Vt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Vt(w,"handleMouseMove",function(k){k.persist(),w.throttleTriggeredAfterMouseMove(k)}),Vt(w,"handleMouseLeave",function(k){w.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};w.setState(j),w.triggerSyncEvent(j);var B=w.props.onMouseLeave;yn(B)&&B(j,k)}),Vt(w,"handleOuterEvent",function(k){var j=Aet(k),B=El(w.props,"".concat(j));if(j&&yn(B)){var E,P;/.*touch.*/i.test(j)?P=w.getMouseInfo(k.changedTouches[0]):P=w.getMouseInfo(k),B((E=P)!==null&&E!==void 0?E:{},k)}}),Vt(w,"handleClick",function(k){var j=w.getMouseInfo(k);if(j){var B=Pe(Pe({},j),{},{isTooltipActive:!0});w.setState(B),w.triggerSyncEvent(B);var E=w.props.onClick;yn(E)&&E(B,k)}}),Vt(w,"handleMouseDown",function(k){var j=w.props.onMouseDown;if(yn(j)){var B=w.getMouseInfo(k);j(B,k)}}),Vt(w,"handleMouseUp",function(k){var j=w.props.onMouseUp;if(yn(j)){var B=w.getMouseInfo(k);j(B,k)}}),Vt(w,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Vt(w,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&w.handleMouseDown(k.changedTouches[0])}),Vt(w,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&w.handleMouseUp(k.changedTouches[0])}),Vt(w,"handleDoubleClick",function(k){var j=w.props.onDoubleClick;if(yn(j)){var B=w.getMouseInfo(k);j(B,k)}}),Vt(w,"handleContextMenu",function(k){var j=w.props.onContextMenu;if(yn(j)){var B=w.getMouseInfo(k);j(B,k)}}),Vt(w,"triggerSyncEvent",function(k){w.props.syncId!==void 0&&R4.emit(D4,w.props.syncId,k,w.eventEmitterSymbol)}),Vt(w,"applySyncEvent",function(k){var j=w.props,B=j.layout,E=j.syncMethod,P=w.state.updateId,T=k.dataStartIndex,N=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)w.setState(Pe({dataStartIndex:T,dataEndIndex:N},f({props:w.props,dataStartIndex:T,dataEndIndex:N,updateId:P},w.state)));else if(k.activeTooltipIndex!==void 0){var F=k.chartX,L=k.chartY,U=k.activeTooltipIndex,H=w.state,W=H.offset,$=H.tooltipTicks;if(!W)return;if(typeof E=="function")U=E($,k);else if(E==="value"){U=-1;for(var z=0;z<$.length;z++)if($[z].value===k.activeLabel){U=z;break}}var Q=Pe(Pe({},W),{},{x:W.left,y:W.top}),ce=Math.min(F,Q.x+Q.width),R=Math.min(L,Q.y+Q.height),M=$[U]&&$[U].value,Y=AR(w.state,w.props.data,U),X=$[U]?{x:B==="horizontal"?$[U].coordinate:ce,y:B==="horizontal"?R:$[U].coordinate}:zge;w.setState(Pe(Pe({},k),{},{activeLabel:M,activeCoordinate:X,activePayload:Y,activeTooltipIndex:U}))}else w.setState(k)}),Vt(w,"renderCursor",function(k){var j,B=w.state,E=B.isTooltipActive,P=B.activeCoordinate,T=B.activePayload,N=B.offset,F=B.activeTooltipIndex,L=B.tooltipAxisBandSize,U=w.getTooltipEventType(),H=(j=k.props.active)!==null&&j!==void 0?j:E,W=w.props.layout,$=k.key||"_recharts-cursor";return re.createElement(Zwt,{key:$,activeCoordinate:P,activePayload:T,activeTooltipIndex:F,chartName:n,element:k,isActive:H,layout:W,offset:N,tooltipAxisBandSize:L,tooltipEventType:U})}),Vt(w,"renderPolarAxis",function(k,j,B){var E=El(k,"type.axisType"),P=El(w.state,"".concat(E,"Map")),T=k.type.defaultProps,N=T!==void 0?Pe(Pe({},T),k.props):k.props,F=P&&P[N["".concat(E,"Id")]];return C.cloneElement(k,Pe(Pe({},F),{},{className:Fn(E,F.className),key:k.key||"".concat(j,"-").concat(B),ticks:cd(F,!0)}))}),Vt(w,"renderPolarGrid",function(k){var j=k.props,B=j.radialLines,E=j.polarAngles,P=j.polarRadius,T=w.state,N=T.radiusAxisMap,F=T.angleAxisMap,L=Eh(N),U=Eh(F),H=U.cx,W=U.cy,$=U.innerRadius,z=U.outerRadius;return C.cloneElement(k,{polarAngles:Array.isArray(E)?E:cd(U,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(P)?P:cd(L,!0).map(function(Q){return Q.coordinate}),cx:H,cy:W,innerRadius:$,outerRadius:z,key:k.key||"polar-grid",radialLines:B})}),Vt(w,"renderLegend",function(){var k=w.state.formattedGraphicalItems,j=w.props,B=j.children,E=j.width,P=j.height,T=w.props.margin||{},N=E-(T.left||0)-(T.right||0),F=Fme({children:B,formattedGraphicalItems:k,legendWidth:N,legendContent:u});if(!F)return null;var L=F.item,U=IX(F,ebt);return C.cloneElement(L,Pe(Pe({},U),{},{chartWidth:E,chartHeight:P,margin:T,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Vt(w,"renderTooltip",function(){var k,j=w.props,B=j.children,E=j.accessibilityLayer,P=Eo(B,ul);if(!P)return null;var T=w.state,N=T.isTooltipActive,F=T.activeCoordinate,L=T.activePayload,U=T.activeLabel,H=T.offset,W=(k=P.props.active)!==null&&k!==void 0?k:N;return C.cloneElement(P,{viewBox:Pe(Pe({},H),{},{x:H.left,y:H.top}),active:W,label:U,payload:W?L:[],coordinate:F,accessibilityLayer:E})}),Vt(w,"renderBrush",function(k){var j=w.props,B=j.margin,E=j.data,P=w.state,T=P.offset,N=P.dataStartIndex,F=P.dataEndIndex,L=P.updateId;return C.cloneElement(k,{key:k.key||"_recharts-brush",onChange:XS(w.handleBrushChange,k.props.onChange),data:E,x:tt(k.props.x)?k.props.x:T.left,y:tt(k.props.y)?k.props.y:T.top+T.height+T.brushBottom-(B.bottom||0),width:tt(k.props.width)?k.props.width:T.width,startIndex:N,endIndex:F,updateId:"brush-".concat(L)})}),Vt(w,"renderReferenceElement",function(k,j,B){if(!k)return null;var E=w,P=E.clipPathId,T=w.state,N=T.xAxisMap,F=T.yAxisMap,L=T.offset,U=k.type.defaultProps||{},H=k.props,W=H.xAxisId,$=W===void 0?U.xAxisId:W,z=H.yAxisId,Q=z===void 0?U.yAxisId:z;return C.cloneElement(k,{key:k.key||"".concat(j,"-").concat(B),xAxis:N[$],yAxis:F[Q],viewBox:{x:L.left,y:L.top,width:L.width,height:L.height},clipPathId:P})}),Vt(w,"renderActivePoints",function(k){var j=k.item,B=k.activePoint,E=k.basePoint,P=k.childIndex,T=k.isRange,N=[],F=j.props.key,L=j.item.type.defaultProps!==void 0?Pe(Pe({},j.item.type.defaultProps),j.item.props):j.item.props,U=L.activeDot,H=L.dataKey,W=Pe(Pe({index:P,dataKey:H,cx:B.x,cy:B.y,r:4,fill:QQ(j.item),strokeWidth:2,stroke:"#fff",payload:B.payload,value:B.value},Tn(U,!1)),EB(U));return N.push(y.renderActiveDot(U,W,"".concat(F,"-activePoint-").concat(P))),E?N.push(y.renderActiveDot(U,Pe(Pe({},W),{},{cx:E.x,cy:E.y}),"".concat(F,"-basePoint-").concat(P))):T&&N.push(null),N}),Vt(w,"renderGraphicChild",function(k,j,B){var E=w.filterFormatItem(k,j,B);if(!E)return null;var P=w.getTooltipEventType(),T=w.state,N=T.isTooltipActive,F=T.tooltipAxis,L=T.activeTooltipIndex,U=T.activeLabel,H=w.props.children,W=Eo(H,ul),$=E.props,z=$.points,Q=$.isRange,ce=$.baseLine,R=E.item.type.defaultProps!==void 0?Pe(Pe({},E.item.type.defaultProps),E.item.props):E.item.props,M=R.activeDot,Y=R.hide,X=R.activeBar,V=R.activeShape,Z=!!(!Y&&N&&W&&(M||X||V)),de={};P!=="axis"&&W&&W.props.trigger==="click"?de={onClick:XS(w.handleItemMouseEnter,k.props.onClick)}:P!=="axis"&&(de={onMouseLeave:XS(w.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:XS(w.handleItemMouseEnter,k.props.onMouseEnter)});var ue=C.cloneElement(k,Pe(Pe({},E.props),de));function se(He){return typeof F.dataKey=="function"?F.dataKey(He.payload):null}if(Z)if(L>=0){var he,ie;if(F.dataKey&&!F.allowDuplicatedCategory){var Ce=typeof F.dataKey=="function"?se:"payload.".concat(F.dataKey.toString());he=NB(z,Ce,U),ie=Q&&ce&&NB(ce,Ce,U)}else he=z==null?void 0:z[L],ie=Q&&ce&&ce[L];if(V||X){var Ie=k.props.activeIndex!==void 0?k.props.activeIndex:L;return[C.cloneElement(k,Pe(Pe(Pe({},E.props),de),{},{activeIndex:Ie})),null,null]}if(!_n(he))return[ue].concat(Vv(w.renderActivePoints({item:E,activePoint:he,basePoint:ie,childIndex:L,isRange:Q})))}else{var te,je=(te=w.getItemByXY(w.state.activeCoordinate))!==null&&te!==void 0?te:{graphicalItem:ue},nt=je.graphicalItem,rt=nt.item,Ne=rt===void 0?k:rt,st=nt.childIndex,we=Pe(Pe(Pe({},E.props),de),{},{activeIndex:st});return[C.cloneElement(Ne,we),null,null]}return Q?[ue,null,null]:[ue,null]}),Vt(w,"renderCustomized",function(k,j,B){return C.cloneElement(k,Pe(Pe({key:"recharts-customized-".concat(B)},w.props),w.state))}),Vt(w,"renderMap",{CartesianGrid:{handler:tk,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:tk},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:tk},YAxis:{handler:tk},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=v.id)!==null&&x!==void 0?x:V2("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=Ope(w.triggeredAfterMouseMove,(b=v.throttleDelay)!==null&&b!==void 0?b:1e3/60),w.state={},w}return hbt(y,g),lbt(y,[{key:"componentDidMount",value:function(){var x,b;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,b=x.children,w=x.data,k=x.height,j=x.layout,B=Eo(b,ul);if(B){var E=B.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var P=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,T=AR(this.state,w,E,P),N=this.state.tooltipTicks[E].coordinate,F=(this.state.offset.top+k)/2,L=j==="horizontal",U=L?{x:N,y:F}:{y:N,x:F},H=this.state.formattedGraphicalItems.find(function($){var z=$.item;return z.type.name==="Scatter"});H&&(U=Pe(Pe({},U),H.props.points[E].tooltipPosition),T=H.props.points[E].tooltipPayload);var W={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:P,activePayload:T,activeCoordinate:U};this.setState(W),this.renderCursor(B),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,b){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==b.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,k;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(x){KM([Eo(x.children,ul)],[Eo(this.props.children,ul)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Eo(this.props.children,ul);if(x&&typeof x.props.shared=="boolean"){var b=x.props.shared?"axis":"item";return o.indexOf(b)>=0?b:s}return s}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var b=this.container,w=b.getBoundingClientRect(),k=Qut(w),j={chartX:Math.round(x.pageX-k.left),chartY:Math.round(x.pageY-k.top)},B=w.width/b.offsetWidth||1,E=this.inRange(j.chartX,j.chartY,B);if(!E)return null;var P=this.state,T=P.xAxisMap,N=P.yAxisMap,F=this.getTooltipEventType();if(F!=="axis"&&T&&N){var L=Eh(T).scale,U=Eh(N).scale,H=L&&L.invert?L.invert(j.chartX):null,W=U&&U.invert?U.invert(j.chartY):null;return Pe(Pe({},j),{},{xValue:H,yValue:W})}var $=OX(this.state,this.props.data,this.props.layout,E);return $?Pe(Pe({},j),$):null}},{key:"inRange",value:function(x,b){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,j=x/w,B=b/w;if(k==="horizontal"||k==="vertical"){var E=this.state.offset,P=j>=E.left&&j<=E.left+E.width&&B>=E.top&&B<=E.top+E.height;return P?{x:j,y:B}:null}var T=this.state,N=T.angleAxisMap,F=T.radiusAxisMap;if(N&&F){var L=Eh(N);return CY({x:j,y:B},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,b=this.getTooltipEventType(),w=Eo(x,ul),k={};w&&b==="axis"&&(w.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=EB(this.props,this.handleOuterEvent);return Pe(Pe({},j),k)}},{key:"addListener",value:function(){R4.on(D4,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){R4.removeListener(D4,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,b,w){for(var k=this.state.formattedGraphicalItems,j=0,B=k.length;j<B;j++){var E=k[j];if(E.item===x||E.props.key===x.key||b===hd(E.item.type)&&w===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,b=this.state.offset,w=b.left,k=b.top,j=b.height,B=b.width;return re.createElement("defs",null,re.createElement("clipPath",{id:x},re.createElement("rect",{x:w,y:k,height:j,width:B})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(b,w){var k=TX(w,2),j=k[0],B=k[1];return Pe(Pe({},b),{},Vt({},j,B.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(b,w){var k=TX(w,2),j=k[0],B=k[1];return Pe(Pe({},b),{},Vt({},j,B.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var b;return(b=this.state.xAxisMap)===null||b===void 0||(b=b[x])===null||b===void 0?void 0:b.scale}},{key:"getYScaleByAxisId",value:function(x){var b;return(b=this.state.yAxisMap)===null||b===void 0||(b=b[x])===null||b===void 0?void 0:b.scale}},{key:"getItemByXY",value:function(x){var b=this.state,w=b.formattedGraphicalItems,k=b.activeItem;if(w&&w.length)for(var j=0,B=w.length;j<B;j++){var E=w[j],P=E.props,T=E.item,N=T.type.defaultProps!==void 0?Pe(Pe({},T.type.defaultProps),T.props):T.props,F=hd(T.type);if(F==="Bar"){var L=(P.data||[]).find(function($){return $gt(x,$)});if(L)return{graphicalItem:E,payload:L}}else if(F==="RadialBar"){var U=(P.data||[]).find(function($){return CY(x,$)});if(U)return{graphicalItem:E,payload:U}}else if(tT(E,k)||nT(E,k)||z1(E,k)){var H=Kyt({graphicalItem:E,activeTooltipItem:k,itemData:N.data}),W=N.activeIndex===void 0?H:N.activeIndex;return{graphicalItem:Pe(Pe({},E),{},{childIndex:W}),payload:z1(E,k)?N.data[H]:E.props.data[H]}}}return null}},{key:"render",value:function(){var x=this;if(!fW(this))return null;var b=this.props,w=b.children,k=b.className,j=b.width,B=b.height,E=b.style,P=b.compact,T=b.title,N=b.desc,F=IX(b,tbt),L=Tn(F,!1);if(P)return re.createElement(fX,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},re.createElement(WM,ly({},L,{width:j,height:B,title:T,desc:N}),this.renderClipPath(),pW(w,this.renderMap)));if(this.props.accessibilityLayer){var U,H;L.tabIndex=(U=this.props.tabIndex)!==null&&U!==void 0?U:0,L.role=(H=this.props.role)!==null&&H!==void 0?H:"application",L.onKeyDown=function($){x.accessibilityManager.keyboardEvent($)},L.onFocus=function(){x.accessibilityManager.focus()}}var W=this.parseEventsOfWrapper();return re.createElement(fX,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},re.createElement("div",ly({className:Fn("recharts-wrapper",k),style:Pe({position:"relative",cursor:"default",width:j,height:B},E)},W,{ref:function(z){x.container=z}}),re.createElement(WM,ly({},L,{width:j,height:B,title:T,desc:N,style:ybt}),this.renderClipPath(),pW(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(C.Component);Vt(p,"displayName",n),Vt(p,"defaultProps",Pe({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},h)),Vt(p,"getDerivedStateFromProps",function(g,y){var v=g.dataKey,x=g.data,b=g.children,w=g.width,k=g.height,j=g.layout,B=g.stackOffset,E=g.margin,P=y.dataStartIndex,T=y.dataEndIndex;if(y.updateId===void 0){var N=FX(g);return Pe(Pe(Pe({},N),{},{updateId:0},f(Pe(Pe({props:g},N),{},{updateId:0}),y)),{},{prevDataKey:v,prevData:x,prevWidth:w,prevHeight:k,prevLayout:j,prevStackOffset:B,prevMargin:E,prevChildren:b})}if(v!==y.prevDataKey||x!==y.prevData||w!==y.prevWidth||k!==y.prevHeight||j!==y.prevLayout||B!==y.prevStackOffset||!Py(E,y.prevMargin)){var F=FX(g),L={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},U=Pe(Pe({},OX(y,x,j)),{},{updateId:y.updateId+1}),H=Pe(Pe(Pe({},F),L),U);return Pe(Pe(Pe({},H),f(Pe({props:g},H),y)),{},{prevDataKey:v,prevData:x,prevWidth:w,prevHeight:k,prevLayout:j,prevStackOffset:B,prevMargin:E,prevChildren:b})}if(!KM(b,y.prevChildren)){var W,$,z,Q,ce=Eo(b,Fv),R=ce&&(W=($=ce.props)===null||$===void 0?void 0:$.startIndex)!==null&&W!==void 0?W:P,M=ce&&(z=(Q=ce.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&z!==void 0?z:T,Y=R!==P||M!==T,X=!_n(x),V=X&&!Y?y.updateId:y.updateId+1;return Pe(Pe({updateId:V},f(Pe(Pe({props:g},y),{},{updateId:V,dataStartIndex:R,dataEndIndex:M}),y)),{},{prevChildren:b,dataStartIndex:R,dataEndIndex:M})}return null}),Vt(p,"renderActiveDot",function(g,y,v){var x;return C.isValidElement(g)?x=C.cloneElement(g,y):yn(g)?x=g(y):x=re.createElement(zQ,y),re.createElement(Si,{className:"recharts-active-dot",key:v},x)});var m=C.forwardRef(function(y,v){return re.createElement(p,ly({},y,{ref:v}))});return m.displayName=p.displayName,m},qge=Kge({chartName:"LineChart",GraphicalChild:I0,axisComponents:[{axisType:"xAxis",AxisComp:jm},{axisType:"yAxis",AxisComp:Bm}],formatAxisMap:uge}),Bbt=Kge({chartName:"BarChart",GraphicalChild:_m,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:jm},{axisType:"yAxis",AxisComp:Bm}],formatAxisMap:uge});const LX={GPTBot:"#22c55e","ChatGPT-User":"#16a34a","OAI-SearchBot":"#15803d",ClaudeBot:"#f97316","Claude-Web":"#ea580c",PerplexityBot:"#3b82f6",Googlebot:"#ef4444","Google-Extended":"#dc2626",Bingbot:"#14b8a6",Bytespider:"#8b5cf6",CCBot:"#6b7280",Amazonbot:"#f59e0b",FacebookBot:"#2563eb","Meta-ExternalAgent":"#1d4ed8",AppleBot:"#a3a3a3",DuckDuckBot:"#f97316",YandexBot:"#ef4444","Cohere-AI":"#ec4899"},Nbt=()=>{const[e,t]=C.useState([]),[n,r]=C.useState(!0),[i,s]=C.useState([]),[a,o]=C.useState(!0);C.useEffect(()=>{(async()=>{const k=new Date(Date.now()-2592e6).toISOString(),{data:j}=await Me.from("crawl_events").select("id, crawler_name, crawler_company, page_path, status_code, created_at").gte("created_at",k).order("created_at",{ascending:!1}).limit(1e3);t(j||[]),r(!1)})()},[]),C.useEffect(()=>{(async()=>{const[{data:k},{data:j}]=await Promise.all([Me.from("aeo_pages").select("slug").eq("status","published"),Me.from("crawl_events").select("page_path")]);if(k&&j){const B=new Set((j||[]).map(P=>P.page_path)),E=k.map(P=>`/${P.slug}`).filter(P=>!B.has(P));s(E)}o(!1)})()},[]);const c=Date.now(),u=c-7*864e5,d=c-14*864e5,h=C.useMemo(()=>e.filter(w=>new Date(w.created_at).getTime()>=u),[e,u]),A=C.useMemo(()=>e.filter(w=>{const k=new Date(w.created_at).getTime();return k>=d&&k<u}),[e,u,d]),f=C.useMemo(()=>new Set(h.map(w=>w.crawler_name)).size,[h]),p=C.useMemo(()=>{const w={};h.forEach(j=>{w[j.crawler_name]=(w[j.crawler_name]||0)+1});const k=Object.entries(w).sort((j,B)=>B[1]-j[1])[0];return k?{name:k[0],count:k[1]}:null},[h]),m=C.useMemo(()=>new Set(h.map(w=>w.page_path)).size,[h]),g=h.length>A.length?"up":h.length<A.length?"down":"flat",y=g==="up"?Tre:g==="down"?k2e:jre,v=C.useMemo(()=>{const w={},k=new Set;return e.forEach(B=>{const E=B.created_at.substring(0,10);w[E]||(w[E]={}),w[E][B.crawler_name]=(w[E][B.crawler_name]||0)+1,k.add(B.crawler_name)}),{data:Object.entries(w).sort((B,E)=>B[0].localeCompare(E[0])).map(([B,E])=>({date:B.slice(5),...E})),crawlers:Array.from(k)}},[e]),x=C.useMemo(()=>{const w={};return h.forEach(k=>{w[k.crawler_name]||(w[k.crawler_name]={company:k.crawler_company,count:0,lastVisit:k.created_at,pageCounts:{}}),w[k.crawler_name].count++,w[k.crawler_name].pageCounts[k.page_path]=(w[k.crawler_name].pageCounts[k.page_path]||0)+1,k.created_at>w[k.crawler_name].lastVisit&&(w[k.crawler_name].lastVisit=k.created_at)}),Object.entries(w).map(([k,j])=>{var B;return{name:k,company:j.company,count:j.count,lastVisit:j.lastVisit,topPage:((B=Object.entries(j.pageCounts).sort((E,P)=>P[1]-E[1])[0])==null?void 0:B[0])||"-"}}).sort((k,j)=>j.count-k.count)},[h]),b=e.slice(0,50);return n?l.jsxs("div",{className:"space-y-4",children:[l.jsx(ht,{className:"h-32 w-full"}),l.jsx(ht,{className:"h-64 w-full"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(Zt,{children:l.jsx(en,{className:"pt-6",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Visits (7d)"}),l.jsx("p",{className:"text-2xl font-bold",children:h.length})]}),l.jsx(y,{className:`w-5 h-5 ${g==="up"?"text-green-500":g==="down"?"text-red-500":"text-muted-foreground"}`})]})})}),l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx(Gk,{className:"w-5 h-5 text-muted-foreground"})}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Unique Crawlers"}),l.jsx("p",{className:"text-2xl font-bold",children:f})]})}),l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Most Active Crawler"}),l.jsx("p",{className:"text-2xl font-bold",children:(p==null?void 0:p.name)||"—"}),p&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:[p.count," visits"]})]})}),l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx(Vp,{className:"w-5 h-5 text-muted-foreground"})}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Pages Crawled"}),l.jsx("p",{className:"text-2xl font-bold",children:m})]})})]}),l.jsxs(Zt,{children:[l.jsx(Sa,{children:l.jsx(ka,{className:"text-base",children:"Crawler Activity — Last 30 Days"})}),l.jsx(en,{children:v.data.length===0?l.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No crawler activity recorded yet."}):l.jsx(gQ,{width:"100%",height:300,children:l.jsxs(qge,{data:v.data,children:[l.jsx(lT,{strokeDasharray:"3 3",className:"stroke-border"}),l.jsx(jm,{dataKey:"date",className:"text-xs"}),l.jsx(Bm,{className:"text-xs"}),l.jsx(ul,{contentStyle:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"}}),l.jsx(Pp,{}),v.crawlers.map(w=>l.jsx(I0,{type:"monotone",dataKey:w,stroke:LX[w]||"#888",strokeWidth:2,dot:!1},w))]})})})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs(Zt,{children:[l.jsx(Sa,{children:l.jsx(ka,{className:"text-base",children:"Crawler Breakdown (7d)"})}),l.jsx(en,{children:x.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No crawler visits in the last 7 days."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-2 font-medium",children:"Crawler"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Company"}),l.jsx("th",{className:"text-right py-2 font-medium",children:"Visits"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Last Visit"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Top Page"})]})}),l.jsx("tbody",{children:x.map(w=>l.jsxs("tr",{className:"border-b border-border/50",children:[l.jsx("td",{className:"py-2 font-medium",children:w.name}),l.jsx("td",{className:"py-2 text-muted-foreground",children:w.company}),l.jsx("td",{className:"py-2 text-right",children:w.count}),l.jsx("td",{className:"py-2 text-muted-foreground",children:Iy(new Date(w.lastVisit),{addSuffix:!0})}),l.jsx("td",{className:"py-2 text-xs text-muted-foreground truncate max-w-[150px]",children:w.topPage})]},w.name))})]})})})]}),l.jsxs(Zt,{children:[l.jsx(Sa,{children:l.jsx(ka,{className:"text-base",children:"Pages Never Crawled"})}),l.jsx(en,{children:a?l.jsx(ht,{className:"h-20 w-full"}):i.length===0?l.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[l.jsx(nU,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm",children:"All AEO pages have been crawled by at least one AI bot."})]}):l.jsx("ul",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:i.map(w=>l.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[l.jsx(qp,{className:"w-4 h-4 text-yellow-500 shrink-0"}),l.jsx("span",{className:"text-muted-foreground truncate",children:w})]},w))})})]})]}),l.jsxs(Zt,{children:[l.jsx(Sa,{children:l.jsx(ka,{className:"text-base",children:"Recent Activity"})}),l.jsx(en,{children:b.length===0?l.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No crawler activity recorded yet. Bot visits will appear here once detected."}):l.jsx("div",{className:"max-h-[400px] overflow-y-auto space-y-2",children:b.map(w=>l.jsxs("div",{className:"flex items-center gap-3 text-sm py-1.5 border-b border-border/30 last:border-0",children:[l.jsx("span",{className:"text-xs text-muted-foreground w-24 shrink-0",children:Iy(new Date(w.created_at),{addSuffix:!0})}),l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:LX[w.crawler_name]||"#888"}}),l.jsx("span",{className:"font-medium w-32 shrink-0",children:w.crawler_name}),l.jsx("span",{className:"text-muted-foreground truncate flex-1",children:w.page_path}),l.jsx(Yt,{variant:w.status_code===200?"default":"destructive",className:"text-xs shrink-0",children:w.status_code||200})]},w.id))})})]})]})},Ux=["perplexity","openai","gemini"],nk={perplexity:{label:"Perplexity",color:"#3b82f6",bgClass:"bg-blue-100 text-blue-800"},openai:{label:"ChatGPT",color:"#22c55e",bgClass:"bg-green-100 text-green-800"},gemini:{label:"Gemini",color:"#a855f7",bgClass:"bg-purple-100 text-purple-800"}},RX={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",guides:"bg-teal-100 text-teal-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},Ebt=["buying","selling","neighborhoods","market-insights","guides","luxury","general"],Tbt=({siteDomain:e})=>{const[t,n]=C.useState([]),[r,i]=C.useState([]),[s,a]=C.useState(!0),[o,c]=C.useState(!1),[u,d]=C.useState({current:0,total:0}),[h,A]=C.useState(new Set),[f,p]=C.useState(new Set),[m,g]=C.useState("all"),[y,v]=C.useState("all"),[x,b]=C.useState("last-checked"),w="khmmwvmdbhaplcfcndjx",k="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",j=C.useCallback(async()=>{const V=new Date(Date.now()-2592e6).toISOString(),[{data:Z},{data:de}]=await Promise.all([Me.from("citation_checks").select("*").eq("site_domain",e).gte("checked_at",V).order("checked_at",{ascending:!1}).limit(1e3),Me.from("monitor_prompts").select("*").eq("site_domain",e).eq("is_active",!0).order("created_at",{ascending:!0})]);n(Z||[]),i(de||[]),a(!1)},[e]);C.useEffect(()=>{j()},[j]);const B=t.length,E=t.filter(V=>V.was_cited).length,P=B>0?Math.round(E/B*100):0,T=C.useMemo(()=>{const V=new Set(t.filter(Z=>Z.was_cited).map(Z=>Z.ai_platform));return Ux.map(Z=>({platform:Z,citing:V.has(Z)}))},[t]),N=C.useMemo(()=>{const V=t.filter(Z=>{const de=Z.competitor_mentions;return Array.isArray(de)&&de.length>0}).length;return B>0?Math.round(V/B*100):0},[t,B]),F=C.useMemo(()=>Ux.map(V=>{var ie;const Z=t.filter(Ce=>Ce.ai_platform===V),de=Z.filter(Ce=>Ce.was_cited).length,ue=Z.length>0?Math.round(de/Z.length*100):0,se=Z[0],he=((ie=Z.find(Ce=>Ce.was_cited&&Ce.citation_url))==null?void 0:ie.citation_url)||null;return{platform:V,total:Z.length,cited:de,rate:ue,lastCheck:se,lastCitedUrl:he,hasData:Z.length>0}}),[t]),L=C.useMemo(()=>r.map(V=>{const Z=t.filter(he=>he.prompt_text===V.prompt_text),de={};Ux.forEach(he=>{de[he]=Z.find(ie=>ie.ai_platform===he)||null});const ue=Z.length>0?Z[0].checked_at:null,se=Ux.filter(he=>{var ie;return(ie=de[he])==null?void 0:ie.was_cited}).length;return{...V,byPlatform:de,lastChecked:ue,citedCount:se}}),[r,t]),U=C.useMemo(()=>{let V=L;return m!=="all"&&(V=V.filter(Z=>Z.category===m)),y==="cited"&&(V=V.filter(Z=>Z.citedCount>0)),y==="not-cited"&&(V=V.filter(Z=>Z.citedCount===0)),x==="citation-rate"?V=[...V].sort((Z,de)=>de.citedCount-Z.citedCount):x==="category"?V=[...V].sort((Z,de)=>Z.category.localeCompare(de.category)):V=[...V].sort((Z,de)=>!Z.lastChecked&&!de.lastChecked?0:Z.lastChecked?de.lastChecked?new Date(de.lastChecked).getTime()-new Date(Z.lastChecked).getTime():-1:1),V},[L,m,y,x]),H=async V=>{c(!0),d({current:0,total:V.length});let Z=0;for(const ue of V){d({current:Z+1,total:V.length});try{await fetch(`https://${w}.supabase.co/functions/v1/check-citations`,{method:"POST",headers:{"Content-Type":"application/json",apikey:k},body:JSON.stringify({prompt_text:ue.prompt_text,site_domain:ue.site_domain,prompt_category:ue.category,prompt_id:ue.id})})}catch(se){console.error("Check failed for prompt:",ue.prompt_text,se)}Z++,Z<V.length&&await new Promise(se=>setTimeout(se,2e3))}c(!1),await j();const de=F.filter(ue=>ue.hasData||!0).length;De({title:`Checked ${Z} prompts across ${de} platforms`})},W=()=>H(r),$=()=>{const V=r.filter(Z=>h.has(Z.id));V.length>0&&H(V)},z=V=>{p(Z=>{const de=new Set(Z);return de.has(V)?de.delete(V):de.add(V),de})},Q=V=>{A(Z=>{const de=new Set(Z);return de.has(V)?de.delete(V):de.add(V),de})},ce=()=>{h.size===U.length?A(new Set):A(new Set(U.map(V=>V.id)))},R=t.length>0?t[0].checked_at:null,M=R?tGe(new Date(R),7):null,Y=P>30?"text-green-600":P>=10?"text-yellow-600":"text-red-500",X=V=>V?V.was_cited&&V.citation_position!=null?l.jsxs("span",{className:"text-green-600 font-medium text-xs",children:["✅ Cited (#",V.citation_position,")"]}):V.was_cited||V.brand_mentioned?l.jsx("span",{className:"text-green-500 text-xs",children:"✅ Mentioned"}):l.jsx("span",{className:"text-muted-foreground text-xs",children:"❌ Not found"}):l.jsx("span",{className:"text-muted-foreground",children:"—"});return s?l.jsxs("div",{className:"space-y-4",children:[l.jsx(ht,{className:"h-32 w-full"}),l.jsx(ht,{className:"h-64 w-full"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Citation Rate (30d)"}),l.jsxs("p",{className:`text-3xl font-bold ${Y}`,children:[P,"%"]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[E," of ",B," checks cited"]})]})}),l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Platforms Citing You"}),l.jsx("div",{className:"flex gap-2 mt-2",children:T.map(({platform:V,citing:Z})=>l.jsx("span",{className:`inline-flex px-2 py-1 rounded-full text-xs font-medium ${Z?nk[V].bgClass:"bg-muted text-muted-foreground"}`,children:nk[V].label},V))})]})}),l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Checks Run"}),l.jsx("p",{className:"text-3xl font-bold",children:B})]})}),l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Competitors Cited Instead"}),l.jsxs("p",{className:`text-3xl font-bold ${N>20?"text-red-500":"text-muted-foreground"}`,children:[N,"%"]})]})})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:F.map(V=>{var Z;return l.jsxs(Zt,{children:[l.jsx(Sa,{className:"pb-3",children:l.jsxs(ka,{className:"text-sm flex items-center justify-between",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`w-2 h-2 rounded-full ${V.hasData?"bg-green-500":"bg-muted-foreground"}`}),nk[V.platform].label]}),!V.hasData&&l.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"No data yet"})]})}),l.jsxs(en,{className:"space-y-3",children:[l.jsx("p",{className:`text-2xl font-bold ${V.rate>30?"text-green-600":V.rate>=10?"text-yellow-600":"text-muted-foreground"}`,children:V.hasData?`${V.rate}%`:"—"}),V.hasData&&l.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:l.jsx("div",{className:"bg-green-500 h-2 rounded-full transition-all",style:{width:`${V.rate}%`}})}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[l.jsxs("p",{children:["Last checked: ",(Z=V.lastCheck)!=null&&Z.checked_at?Iy(new Date(V.lastCheck.checked_at),{addSuffix:!0}):"Never"]}),V.lastCitedUrl&&l.jsxs("p",{className:"truncate",children:["Last citation: ",l.jsx("a",{href:`https://${V.lastCitedUrl}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:V.lastCitedUrl})]})]})]})]},V.platform)})}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(_r,{value:m,onValueChange:g,children:[l.jsx(fr,{className:"w-[160px]",children:l.jsx(jr,{placeholder:"Category"})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"All Categories"}),Ebt.map(V=>l.jsx(dt,{value:V,children:V},V))]})]}),l.jsxs(_r,{value:y,onValueChange:v,children:[l.jsx(fr,{className:"w-[150px]",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"Show All"}),l.jsx(dt,{value:"cited",children:"Cited Only"}),l.jsx(dt,{value:"not-cited",children:"Not Cited Only"})]})]}),l.jsxs(_r,{value:x,onValueChange:b,children:[l.jsx(fr,{className:"w-[150px]",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"last-checked",children:"Last Checked"}),l.jsx(dt,{value:"citation-rate",children:"Citation Rate"}),l.jsx(dt,{value:"category",children:"Category"})]})]})]}),l.jsx(Zt,{children:l.jsx(en,{className:"pt-6",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-2 w-8",children:l.jsx($o,{checked:h.size===U.length&&U.length>0,onCheckedChange:ce})}),l.jsx("th",{className:"text-left py-2 w-6"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Prompt"}),l.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Category"}),l.jsx("th",{className:"text-center py-2 font-medium w-28",children:"Perplexity"}),l.jsx("th",{className:"text-center py-2 font-medium w-28",children:"ChatGPT"}),l.jsx("th",{className:"text-center py-2 font-medium w-28",children:"Gemini"}),l.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Last Checked"})]})}),l.jsxs("tbody",{children:[U.map(V=>l.jsxs(l.Fragment,{children:[l.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/30 cursor-pointer",onClick:()=>z(V.id),children:[l.jsx("td",{className:"py-2.5",onClick:Z=>Z.stopPropagation(),children:l.jsx($o,{checked:h.has(V.id),onCheckedChange:()=>Q(V.id)})}),l.jsx("td",{className:"py-2.5",children:f.has(V.id)?l.jsx(yc,{className:"w-4 h-4 text-muted-foreground"}):l.jsx(vc,{className:"w-4 h-4 text-muted-foreground"})}),l.jsx("td",{className:"py-2.5",children:l.jsxs(wU,{children:[l.jsx(bU,{asChild:!0,children:l.jsx("span",{className:"block max-w-[300px] truncate",children:V.prompt_text})}),l.jsx(xE,{side:"top",className:"max-w-sm",children:l.jsx("p",{children:V.prompt_text})})]})}),l.jsx("td",{className:"py-2.5",children:l.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${RX[V.category]||RX.general}`,children:V.category})}),l.jsx("td",{className:"py-2.5 text-center",children:X(V.byPlatform.perplexity)}),l.jsx("td",{className:"py-2.5 text-center",children:X(V.byPlatform.openai)}),l.jsx("td",{className:"py-2.5 text-center",children:X(V.byPlatform.gemini)}),l.jsx("td",{className:"py-2.5 text-xs text-muted-foreground",children:V.lastChecked?Iy(new Date(V.lastChecked),{addSuffix:!0}):"Never"})]},V.id),f.has(V.id)&&l.jsx("tr",{className:"bg-muted/20",children:l.jsx("td",{colSpan:8,className:"p-4",children:l.jsxs("div",{className:"space-y-3",children:[Ux.map(Z=>{const de=V.byPlatform[Z];return de?l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:nk[Z].label}),de.response_snippet&&l.jsx("p",{className:"text-muted-foreground bg-muted p-2 rounded text-xs leading-relaxed line-clamp-4",children:de.response_snippet}),de.citation_url&&l.jsxs("p",{children:["Citation: ",l.jsxs("a",{href:de.citation_url.startsWith("http")?de.citation_url:`https://${de.citation_url}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-1",children:[de.citation_url," ",l.jsx(ao,{className:"w-3 h-3"})]})]}),Array.isArray(de.competitor_mentions)&&de.competitor_mentions.length>0&&l.jsxs("p",{className:"text-red-500",children:["Competitors mentioned: ",de.competitor_mentions.join(", ")]})]},Z):null}),l.jsxs(xe,{size:"sm",variant:"outline",disabled:o,onClick:Z=>{Z.stopPropagation(),H([V])},children:[l.jsx(F3,{className:"w-3 h-3 mr-1"})," Run This Prompt"]})]})})},`${V.id}-detail`)]})),U.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:8,className:"py-8 text-center text-muted-foreground",children:"No prompts match the current filters."})})]})]})})})}),l.jsx(Zt,{children:l.jsxs(en,{className:"pt-6 space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(xe,{onClick:W,disabled:o||r.length===0,children:[o?l.jsx(Ea,{className:"w-4 h-4 mr-2 animate-spin"}):l.jsx(F3,{className:"w-4 h-4 mr-2"}),o?`Checking prompt ${u.current} of ${u.total}...`:"Run All Checks Now"]}),l.jsxs(xe,{variant:"outline",onClick:$,disabled:o||h.size===0,children:["Run Selected (",h.size,")"]})]}),o&&l.jsx(Cv,{value:u.current/u.total*100,className:"h-2"}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[l.jsxs("p",{children:["Last full run: ",R?Iy(new Date(R),{addSuffix:!0}):"Never"]}),M&&l.jsxs("p",{children:["Next suggested run: ",M.toLocaleDateString()]}),l.jsx("p",{className:"text-muted-foreground/60",children:"Estimated cost: ~$0.01–0.03 per prompt across all platforms"})]})]})})]})},Ibt=[{id:"buying",label:"Buying"},{id:"selling",label:"Selling"},{id:"neighborhoods",label:"Neighborhoods & Area Guides"},{id:"market-insights",label:"Market Reports & Trends"}],Pbt=[{name:"Buyer Personas",items:[{id:"first-time-buyers",label:"First-Time Buyers",description:"First-time homebuyer guidance, programs, and local advice"},{id:"move-up-buyers",label:"Move-Up Buyers",description:"Current owners upgrading to a bigger or nicer home"},{id:"downsizers",label:"Downsizers / Empty Nesters",description:"Selling the family home, moving to something smaller"},{id:"relocation",label:"Relocation / Out-of-State",description:"People moving to the area from another city or state"},{id:"military-va",label:"Military / VA Buyers",description:"VA loans, base proximity, military-friendly agents"},{id:"investors",label:"Investors / Rental Properties",description:"Investment properties, cap rates, landlord guidance"},{id:"retirees",label:"Retirees",description:"Retirement communities, 55+, lifestyle transitions"},{id:"divorce-buyers",label:"Divorce Buyers",description:"Buying after a divorce, sensitive situations"},{id:"multi-generational",label:"Multi-Generational Buyers",description:"Homes for extended families, in-law suites"}]},{name:"Seller Personas",items:[{id:"fsbo-converts",label:"FSBO Converts",description:"For Sale By Owner sellers considering hiring an agent"},{id:"estate-probate",label:"Estate / Probate Sales",description:"Inherited property, estate settlement"},{id:"divorce-sellers",label:"Divorce Sellers",description:"Selling during or after a divorce"},{id:"landlords-exiting",label:"Landlords Exiting Rentals",description:"Selling investment/rental properties"},{id:"distressed-sellers",label:"Pre-Foreclosure / Distressed Sellers",description:"Short sales, financial distress situations"}]},{name:"Property Types",items:[{id:"luxury",label:"Luxury / High-End",description:"Premium properties, estates, high-end market"},{id:"waterfront",label:"Waterfront / Lakefront",description:"Waterfront homes, lake properties, coastal"},{id:"condos-townhomes",label:"Condos / Townhomes",description:"Condo and townhome market, HOA considerations"},{id:"new-construction",label:"New Construction",description:"New builds, builder relationships, custom homes"},{id:"historic-homes",label:"Historic / Older Homes",description:"Historic properties, renovation considerations"},{id:"land-lots",label:"Land / Lots",description:"Vacant land, building lots, acreage"},{id:"multi-family",label:"Multi-Family / Duplexes",description:"Duplexes, triplexes, small multi-family"},{id:"farms-rural",label:"Farms / Rural Property",description:"Agricultural, rural, hobby farms"},{id:"senior-living",label:"55+ Communities / Senior Living",description:"Age-restricted communities"}]},{name:"Local Knowledge",items:[{id:"school-districts",label:"School Districts",description:"School quality, district boundaries, family decisions"},{id:"commuter-guides",label:"Commuter Guides",description:"Commute times, transit access, highway proximity"}]},{name:"Specialty Topics",items:[{id:"financing",label:"FHA / VA / USDA Financing",description:"Government-backed loan programs and eligibility"},{id:"fixer-uppers",label:"Home Renovation / Fixer-Uppers",description:"Homes needing work, renovation potential"},{id:"second-homes",label:"Second Homes / Vacation Properties",description:"Vacation homes, short-term rental potential"}]}],DX=3,Obt=({selectedCategories:e,onCategoriesChange:t,onContinue:n})=>{const r=s=>{e.includes(s)?t(e.filter(a=>a!==s)):t([...e,s])},i=e.length>=DX;return l.jsxs("div",{className:"space-y-6 max-w-3xl mx-auto py-4",children:[l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"What do you specialize in?"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Select the niches you serve. The discovery engine will find high-intent questions in these categories. Buying, Selling, Neighborhoods, and Market Insights are always included."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Always Included"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ibt.map(s=>l.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border bg-muted/40 px-3 py-2.5 opacity-80",children:[l.jsx($o,{checked:!0,disabled:!0,className:"opacity-60"}),l.jsx(kre,{className:"w-3.5 h-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id))})]}),Pbt.map(s=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s.name}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:s.items.map(a=>{const o=e.includes(a.id);return l.jsxs("button",{type:"button",onClick:()=>r(a.id),className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5 text-left transition-colors hover:bg-muted/50 ${o?"border-primary bg-primary/5":"border-border"}`,children:[l.jsx($o,{checked:o,className:"mt-0.5 pointer-events-none"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"text-sm font-medium block",children:a.label}),l.jsx("span",{className:"text-xs text-muted-foreground block",children:a.description})]})]},a.id)})})]},s.name)),l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.jsxs(Yt,{variant:i?"default":"secondary",className:"mr-2",children:[e.length," of ",DX," minimum"]}),"selected"]}),l.jsxs(xe,{onClick:n,disabled:!i,children:["Continue ",l.jsx(vc,{className:"w-4 h-4 ml-1"})]})]})]})},UX={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",guides:"bg-teal-100 text-teal-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},Fbt={perplexity:"bg-blue-500",openai:"bg-green-500",gemini:"bg-purple-500"},Mbt=({open:e,onOpenChange:t,siteDomain:n,onImported:r})=>{const[i,s]=C.useState("categories"),[a,o]=C.useState(""),[c,u]=C.useState(""),[d,h]=C.useState([]),[A,f]=C.useState(null),[p,m]=C.useState(new Set),[g,y]=C.useState({}),[v,x]=C.useState(!0),[b,w]=C.useState("all"),[k,j]=C.useState("score"),[B,E]=C.useState(!1),[P,T]=C.useState(!1),[N,F]=C.useState(1),[L,U]=C.useState(""),[H,W]=C.useState(0),[$,z]=C.useState(0),[Q,ce]=C.useState([]),[R,M]=C.useState(0),Y="khmmwvmdbhaplcfcndjx",X="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q";C.useEffect(()=>{!e||!n||(async()=>{const{data:we}=await Me.from("monitored_sites").select("selected_categories").eq("domain",n).limit(1).single();we!=null&&we.selected_categories&&Array.isArray(we.selected_categories)&&we.selected_categories.length>0&&h(we.selected_categories)})()},[e,n]);const V=async()=>{await Me.from("monitored_sites").update({selected_categories:d}).eq("domain",n),s("input")},Z=async()=>{if(!(!a.trim()||!c.trim())){s("loading"),F(1),U(`Starting discovery for ${a.trim()}, ${c.trim()}...`),W(0),z(0),ce([]),M(0);try{const we=await fetch(`https://${Y}.supabase.co/functions/v1/discover-prompts`,{method:"POST",headers:{"Content-Type":"application/json",apikey:X},body:JSON.stringify({metro:a.trim(),state:c.trim(),categories:d})});if(!we.ok||!we.body){const ye=await we.text();throw new Error(ye||"Failed to start discovery")}const He=we.body.getReader(),Ve=new TextDecoder;let Dt="",pt=null;for(;;){const{done:ye,value:Be}=await He.read();if(ye)break;Dt+=Ve.decode(Be,{stream:!0});let Ge;for(;(Ge=Dt.indexOf(`

`))!==-1;){const Ue=Dt.slice(0,Ge).trim();if(Dt=Dt.slice(Ge+2),!Ue.startsWith("data: "))continue;const Ze=Ue.slice(6).trim();if(Ze!=="[DONE]")try{const pe=JSON.parse(Ze);switch(pe.type){case"status":U(pe.message),pe.phase&&F(pe.phase),de(pe.message);break;case"progress":U(pe.message),W(pe.completed),z(pe.total),pe.phase&&F(pe.phase),de(pe.message);break;case"phase_complete":U(pe.message),pe.uniqueQuestions&&M(pe.uniqueQuestions),de(pe.message);break;case"error":throw new Error(pe.message);case"result":pt=pe;break}}catch(pe){if(pe.message&&!pe.message.includes("JSON"))throw pe}}}if(pt){f(pt);const ye=new Set;pt.questions.forEach(Be=>{Be.citability_score>=3&&ye.add(Be.normalized)}),m(ye),s("results")}else throw new Error("No results received from discovery")}catch(we){De({title:"Discovery failed",description:we.message,variant:"destructive"}),s("input")}}},de=we=>{ce(He=>[...He,`[${new Date().toLocaleTimeString()}] ${we}`].slice(-30))},ue=C.useMemo(()=>{if(!A)return[];let we=[...A.questions];return v&&(we=we.filter(He=>He.citability_score>=4)),b!=="all"&&(we=we.filter(He=>He.category===b)),k==="score"?we.sort((He,Ve)=>Ve.citability_score-He.citability_score):k==="category"?we.sort((He,Ve)=>He.category.localeCompare(Ve.category)):k==="platforms"&&we.sort((He,Ve)=>Ve.source_count-He.source_count),we},[A,v,b,k]),se=p.size,he=(A==null?void 0:A.questions.filter(we=>p.has(we.normalized)&&we.citability_score>=4).length)||0,ie=(A==null?void 0:A.questions.filter(we=>p.has(we.normalized)&&we.citability_score>=3&&we.citability_score<4).length)||0,Ce=we=>{m(He=>{const Ve=new Set(He);return Ve.has(we)?Ve.delete(we):Ve.add(we),Ve})},Ie=()=>{const we=new Set(p);ue.forEach(He=>we.add(He.normalized)),m(we)},te=()=>m(new Set),je=async()=>{if(!(!A||se===0)){E(!0);try{const{data:we}=await Me.from("monitor_prompts").select("prompt_text").eq("site_domain",n),He=new Set((we||[]).map(pt=>pt.prompt_text.toLowerCase().replace(/[?!.,]+$/,"").trim())),Ve=A.questions.filter(pt=>p.has(pt.normalized)).filter(pt=>!He.has(pt.normalized)).map(pt=>({site_domain:n,prompt_text:g[pt.normalized]||pt.question,category:pt.category,citability_score:pt.citability_score})),Dt=se-Ve.length;if(Ve.length>0){const{error:pt}=await Me.from("monitor_prompts").insert(Ve);if(pt)throw pt}De({title:`Added ${Ve.length} new prompts to your prompt bank`,description:Dt>0?`${Dt} duplicates skipped`:void 0}),r(),t(!1),nt()}catch(we){De({title:"Import failed",description:we.message,variant:"destructive"})}finally{E(!1)}}},nt=()=>{s("categories"),f(null),m(new Set),y({}),ce([]),F(1),U(""),W(0),z(0),M(0)},rt=we=>{we||nt(),t(we)},Ne=we=>{const He=we/5*100,Ve=we>=4?"bg-green-500":we>=3?"bg-yellow-500":we>=2?"bg-orange-500":"bg-red-500",Dt=we>=4?"High":we>=3?"Medium":we>=2?"Low":"Unlikely";return l.jsxs("div",{className:"flex items-center gap-2 min-w-[140px]",children:[l.jsx("div",{className:"flex-1 h-2 rounded-full bg-muted overflow-hidden",children:l.jsx("div",{className:`h-full rounded-full ${Ve}`,style:{width:`${He}%`}})}),l.jsx("span",{className:"text-xs font-medium w-8 text-right",children:we.toFixed(1)}),l.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${we>=4?"bg-green-100 text-green-800":we>=3?"bg-yellow-100 text-yellow-800":we>=2?"bg-orange-100 text-orange-800":"bg-red-100 text-red-800"}`,children:Dt})]})},st=$>0?Math.round(H/$*100):0;return l.jsx(Fo,{open:e,onOpenChange:rt,children:l.jsxs(Ja,{className:"max-w-6xl max-h-[90vh] flex flex-col p-0",children:[l.jsx(Za,{className:"px-6 pt-6 pb-4 border-b",children:l.jsxs(eo,{className:"flex items-center gap-2",children:[l.jsx(Os,{className:"w-5 h-5 text-primary"})," Prompt Discovery Engine"]})}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[i==="categories"&&l.jsx(Obt,{selectedCategories:d,onCategoriesChange:h,onContinue:V}),i==="input"&&l.jsxs("div",{className:"max-w-md mx-auto py-12 space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),l.jsx(Je,{placeholder:"e.g., Grand Rapids, Phoenix, Dallas-Fort Worth",value:a,onChange:we=>o(we.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"State"}),l.jsx(Je,{placeholder:"e.g., MI, AZ, TX",value:c,onChange:we=>u(we.target.value),className:"mt-1"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{variant:"outline",onClick:()=>s("categories"),children:"Back"}),l.jsxs(xe,{onClick:Z,disabled:!a.trim()||!c.trim(),className:"flex-1",children:[l.jsx(Os,{className:"w-4 h-4 mr-2"})," Discover Questions"]})]})]}),l.jsxs("div",{className:"text-center space-y-2",children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Querying ",4+d.length," prompt categories across AI platforms. Takes 2-4 minutes."]}),d.length>0&&l.jsx("div",{className:"flex flex-wrap justify-center gap-1",children:d.map(we=>l.jsx(Yt,{variant:"secondary",className:"text-[10px]",children:we},we))})]})]}),i==="loading"&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-10 space-y-6 max-w-2xl mx-auto",children:[l.jsx(Ea,{className:"w-10 h-10 animate-spin text-primary"}),l.jsxs("div",{className:"text-center space-y-2 w-full",children:[l.jsx("p",{className:"font-medium",children:L}),l.jsx("div",{className:"flex items-center justify-center gap-2",children:["perplexity","openai","gemini"].map(we=>l.jsx(Yt,{variant:"secondary",className:"text-xs capitalize",children:we==="openai"?"ChatGPT":we.charAt(0).toUpperCase()+we.slice(1)},we))}),$>0&&l.jsxs("div",{className:"w-full space-y-1 pt-2",children:[l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:["Phase ",N,": ",H,"/",$]}),l.jsxs("span",{children:[st,"%"]})]}),l.jsx("div",{className:"w-full h-3 rounded-full bg-muted overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${st}%`}})})]}),R>0&&l.jsxs("p",{className:"text-sm text-muted-foreground pt-1",children:["✅ ",R," unique questions discovered — now scoring citability..."]})]}),l.jsxs("div",{className:"w-full border rounded-lg bg-muted/30 p-3 max-h-48 overflow-y-auto",children:[l.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Live Activity Log"}),l.jsxs("div",{className:"space-y-0.5 font-mono text-[11px] text-muted-foreground",children:[Q.length===0&&l.jsx("p",{children:"Waiting for events..."}),Q.map((we,He)=>l.jsx("p",{className:He===Q.length-1?"text-foreground font-medium":"",children:we},He))]})]})]}),i==="results"&&A&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("p",{className:"font-medium",children:["Total questions found: ",A.total_questions]}),l.jsxs("p",{className:"text-sm font-medium text-green-700",children:[A.high_citability_count," questions scored 4+ (high citability) — these are your priority targets"]})]}),l.jsxs("div",{className:"flex h-3 rounded-full overflow-hidden bg-muted",children:[A.high_citability_count>0&&l.jsx("div",{className:"bg-green-500 transition-all",style:{width:`${A.high_citability_count/A.total_questions*100}%`}}),A.medium_citability_count>0&&l.jsx("div",{className:"bg-yellow-500 transition-all",style:{width:`${A.medium_citability_count/A.total_questions*100}%`}}),A.low_citability_count>0&&l.jsx("div",{className:"bg-red-500 transition-all",style:{width:`${A.low_citability_count/A.total_questions*100}%`}})]}),l.jsxs("div",{className:"flex gap-4 text-xs text-muted-foreground",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-green-500"})," High (",A.high_citability_count,")"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500"})," Medium (",A.medium_citability_count,")"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-red-500"})," Low (",A.low_citability_count,")"]})]}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:A.accuracy_note})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wc,{checked:v,onCheckedChange:x}),l.jsx("span",{className:"text-sm font-medium",children:"High Citability Only"})]}),l.jsxs(_r,{value:b,onValueChange:w,children:[l.jsx(fr,{className:"w-[160px]",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"All Categories"}),["buying","selling","neighborhoods","market-insights","luxury","guides","general"].map(we=>l.jsx(dt,{value:we,children:we},we))]})]}),l.jsxs(_r,{value:k,onValueChange:j,children:[l.jsx(fr,{className:"w-[160px]",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"score",children:"Citability Score"}),l.jsx(dt,{value:"category",children:"Category"}),l.jsx(dt,{value:"platforms",children:"Number of Platforms"})]})]}),l.jsxs("div",{className:"flex gap-2 ml-auto",children:[l.jsx(xe,{size:"sm",variant:"outline",onClick:Ie,children:"Select All Visible"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:te,children:"Deselect All"})]})]}),l.jsx("div",{className:"border rounded-lg overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b bg-muted/50 text-muted-foreground",children:[l.jsx("th",{className:"w-10 p-2"}),l.jsx("th",{className:"text-left p-2 font-medium",children:"Question"}),l.jsx("th",{className:"text-left p-2 font-medium w-32",children:"Category"}),l.jsx("th",{className:"text-left p-2 font-medium w-44",children:"Citability"}),l.jsx("th",{className:"text-center p-2 font-medium w-24",children:"Platforms"})]})}),l.jsxs("tbody",{children:[ue.map(we=>l.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/30",children:[l.jsx("td",{className:"p-2 text-center",children:l.jsx($o,{checked:p.has(we.normalized),onCheckedChange:()=>Ce(we.normalized)})}),l.jsx("td",{className:"p-2",children:l.jsx("input",{className:"w-full bg-transparent border-none outline-none text-sm focus:ring-1 focus:ring-primary rounded px-1 py-0.5",value:g[we.normalized]??we.question,onChange:He=>y(Ve=>({...Ve,[we.normalized]:He.target.value}))})}),l.jsx("td",{className:"p-2",children:l.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${UX[we.category]||UX.general}`,children:we.category})}),l.jsx("td",{className:"p-2",children:Ne(we.citability_score)}),l.jsx("td",{className:"p-2",children:l.jsx("div",{className:"flex items-center justify-center gap-1.5",children:we.sources.map(He=>l.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${Fbt[He]||"bg-gray-400"}`,title:He},He))})})]},we.normalized)),ue.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:5,className:"py-8 text-center text-muted-foreground",children:"No questions match the current filters."})})]})]})})]})]}),i==="results"&&l.jsxs("div",{className:"border-t bg-background px-6 py-4 flex items-center justify-between",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:[se," questions selected (",he," high, ",ie," medium)"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(xe,{variant:"outline",onClick:()=>T(!0),disabled:se===0||B,children:[l.jsx(Vp,{className:"w-4 h-4 mr-2"})," Generate Blueprint from Selected"]}),l.jsxs(xe,{onClick:je,disabled:se===0||B,children:[B?l.jsx(Ea,{className:"w-4 h-4 mr-2 animate-spin"}):l.jsx(Sl,{className:"w-4 h-4 mr-2"}),"Add Selected to Prompt Bank"]})]})]}),A&&l.jsx(hAe,{open:P,onOpenChange:T,siteDomain:n,questions:A.questions.filter(we=>p.has(we.normalized)),metro:A.metro||a,state:A.state||c,onImported:r})]})})},H4=["buying","selling","neighborhoods","market-insights","guides","luxury","general"],HX={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",guides:"bg-teal-100 text-teal-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},Lbt=({score:e})=>{if(e==null)return l.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const t=e/5*100,n=e>=4?"bg-green-500":e>=3?"bg-yellow-500":e>=2?"bg-orange-500":"bg-red-500",r=e>=4?"High":e>=3?"Medium":e>=2?"Low":"Unlikely",i=e>=4?"bg-green-100 text-green-800":e>=3?"bg-yellow-100 text-yellow-800":e>=2?"bg-orange-100 text-orange-800":"bg-red-100 text-red-800";return l.jsxs("div",{className:"flex items-center gap-1.5 min-w-[110px]",children:[l.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:l.jsx("div",{className:`h-full rounded-full ${n}`,style:{width:`${t}%`}})}),l.jsx("span",{className:"text-[10px] font-medium w-6 text-right",children:e.toFixed(1)}),l.jsx("span",{className:`text-[9px] font-medium px-1 py-0.5 rounded ${i}`,children:r})]})},Rbt=()=>{const[e,t]=C.useState([]),[n,r]=C.useState(null),[i,s]=C.useState(!0),[a,o]=C.useState(""),[c,u]=C.useState("all"),[d,h]=C.useState(!1),[A,f]=C.useState(!1),[p,m]=C.useState(!1),[g,y]=C.useState(""),[v,x]=C.useState("general"),[b,w]=C.useState(""),[k,j]=C.useState("general"),[B,E]=C.useState(null),[P,T]=C.useState(""),[N,F]=C.useState(!1),[L,U]=C.useState(""),[H,W]=C.useState(""),[$,z]=C.useState(!1),[Q,ce]=C.useState(!1),[R,M]=C.useState(""),[Y,X]=C.useState(""),[V,Z]=C.useState("default"),[de,ue]=C.useState(!1),[se,he]=C.useState(!1),[ie,Ce]=C.useState(!1),[Ie,te]=C.useState(""),[je,nt]=C.useState(""),rt="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",Ne=async()=>{const[{data:pe},{data:mt}]=await Promise.all([Me.from("monitored_sites").select("*").limit(1).single(),Me.from("monitor_prompts").select("*").order("created_at",{ascending:!0})]);pe&&r({id:pe.id,domain:pe.domain,brand_keywords:pe.brand_keywords||[],competitor_domains:pe.competitor_domains||[]}),t(mt||[]),s(!1)};C.useEffect(()=>{Ne()},[]);const st=C.useMemo(()=>{let pe=e.filter(mt=>!(c!=="all"&&mt.category!==c||a&&!mt.prompt_text.toLowerCase().includes(a.toLowerCase())||de&&(mt.citability_score==null||mt.citability_score<4)));return V==="citability"&&(pe=[...pe].sort((mt,ft)=>(ft.citability_score??0)-(mt.citability_score??0))),pe},[e,c,a,V,de]),we=async()=>{if(!g.trim()||!n)return;const{error:pe}=await Me.from("monitor_prompts").insert({site_domain:n.domain,prompt_text:g.trim(),category:v});if(pe){De({title:"Failed to add prompt",variant:"destructive"});return}De({title:"Prompt added"}),y(""),h(!1),Ne()},He=async()=>{if(!b.trim()||!n)return;const pe=b.split(`
`).map(wt=>wt.trim()).filter(Boolean);if(pe.length===0)return;const mt=pe.map(wt=>({site_domain:n.domain,prompt_text:wt,category:k})),{error:ft}=await Me.from("monitor_prompts").insert(mt);if(ft){De({title:"Bulk add failed",variant:"destructive"});return}De({title:`${pe.length} prompts added`}),w(""),f(!1),Ne()},Ve=async(pe,mt)=>{await Me.from("monitor_prompts").update({is_active:mt}).eq("id",pe),t(ft=>ft.map(wt=>wt.id===pe?{...wt,is_active:mt}:wt))},Dt=async pe=>{confirm("Delete this prompt?")&&(await Me.from("monitor_prompts").delete().eq("id",pe),t(mt=>mt.filter(ft=>ft.id!==pe)),De({title:"Prompt deleted"}))},pt=async pe=>{await Me.from("monitor_prompts").update({prompt_text:P}).eq("id",pe),t(mt=>mt.map(ft=>ft.id===pe?{...ft,prompt_text:P}:ft)),E(null),De({title:"Prompt updated"})},ye=async()=>{if(!L.trim()||!n)return;const pe=[...n.brand_keywords,L.trim()];await Me.from("monitored_sites").update({brand_keywords:pe}).eq("id",n.id),r({...n,brand_keywords:pe}),U("")},Be=async pe=>{if(!n)return;const mt=n.brand_keywords.filter(ft=>ft!==pe);await Me.from("monitored_sites").update({brand_keywords:mt}).eq("id",n.id),r({...n,brand_keywords:mt})},Ge=async()=>{if(!H.trim()||!n)return;const pe=[...n.competitor_domains,H.trim()];await Me.from("monitored_sites").update({competitor_domains:pe}).eq("id",n.id),r({...n,competitor_domains:pe}),W("")},Ue=async pe=>{if(!n)return;const mt=n.competitor_domains.filter(ft=>ft!==pe);await Me.from("monitored_sites").update({competitor_domains:mt}).eq("id",n.id),r({...n,competitor_domains:mt})},Ze=async()=>{if(!(!R.trim()||!Y.trim()||!n)){z(!0),ce(!1);try{const pe=e.filter(Lt=>Lt.is_active);if(pe.length===0){De({title:"No active prompts to score"}),z(!1);return}const mt=pe.map(Lt=>Lt.prompt_text),ft=Dbt(mt,R.trim(),Y.trim()),Rt=await Ubt(ft,mt.length,"https://khmmwvmdbhaplcfcndjx.supabase.co",rt);for(let Lt=0;Lt<pe.length;Lt++){const Mt=Rt[Lt]??3;await Me.from("monitor_prompts").update({citability_score:Mt}).eq("id",pe[Lt].id)}const zt=Rt.filter(Lt=>Lt>=4).length,gt=Rt.filter(Lt=>Lt>=3&&Lt<4).length;De({title:`Scored ${pe.length} prompts`,description:`${zt} scored high, ${gt} scored medium.`}),Ne()}catch(pe){De({title:"Scoring failed",description:pe.message,variant:"destructive"})}finally{z(!1)}}};return i?l.jsx(ht,{className:"h-64 w-full"}):l.jsxs("div",{className:"space-y-6",children:[l.jsx(Xw,{open:N,onOpenChange:F,children:l.jsxs(Zt,{children:[l.jsx(Jw,{className:"w-full",children:l.jsxs(Sa,{className:"flex flex-row items-center justify-between cursor-pointer",children:[l.jsxs(ka,{className:"text-base flex items-center gap-2",children:[l.jsx(sU,{className:"w-4 h-4"})," Site Settings"]}),l.jsx(yc,{className:`w-4 h-4 transition-transform ${N?"rotate-180":""}`})]})}),l.jsx(Zw,{children:l.jsxs(en,{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Site Domain"}),l.jsx("p",{className:"text-sm font-mono mt-1",children:n==null?void 0:n.domain})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Brand Keywords"}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:n==null?void 0:n.brand_keywords.map(pe=>l.jsxs(Yt,{variant:"secondary",className:"gap-1",children:[pe,l.jsx("button",{onClick:()=>Be(pe),className:"ml-1 hover:text-destructive",children:l.jsx(ra,{className:"w-3 h-3"})})]},pe))}),l.jsxs("div",{className:"flex gap-2 mt-2",children:[l.jsx(Je,{placeholder:"Add keyword...",value:L,onChange:pe=>U(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&ye(),className:"max-w-xs"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:ye,children:"Add"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Competitor Domains"}),l.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[n==null?void 0:n.competitor_domains.map(pe=>l.jsxs(Yt,{variant:"secondary",className:"gap-1",children:[pe,l.jsx("button",{onClick:()=>Ue(pe),className:"ml-1 hover:text-destructive",children:l.jsx(ra,{className:"w-3 h-3"})})]},pe)),(n==null?void 0:n.competitor_domains.length)===0&&l.jsx("span",{className:"text-sm text-muted-foreground",children:"None added yet"})]}),l.jsxs("div",{className:"flex gap-2 mt-2",children:[l.jsx(Je,{placeholder:"Add competitor domain...",value:H,onChange:pe=>W(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&Ge(),className:"max-w-xs"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:Ge,children:"Add"})]})]})]})})]})}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[l.jsx(cE,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),l.jsx(Je,{placeholder:"Search prompts...",value:a,onChange:pe=>o(pe.target.value),className:"pl-9"})]}),l.jsxs(_r,{value:c,onValueChange:u,children:[l.jsx(fr,{className:"w-[180px]",children:l.jsx(jr,{placeholder:"Category"})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"All Categories"}),H4.map(pe=>l.jsx(dt,{value:pe,children:pe},pe))]})]}),l.jsxs(_r,{value:V,onValueChange:Z,children:[l.jsx(fr,{className:"w-[160px]",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"default",children:"Date Added"}),l.jsx(dt,{value:"citability",children:"Citability Score"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wc,{checked:de,onCheckedChange:ue}),l.jsx("span",{className:"text-sm font-medium",children:"High Only"})]}),l.jsxs(xe,{size:"sm",onClick:()=>h(!0),children:[l.jsx(Kp,{className:"w-4 h-4 mr-1"})," Add Prompt"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>f(!0),children:[l.jsx(p2e,{className:"w-4 h-4 mr-1"})," Bulk Add"]}),l.jsxs(xe,{size:"sm",variant:"default",onClick:()=>m(!0),className:"bg-primary",children:[l.jsx(Os,{className:"w-4 h-4 mr-1"})," Discover Prompts"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>ce(!0),disabled:$,children:[$?l.jsx(Ea,{className:"w-4 h-4 mr-1 animate-spin"}):l.jsx(nu,{className:"w-4 h-4 mr-1"}),"Re-score Prompts"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>Ce(!0),disabled:e.filter(pe=>pe.is_active).length===0,children:[l.jsx(Vp,{className:"w-4 h-4 mr-1"})," Generate Blueprint from Bank"]})]}),l.jsx(Zt,{children:l.jsx(en,{className:"pt-6",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-2 font-medium",children:"Prompt Text"}),l.jsx("th",{className:"text-left py-2 font-medium w-32",children:"Category"}),l.jsx("th",{className:"text-left py-2 font-medium w-32",children:"Citability"}),l.jsx("th",{className:"text-center py-2 font-medium w-20",children:"Active"}),l.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Last Checked"}),l.jsx("th",{className:"text-right py-2 font-medium w-24",children:"Actions"})]})}),l.jsxs("tbody",{children:[st.map(pe=>l.jsxs("tr",{className:"border-b border-border/50",children:[l.jsx("td",{className:"py-2.5",children:B===pe.id?l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Je,{value:P,onChange:mt=>T(mt.target.value),className:"text-sm"}),l.jsx(xe,{size:"sm",onClick:()=>pt(pe.id),children:"Save"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>E(null),children:"Cancel"})]}):l.jsx("span",{children:pe.prompt_text})}),l.jsx("td",{className:"py-2.5",children:l.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${HX[pe.category]||HX.general}`,children:pe.category})}),l.jsx("td",{className:"py-2.5",children:l.jsx(Lbt,{score:pe.citability_score})}),l.jsx("td",{className:"py-2.5 text-center",children:l.jsx(wc,{checked:pe.is_active??!0,onCheckedChange:mt=>Ve(pe.id,mt)})}),l.jsx("td",{className:"py-2.5 text-muted-foreground text-xs",children:pe.last_checked_at?Iy(new Date(pe.last_checked_at),{addSuffix:!0}):"Never"}),l.jsx("td",{className:"py-2.5 text-right",children:l.jsxs("div",{className:"flex justify-end gap-1",children:[l.jsx(xe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>{E(pe.id),T(pe.prompt_text)},children:l.jsx(Bre,{className:"w-3.5 h-3.5"})}),l.jsx(xe,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive",onClick:()=>Dt(pe.id),children:l.jsx(Ol,{className:"w-3.5 h-3.5"})})]})})]},pe.id)),st.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:6,className:"py-8 text-center text-muted-foreground",children:"No prompts found."})})]})]})})})}),l.jsx(Fo,{open:d,onOpenChange:h,children:l.jsxs(Ja,{children:[l.jsx(Za,{children:l.jsx(eo,{children:"Add Prompt"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(hi,{placeholder:"Enter your prompt question...",value:g,onChange:pe=>y(pe.target.value),rows:3}),l.jsxs(_r,{value:v,onValueChange:x,children:[l.jsx(fr,{children:l.jsx(jr,{})}),l.jsx(Ar,{children:H4.map(pe=>l.jsx(dt,{value:pe,children:pe},pe))})]}),l.jsx(xe,{onClick:we,disabled:!g.trim(),className:"w-full",children:"Save Prompt"})]})]})}),l.jsx(Fo,{open:A,onOpenChange:f,children:l.jsxs(Ja,{children:[l.jsx(Za,{children:l.jsx(eo,{children:"Bulk Add Prompts"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(hi,{placeholder:"Paste one prompt per line...",value:b,onChange:pe=>w(pe.target.value),rows:8}),l.jsxs(_r,{value:k,onValueChange:j,children:[l.jsx(fr,{children:l.jsx(jr,{})}),l.jsx(Ar,{children:H4.map(pe=>l.jsx(dt,{value:pe,children:pe},pe))})]}),l.jsxs(xe,{onClick:He,disabled:!b.trim(),className:"w-full",children:["Add ",b.split(`
`).filter(pe=>pe.trim()).length," Prompts"]})]})]})}),l.jsx(Fo,{open:Q,onOpenChange:ce,children:l.jsxs(Ja,{children:[l.jsx(Za,{children:l.jsx(eo,{children:"Re-score Prompts for Citability"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["This will score all ",e.filter(pe=>pe.is_active).length," active prompts for citability. Requires a metro area for context."]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),l.jsx(Je,{placeholder:"e.g., Grand Rapids",value:R,onChange:pe=>M(pe.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"State"}),l.jsx(Je,{placeholder:"e.g., MI",value:Y,onChange:pe=>X(pe.target.value),className:"mt-1"})]}),l.jsxs(xe,{onClick:Ze,disabled:!R.trim()||!Y.trim(),className:"w-full",children:["Score ",e.filter(pe=>pe.is_active).length," Prompts"]})]})]})}),n&&l.jsx(Mbt,{open:p,onOpenChange:m,siteDomain:n.domain,onImported:Ne}),l.jsx(Fo,{open:ie,onOpenChange:Ce,children:l.jsxs(Ja,{children:[l.jsx(Za,{children:l.jsx(eo,{children:"Generate Blueprint from Prompt Bank"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["This will cluster and rewrite ",e.filter(pe=>pe.is_active).length," active prompts into a structured content blueprint. Enter the metro area for context."]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),l.jsx(Je,{placeholder:"e.g., Grand Rapids",value:Ie,onChange:pe=>te(pe.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"State"}),l.jsx(Je,{placeholder:"e.g., MI",value:je,onChange:pe=>nt(pe.target.value),className:"mt-1"})]}),l.jsxs(xe,{onClick:()=>{Ce(!1),he(!0)},disabled:!Ie.trim()||!je.trim(),className:"w-full",children:[l.jsx(Vp,{className:"w-4 h-4 mr-2"})," Generate Blueprint"]})]})]})}),n&&l.jsx(hAe,{open:se,onOpenChange:he,siteDomain:n.domain,questions:e.filter(pe=>pe.is_active&&pe.citability_score!=null&&pe.citability_score>=4).map(pe=>({question:pe.prompt_text,category:pe.category,citability_score:pe.citability_score??4})),metro:Ie,state:je,onImported:Ne})]})};function Dbt(e,t,n){const r=e.map((i,s)=>`${s+1}. ${i}`).join(`
`);return`You are evaluating real estate questions for ${t}, ${n}. For each question below, rate on a scale of 1-5 how likely you would be to include a specific local real estate agent's name, cite an agent's website URL, or directly recommend contacting a local realtor in your response.

SCORING GUIDE:
5 = You would almost certainly name a specific agent or link to an agent's website
4 = You would very likely recommend a specific agent or cite agent content
3 = You might cite an agent's content if it was high quality and relevant
2 = You would mostly answer with general info but might mention an agent in passing
1 = You would answer entirely with general knowledge and would not cite a specific agent

For each question, respond with ONLY the number (1-5), one per line, in the same order. No explanations.

Questions:
${r}`}async function Ubt(e,t,n,r){await fetch(`${n}/functions/v1/discover-prompts`,{method:"POST",headers:{"Content-Type":"application/json",apikey:r},body:JSON.stringify({score_only:!0,scoring_prompt:e,count:t})});const i=`${n}/functions/v1/generate-aeo-content`,s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",apikey:r},body:JSON.stringify({prompt:e,max_tokens:2e3})});if(!s.ok)throw new Error("Scoring request failed");const a=await s.json(),c=(a.content||a.text||"").trim().split(`
`).map(d=>d.trim()),u=[];for(const d of c){const h=d.match(/(\d)/);if(h){const A=parseInt(h[1]);A>=1&&A<=5&&u.push(A)}if(u.length>=t)break}for(;u.length<t;)u.push(3);return u}const Hbt=()=>{const[e,t]=C.useState([]),[n,r]=C.useState("");return C.useEffect(()=>{(async()=>{const{data:s}=await Me.from("monitored_sites").select("id, domain, display_name").eq("is_active",!0).order("created_at",{ascending:!0});s&&s.length>0&&(t(s),r(s[0].domain))})()},[]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"AEO Monitor"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Track AI crawler activity and monitor your brand's visibility across AI platforms."})]}),e.length>1&&l.jsxs(_r,{value:n,onValueChange:r,children:[l.jsx(fr,{className:"w-[220px]",children:l.jsx(jr,{placeholder:"Select site"})}),l.jsx(Ar,{children:e.map(i=>l.jsx(dt,{value:i.domain,children:i.display_name},i.domain))})]})]}),n&&l.jsxs(ym,{defaultValue:"crawler-activity",children:[l.jsxs(Kf,{className:"bg-muted/50 p-1",children:[l.jsx($n,{value:"crawler-activity",className:"text-xs uppercase tracking-wider",children:"Crawler Activity"}),l.jsx($n,{value:"citation-tracker",className:"text-xs uppercase tracking-wider",children:"Citation Tracker"}),l.jsx($n,{value:"prompt-bank",className:"text-xs uppercase tracking-wider",children:"Prompt Bank"})]}),l.jsx(zn,{value:"crawler-activity",className:"mt-6",children:l.jsx(Nbt,{})}),l.jsx(zn,{value:"citation-tracker",className:"mt-6",children:l.jsx(Tbt,{siteDomain:n})}),l.jsx(zn,{value:"prompt-bank",className:"mt-6",children:l.jsx(Rbt,{})})]})]})},Qbt=()=>{const{isAdmin:e,isLoading:t}=p0(),{tier:n,isAeo:r,setTier:i,isLoading:s}=Yhe(),{configMap:a}=oa(),o=Ll(),[c,u]=C.useState(!1),[d,h]=C.useState("index"),[A,f]=C.useState(""),[p,m]=C.useState(!1),[g,y]=C.useState(!1),[v,x]=C.useState(!1),[b,w]=C.useState(null),[k,j]=C.useState(!1),[B,E]=C.useState(!1),P="khmmwvmdbhaplcfcndjx",T="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",N=async()=>{x(!0),j(!0),w(null);try{const[H,W]=await Promise.all([fetch(`https://${P}.supabase.co/functions/v1/sync-site-content`,{headers:{apikey:T}}),fetch("/sitemap-aeo.xml").then(Q=>Q.ok?Q.text():"").catch(()=>"")]);if(!H.ok)throw new Error(await H.text());const $=await H.json(),z=a.site_base_url||"https://www.holdengr.com";W&&$.audit&&($.audit=$.audit.map(Q=>{const R=Q.path==="/"&&Q.htmlFile==="index.html"?W.includes(`<loc>${z}/</loc>`)||W.includes(`<loc>${z}</loc>`):W.includes(`<loc>${z}/${Q.htmlFile}</loc>`);return{...Q,sitemapAeo:R?"✅":"❌"}})),w($),De({title:"Site content synchronized successfully"})}catch(H){De({title:"Sync failed",description:H.message,variant:"destructive"}),j(!1)}finally{x(!1)}},F=async()=>{E(!0);try{const H=await fetch(`https://${P}.supabase.co/functions/v1/sitemap`,{headers:{apikey:T}});if(!H.ok)throw new Error(await H.text());De({title:"Sitemaps regenerated",description:"sitemap.xml has been rebuilt from the database."})}catch(H){De({title:"Sitemap rebuild failed",description:H.message,variant:"destructive"})}finally{E(!1)}},L=async H=>{h(H),m(!0),u(!0),f("");try{const $=await(await fetch(`https://${P}.supabase.co/functions/v1/generate-llms-txt?type=${H}&rebuild=true`,{headers:{apikey:T}})).text();f($)}catch(W){De({title:"Rebuild failed",description:W.message,variant:"destructive"}),u(!1)}finally{m(!1)}},U=()=>{navigator.clipboard.writeText(A),y(!0),setTimeout(()=>y(!1),2e3)};return C.useEffect(()=>{!t&&!e&&o("/auth")},[e,t,o]),t||s?l.jsx(un,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(ht,{className:"h-10 w-64 mb-8"}),l.jsx(ht,{className:"h-64 w-full"})]})}):e?l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Site Factory | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-20",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"heading-section mb-0",children:"Site Factory"}),l.jsx(Yt,{variant:r?"default":"outline",className:"text-xs uppercase tracking-wider",children:n==="aeo"?"AEO":"Core"})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx("span",{className:`font-medium ${r?"text-muted-foreground":"text-foreground"}`,children:"Core"}),l.jsx(wc,{checked:r,onCheckedChange:H=>i(H?"aeo":"core")}),l.jsx("span",{className:`font-medium ${r?"text-foreground":"text-muted-foreground"}`,children:"AEO"})]}),l.jsxs(St,{to:"/",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(mm,{className:"w-4 h-4"}),"Back to Site"]})]})]}),l.jsxs("div",{className:"mb-8 flex flex-wrap items-center gap-3",children:[l.jsxs(xe,{size:"sm",variant:"default",onClick:N,disabled:v,children:[l.jsx(C2e,{className:"w-3.5 h-3.5 mr-1.5"})," Full Site Sync & Audit"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:F,disabled:B,children:[l.jsx(w2,{className:`w-3.5 h-3.5 mr-1.5 ${B?"animate-spin":""}`}),B?"Rebuilding...":"Regenerate Sitemaps"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>L("index"),disabled:p,children:[l.jsx(nu,{className:"w-3.5 h-3.5 mr-1.5"})," Rebuild llms.txt"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>L("full"),disabled:p,children:[l.jsx(nu,{className:"w-3.5 h-3.5 mr-1.5"})," Rebuild llms-full.txt"]})]}),l.jsx("div",{className:"mb-8",children:l.jsx(wYe,{})}),l.jsxs(ym,{defaultValue:"agent-config",className:"space-y-8",children:[l.jsxs(Kf,{className:"bg-muted/50 p-1",children:[l.jsx($n,{value:"agent-config",className:"text-xs uppercase tracking-wider",children:"Agent Config"}),l.jsx($n,{value:"blueprint",className:"text-xs uppercase tracking-wider",children:"Blueprint"}),l.jsx($n,{value:"media",className:"text-xs uppercase tracking-wider",children:"Media Library"}),r&&l.jsx($n,{value:"generator",className:"text-xs uppercase tracking-wider",children:"Page Generator"}),r&&l.jsx($n,{value:"cannibalization",className:"text-xs uppercase tracking-wider",children:"Cannibalization"}),l.jsx($n,{value:"monitor",className:"text-xs uppercase tracking-wider",children:"Monitor"}),l.jsx($n,{value:"backups",className:"text-xs uppercase tracking-wider",children:"Backups"}),l.jsx($n,{value:"crawlability",className:"text-xs uppercase tracking-wider",children:"Crawlability"}),l.jsx($n,{value:"readiness",className:"text-xs uppercase tracking-wider",children:"Readiness"})]}),l.jsx(zn,{value:"agent-config",children:l.jsx(bqe,{})}),l.jsx(zn,{value:"blueprint",children:l.jsx(FWe,{})}),l.jsx(zn,{value:"media",children:l.jsx(KWe,{})}),r&&l.jsx(zn,{value:"generator",children:l.jsx(LWe,{})}),r&&l.jsx(zn,{value:"cannibalization",children:l.jsx(RWe,{})}),l.jsx(zn,{value:"monitor",children:l.jsx(Hbt,{})}),l.jsx(zn,{value:"backups",children:l.jsx(DWe,{})}),l.jsx(zn,{value:"crawlability",children:l.jsx(xYe,{})}),l.jsx(zn,{value:"readiness",children:l.jsx(vYe,{})})]}),l.jsx(Fo,{open:c,onOpenChange:u,children:l.jsxs(Ja,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[l.jsx(Za,{children:l.jsxs(eo,{children:[d==="full"?"llms-full.txt":"llms.txt"," — Generated Content"]})}),p?l.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Generating..."}):l.jsxs(l.Fragment,{children:[l.jsxs(xe,{size:"sm",variant:"outline",onClick:U,className:"mb-2 w-fit",children:[g?l.jsx(Sl,{className:"w-3.5 h-3.5 mr-1.5"}):l.jsx(P3,{className:"w-3.5 h-3.5 mr-1.5"}),g?"Copied!":"Copy to Clipboard"]}),l.jsx("pre",{className:"text-xs bg-muted p-4 rounded overflow-auto max-h-[50vh] whitespace-pre-wrap",children:A})]})]})}),l.jsx(bYe,{open:k,onOpenChange:j,syncReport:b,setSyncReport:w,isSyncing:v})]})]}):null},$bt=G6,zbt=Y6,Wge=C.forwardRef(({className:e,...t},n)=>l.jsx(I2,{className:ot("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",e),...t,ref:n}));Wge.displayName=I2.displayName;const Vbt=v2("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out 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"}}),Gge=C.forwardRef(({side:e="right",className:t,children:n,...r},i)=>l.jsxs(zbt,{children:[l.jsx(Wge,{}),l.jsxs(P2,{ref:i,className:ot(Vbt({side:e}),t),...r,children:[n,l.jsxs(GE,{className:"absolute right-4 top-4 rounded-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:[l.jsx(ra,{className:"h-4 w-4 text-white"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Gge.displayName=P2.displayName;const Yge=({className:e,...t})=>l.jsx("div",{className:ot("flex flex-col space-y-2 text-center sm:text-left",e),...t});Yge.displayName="SheetHeader";const Xge=C.forwardRef(({className:e,...t},n)=>l.jsx(O2,{ref:n,className:ot("text-lg font-semibold text-foreground",e),...t}));Xge.displayName=O2.displayName;const Jge=C.forwardRef(({className:e,...t},n)=>l.jsx(F2,{ref:n,className:ot("text-sm text-muted-foreground",e),...t}));Jge.displayName=F2.displayName;const Kbt="khmmwvmdbhaplcfcndjx",QX="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",qbt=`https://${Kbt}.supabase.co/functions/v1`,e$="possible_list_session",$X="possible_list_lurker_prompt_dismissed",Wbt=["Holland","Hudsonville","Zeeland","Byron Center","Grandville","Caledonia","Forest Hills (Cascade)","Forest Hills (Ada)","Rockford","Jenison","Allendale"],Gbt=["Single-family","Ranch","Colonial","Condo","Townhouse","Land","Multi-family","New construction","Other"],Ybt=["Ranch","Colonial","Cape Cod","Craftsman","Contemporary / Modern","Farmhouse","Tudor","Mid-Century","Victorian","No preference"],Xbt=["Under 0.25 acre","0.25–0.5 acre","0.5–1 acre","1–3 acres","3–5 acres","5+ acres"],Jbt=["None","1-car","2-car","3-car","4+ car"],Zbt=["None / slab","Crawl space","Unfinished","Partially finished","Finished","Walkout","Daylight"],e1t=["1 story","1.5 stories","2 stories","3+ stories","No preference"],t1t=["Lakefront","Riverfront","Pond","Lake access (no frontage)","Wooded view","None required"],n1t=["Pole barn","Detached garage","Shed","Workshop","Guest house / ADU","Horse barn","None"],r1t=["No HOA only","OK if reasonable dues","OK if amenities included","Don't care"],i1t=["Move-in ready only","Light cosmetic updates OK","Major updates OK","Full renovation OK","Tear-down / land value OK"],s1t=["Relocating to area","Upsizing","Downsizing","First home","Investment / rental","Second home / vacation","Job change","Family growth","Empty nesters","Retirement","Divorce / separation","Estate / inherited","Other"],a1t=["Own outright","Own with mortgage","Renting","Living with family","Need to sell first","Already under contract elsewhere","Other"],o1t=["Cash","Conventional","FHA","VA","USDA","Physician / portfolio","Other","Not sure yet"],l1t=["Yes — pre-approved","In progress","Not yet","Cash buyer (N/A)"],c1t=["No","Yes","Maybe / depends on terms"],u1t=["Anytime with 24h notice","By appointment only","Limited (evenings/weekends)","Tenant-occupied — restricted"],d1t=["No","Yes — short (under 30 days)","Yes — extended (30–90 days)","Maybe"],h1t=["Off-market only","Either / open to both","Lean toward listing publicly"],f1t=["Free and clear","Comfortably below market value","Tight but workable","Underwater / sensitive","Prefer not to say"],Zge=[{value:"now",label:"Now / actively"},{value:"3mo",label:"Within 3 months"},{value:"6mo",label:"Within 6 months"},{value:"12mo",label:"Within a year"},{value:"right_offer",label:"If the right offer comes"}];function eye(){try{return localStorage.getItem(e$)}catch{return null}}function A1t(e){try{localStorage.setItem(e$,e)}catch{}}function p1t(){try{localStorage.removeItem(e$)}catch{}}async function P0(e,t={}){const n={"Content-Type":"application/json",apikey:QX,Authorization:`Bearer ${QX}`};if(t.auth){const s=eye();s&&(n["x-list-session-token"]=s)}const r=await fetch(`${qbt}${e}`,{method:t.method||(t.body?"POST":"GET"),headers:n,body:t.body?JSON.stringify(t.body):void 0}),i=await r.json().catch(()=>({}));if(!r.ok){const s=i&&i.error||`Request failed (${r.status})`;throw Object.assign(new Error(s),{status:r.status,data:i})}return i}async function m1t(e){return P0("/list-signup",{body:e})}async function g1t(e){const t=await P0("/list-redeem-invite",{body:e});return t.session_token&&A1t(t.session_token),t}async function tye(){if(!eye())return{valid:!1};try{return await P0("/list-session-info",{auth:!0,method:"POST",body:{}})}catch{return{valid:!1}}}async function y1t(){return P0("/list-dashboard-data",{auth:!0})}async function v1t(e){return P0("/list-submit-intent",{body:e,auth:!0})}async function x1t(e,t){return P0("/list-tell-holden",{body:{intent_id:e,message:t||void 0},auth:!0})}function w1t(e){var t;return e?((t=Zge.find(n=>n.value===e))==null?void 0:t.label)??null:null}function b1t(){const e="ABCDEFGHJKMNPQRSTUVWXYZ23456789",t=()=>e[Math.floor(Math.random()*e.length)],n=()=>Array.from({length:3},t).join("");return`${n()}-${n()}-${n()}`}const nye="The Off-Market List is an informational tool tracking hypothetical, non-binding buyer and seller interest. It is not a listing service, MLS, or private listing network. No property on this list is subject to a listing agreement. Participation does not create an agency, brokerage, or buyer-representation relationship with Holden Richardson or 616 Realty LLC. All real estate transactions require separate written agreements and are subject to NAR Clear Cooperation Policy and MichRIC rules. Equal Housing Opportunity. Holden Richardson, REALTOR®, MI License #6501392389, 616 Realty LLC.",rye=`The no-push promise: you'll never get a "ready to convert?" email, a "your intent is going stale" reminder, or a sequence trying to move you off the list. The dashboard sits there. Holden writes you when there's a real reason. Otherwise, silence.`,Mo=Me,C1t=()=>{const{isAdmin:e,isLoading:t}=p0(),n=Ll();return C.useEffect(()=>{!t&&!e&&n("/auth")},[e,t,n]),t?l.jsx(un,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(ht,{className:"h-10 w-64 mb-8"}),l.jsx(ht,{className:"h-64 w-full"})]})}):e?l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Off-Market List Admin | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-20",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"heading-section mb-0",children:"Off-Market List"}),l.jsx(Yt,{variant:"default",className:"text-xs uppercase tracking-wider",children:"Admin"})]}),l.jsxs(St,{to:"/",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[l.jsx(mm,{className:"w-4 h-4"})," Back to Site"]})]}),l.jsxs(ym,{defaultValue:"members",className:"space-y-8",children:[l.jsxs(Kf,{className:"bg-muted/50 p-1 flex-wrap h-auto",children:[l.jsx($n,{value:"members",className:"text-xs uppercase tracking-wider",children:"Members"}),l.jsx($n,{value:"invites",className:"text-xs uppercase tracking-wider",children:"Invites"}),l.jsx($n,{value:"intents",className:"text-xs uppercase tracking-wider",children:"Intents"}),l.jsx($n,{value:"queue",className:"text-xs uppercase tracking-wider",children:"Action Queue"}),l.jsx($n,{value:"digest",className:"text-xs uppercase tracking-wider",children:"Digest"}),l.jsx($n,{value:"audit",className:"text-xs uppercase tracking-wider",children:"Audit log"})]}),l.jsx(zn,{value:"members",children:l.jsx(S1t,{})}),l.jsx(zn,{value:"invites",children:l.jsx(k1t,{})}),l.jsx(zn,{value:"intents",children:l.jsx(_1t,{})}),l.jsx(zn,{value:"queue",children:l.jsx(B1t,{})}),l.jsx(zn,{value:"digest",children:l.jsx(N1t,{})}),l.jsx(zn,{value:"audit",children:l.jsx(E1t,{})})]})]})]}):null},S1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState("all"),[i,s]=C.useState(""),a=async()=>{t(null);let u=Mo.from("list_members").select("*").order("created_at",{ascending:!1});n!=="all"&&(u=u.eq("status",n));const{data:d,error:h}=await u;h&&De({title:"Failed to load members",description:h.message,variant:"destructive"}),t(d||[])};C.useEffect(()=>{a()},[n]);const o=C.useMemo(()=>{if(!e)return[];if(!i.trim())return e;const u=i.toLowerCase();return e.filter(d=>{var h;return((h=d.email)==null?void 0:h.toLowerCase().includes(u))||`${d.first_name||""} ${d.last_name||""}`.toLowerCase().includes(u)})},[e,i]),c=async(u,d)=>{const h={status:d};d==="approved"&&(h.approved_at=new Date().toISOString());const{error:A}=await Mo.from("list_members").update(h).eq("id",u);if(A){De({title:"Update failed",description:A.message,variant:"destructive"});return}await Mo.from("list_audit_log").insert({action:`member_set_${d}`,target_id:u,target_table:"list_members",payload:{}}),De({title:`Member set to ${d}`}),a()};return l.jsx(Zt,{children:l.jsxs(en,{className:"p-6 space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(_r,{value:n,onValueChange:r,children:[l.jsx(fr,{className:"w-40",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"All statuses"}),l.jsx(dt,{value:"pending",children:"Pending"}),l.jsx(dt,{value:"approved",children:"Approved"}),l.jsx(dt,{value:"paused",children:"Paused"}),l.jsx(dt,{value:"removed",children:"Removed"})]})]}),l.jsx(Je,{placeholder:"Search email or name…",value:i,onChange:u=>s(u.target.value),className:"max-w-xs"}),l.jsxs("div",{className:"ml-auto text-sm text-muted-foreground",children:[o.length," member(s)"]})]}),e===null?l.jsx(ht,{className:"h-64 w-full"}):l.jsxs(Wf,{children:[l.jsx(Gf,{children:l.jsxs(Li,{children:[l.jsx(vn,{children:"Name / Email"}),l.jsx(vn,{children:"Status"}),l.jsx(vn,{children:"Source"}),l.jsx(vn,{children:"Last visit"}),l.jsx(vn,{className:"text-right",children:"Actions"})]})}),l.jsxs(Yf,{children:[o.map(u=>l.jsxs(Li,{children:[l.jsxs(on,{children:[l.jsx("div",{className:"font-medium",children:u.first_name||u.last_name?`${u.first_name||""} ${u.last_name||""}`.trim():"—"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:u.email})]}),l.jsx(on,{children:l.jsx(Yt,{variant:u.status==="approved"?"default":"outline",className:"text-[10px] uppercase",children:u.status})}),l.jsx(on,{className:"text-xs text-muted-foreground",children:u.source}),l.jsx(on,{className:"text-xs text-muted-foreground",children:u.last_dashboard_visit_at?new Date(u.last_dashboard_visit_at).toLocaleDateString():"—"}),l.jsxs(on,{className:"text-right space-x-1",children:[u.status!=="approved"&&l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>c(u.id,"approved"),children:"Approve"}),u.status!=="paused"&&u.status!=="removed"&&l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>c(u.id,"paused"),children:"Pause"}),u.status!=="removed"&&l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>c(u.id,"removed"),children:"Remove"})]})]},u.id)),o.length===0&&l.jsx(Li,{children:l.jsx(on,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No members yet."})})]})]})]})})},k1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState(""),[i,s]=C.useState(""),[a,o]=C.useState(""),[c,u]=C.useState(""),[d,h]=C.useState("30"),[A,f]=C.useState(!1),[p,m]=C.useState(null),[g,y]=C.useState(!1),v=async()=>{t(null);const{data:w,error:k}=await Mo.from("list_invites").select("*").order("created_at",{ascending:!1}).limit(200);k&&De({title:"Failed to load invites",description:k.message,variant:"destructive"}),t(w||[])};C.useEffect(()=>{v()},[]);const x=async()=>{f(!0);try{const w=b1t(),k=d==="never"?null:new Date(Date.now()+parseInt(d,10)*24*60*60*1e3).toISOString(),{error:j}=await Mo.from("list_invites").insert({code:w,invitee_name:n||null,invitee_personal_context:i||null,invitee_email:a||null,invitee_phone:c||null,expires_at:k});if(j)throw j;m(w),r(""),s(""),o(""),u(""),De({title:"Invite created",description:w}),v()}catch(w){De({title:"Couldn't create invite",description:w.message,variant:"destructive"})}finally{f(!1)}},b=w=>{navigator.clipboard.writeText(w),y(!0),setTimeout(()=>y(!1),1500)};return l.jsxs("div",{className:"space-y-6",children:[l.jsx(Zt,{children:l.jsxs(en,{className:"p-6 space-y-4",children:[l.jsx("h3",{className:"font-semibold",children:"Generate invite code"}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Invitee name"}),l.jsx(Je,{value:n,onChange:w=>r(w.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Expires in"}),l.jsxs(_r,{value:d,onValueChange:h,children:[l.jsx(fr,{className:"mt-1",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"7",children:"7 days"}),l.jsx(dt,{value:"30",children:"30 days"}),l.jsx(dt,{value:"90",children:"90 days"}),l.jsx(dt,{value:"never",children:"Never"})]})]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Invitee email (optional pre-fill)"}),l.jsx(Je,{value:a,onChange:w=>o(w.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Invitee phone (optional)"}),l.jsx(Je,{value:c,onChange:w=>u(w.target.value),className:"mt-1"})]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Internal context (why you invited them)"}),l.jsx(hi,{rows:2,value:i,onChange:w=>s(w.target.value),className:"mt-1"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xe,{onClick:x,disabled:A,children:A?"Generating…":"Generate code"}),p&&l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx("code",{className:"font-mono bg-muted px-2 py-1 rounded",children:p}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>b(p),children:g?l.jsx(Sl,{className:"w-4 h-4"}):l.jsx(P3,{className:"w-4 h-4"})})]})]})]})}),l.jsx(Zt,{children:l.jsx(en,{className:"p-6",children:e===null?l.jsx(ht,{className:"h-48 w-full"}):l.jsxs(Wf,{children:[l.jsx(Gf,{children:l.jsxs(Li,{children:[l.jsx(vn,{children:"Code"}),l.jsx(vn,{children:"Invitee"}),l.jsx(vn,{children:"Status"}),l.jsx(vn,{children:"Redeemed"}),l.jsx(vn,{children:"Expires"}),l.jsx(vn,{})]})}),l.jsxs(Yf,{children:[e.map(w=>l.jsxs(Li,{children:[l.jsx(on,{children:l.jsx("code",{className:"font-mono text-xs",children:w.code})}),l.jsxs(on,{className:"text-sm",children:[w.invitee_name||"—",w.invitee_email&&l.jsx("div",{className:"text-xs text-muted-foreground",children:w.invitee_email})]}),l.jsx(on,{children:l.jsx(Yt,{variant:w.status==="unused"?"outline":"secondary",className:"text-[10px] uppercase",children:w.status})}),l.jsx(on,{className:"text-xs text-muted-foreground",children:w.redeemed_at?new Date(w.redeemed_at).toLocaleDateString():"—"}),l.jsx(on,{className:"text-xs text-muted-foreground",children:w.expires_at?new Date(w.expires_at).toLocaleDateString():"Never"}),l.jsx(on,{children:l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>b(w.code),children:l.jsx(P3,{className:"w-3 h-3"})})})]},w.id)),e.length===0&&l.jsx(Li,{children:l.jsx(on,{colSpan:6,className:"text-center text-muted-foreground py-8",children:"No invites yet."})})]})]})})})]})},_1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState("pending_review"),[i,s]=C.useState(null),a=async()=>{t(null);let o=Mo.from("list_intents").select("*").order("created_at",{ascending:!1});n!=="all"&&(o=o.eq("status",n));const{data:c,error:u}=await o;u&&De({title:"Failed to load intents",description:u.message,variant:"destructive"}),t(c||[])};return C.useEffect(()=>{a()},[n]),l.jsxs(Zt,{children:[l.jsxs(en,{className:"p-6 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(_r,{value:n,onValueChange:r,children:[l.jsx(fr,{className:"w-48",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"All"}),l.jsx(dt,{value:"draft",children:"Draft"}),l.jsx(dt,{value:"pending_review",children:"Pending review"}),l.jsx(dt,{value:"active",children:"Active"}),l.jsx(dt,{value:"paused",children:"Paused"}),l.jsx(dt,{value:"converted",children:"Converted"}),l.jsx(dt,{value:"expired",children:"Expired"})]})]}),l.jsxs("div",{className:"ml-auto text-sm text-muted-foreground",children:[(e==null?void 0:e.length)||0," intent(s)"]})]}),e===null?l.jsx(ht,{className:"h-64 w-full"}):l.jsxs(Wf,{children:[l.jsx(Gf,{children:l.jsxs(Li,{children:[l.jsx(vn,{children:"Type"}),l.jsx(vn,{children:"Title"}),l.jsx(vn,{children:"Towns"}),l.jsx(vn,{children:"Status"}),l.jsx(vn,{children:"Submitted"})]})}),l.jsxs(Yf,{children:[e.map(o=>l.jsxs(Li,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(o),children:[l.jsx(on,{children:l.jsx(Yt,{variant:o.type==="buy"?"default":"secondary",className:"text-[10px] uppercase",children:o.type})}),l.jsx(on,{className:"text-sm",children:o.title||l.jsx("em",{className:"text-muted-foreground",children:"untitled"})}),l.jsx(on,{className:"text-xs text-muted-foreground",children:(o.towns||[]).join(", ")||"—"}),l.jsx(on,{children:l.jsx(Yt,{variant:"outline",className:"text-[10px] uppercase",children:o.status.replace(/_/g," ")})}),l.jsx(on,{className:"text-xs text-muted-foreground",children:o.submitted_at?new Date(o.submitted_at).toLocaleDateString():"—"})]},o.id)),e.length===0&&l.jsx(Li,{children:l.jsx(on,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No intents in this view."})})]})]})]}),l.jsx(j1t,{intent:i,onClose:()=>s(null),onSaved:()=>{s(null),a()}})]})},j1t=({intent:e,onClose:t,onSaved:n})=>{const[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1);if(C.useEffect(()=>{e&&(i(e.title||""),a(e.must_haves||""),c(e.notable_features||""),d(e.public_summary||""))},[e==null?void 0:e.id]),!e)return null;const f=async p=>{A(!0);try{const m={title:r||null,must_haves:s||null,notable_features:o||null,public_summary:u||null,status:p};p==="active"&&!e.approved_at&&(m.approved_at=new Date().toISOString());const{error:g}=await Mo.from("list_intents").update(m).eq("id",e.id);if(g)throw g;if(await Mo.from("list_audit_log").insert({action:`intent_set_${p}`,target_id:e.id,target_table:"list_intents",payload:{}}),De({title:`Intent set to ${p}`}),p==="active")try{const{data:y,error:v}=await Me.functions.invoke("list-run-matches",{body:{intent_id:e.id}});if(v)throw v;const x=(y==null?void 0:y.inserted)??0;x>0?De({title:`Matching ran — ${x} new candidate${x===1?"":"s"}`,description:`Top score ${(y==null?void 0:y.top_score)??0}. See Action Queue.`}):De({title:"Matching ran — no new candidates",description:"No active counterparts overlap this intent yet."})}catch(y){console.error("Matching invoke failed",y),De({title:"Matching run failed",description:(y==null?void 0:y.message)??"See console.",variant:"destructive"})}n()}catch(m){De({title:"Save failed",description:m.message,variant:"destructive"})}finally{A(!1)}};return l.jsx($bt,{open:!!e,onOpenChange:p=>!p&&t(),children:l.jsxs(Gge,{className:"w-full sm:max-w-xl overflow-y-auto",children:[l.jsxs(Yge,{children:[l.jsxs(Xge,{children:[l.jsx(Yt,{variant:e.type==="buy"?"default":"secondary",className:"mr-2 text-[10px] uppercase",children:e.type}),"Moderate intent"]}),l.jsx(Jge,{children:"Edit the editorial fields and approve, pause, or expire. Holden's pass strips fair-housing landmines and tightens the narrative."})]}),l.jsxs("div",{className:"mt-6 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Status:"})," ",e.status]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Timeline:"})," ",e.timeline||"—"]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{className:"text-muted-foreground",children:"Towns:"})," ",(e.towns||[]).join(", ")||"—"]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{className:"text-muted-foreground",children:"Property types:"})," ",(e.property_types||[]).join(", ")||"—"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Price:"})," ",e.price_min?`$${e.price_min.toLocaleString()}`:"?","–",e.price_max?`$${e.price_max.toLocaleString()}`:"?"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Beds/Baths:"})," ",e.beds_min||"?"," / ",e.baths_min||"?"]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Title"}),l.jsx(Je,{value:r,onChange:p=>i(p.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Must-haves (buyer)"}),l.jsx(hi,{rows:3,value:s,onChange:p=>a(p.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Notable features (seller)"}),l.jsx(hi,{rows:3,value:o,onChange:p=>c(p.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Public summary (Holden's editorial card text)"}),l.jsx(hi,{rows:4,value:u,onChange:p=>d(p.target.value),className:"mt-1",placeholder:"The narrative that lands on the dashboard. Strip fair-housing landmines."})]}),e.notes&&l.jsxs("div",{className:"text-xs",children:[l.jsx("div",{className:"text-muted-foreground mb-1",children:"Member notes (internal):"}),l.jsx("div",{className:"bg-muted/50 rounded p-2",children:e.notes})]}),l.jsxs("div",{className:"flex flex-wrap gap-2 pt-4 border-t",children:[l.jsx(xe,{onClick:()=>f("active"),disabled:h,children:"Approve (active)"}),l.jsx(xe,{variant:"outline",onClick:()=>f("paused"),disabled:h,children:"Pause"}),l.jsx(xe,{variant:"outline",onClick:()=>f("converted"),disabled:h,children:"Convert"}),l.jsx(xe,{variant:"ghost",onClick:()=>f("expired"),disabled:h,children:"Expire"})]})]})]})})},B1t=()=>{const[e,t]=C.useState("all"),[n,r]=C.useState(null),[i,s]=C.useState(null),[a,o]=C.useState(!1),c=async()=>{r(null),s(null);const[f,p]=await Promise.all([Mo.from("list_interest_pings").select("*, intent:intent_id (id, title, type, towns, price_min, price_max), member:member_id (id, first_name, last_name, email)").order("created_at",{ascending:!1}),Mo.from("list_matches").select("*, buy:buy_intent_id (id, title, towns, price_min, price_max, member:member_id (first_name, last_name, email)), sell:sell_intent_id (id, title, towns, price_min, price_max, member:member_id (first_name, last_name, email))").neq("status","dismissed").order("match_score",{ascending:!1}).order("created_at",{ascending:!1})]);f.error&&De({title:"Failed to load pings",description:f.error.message,variant:"destructive"}),p.error&&De({title:"Failed to load matches",description:p.error.message,variant:"destructive"}),r(f.data||[]),s(p.data||[])};C.useEffect(()=>{c()},[]);const u=async(f,p)=>{const{error:m}=await Mo.from("list_interest_pings").update({status:p}).eq("id",f);if(m){De({title:"Update failed",description:m.message,variant:"destructive"});return}De({title:`Marked ${p}`}),c()},d=async(f,p)=>{const m={status:p};(p==="reviewed"||p==="intro_made"||p==="dismissed")&&(m.reviewed_at=new Date().toISOString());const{error:g}=await Mo.from("list_matches").update(m).eq("id",f);if(g){De({title:"Update failed",description:g.message,variant:"destructive"});return}De({title:`Match ${p.replace("_"," ")}`}),c()},h=async()=>{o(!0);try{const{data:f,error:p}=await Me.functions.invoke("list-run-matches",{body:{}});if(p)throw p;const m=(f==null?void 0:f.inserted)??0,g=(f==null?void 0:f.skipped_existing)??0,y=(f==null?void 0:f.top_score)??0;De({title:`Rescan complete — ${m} new`,description:`Skipped ${g} existing. Top score ${y}.`}),c()}catch(f){De({title:"Rescan failed",description:(f==null?void 0:f.message)??"See console",variant:"destructive"})}finally{o(!1)}},A=f=>f?`$${(f/1e3).toFixed(0)}k`:"?";return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[["all","pings","matches"].map(f=>l.jsx(xe,{size:"sm",variant:e===f?"default":"outline",onClick:()=>t(f),children:f==="all"?"All":f==="pings"?"Interest pings":"Auto matches"},f)),l.jsx("div",{className:"ml-auto",children:l.jsx(xe,{size:"sm",variant:"secondary",onClick:h,disabled:a,children:a?"Re-scanning…":"Re-scan all matches"})})]}),(e==="all"||e==="pings")&&l.jsx(Zt,{children:l.jsxs(en,{className:"p-6",children:[l.jsx("h3",{className:"font-semibold mb-4",children:"Interest pings"}),n===null?l.jsx(ht,{className:"h-32 w-full"}):n.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No pings yet."}):l.jsxs(Wf,{children:[l.jsx(Gf,{children:l.jsxs(Li,{children:[l.jsx(vn,{children:"From"}),l.jsx(vn,{children:"On intent"}),l.jsx(vn,{children:"Message"}),l.jsx(vn,{children:"Status"}),l.jsx(vn,{className:"text-right",children:"Actions"})]})}),l.jsx(Yf,{children:n.map(f=>{var p,m,g,y,v,x;return l.jsxs(Li,{children:[l.jsxs(on,{className:"text-sm",children:[((p=f.member)==null?void 0:p.first_name)||""," ",((m=f.member)==null?void 0:m.last_name)||"",l.jsx("div",{className:"text-xs text-muted-foreground",children:(g=f.member)==null?void 0:g.email})]}),l.jsxs(on,{className:"text-sm",children:[((y=f.intent)==null?void 0:y.title)||"—",l.jsxs("div",{className:"text-xs text-muted-foreground",children:[(v=f.intent)==null?void 0:v.type," · ",(((x=f.intent)==null?void 0:x.towns)||[]).join(", ")]})]}),l.jsx(on,{className:"text-xs max-w-xs",children:f.message||l.jsx("em",{className:"text-muted-foreground",children:"no message"})}),l.jsx(on,{children:l.jsx(Yt,{variant:"outline",className:"text-[10px] uppercase",children:f.status})}),l.jsxs(on,{className:"text-right space-x-1",children:[l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>u(f.id,"contacted"),children:"Contacted"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>u(f.id,"converted"),children:"Converted"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>u(f.id,"dismissed"),children:"Dismiss"})]})]},f.id)})})]})]})}),(e==="all"||e==="matches")&&l.jsx(Zt,{children:l.jsxs(en,{className:"p-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"font-semibold",children:"Auto matches"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Candidates only. No member is ever told until you make the intro."})]}),i===null?l.jsx(ht,{className:"h-32 w-full"}):i.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:'No candidate matches yet. Approve more intents or hit "Re-scan all matches".'}):l.jsx("div",{className:"space-y-3",children:i.map(f=>{var g,y,v,x,b,w,k,j,B,E,P,T,N,F,L,U,H,W,$,z;const p=f.match_reasons||{},m=p.weak_match;return l.jsxs("div",{className:`rounded-lg border p-4 ${m?"opacity-60 border-dashed":""}`,children:[l.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Yt,{variant:m?"outline":"default",className:"text-[10px] uppercase",children:["Score ",f.match_score,m?" · weak":""]}),l.jsx(Yt,{variant:"outline",className:"text-[10px] uppercase",children:f.status}),(p.warnings||[]).map((Q,ce)=>l.jsxs(Yt,{variant:"outline",className:"text-[10px] normal-case font-normal",children:["⚠ ",Q]},ce))]}),l.jsxs("div",{className:"space-x-1",children:[l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>d(f.id,"reviewed"),children:"Reviewed"}),l.jsx(xe,{size:"sm",onClick:()=>d(f.id,"intro_made"),children:"Intro made"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>d(f.id,"dismissed"),children:"Dismiss"})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{className:"rounded border bg-muted/30 p-3",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Buyer"}),l.jsxs("div",{className:"font-medium",children:[(y=(g=f.buy)==null?void 0:g.member)==null?void 0:y.first_name," ",(x=(v=f.buy)==null?void 0:v.member)==null?void 0:x.last_name]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:(w=(b=f.buy)==null?void 0:b.member)==null?void 0:w.email}),l.jsx("div",{className:"text-xs mt-2",children:((k=f.buy)==null?void 0:k.title)||l.jsx("em",{children:"untitled"})}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[(((j=f.buy)==null?void 0:j.towns)||[]).join(", ")," · ",A((B=f.buy)==null?void 0:B.price_min),"–",A((E=f.buy)==null?void 0:E.price_max)]})]}),l.jsxs("div",{className:"rounded border bg-muted/30 p-3",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Seller"}),l.jsxs("div",{className:"font-medium",children:[(T=(P=f.sell)==null?void 0:P.member)==null?void 0:T.first_name," ",(F=(N=f.sell)==null?void 0:N.member)==null?void 0:F.last_name]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:(U=(L=f.sell)==null?void 0:L.member)==null?void 0:U.email}),l.jsx("div",{className:"text-xs mt-2",children:((H=f.sell)==null?void 0:H.title)||l.jsx("em",{children:"untitled"})}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[(((W=f.sell)==null?void 0:W.towns)||[]).join(", ")," · ",A(($=f.sell)==null?void 0:$.price_min),"–",A((z=f.sell)==null?void 0:z.price_max)]})]})]}),l.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5 text-[11px]",children:[(p.town_match||[]).length>0&&l.jsxs(Yt,{variant:"secondary",className:"font-normal",children:["🏘 ",(p.town_match||[]).join(", ")]}),(p.shared_property_types||[]).length>0&&l.jsxs(Yt,{variant:"secondary",className:"font-normal",children:["🏠 ",(p.shared_property_types||[]).join(", ")]}),p.price_fit&&l.jsxs(Yt,{variant:"secondary",className:"font-normal",children:["💰 ",String(p.price_fit).replace("_"," ")]}),p.timeline_fit&&p.timeline_fit!=="unknown"&&l.jsxs(Yt,{variant:"secondary",className:"font-normal",children:["⏱ ",String(p.timeline_fit).replace("_"," ")]})]})]},f.id)})})]})})]})},N1t=()=>l.jsx(Zt,{className:"border-dashed",children:l.jsxs(en,{className:"p-12 text-center text-muted-foreground space-y-2",children:[l.jsx("h3",{className:"font-semibold text-foreground",children:"Digest preview"}),l.jsx("p",{className:"text-sm max-w-md mx-auto",children:"Weekly digest sender (Resend + Twilio) is deferred. Once wired, the next scheduled payload will preview here before it ships Saturday morning."})]})}),E1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState(""),i=async()=>{t(null);let s=Mo.from("list_audit_log").select("*").order("created_at",{ascending:!1}).limit(500);n.trim()&&(s=s.ilike("action",`%${n.trim()}%`));const{data:a,error:o}=await s;o&&De({title:"Failed to load audit log",description:o.message,variant:"destructive"}),t(a||[])};return C.useEffect(()=>{i()},[n]),l.jsx(Zt,{children:l.jsxs(en,{className:"p-6 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Je,{placeholder:"Filter by action…",value:n,onChange:s=>r(s.target.value),className:"max-w-xs"}),l.jsxs("div",{className:"ml-auto text-sm text-muted-foreground",children:[(e==null?void 0:e.length)||0," entries"]})]}),e===null?l.jsx(ht,{className:"h-64 w-full"}):l.jsxs(Wf,{children:[l.jsx(Gf,{children:l.jsxs(Li,{children:[l.jsx(vn,{children:"When"}),l.jsx(vn,{children:"Action"}),l.jsx(vn,{children:"Target"}),l.jsx(vn,{children:"Payload"})]})}),l.jsxs(Yf,{children:[e.map(s=>l.jsxs(Li,{children:[l.jsx(on,{className:"text-xs whitespace-nowrap",children:new Date(s.created_at).toLocaleString()}),l.jsx(on,{children:l.jsx("code",{className:"text-xs",children:s.action})}),l.jsxs(on,{className:"text-xs",children:[s.target_table,s.target_id&&l.jsx("div",{className:"text-muted-foreground truncate max-w-[12rem]",children:s.target_id})]}),l.jsx(on,{children:l.jsx("pre",{className:"text-[10px] max-w-xs overflow-x-auto bg-muted/50 p-2 rounded",children:JSON.stringify(s.payload,null,0)})})]},s.id)),e.length===0&&l.jsx(Li,{children:l.jsx(on,{colSpan:4,className:"text-center text-muted-foreground py-8",children:"No audit entries."})})]})]})]})})},T1t=[{to:"/admin/list",title:"Off-Market List",desc:"Members, invites, intents, redemptions, settings.",icon:f2e},{to:"/admin/aeo",title:"AEO",desc:"Pages, categories, monitor, blueprints, crawl health.",icon:Os},{to:"/admin/blog",title:"Blog",desc:"Long-form posts, drafts, publishing.",icon:Vp},{to:"/admin/profile",title:"Profile",desc:"Agent profile + site config.",icon:dE}];function I1t(){const e=Ll(),{user:t,isLoading:n,isAdmin:r,signOut:i}=p0();return C.useEffect(()=>{!n&&(!t||!r)&&e("/auth")},[t,r,n,e]),n||!t||!r?l.jsx(un,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center text-muted-foreground",children:"Loading…"})}):l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Admin | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-5xl",children:[l.jsxs("div",{className:"flex items-start justify-between mb-10 gap-4 flex-wrap",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-2 text-sm font-semibold",children:"Admin"}),l.jsx("h1",{className:"heading-section text-4xl md:text-5xl",children:"Dashboard"}),l.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["Signed in as ",t.email]})]}),l.jsxs(xe,{variant:"outline",onClick:async()=>{await i(),e("/")},children:[l.jsx(_re,{className:"w-4 h-4 mr-2"})," Sign out"]})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:T1t.map(s=>l.jsx(St,{to:s.to,className:"group",children:l.jsxs(Zt,{className:"h-full transition-all hover:shadow-lg hover:border-accent/40",children:[l.jsxs(Sa,{children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-md bg-accent/10 text-accent flex items-center justify-center",children:l.jsx(s.icon,{className:"w-5 h-5"})}),l.jsx(ka,{className:"text-xl group-hover:text-accent transition-colors",children:s.title})]}),l.jsx(jp,{className:"pt-2",children:s.desc})]}),l.jsx(en,{children:l.jsx("span",{className:"text-sm text-accent font-medium",children:"Open →"})})]})},s.to))})]})})]})}const P1t=({onSuccess:e})=>{const[t,n]=C.useState(""),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1),[f,p]=C.useState(!0),[m,g]=C.useState(!1),[y,v]=C.useState(null),x=async b=>{if(b.preventDefault(),v(null),!s){v("Email required.");return}g(!0);try{const w=await m1t({email:s,phone:o||void 0,first_name:t||void 0,last_name:r||void 0,referral_text:u||void 0,sms_opt_in:h,email_opt_in:f});w.already_on_list?De({title:"You're already on the list",description:w.status==="approved"?"Approved. Use your invite code to sign in.":"Holden has your application — sit tight."}):De({title:"You're in the queue",description:"Holden will personally review within a day or two."}),e()}catch(w){v((w==null?void 0:w.message)||"Something went wrong.")}finally{g(!1)}};return l.jsxs("form",{onSubmit:x,className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"fn",children:"First name"}),l.jsx(Je,{id:"fn",value:t,onChange:b=>n(b.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"ln",children:"Last name"}),l.jsx(Je,{id:"ln",value:r,onChange:b=>i(b.target.value),className:"mt-1"})]})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"em",children:"Email *"}),l.jsx(Je,{id:"em",type:"email",required:!0,value:s,onChange:b=>a(b.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"ph",children:"Phone (optional)"}),l.jsx(Je,{id:"ph",type:"tel",value:o,onChange:b=>c(b.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"ref",children:"Who referred you? (optional)"}),l.jsx(hi,{id:"ref",rows:2,value:u,onChange:b=>d(b.target.value),className:"mt-1"})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx($o,{checked:f,onCheckedChange:b=>p(!!b),className:"mt-0.5"}),l.jsx("span",{children:"Email me about my list status and the weekly digest."})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx($o,{checked:h,onCheckedChange:b=>A(!!b),className:"mt-0.5"}),l.jsx("span",{children:"Text me when there's a real match. (Holden only — no automated nudges.)"})]}),y&&l.jsx("div",{className:"text-sm text-destructive",children:y}),l.jsx(xe,{type:"submit",disabled:m,className:"w-full",children:m?"Submitting…":"Join the queue"})]})},O1t=({onSuccess:e})=>{const[t,n]=C.useState(""),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1),[f,p]=C.useState(!0),[m,g]=C.useState(!1),[y,v]=C.useState(null),x=async b=>{if(b.preventDefault(),v(null),!t||!r){v("Code and email required.");return}g(!0);try{await g1t({code:t.toUpperCase().replace(/\s+/g,""),email:r,first_name:s||void 0,last_name:o||void 0,phone:u||void 0,sms_opt_in:h,email_opt_in:f}),De({title:"You're in",description:"Welcome to the Off-Market List."}),e()}catch(w){v((w==null?void 0:w.message)||"That code isn't valid. Double-check it or DM Holden.")}finally{g(!1)}};return l.jsxs("form",{onSubmit:x,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"code",children:"Invite code *"}),l.jsx(Je,{id:"code",required:!0,value:t,onChange:b=>n(b.target.value.toUpperCase()),placeholder:"XXX-XXX-XXX",className:"mt-1 font-mono tracking-widest"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"r-fn",children:"First name"}),l.jsx(Je,{id:"r-fn",value:s,onChange:b=>a(b.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"r-ln",children:"Last name"}),l.jsx(Je,{id:"r-ln",value:o,onChange:b=>c(b.target.value),className:"mt-1"})]})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"r-em",children:"Email *"}),l.jsx(Je,{id:"r-em",type:"email",required:!0,value:r,onChange:b=>i(b.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"r-ph",children:"Phone (optional)"}),l.jsx(Je,{id:"r-ph",type:"tel",value:u,onChange:b=>d(b.target.value),className:"mt-1"})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx($o,{checked:f,onCheckedChange:b=>p(!!b),className:"mt-0.5"}),l.jsx("span",{children:"Email me the weekly digest."})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx($o,{checked:h,onCheckedChange:b=>A(!!b),className:"mt-0.5"}),l.jsx("span",{children:"Text me when there's a real match."})]}),y&&l.jsx("div",{className:"text-sm text-destructive",children:y}),l.jsx(xe,{type:"submit",disabled:m,className:"w-full",children:m?"Checking…":"Redeem code"})]})};var t$="Radio",[F1t,iye]=fs(t$),[M1t,L1t]=F1t(t$),sye=C.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:c,form:u,...d}=e,[h,A]=C.useState(null),f=sn(t,g=>A(g)),p=C.useRef(!1),m=h?u||!!h.closest("form"):!0;return l.jsxs(M1t,{scope:n,checked:i,disabled:a,children:[l.jsx(_t.button,{type:"button",role:"radio","aria-checked":i,"data-state":cye(i),"data-disabled":a?"":void 0,disabled:a,value:o,...d,ref:f,onClick:at(e.onClick,g=>{i||c==null||c(),m&&(p.current=g.isPropagationStopped(),p.current||g.stopPropagation())})}),m&&l.jsx(lye,{control:h,bubbles:!p.current,name:r,value:o,checked:i,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});sye.displayName=t$;var aye="RadioIndicator",oye=C.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,s=L1t(aye,n);return l.jsx(aa,{present:r||s.checked,children:l.jsx(_t.span,{"data-state":cye(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})})});oye.displayName=aye;var R1t="RadioBubbleInput",lye=C.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},s)=>{const a=C.useRef(null),o=sn(a,s),c=YE(n),u=pE(t);return C.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&f){const p=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(p)}},[c,n,r]),l.jsx(_t.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});lye.displayName=R1t;function cye(e){return e?"checked":"unchecked"}var D1t=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],uT="RadioGroup",[U1t,VTt]=fs(uT,[ME,iye]),uye=ME(),dye=iye(),[H1t,Q1t]=U1t(uT),hye=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...A}=e,f=uye(n),p=f0(u),[m,g]=lo({prop:s,defaultProp:i??null,onChange:h,caller:uT});return l.jsx(H1t,{scope:n,name:r,required:a,disabled:o,value:m,onValueChange:g,children:l.jsx(boe,{asChild:!0,...f,orientation:c,dir:p,loop:d,children:l.jsx(_t.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:p,...A,ref:t})})})});hye.displayName=uT;var fye="RadioGroupItem",Aye=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,s=Q1t(fye,n),a=s.disabled||r,o=uye(n),c=dye(n),u=C.useRef(null),d=sn(t,u),h=s.value===i.value,A=C.useRef(!1);return C.useEffect(()=>{const f=m=>{D1t.includes(m.key)&&(A.current=!0)},p=()=>A.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",p)}},[]),l.jsx(Coe,{asChild:!0,...o,focusable:!a,active:h,children:l.jsx(sye,{disabled:a,required:s.required,checked:h,...c,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:at(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:at(i.onFocus,()=>{var f;A.current&&((f=u.current)==null||f.click())})})})});Aye.displayName=fye;var $1t="RadioGroupIndicator",pye=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=dye(n);return l.jsx(oye,{...i,...r,ref:t})});pye.displayName=$1t;var mye=hye,gye=Aye,z1t=pye;const yye=C.forwardRef(({className:e,...t},n)=>l.jsx(mye,{className:ot("grid gap-2",e),...t,ref:n}));yye.displayName=mye.displayName;const pR=C.forwardRef(({className:e,...t},n)=>l.jsx(gye,{ref:n,className:ot("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(z1t,{className:"flex items-center justify-center",children:l.jsx(rU,{className:"h-2.5 w-2.5 fill-current text-current"})})}));pR.displayName=gye.displayName;const TA=e=>{if(!e)return null;const t=parseInt(e.replace(/[^0-9]/g,""),10);return Number.isFinite(t)?t:null},zX="__none__",vye=({onSuccess:e,onCancel:t})=>{const[n,r]=C.useState("buy"),[i,s]=C.useState(""),[a,o]=C.useState([]),[c,u]=C.useState(""),[d,h]=C.useState([]),[A,f]=C.useState([]),[p,m]=C.useState(""),[g,y]=C.useState(""),[v,x]=C.useState(""),[b,w]=C.useState(""),[k,j]=C.useState(""),[B,E]=C.useState(""),[P,T]=C.useState(""),[N,F]=C.useState(""),[L,U]=C.useState(""),[H,W]=C.useState(""),[$,z]=C.useState(""),[Q,ce]=C.useState(""),[R,M]=C.useState(""),[Y,X]=C.useState([]),[V,Z]=C.useState([]),[de,ue]=C.useState(""),[se,he]=C.useState(""),[ie,Ce]=C.useState(""),[Ie,te]=C.useState(""),[je,nt]=C.useState(""),[rt,Ne]=C.useState(""),[st,we]=C.useState(""),[He,Ve]=C.useState(""),[Dt,pt]=C.useState(""),[ye,Be]=C.useState(""),[Ge,Ue]=C.useState(""),[Ze,pe]=C.useState(""),[mt,ft]=C.useState(""),[wt,Rt]=C.useState(""),[zt,gt]=C.useState(""),[Lt,Mt]=C.useState(""),[qt,nr]=C.useState(""),[tn,Bt]=C.useState(""),[jn,Ut]=C.useState(""),[Wt,wn]=C.useState(!1),[Nr,At]=C.useState(null),Ur=(Ye,Gn,lr)=>lr(Gn.includes(Ye)?Gn.filter(ni=>ni!==Ye):[...Gn,Ye]),Ln=Ye=>!Ye||Ye===zX?null:Ye,gr=async Ye=>{Ye.preventDefault(),At(null);const Gn=[...a];if(c.trim()&&c.split(",").map(ni=>ni.trim()).filter(Boolean).forEach(ni=>Gn.push(ni)),Gn.length===0){At("Pick at least one town.");return}if(d.length===0){At("Pick at least one property type.");return}const lr={type:n,title:i.trim()||void 0,towns:Gn,property_types:d,architectural_styles:A,price_min:TA(g),price_max:TA(v),sqft_min:TA(b),sqft_max:TA(k),beds_min:B?parseInt(B,10):null,baths_min:P?parseFloat(P):null,half_baths_min:N?parseInt(N,10):null,lot_size_band:Ln(L),year_built_min:TA(H),garage:Ln($),basement:Ln(Q),stories:Ln(R),waterfront_views:Y,outbuildings:V,hoa_tolerance:Ln(de),condition_target:Ln(se),reason:Ln(ie),current_housing_situation:Ln(Ie),timeline:p||null,must_haves:n==="buy"&&je.trim()||void 0,notable_features:n==="sell"&&rt.trim()||void 0,notes:Dt.trim()||void 0};n==="buy"?(lr.deal_breakers=st.trim()||void 0,lr.financing_type=Ln(ye),lr.pre_approved=Ln(Ge),lr.lender_name=Ze.trim()||void 0,lr.max_monthly_payment=TA(mt),lr.need_to_sell_first=Ln(wt)):(lr.recent_updates=He.trim()||void 0,lr.estimated_value=TA(zt),lr.mortgage_payoff_comfort=Ln(Lt),lr.showing_flexibility=Ln(qt),lr.leaseback_needed=Ln(tn),lr.listing_openness=Ln(jn)),wn(!0);try{await v1t(lr),De({title:"Intent submitted",description:"Holden reviews each one personally — you'll see it on your dashboard once approved."}),e==null||e()}catch(ni){At((ni==null?void 0:ni.message)||"Something went wrong.")}finally{wn(!1)}},or=({options:Ye,selected:Gn,onToggle:lr,cols:ni=2})=>l.jsx("div",{className:`grid ${ni===3?"sm:grid-cols-3":"sm:grid-cols-2"} grid-cols-1 gap-2`,children:Ye.map(ns=>l.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[l.jsx($o,{checked:Gn.includes(ns),onCheckedChange:()=>lr(ns)}),l.jsx("span",{children:ns})]},ns))}),xn=({value:Ye,onChange:Gn,options:lr,placeholder:ni="No preference",allowNone:ns=!0})=>l.jsxs(_r,{value:Ye,onValueChange:Gn,children:[l.jsx(fr,{className:"mt-1",children:l.jsx(jr,{placeholder:ni})}),l.jsxs(Ar,{children:[ns&&l.jsx(dt,{value:zX,children:"No preference"}),lr.map(Ma=>l.jsx(dt,{value:Ma,children:Ma},Ma))]})]});return l.jsxs("form",{onSubmit:gr,className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx(qe,{className:"mb-2 block",children:"I'm here to…"}),l.jsxs(yye,{value:n,onValueChange:Ye=>r(Ye),className:"flex gap-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pR,{value:"buy",id:"t-buy"}),l.jsx(qe,{htmlFor:"t-buy",className:"font-normal cursor-pointer",children:"Buy"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pR,{value:"sell",id:"t-sell"}),l.jsx(qe,{htmlFor:"t-sell",className:"font-normal cursor-pointer",children:"Sell"})]})]})]}),l.jsxs("div",{className:"space-y-5 p-4 rounded-lg border border-border bg-card/40",children:[l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"title",children:"Short label (optional)"}),l.jsx(Je,{id:"title",value:i,onChange:Ye=>s(Ye.target.value),placeholder:'e.g. "Townhouse in GR ~$400k"',className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"mb-2 block",children:"Towns"}),l.jsx(or,{options:Wbt,selected:a,onToggle:Ye=>Ur(Ye,a,o),cols:3}),l.jsx(Je,{value:c,onChange:Ye=>u(Ye.target.value),placeholder:"Other town(s) — comma separated",className:"mt-2"})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"mb-2 block",children:"Property type"}),l.jsx(or,{options:Gbt,selected:d,onToggle:Ye=>Ur(Ye,d,h),cols:3})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"pmin",children:"Price min"}),l.jsx(Je,{id:"pmin",value:g,onChange:Ye=>y(Ye.target.value),placeholder:"$300,000",className:"mt-1",inputMode:"numeric"})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"pmax",children:"Price max"}),l.jsx(Je,{id:"pmax",value:v,onChange:Ye=>x(Ye.target.value),placeholder:"$450,000",className:"mt-1",inputMode:"numeric"})]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Timeline"}),l.jsxs(_r,{value:p,onValueChange:Ye=>m(Ye),children:[l.jsx(fr,{className:"mt-1",children:l.jsx(jr,{placeholder:"Pick one"})}),l.jsx(Ar,{children:Zge.map(Ye=>l.jsx(dt,{value:Ye.value,children:Ye.label},Ye.value))})]})]})]}),l.jsxs(Pf,{type:"multiple",defaultValue:["size","detail"],className:"space-y-2",children:[l.jsxs(Ka,{value:"size",className:"border border-border rounded-lg px-4",children:[l.jsx(qa,{className:"text-sm font-medium",children:"Size, beds & baths"}),l.jsxs(Wa,{className:"space-y-4 pt-2",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Sqft min"}),l.jsx(Je,{value:b,onChange:Ye=>w(Ye.target.value),placeholder:"1,500",className:"mt-1",inputMode:"numeric"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Sqft max"}),l.jsx(Je,{value:k,onChange:Ye=>j(Ye.target.value),placeholder:"3,500",className:"mt-1",inputMode:"numeric"})]})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Beds (min)"}),l.jsxs(_r,{value:B,onValueChange:E,children:[l.jsx(fr,{className:"mt-1",children:l.jsx(jr,{placeholder:"Any"})}),l.jsx(Ar,{children:["1","2","3","4","5","6","7"].map(Ye=>l.jsxs(dt,{value:Ye,children:[Ye,"+"]},Ye))})]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Full baths (min)"}),l.jsxs(_r,{value:P,onValueChange:T,children:[l.jsx(fr,{className:"mt-1",children:l.jsx(jr,{placeholder:"Any"})}),l.jsx(Ar,{children:["1","1.5","2","2.5","3","3.5","4"].map(Ye=>l.jsxs(dt,{value:Ye,children:[Ye,"+"]},Ye))})]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Half baths (min)"}),l.jsxs(_r,{value:N,onValueChange:F,children:[l.jsx(fr,{className:"mt-1",children:l.jsx(jr,{placeholder:"Any"})}),l.jsx(Ar,{children:["0","1","2"].map(Ye=>l.jsxs(dt,{value:Ye,children:[Ye,"+"]},Ye))})]})]})]})]})]}),l.jsxs(Ka,{value:"detail",className:"border border-border rounded-lg px-4",children:[l.jsx(qa,{className:"text-sm font-medium",children:"Property detail (style, lot, garage, basement…)"}),l.jsxs(Wa,{className:"space-y-5 pt-2",children:[l.jsxs("div",{children:[l.jsx(qe,{className:"mb-2 block",children:"Architectural style (any that fit)"}),l.jsx(or,{options:Ybt,selected:A,onToggle:Ye=>Ur(Ye,A,f),cols:3})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Lot size"}),l.jsx(xn,{value:L,onChange:U,options:Xbt})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Year built (min)"}),l.jsx(Je,{value:H,onChange:Ye=>W(Ye.target.value),placeholder:"e.g. 1990",className:"mt-1",inputMode:"numeric"})]})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Garage"}),l.jsx(xn,{value:$,onChange:z,options:Jbt})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Basement"}),l.jsx(xn,{value:Q,onChange:ce,options:Zbt})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Stories"}),l.jsx(xn,{value:R,onChange:M,options:e1t})]})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"mb-2 block",children:"Waterfront / view"}),l.jsx(or,{options:t1t,selected:Y,onToggle:Ye=>Ur(Ye,Y,X),cols:3})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"mb-2 block",children:"Outbuildings"}),l.jsx(or,{options:n1t,selected:V,onToggle:Ye=>Ur(Ye,V,Z),cols:3})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"HOA tolerance"}),l.jsx(xn,{value:de,onChange:ue,options:r1t})]}),l.jsxs("div",{children:[l.jsx(qe,{children:n==="sell"?"Current condition":"Condition target"}),l.jsx(xn,{value:se,onChange:he,options:i1t})]})]})]})]}),l.jsxs(Ka,{value:"situation",className:"border border-border rounded-lg px-4",children:[l.jsx(qa,{className:"text-sm font-medium",children:"Your situation (optional but helpful)"}),l.jsx(Wa,{className:"space-y-4 pt-2",children:l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Reason"}),l.jsx(xn,{value:ie,onChange:Ce,options:s1t,allowNone:!1})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Current housing"}),l.jsx(xn,{value:Ie,onChange:te,options:a1t,allowNone:!1})]})]})})]}),n==="buy"&&l.jsxs(Ka,{value:"buyer",className:"border border-border rounded-lg px-4",children:[l.jsx(qa,{className:"text-sm font-medium",children:"Buyer specifics (financing, deal-breakers)"}),l.jsxs(Wa,{className:"space-y-4 pt-2",children:[l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"must",children:"Must-haves"}),l.jsx(hi,{id:"must",rows:3,className:"mt-1",value:je,onChange:Ye=>nt(Ye.target.value),placeholder:"Garage, main-floor primary, walkout basement, fenced yard, etc."})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"dealbreakers",children:"Deal-breakers"}),l.jsx(hi,{id:"dealbreakers",rows:3,className:"mt-1",value:st,onChange:Ye=>we(Ye.target.value),placeholder:"Busy road, electric heat, septic, HOA over $X, etc."})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Financing"}),l.jsx(xn,{value:ye,onChange:Be,options:o1t,allowNone:!1})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Pre-approval"}),l.jsx(xn,{value:Ge,onChange:Ue,options:l1t,allowNone:!1})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Lender (optional)"}),l.jsx(Je,{value:Ze,onChange:Ye=>pe(Ye.target.value),placeholder:"e.g. Lake Michigan Credit Union",className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Max comfortable monthly payment"}),l.jsx(Je,{value:mt,onChange:Ye=>ft(Ye.target.value),placeholder:"$2,800",className:"mt-1",inputMode:"numeric"})]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Need to sell current home first?"}),l.jsx(xn,{value:wt,onChange:Rt,options:c1t,allowNone:!1})]})]})]}),n==="sell"&&l.jsxs(Ka,{value:"seller",className:"border border-border rounded-lg px-4",children:[l.jsx(qa,{className:"text-sm font-medium",children:"Seller specifics (updates, showings, payoff)"}),l.jsxs(Wa,{className:"space-y-4 pt-2",children:[l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"features",children:"Notable features"}),l.jsx(hi,{id:"features",rows:3,className:"mt-1",value:rt,onChange:Ye=>Ne(Ye.target.value),placeholder:"Anything that makes this place stand out (lot, view, build quality, etc.)"})]}),l.jsxs("div",{children:[l.jsx(qe,{htmlFor:"updates",children:"Recent updates / improvements"}),l.jsx(hi,{id:"updates",rows:3,className:"mt-1",value:He,onChange:Ye=>Ve(Ye.target.value),placeholder:"Roof 2022, HVAC 2021, kitchen reno 2023, new windows…"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Your value estimate (optional)"}),l.jsx(Je,{value:zt,onChange:Ye=>gt(Ye.target.value),placeholder:"$525,000",className:"mt-1",inputMode:"numeric"})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Mortgage / payoff position"}),l.jsx(xn,{value:Lt,onChange:Mt,options:f1t,allowNone:!1})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(qe,{children:"Showing flexibility"}),l.jsx(xn,{value:qt,onChange:nr,options:u1t,allowNone:!1})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Leaseback needed?"}),l.jsx(xn,{value:tn,onChange:Bt,options:d1t,allowNone:!1})]})]}),l.jsxs("div",{children:[l.jsx(qe,{children:"Off-market only, or also open to publicly listing?"}),l.jsx(xn,{value:jn,onChange:Ut,options:h1t,allowNone:!1})]})]})]}),l.jsxs(Ka,{value:"notes",className:"border border-border rounded-lg px-4",children:[l.jsx(qa,{className:"text-sm font-medium",children:"Anything else for Holden"}),l.jsx(Wa,{className:"pt-2",children:l.jsx(hi,{rows:3,value:Dt,onChange:Ye=>pt(Ye.target.value),placeholder:"Private notes — Holden may keep these private or use a vetted version on your card."})})]})]}),Nr&&l.jsx("div",{className:"text-sm text-destructive bg-destructive/10 border border-destructive/30 rounded-md p-3",children:Nr}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx(xe,{type:"submit",disabled:Wt,children:Wt?"Submitting…":"Submit intent"}),t&&l.jsx(xe,{type:"button",variant:"outline",onClick:t,disabled:Wt,children:"Cancel"})]})]})},V1t=e=>{const t=new Date(e),n=Math.floor((Date.now()-t.getTime())/(1e3*60*60*24));return n<1?"today":n<7?`${n}d ago`:n<30?`${Math.floor(n/7)}w ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},K1t=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"}),q1t=({card:e})=>{var d,h;const[t,n]=C.useState(!1),[r,i]=C.useState(""),[s,a]=C.useState(e.pinged),[o,c]=C.useState(!1),u=async()=>{c(!0);try{await x1t(e.id,r.trim()||void 0),a(!0),n(!1),De({title:"Holden notified",description:"He'll text you when there's an update."})}catch(A){De({title:"Couldn't send",description:(A==null?void 0:A.message)||"Try again in a moment.",variant:"destructive"})}finally{c(!1)}};return l.jsx(Zt,{className:"overflow-hidden",children:l.jsxs(en,{className:"p-5 space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"font-mono text-sm font-medium",children:e.codename}),l.jsx(Yt,{variant:e.type==="buy"?"default":"secondary",className:"text-[10px] uppercase",children:e.type==="buy"?"Buyer":"Seller"})]}),e.price_band&&l.jsx("div",{className:"text-lg font-semibold mt-0.5",children:e.price_band})]}),l.jsxs("div",{className:"text-xs text-muted-foreground text-right shrink-0",children:["added ",V1t(e.created_at)]})]}),e.public_summary&&l.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.public_summary}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted-foreground",children:[((d=e.towns)==null?void 0:d.length)>0&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(ov,{className:"w-3 h-3"})," ",e.towns.join(", ")]}),e.beds_min!=null&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(V1e,{className:"w-3 h-3"})," ",e.beds_min,"+"]}),e.baths_min!=null&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(tU,{className:"w-3 h-3"})," ",e.baths_min,"+"]}),e.sqft_band&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(w2e,{className:"w-3 h-3"})," ",e.sqft_band]}),e.timeline&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(J1e,{className:"w-3 h-3"})," ",w1t(e.timeline)]})]}),((h=e.property_types)==null?void 0:h.length)>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.property_types.map(A=>l.jsx(Yt,{variant:"outline",className:"text-[10px] font-normal",children:A},A))}),e.reviewed_at&&l.jsxs("div",{className:"text-[11px] text-muted-foreground italic",children:["Reviewed by Holden: ",K1t(e.reviewed_at)]}),l.jsx("div",{className:"pt-2 border-t border-border/60",children:s?l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx(Sl,{className:"w-4 h-4 text-primary"}),"Holden notified"]}):t?l.jsxs("div",{className:"space-y-2",children:[l.jsx(hi,{placeholder:"Optional: anything Holden should know? (one line)",rows:2,value:r,onChange:A=>i(A.target.value)}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{size:"sm",onClick:u,disabled:o,children:o?"Sending…":"Send"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"})]})]}):l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>n(!0),children:"Tell Holden I'm interested"})})]})})},W1t=[{rate:"3.5%",label:"Matched on the list",summary:"When a buyer and seller already on the Off-Market List come together and Holden represents both sides, total commission is 3.5% — split between the two parties. No MLS, no marketing spend, just a clean match.",conditions:["Both buyer and seller are approved Off-Market List members","Holden represents both sides under written dual-agency disclosure","Split between parties as agreed in writing","Disclosed per MichRIC and Michigan agency rules"]},{rate:"4%",label:"MLS listing",summary:"If you'd rather list on the open market instead of waiting for a match, Holden lists your home for 4% total — 2% to Holden, 2% offered as buyer-agent compensation. Full marketing, photography, and contract-to-close, at well below the traditional 6%.",conditions:["2% to Holden as listing agent","2% offered as buyer-agent compensation","Full MLS exposure, professional photo/video, syndicated marketing","Available to Off-Market List members electing to go to market"]}],xye=()=>l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Member Benefits"}),l.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"The benefit is structural, not promotional. If a transaction happens because two people on the list lined up, the commission is lower — because the work is lower. That's it. No tiers, no points, no expiring perks."})]}),l.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:W1t.map(e=>l.jsx(Zt,{className:"flex flex-col",children:l.jsxs(en,{className:"p-6 flex-1 flex flex-col",children:[l.jsxs("div",{className:"flex items-baseline gap-2 mb-1",children:[l.jsx("span",{className:"text-4xl font-bold",children:e.rate}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"total commission"})]}),l.jsx(Yt,{variant:"outline",className:"self-start mb-3 text-xs",children:e.label}),l.jsx("p",{className:"text-sm text-foreground/90 mb-4",children:e.summary}),l.jsxs("div",{className:"mt-auto",children:[l.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2",children:"Conditions"}),l.jsx("ul",{className:"space-y-1.5 text-xs text-muted-foreground",children:e.conditions.map(t=>l.jsxs("li",{className:"flex gap-2",children:[l.jsx("span",{className:"text-primary",children:"·"}),l.jsx("span",{children:t})]},t))})]})]})},e.rate))}),l.jsx("div",{className:"text-xs text-muted-foreground max-w-2xl",children:"Voice pass on this copy is pending. Numbers, conditions, and structure are locked."})]}),G1t=()=>l.jsx("div",{className:"border-t border-border/60 pt-6 mt-12 text-xs text-muted-foreground leading-relaxed max-w-3xl",children:nye}),Y1t=()=>{const[e,t]=Qie(),[n,r]=C.useState("loading"),[i,s]=C.useState(null),[a,o]=C.useState(!1),[c,u]=C.useState(!1),d=async()=>{const f=await tye();if(!f.valid){s(null),r("logged_out");return}s(f.member),r(f.member.status==="approved"?"approved":"pending")};C.useEffect(()=>{d()},[]);const h=()=>{u(!1),d()},A=()=>{p1t(),s(null),r("logged_out")};return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"The Off-Market List | Holden Richardson"}),l.jsx("meta",{name:"description",content:"A small, vetted list of buyers and sellers in West Michigan exploring off-market moves before anything hits the MLS."}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-16",children:[n==="loading"&&l.jsxs("div",{className:"space-y-4 max-w-3xl",children:[l.jsx(ht,{className:"h-12 w-64"}),l.jsx(ht,{className:"h-64 w-full"})]}),n==="logged_out"&&l.jsx(X1t,{openSignup:()=>o(!0),openRedeem:()=>u(!0)}),n==="pending"&&i&&l.jsx(J1t,{member:i,onSignout:A}),n==="approved"&&i&&l.jsx(Z1t,{member:i,onSignout:A,initialTab:e.get("tab")||void 0,setTab:f=>t({tab:f})}),l.jsx(G1t,{})]}),l.jsx(Fo,{open:a,onOpenChange:o,children:l.jsxs(Ja,{className:"max-w-md",children:[l.jsxs(Za,{children:[l.jsx(eo,{children:"Apply to join the Off-Market List"}),l.jsx(Nj,{children:"Holden personally reviews each application. You'll hear within a day or two."})]}),l.jsx(P1t,{onSuccess:()=>o(!1)})]})}),l.jsx(Fo,{open:c,onOpenChange:u,children:l.jsxs(Ja,{className:"max-w-md",children:[l.jsxs(Za,{children:[l.jsx(eo,{children:"Redeem your invite code"}),l.jsx(Nj,{children:"Holden DM'd or texted you a 9-character code. Drop it in."})]}),l.jsx(O1t,{onSuccess:h})]})})]})},X1t=({openSignup:e,openRedeem:t})=>l.jsxs("div",{className:"space-y-12 max-w-4xl",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(Yt,{variant:"outline",className:"text-xs uppercase tracking-wider",children:"Off-Market · West Michigan"}),l.jsx("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight",children:"The Off-Market List"}),l.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl leading-relaxed",children:"A small, vetted group of West Michigan buyers and sellers exploring off-market moves before anything hits the MLS. It's an intent tracker, not a listing service. When two sides line up, Holden makes the introduction."})]}),l.jsx(Zt,{className:"bg-muted/40 border-primary/30",children:l.jsxs(en,{className:"p-6",children:[l.jsx("div",{className:"text-xs uppercase tracking-wider text-primary mb-2",children:"The no-push promise"}),l.jsx("p",{className:"text-sm leading-relaxed",children:rye})]})}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsx(Zt,{className:"hover:border-primary/50 transition-colors",children:l.jsxs(en,{className:"p-6 space-y-3",children:[l.jsx("h3",{className:"font-semibold text-lg",children:"New here?"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Apply to join. Holden personally reviews each one — usually within a day or two."}),l.jsx(xe,{onClick:e,className:"w-full",children:"Sign up to join"})]})}),l.jsx(Zt,{className:"hover:border-primary/50 transition-colors",children:l.jsxs(en,{className:"p-6 space-y-3",children:[l.jsx("h3",{className:"font-semibold text-lg",children:"Have a code?"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"If Holden sent you a 9-character invite code, drop it in to skip the queue."}),l.jsx(xe,{onClick:t,variant:"outline",className:"w-full",children:"I have a code"})]})})]}),l.jsx(Zt,{className:"border-dashed",children:l.jsxs(en,{className:"p-8 text-center text-muted-foreground",children:[l.jsx("div",{className:"text-xs uppercase tracking-wider mb-2",children:"Demo"}),l.jsx("div",{className:"aspect-video bg-muted/50 rounded-md flex items-center justify-center",children:"Loom walkthrough coming soon"})]})})]}),J1t=({member:e,onSignout:t})=>l.jsxs("div",{className:"max-w-2xl space-y-6",children:[l.jsx(Yt,{variant:"outline",className:"text-xs uppercase tracking-wider",children:"In review"}),l.jsxs("h1",{className:"text-3xl md:text-4xl font-bold tracking-tight",children:["You're in the queue",e.first_name?`, ${e.first_name}`:"","."]}),l.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed",children:"Holden personally reviews each application. You'll hear within a day or two — usually a quick text or email with an invite code."}),l.jsx(Zt,{className:"bg-muted/40",children:l.jsxs(en,{className:"p-6 text-sm space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(kre,{className:"w-4 h-4"}),"The dashboard is locked until you're approved."]}),l.jsx("p",{className:"text-muted-foreground",children:"No automated reminders, no nurture sequence, no follow-up cadence. Just a real reply from Holden when he gets to your application."})]})}),l.jsx(xe,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground",children:"Sign out"})]}),Z1t=({member:e,onSignout:t,initialTab:n,setTab:r})=>{const[i,s]=C.useState(null),[a,o]=C.useState(!0),[c,u]=C.useState(!1),[d,h]=C.useState(()=>typeof window<"u"&&!!localStorage.getItem($X)),[A,f]=C.useState(n||"buyers"),p=async()=>{o(!0);try{const y=await y1t();s(y)}finally{o(!1)}};C.useEffect(()=>{p()},[]);const m=()=>{localStorage.setItem($X,"1"),h(!0)},g=y=>{f(y),r(y)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-end justify-between flex-wrap gap-3",children:[l.jsxs("div",{children:[l.jsx(Yt,{variant:"default",className:"text-xs uppercase tracking-wider mb-2",children:"Approved"}),l.jsxs("h1",{className:"text-3xl md:text-4xl font-bold tracking-tight",children:["The Off-Market List",e.first_name?` — ${e.first_name}`:""]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{onClick:()=>u(!0),children:"Add intent"}),l.jsx(xe,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground",children:"Sign out"})]})]}),e.tier==="lurker"&&!d&&l.jsx(Zt,{className:"bg-primary/5 border-primary/40",children:l.jsxs(en,{className:"p-4 flex items-start gap-3",children:[l.jsxs("div",{className:"flex-1 text-sm",children:[l.jsx("span",{className:"font-medium",children:"Add what you're looking for"})," and we'll alert you when it shows up. Takes 90 seconds."]}),l.jsx(xe,{size:"sm",onClick:()=>u(!0),children:"Add intent"}),l.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground p-1",children:l.jsx(ra,{className:"w-4 h-4"})})]})}),l.jsxs(ym,{value:A,onValueChange:g,children:[l.jsxs(Kf,{className:"bg-muted/50",children:[l.jsx($n,{value:"buyers",className:"text-xs uppercase tracking-wider",children:"Buyers"}),l.jsx($n,{value:"sellers",className:"text-xs uppercase tracking-wider",children:"Sellers"}),l.jsx($n,{value:"my",className:"text-xs uppercase tracking-wider",children:"My Intents"}),l.jsx($n,{value:"benefits",className:"text-xs uppercase tracking-wider",children:"Member Benefits"})]}),l.jsx(zn,{value:"buyers",children:l.jsx(VX,{loading:a,cards:(i==null?void 0:i.buy_intents)||[],kind:"buy"})}),l.jsx(zn,{value:"sellers",children:l.jsx(VX,{loading:a,cards:(i==null?void 0:i.sell_intents)||[],kind:"sell"})}),l.jsx(zn,{value:"my",children:l.jsx(e2t,{loading:a,intents:(i==null?void 0:i.my_intents)||[],onAdd:()=>u(!0)})}),l.jsx(zn,{value:"benefits",children:l.jsx(xye,{})})]}),l.jsx(Zt,{className:"bg-muted/30 border-dashed mt-8",children:l.jsxs(en,{className:"p-4 text-xs text-muted-foreground",children:[l.jsx("span",{className:"uppercase tracking-wider text-primary mr-2",children:"No-push promise"}),rye]})}),l.jsx(Fo,{open:c,onOpenChange:u,children:l.jsxs(Ja,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(Za,{children:[l.jsx(eo,{children:"Add an intent"}),l.jsx(Nj,{children:"What would you do, if the right thing showed up? Holden reviews each one before it lands on the dashboard."})]}),l.jsx(vye,{onSuccess:()=>{u(!1),p(),g("my")},onCancel:()=>u(!1)})]})})]})},VX=({loading:e,cards:t,kind:n})=>{const[r,i]=C.useState("all"),[s,a]=C.useState("all"),[o,c]=C.useState("all"),[u,d]=C.useState(""),[h,A]=C.useState("newest"),f=C.useMemo(()=>{const g=new Set;return t.forEach(y=>{var v;return(v=y.towns)==null?void 0:v.forEach(x=>g.add(x))}),Array.from(g).sort()},[t]),p=C.useMemo(()=>{const g=new Set;return t.forEach(y=>{var v;return(v=y.property_types)==null?void 0:v.forEach(x=>g.add(x))}),Array.from(g).sort()},[t]),m=C.useMemo(()=>{let g=[...t];r!=="all"&&(g=g.filter(v=>{var x;return(x=v.towns)==null?void 0:x.includes(r)})),s!=="all"&&(g=g.filter(v=>{var x;return(x=v.property_types)==null?void 0:x.includes(s)})),o!=="all"&&(g=g.filter(v=>v.timeline===o));const y=parseInt(u.replace(/[^0-9]/g,""),10);return Number.isFinite(y)&&(g=g.filter(v=>{if(!v.price_band)return!0;const x=v.price_band.match(/\$?([\d.]+)([kKmM])/);return x?parseFloat(x[1])*(x[2].toLowerCase()==="m"?1e6:1e3)<=y:!0})),h==="newest"&&g.sort((v,x)=>new Date(x.created_at).getTime()-new Date(v.created_at).getTime()),g},[t,r,s,o,u,h]);return e?l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4 mt-6",children:Array.from({length:6}).map((g,y)=>l.jsx(ht,{className:"h-64 w-full"},y))}):l.jsxs("div",{className:"space-y-4 mt-6",children:[l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs(_r,{value:r,onValueChange:i,children:[l.jsx(fr,{className:"w-auto min-w-[140px]",children:l.jsx(jr,{placeholder:"Town"})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"All towns"}),f.map(g=>l.jsx(dt,{value:g,children:g},g))]})]}),l.jsxs(_r,{value:s,onValueChange:a,children:[l.jsx(fr,{className:"w-auto min-w-[140px]",children:l.jsx(jr,{placeholder:"Type"})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"All types"}),p.map(g=>l.jsx(dt,{value:g,children:g},g))]})]}),l.jsxs(_r,{value:o,onValueChange:c,children:[l.jsx(fr,{className:"w-auto min-w-[140px]",children:l.jsx(jr,{placeholder:"Timeline"})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"all",children:"Any timeline"}),l.jsx(dt,{value:"now",children:"Now"}),l.jsx(dt,{value:"3mo",children:"≤3 months"}),l.jsx(dt,{value:"6mo",children:"≤6 months"}),l.jsx(dt,{value:"12mo",children:"≤12 months"}),l.jsx(dt,{value:"right_offer",children:"Right offer"})]})]}),l.jsx(Je,{placeholder:"Max price",value:u,onChange:g=>d(g.target.value),className:"w-32",inputMode:"numeric"}),l.jsx("div",{className:"ml-auto",children:l.jsxs(_r,{value:h,onValueChange:g=>A(g),children:[l.jsx(fr,{className:"w-auto min-w-[140px]",children:l.jsx(jr,{})}),l.jsxs(Ar,{children:[l.jsx(dt,{value:"newest",children:"Newest first"}),l.jsx(dt,{value:"price_asc",children:"Price ↑ (soon)"}),l.jsx(dt,{value:"price_desc",children:"Price ↓ (soon)"})]})]})})]}),m.length===0?l.jsx(Zt,{className:"border-dashed",children:l.jsxs(en,{className:"p-12 text-center text-muted-foreground",children:["No ",n==="buy"?"buyer":"seller"," intents match those filters yet."]})}):l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map(g=>l.jsx(q1t,{card:g},g.id))})]})},e2t=({loading:e,intents:t,onAdd:n})=>e?l.jsx(ht,{className:"h-48 w-full mt-6"}):t.length===0?l.jsx(Zt,{className:"mt-6 border-dashed",children:l.jsxs(en,{className:"p-12 text-center space-y-3",children:[l.jsx("p",{className:"text-muted-foreground",children:"You haven't added any intents yet."}),l.jsx(xe,{onClick:n,children:"Add your first intent"})]})}):l.jsx("div",{className:"space-y-3 mt-6",children:t.map(r=>{var i;return l.jsx(Zt,{children:l.jsxs(en,{className:"p-5 flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[l.jsx(Yt,{variant:r.type==="buy"?"default":"secondary",className:"text-[10px] uppercase",children:r.type}),l.jsx(Yt,{variant:"outline",className:"text-[10px] uppercase",children:r.status.replace(/_/g," ")})]}),r.title&&l.jsx("div",{className:"font-medium",children:r.title}),l.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:[((i=r.towns)==null?void 0:i.join(", "))||"—",(r.price_min||r.price_max)&&l.jsxs(l.Fragment,{children:[" · ",r.price_min?`$${r.price_min.toLocaleString()}`:"?","–",r.price_max?`$${r.price_max.toLocaleString()}`:"?"]}),r.timeline&&l.jsxs(l.Fragment,{children:[" · ",r.timeline]})]})]}),l.jsx(xe,{size:"sm",variant:"outline",disabled:!0,title:"Pause/edit coming soon",children:"Pause"})]})},r.id)})}),t2t=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Member Benefits — The Off-Market List | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-16",children:[l.jsxs(St,{to:"/list",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground mb-6",children:[l.jsx(mm,{className:"w-4 h-4"})," Back to The Off-Market List"]}),l.jsx(xye,{}),l.jsx("div",{className:"border-t border-border/60 pt-6 mt-12 text-xs text-muted-foreground leading-relaxed max-w-3xl",children:nye})]})]}),n2t=()=>{const e=Ll(),[t,n]=C.useState(null);return C.useEffect(()=>{(async()=>{const r=await tye();if(!r.valid||r.member.status!=="approved"){e("/list",{replace:!0});return}n(!0)})()},[e]),l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Add Intent — The Off-Market List | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-16 max-w-2xl",children:[l.jsx("h1",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-2",children:"Add an intent"}),l.jsx("p",{className:"text-muted-foreground mb-8",children:"What would you do, if the right thing showed up? Holden reviews each one before it lands on the dashboard."}),t===null?l.jsx(ht,{className:"h-96 w-full"}):l.jsx(Zt,{children:l.jsx(en,{className:"p-6",children:l.jsx(vye,{onSuccess:()=>e("/list?tab=my"),onCancel:()=>e("/list")})})})]})]})},r2t=()=>{const e=Ll(),{toast:t}=$f(),[n,r]=C.useState(!1),[i,s]=C.useState(""),[a,o]=C.useState(""),[c,u]=C.useState(!1),[d,h]=C.useState(!1),[A,f]=C.useState(!0);C.useEffect(()=>{const{data:{subscription:m}}=Me.auth.onAuthStateChange(g=>{g==="PASSWORD_RECOVERY"&&(r(!0),f(!1))});return Me.auth.getSession().then(({data:{session:g}})=>{g&&r(!0),f(!1)}),()=>m.unsubscribe()},[]);const p=async m=>{if(m.preventDefault(),i!==a){t({variant:"destructive",title:"Passwords don't match",description:"Please make sure your passwords match."});return}if(i.length<6){t({variant:"destructive",title:"Password too short",description:"Password must be at least 6 characters."});return}u(!0);const{error:g}=await Me.auth.updateUser({password:i});g?t({variant:"destructive",title:"Failed to reset password",description:g.message}):(h(!0),t({title:"Password updated!",description:"Your password has been changed. Redirecting…"}),setTimeout(()=>e("/auth"),2e3)),u(!1)};return A?l.jsx(un,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Verifying reset link…"})})}):l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Reset Password | Holden Richardson — Grand Rapids Real Estate"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsx("div",{className:"container-page max-w-md",children:l.jsxs(Zt,{className:"border-border",children:[l.jsxs(Sa,{className:"text-center",children:[l.jsx(ka,{className:"heading-card",children:"Reset Password"}),l.jsx(jp,{children:n?"Enter your new password below.":"This link is invalid or has expired."})]}),l.jsx(en,{children:d?l.jsx("div",{className:"text-center space-y-4",children:l.jsx("p",{className:"text-muted-foreground",children:"Password updated successfully! Redirecting to sign in…"})}):n?l.jsxs("form",{onSubmit:p,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"new-password",children:"New Password"}),l.jsx(Je,{id:"new-password",type:"password",placeholder:"••••••••",value:i,onChange:m=>s(m.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"confirm-password",children:"Confirm Password"}),l.jsx(Je,{id:"confirm-password",type:"password",placeholder:"••••••••",value:a,onChange:m=>o(m.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:c,children:c?"Updating…":"Set New Password"})]}):l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("p",{className:"text-muted-foreground",children:"The password reset link is invalid or has expired. Please request a new one."}),l.jsx(St,{to:"/auth",children:l.jsx(xe,{variant:"outline",children:"Back to Sign In"})})]})})]})})})]})},i2t=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Privacy Policy | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Privacy policy for HoldenGR.com — how we collect, use, and protect your personal information."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/privacy-policy"}),l.jsx("meta",{property:"og:title",content:"Privacy Policy | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Privacy policy for HoldenGR.com — how we collect, use, and protect your personal information."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/privacy-policy"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary"}),l.jsx("meta",{name:"twitter:title",content:"Privacy Policy | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Privacy policy for HoldenGR.com."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{variant:"blur",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),l.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Privacy Policy"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})})}),l.jsx("section",{className:"py-14 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:l.jsxs(_e,{children:[l.jsx("h2",{children:"Information We Collect"}),l.jsx("p",{children:"When you use our website, we may collect the following personal information:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Contact Information:"})," Name, email address, phone number, and any message you provide through our contact form."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Usage Data:"})," Information about how you access and use our website, including your IP address, browser type, pages visited, and time spent on the site."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cookies:"})," We use cookies and similar technologies to improve your experience and analyze site traffic."]})]}),l.jsx("h2",{children:"How We Use Your Information"}),l.jsx("p",{children:"We use the information we collect to:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Respond to your inquiries and provide real estate services"}),l.jsx("li",{children:"Send you relevant property information and market updates (only with your consent)"}),l.jsx("li",{children:"Improve our website and user experience"}),l.jsx("li",{children:"Comply with legal obligations"})]}),l.jsx("h2",{children:"Information Sharing"}),l.jsx("p",{children:"We do not sell, trade, or rent your personal information to third parties. We may share your information with:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"616 Realty LLC:"})," Our brokerage, as necessary to facilitate real estate transactions"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Service Providers:"})," Third-party services that help us operate our website and CRM systems"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Legal Requirements:"})," When required by law or to protect our rights"]})]}),l.jsx("h2",{children:"Data Security"}),l.jsx("p",{children:"We implement reasonable security measures to protect your personal information. However, no method of transmission over the internet is 100% secure, and we cannot guarantee absolute security."}),l.jsx("h2",{children:"Your Rights"}),l.jsx("p",{children:"You have the right to:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Request access to the personal information we hold about you"}),l.jsx("li",{children:"Request correction or deletion of your personal information"}),l.jsx("li",{children:"Opt out of marketing communications at any time"})]}),l.jsx("h2",{children:"Contact Us"}),l.jsx("p",{children:"If you have questions about this privacy policy, please contact us at:"}),l.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",l.jsx("br",{}),"1171 Plainfield Ave NE, Grand Rapids, MI 49503",l.jsx("br",{}),l.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),l.jsx("br",{}),"(616) 403-6393"]})]})})})]}),s2t=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Terms of Service | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Terms of service for HoldenGR.com — conditions governing the use of this website."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/terms-of-service"}),l.jsx("meta",{property:"og:title",content:"Terms of Service | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Terms of service for HoldenGR.com — conditions governing the use of this website."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/terms-of-service"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary"}),l.jsx("meta",{name:"twitter:title",content:"Terms of Service | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Terms of service for HoldenGR.com."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{variant:"blur",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),l.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Terms of Service"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})})}),l.jsx("section",{className:"py-14 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:l.jsxs(_e,{children:[l.jsx("h2",{children:"Agreement to Terms"}),l.jsx("p",{children:'By accessing and using HoldenGR.com ("the Website"), you agree to be bound by these Terms of Service. If you do not agree to these terms, please do not use the Website.'}),l.jsx("h2",{children:"Use of Website"}),l.jsx("p",{children:"This Website is operated by Holden Richardson, a licensed real estate agent with 616 Realty LLC (License #6501392389). The Website is intended to provide general information about real estate services in the Grand Rapids, Michigan area."}),l.jsx("p",{children:"You agree to use the Website only for lawful purposes and in a manner that does not infringe upon the rights of others."}),l.jsx("h2",{children:"Property Listings & Information"}),l.jsx("p",{children:"Property listing information displayed on this Website is sourced from various third-party providers, including Multiple Listing Services (MLS). While we strive for accuracy:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Listings may not reflect real-time availability, pricing, or property conditions"}),l.jsx("li",{children:"All information should be independently verified before making any decisions"}),l.jsx("li",{children:"Photos and descriptions may not represent current property conditions"}),l.jsx("li",{children:"We are not responsible for errors or omissions in listing data"})]}),l.jsx("h2",{children:"No Professional Advice"}),l.jsx("p",{children:"The content on this Website is for informational purposes only and does not constitute professional real estate, legal, financial, or tax advice. Always consult with appropriate professionals before making real estate decisions."}),l.jsx("h2",{children:"Intellectual Property"}),l.jsx("p",{children:"All content on this Website, including text, images, logos, and design elements, is the property of Holden Richardson and 616 Realty LLC or their respective owners and is protected by copyright and trademark laws."}),l.jsx("h2",{children:"Limitation of Liability"}),l.jsx("p",{children:"To the fullest extent permitted by law, Holden Richardson and 616 Realty LLC shall not be liable for any direct, indirect, incidental, or consequential damages arising from your use of or inability to use this Website."}),l.jsx("h2",{children:"Governing Law"}),l.jsx("p",{children:"These terms are governed by the laws of the State of Michigan. Any disputes shall be resolved in the courts of Kent County, Michigan."}),l.jsx("h2",{children:"Changes to Terms"}),l.jsx("p",{children:"We reserve the right to modify these terms at any time. Continued use of the Website after changes constitutes acceptance of the updated terms."}),l.jsx("h2",{children:"Contact"}),l.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",l.jsx("br",{}),"1171 Plainfield Ave NE, Grand Rapids, MI 49503",l.jsx("br",{}),l.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),l.jsx("br",{}),"(616) 403-6393"]})]})})})]}),a2t=()=>l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Accessibility | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Accessibility statement for HoldenGR.com — our commitment to digital accessibility."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/accessibility"}),l.jsx("meta",{property:"og:title",content:"Accessibility | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Accessibility statement for HoldenGR.com — our commitment to digital accessibility."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/accessibility"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary"}),l.jsx("meta",{name:"twitter:title",content:"Accessibility | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Accessibility statement for HoldenGR.com."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{variant:"blur",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),l.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Accessibility"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"})]})})}),l.jsx("section",{className:"py-14 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:l.jsxs(_e,{children:[l.jsx("h2",{children:"Our Commitment"}),l.jsx("p",{children:"Holden Richardson and 616 Realty LLC are committed to ensuring digital accessibility for people with disabilities. We continually improve the user experience for everyone and apply the relevant accessibility standards."}),l.jsx("h2",{children:"Standards"}),l.jsx("p",{children:"We aim to conform to the Web Content Accessibility Guidelines (WCAG) 2.1 at the AA level. These guidelines explain how to make web content more accessible to people with a wide range of disabilities, including:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Visual impairments (blindness, low vision, color blindness)"}),l.jsx("li",{children:"Hearing impairments"}),l.jsx("li",{children:"Motor impairments"}),l.jsx("li",{children:"Cognitive disabilities"})]}),l.jsx("h2",{children:"Measures Taken"}),l.jsx("p",{children:"We have taken the following measures to ensure accessibility:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Semantic HTML structure throughout the website"}),l.jsx("li",{children:"Descriptive alt text for all meaningful images"}),l.jsx("li",{children:"Sufficient color contrast ratios for text and interactive elements"}),l.jsx("li",{children:"Keyboard navigation support"}),l.jsx("li",{children:"Responsive design that works across devices and screen sizes"}),l.jsx("li",{children:"Clear and consistent navigation"}),l.jsx("li",{children:"Form labels and error messages for all input fields"})]}),l.jsx("h2",{children:"Known Limitations"}),l.jsx("p",{children:"While we strive for full accessibility, some third-party content (such as embedded property listing tools, video players, or map widgets) may not be fully accessible. We are actively working with our vendors to improve these areas."}),l.jsx("h2",{children:"Feedback"}),l.jsx("p",{children:"We welcome your feedback on the accessibility of this website. If you encounter any barriers or have suggestions for improvement, please contact us:"}),l.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",l.jsx("br",{}),l.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),l.jsx("br",{}),"(616) 403-6393"]}),l.jsx("p",{children:"We will make reasonable efforts to address any accessibility concerns and respond within 5 business days."}),l.jsx("h2",{children:"Fair Housing"}),l.jsx("p",{children:"In accordance with the Fair Housing Act, we do not discriminate on the basis of race, color, religion, sex, handicap, familial status, or national origin. We are committed to providing equal housing opportunities for all."})]})})})]}),o2t=()=>{const e=co();return C.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Page Not Found | Holden Richardson — Grand Rapids Real Estate"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("section",{className:"section-padding bg-background min-h-[60vh] flex items-center",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx("h1",{className:"text-8xl md:text-9xl font-serif text-gold mb-6",children:"404"}),l.jsx("h2",{className:"heading-section mb-4",children:"Page Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground mb-10 max-w-md mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),l.jsx(St,{to:"/",className:"btn-outline-primary",children:"Return Home"})]})})]})},l2t=e=>/<(p|div|h[1-6]|ul|ol|blockquote|table|section|article)\b/i.test(e)?e:e.split(/\n{2,}/).map(t=>t.trim()).filter(Boolean).map(t=>`<p>${t.replace(/\n/g,"<br />")}</p>`).join(`
`),y_=()=>{var de,ue,se,he;const e=gm(),t=co(),n=!e.category&&t.pathname.startsWith("/news/"),r=n?"about":e.category,i=n?"news":e.subcategory,a=e.slug||"",{data:o,isLoading:c}=Sqe(r||"",a,i),{data:u}=kqe(o==null?void 0:o.id),d=C.useMemo(()=>{if(!o)return"";const Ce=(Array.isArray(o.faq_json)?o.faq_json:[]).map(Ie=>`${(Ie==null?void 0:Ie.question)||""} ${(Ie==null?void 0:Ie.answer)||""}`).join(" ");return`${o.h1||""} ${o.title||""} ${o.intro_text||""} ${Ce}`},[o]),{data:h}=jqe(o==null?void 0:o.category_id,o==null?void 0:o.id,d,5),{configMap:A}=oa(),{data:f}=A0(),p=C.useMemo(()=>!f||!(o!=null&&o.cover_image_id)?null:f.find(ie=>ie.id===o.cover_image_id)||null,[f,o==null?void 0:o.cover_image_id]),m=A.agent_phone,g=A.agent_email,y=A.booking_url,v=A.agent_name,x=((de=A.site_base_url)==null?void 0:de.replace(/\/$/,""))||"",b=n?"News":r==="about"?"About":r==null?void 0:r.replace(/-/g," "),w=n?"/news":`/${r}`,k=n?null:i?`/${r}/${i}`:null,j=n?`/news/${a}`:i?`/${r}/${i}/${a}`:`/${r}/${a}`,B=x?`${x}${j}`:"",E=ie=>x?`${x}${ie}`:ie;if(c)return l.jsx(un,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(ht,{className:"h-12 w-3/4 mb-6"}),l.jsx(ht,{className:"h-6 w-full mb-4"}),l.jsx(ht,{className:"h-64 w-full"})]})});if(!o)return l.jsx(un,{children:l.jsxs("div",{className:"container-page section-padding text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Page Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground",children:"The page you're looking for doesn't exist."})]})});const P=((ue=o.category)==null?void 0:ue.slug)==="news",T=o.press_links,N=[A.about_website,A.about_google_business,A.about_facebook,A.about_instagram,A.about_linkedin,A.about_youtube,A.about_x,A.about_tiktok,A.about_zillow,A.about_realtor].filter(Boolean),F=(se=o.faq_json)!=null&&se.length?{"@context":"https://schema.org","@type":"FAQPage",...B&&{mainEntityOfPage:{"@type":"WebPage","@id":B}},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:o.faq_json.map(ie=>({"@type":"Question",name:ie.question,acceptedAnswer:{"@type":"Answer",text:ie.answer}}))}:null,L=P?{"@context":"https://schema.org","@type":"NewsArticle",headline:o.h1,description:o.meta_description||o.intro_text||o.title,...B&&{mainEntityOfPage:{"@type":"WebPage","@id":B},url:B},...o.published_at&&{datePublished:o.published_at},...o.updated_at&&{dateModified:o.updated_at},author:{"@type":"Person",name:v||"Holden Richardson",url:"https://www.holdengr.com/about",...m&&{telephone:m},...g&&{email:g}},...p&&{image:[kc(p.file_path)]},publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US"}:null,U=!P&&v?{"@context":"https://schema.org","@type":"RealEstateAgent","@id":"https://www.holdengr.com/#agent",name:v,...A.agent_brokerage&&{worksFor:{"@type":"RealEstateOrganization",name:A.agent_brokerage}},...A.agent_market&&{areaServed:A.agent_market},...m&&{telephone:m},...g&&{email:g},...N.length>0&&{sameAs:N}}:null,H=[{"@type":"ListItem",position:1,name:"Home",item:x?`${x}/`:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:b||"",item:E(w)}];i&&!n?(H.push({"@type":"ListItem",position:3,name:i.replace(/-/g," "),item:E(k)}),H.push({"@type":"ListItem",position:4,name:o.title,item:B||E(j)})):H.push({"@type":"ListItem",position:3,name:o.title,item:B||E(j)});const W={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:H},$=o.video_url,z=o.video_transcript,ce=(o.video_orientation||"horizontal")==="vertical",R=$==null?void 0:$.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|shorts\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/),M=R==null?void 0:R[1],Y=$&&M?{"@context":"https://schema.org","@type":"VideoObject",name:o.h1,description:o.meta_description||o.subheadline||o.title,thumbnailUrl:`https://i.ytimg.com/vi/${M}/hqdefault.jpg`,embedUrl:`https://www.youtube.com/embed/${M}`,contentUrl:`https://www.youtube.com/watch?v=${M}`,...o.published_at&&{uploadDate:o.published_at},publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US",isAccessibleForFree:!0,...z&&{transcript:z}}:null,X=o.subheadline,V=p?kc(p.file_path):null,Z=o.schema_markup&&typeof o.schema_markup=="object"?o.schema_markup:null;return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsx("title",{children:o.meta_title||o.title}),l.jsx("meta",{name:"description",content:o.meta_description||o.intro_text||o.subheadline||""}),l.jsx("meta",{property:"og:title",content:o.meta_title||o.title}),l.jsx("meta",{property:"og:description",content:o.meta_description||o.intro_text||o.subheadline||""}),l.jsx("meta",{property:"og:type",content:"article"}),l.jsx("meta",{property:"og:image",content:V||"https://www.holdengr.com/og-image-1200x630.png"}),B&&l.jsx("meta",{property:"og:url",content:B}),B&&l.jsx("link",{rel:"canonical",href:B}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:o.meta_title||o.title}),l.jsx("meta",{name:"twitter:description",content:o.meta_description||o.intro_text||o.subheadline||""}),l.jsx("meta",{name:"twitter:image",content:V||"https://www.holdengr.com/og-image-1200x630.png"}),Z&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(Z)}),F&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(F)}),L&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(L)}),U&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(U)}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify(W)}),Y&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(Y)})]}),l.jsxs("section",{className:"relative text-background py-20 md:py-28 -mt-20 pt-32 md:pt-40 overflow-hidden min-h-[50vh] flex items-end",children:[V?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${V})`}}),l.jsx("div",{className:"absolute inset-0 bg-black/40"})]}):l.jsx("div",{className:"absolute inset-0 bg-black"}),l.jsxs("div",{className:"container-page relative z-10 w-full",children:[l.jsx(_e,{variant:"blur",children:l.jsxs("nav",{className:"text-sm text-background/50 mb-6 uppercase tracking-wider",children:[l.jsx(St,{to:"/",className:"text-accent/70 hover:text-accent transition-colors",children:"Home"}),l.jsx("span",{className:"mx-2",children:"/"}),l.jsx(St,{to:w,className:"text-accent/70 hover:text-accent transition-colors capitalize",children:b}),i&&!n&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"mx-2",children:"/"}),l.jsx(St,{to:k,className:"text-accent/70 hover:text-accent transition-colors capitalize",children:i.replace(/-/g," ")})]}),l.jsx("span",{className:"mx-2",children:"/"}),l.jsx("span",{className:"text-background/80",children:o.title})]})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"text-3xl md:text-5xl lg:text-6xl font-semibold tracking-tight leading-tight mb-4 max-w-4xl",children:o.h1}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-4 mb-6"})]}),X&&l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-lg md:text-xl text-background/65 max-w-3xl",children:X})})]})]}),l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[o.intro_text&&l.jsx(_e,{children:l.jsx("p",{className:"text-body text-foreground/75 text-lg leading-relaxed max-w-3xl mx-auto text-left",children:o.intro_text})}),P&&o.body_content&&l.jsx(_e,{children:l.jsxs("div",{className:"mt-10 md:mt-14",children:[T&&(T.national||T.local||T.source)&&l.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-8 p-4 border border-border bg-secondary/40",children:[l.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium",children:"As seen in:"}),T.national&&l.jsxs("a",{href:T.national,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-accent hover:text-accent/80 transition-colors font-medium",children:[l.jsx(ao,{className:"w-3.5 h-3.5"})," National"]}),T.local&&l.jsxs("a",{href:T.local,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-accent hover:text-accent/80 transition-colors font-medium",children:[l.jsx(ao,{className:"w-3.5 h-3.5"})," Local"]}),T.source&&l.jsxs("a",{href:T.source,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-accent hover:text-accent/80 transition-colors font-medium",children:[l.jsx(ao,{className:"w-3.5 h-3.5"})," Source"]})]}),l.jsx("div",{className:"prose prose-sm md:prose-base max-w-none prose-headings:font-semibold prose-headings:tracking-tight prose-a:text-accent",dangerouslySetInnerHTML:{__html:l2t(o.body_content)}})]})}),o.intro_text&&o.faq_json&&o.faq_json.length>0&&l.jsxs("div",{className:"flex items-center justify-center my-10 md:my-14",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),o.faq_json&&o.faq_json.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-10",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Common Questions"}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight text-foreground",children:"What You Need to Know"})]})}),l.jsx(_e,{delay:.1,children:l.jsx(Pf,{type:"single",collapsible:!0,className:"space-y-4",children:o.faq_json.map((ie,Ce)=>l.jsxs(Ka,{value:`faq-${Ce}`,className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(qa,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:ie.question}),l.jsx(Wa,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:ie.answer})]},Ce))})})]})]})}),o.faq_json&&o.faq_json.length>0&&$&&M&&l.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),$&&M&&l.jsx("section",{className:"py-16 md:py-24 bg-secondary/15",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Watch"}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-6",children:"Video Overview"})]}),l.jsx(_e,{delay:.1,children:l.jsx("div",{className:`relative overflow-hidden mx-auto ${ce?"max-w-sm aspect-[9/16]":"w-full aspect-video"}`,children:l.jsx("iframe",{src:`https://www.youtube.com/embed/${M}`,title:o.h1,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full border border-border",loading:"lazy"})})}),z&&l.jsx(Pf,{type:"single",collapsible:!0,className:"mt-6",children:l.jsxs(Ka,{value:"transcript",className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(qa,{className:"text-left text-sm font-medium hover:no-underline py-4 text-foreground/75 hover:text-foreground",children:"View Video Transcript"}),l.jsx(Wa,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1 whitespace-pre-line",children:z})]})})]})}),h&&h.length>0&&l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Related Topics"}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-2",children:["Most Relevant ",b," Questions"]}),l.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:h.map((ie,Ce)=>l.jsx(_e,{delay:Ce*.06,children:l.jsxs(St,{to:i?`/${r}/${i}/${ie.slug}`:`/${r}/${ie.slug}`,className:"group flex items-center gap-4 px-5 py-4 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("div",{className:"w-1 h-8 bg-accent shrink-0"}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"text-sm md:text-base font-medium group-hover:text-accent transition-colors leading-snug",children:ie.h1||ie.title})}),l.jsx(Xa,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},ie.id))}),l.jsx(_e,{children:l.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-x-6 gap-y-3 text-sm",children:[l.jsxs(St,{to:"/faq",className:"inline-flex items-center gap-2 text-accent hover:text-accent/80 transition-colors uppercase tracking-wider text-caption font-medium",children:["Browse all questions ",l.jsx(Xa,{size:14})]}),l.jsxs(St,{to:w,className:"inline-flex items-center gap-2 text-foreground/60 hover:text-foreground transition-colors uppercase tracking-wider text-caption font-medium",children:["All ",b," topics ",l.jsx(Xa,{size:14})]})]})})]})}),u&&u.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-secondary/15",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Sub-Topics"}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-2",children:"Explore More Topics"}),l.jsx("div",{className:"w-12 h-px bg-accent mb-12"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:u.map((ie,Ce)=>l.jsx(_e,{delay:Ce*.08,variant:"lift",children:l.jsxs(St,{to:`/${r}/${ie.slug}`,className:"group block p-8 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("h3",{className:"text-lg font-semibold tracking-tight mb-2 group-hover:text-accent transition-colors",children:ie.title}),ie.intro_text&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:ie.intro_text}),l.jsxs("span",{className:"inline-flex items-center gap-2 text-caption text-foreground/60 group-hover:text-accent transition-colors uppercase tracking-wider",children:["Read More ",l.jsx(Xa,{size:14,className:"transition-transform group-hover:translate-x-1"})]})]})},ie.id))})]})}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:v?`${v} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[y&&l.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Cl,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),g&&l.jsx("a",{href:`mailto:${g}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(Yk,{className:"w-4 h-4 mr-2"}),"Email"]})}),m&&l.jsx("a",{href:`tel:${m}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(kp,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(St,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(df,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})}),l.jsx("noscript",{children:l.jsxs("div",{style:{padding:"2rem"},children:[l.jsx("h1",{children:o.h1}),o.intro_text&&l.jsx("p",{children:o.intro_text}),(he=o.faq_json)==null?void 0:he.map((ie,Ce)=>l.jsxs("div",{children:[l.jsx("h3",{children:ie.question}),l.jsx("p",{children:ie.answer})]},Ce))]})})]})},c2t={car:G1e,trees:S2e,building:W1e,heart:Cre,users:j2e,school:i2e,pin:ov},n$=({stats:e})=>{if(!e||e.length===0)return null;const t=e.length,n=t<=3?t:Math.ceil(t/2),r=t<=6?t:Math.ceil(t/2),i=`nbs-${C.useId().replace(/:/g,"")}`;return l.jsxs("section",{className:"relative py-10 md:py-14 overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-foreground via-foreground/95 to-foreground"}),l.jsx("div",{className:"absolute inset-0 backdrop-blur-sm"}),l.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-accent/30 to-transparent"}),l.jsx("style",{children:`
        #${i} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }
        @media (min-width: 768px) {
          #${i} { grid-template-columns: repeat(${r}, minmax(0, 1fr)); }
        }
      `}),l.jsx("div",{className:"relative container-page",children:l.jsx("div",{id:i,className:"grid gap-6 md:gap-8",children:e.map((s,a)=>{const o=s.icon&&c2t[s.icon]||ov;return l.jsx(_e,{delay:a*.08,children:l.jsxs("div",{className:"text-center group",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-xl bg-background/10 backdrop-blur-md border border-background/20 shadow-lg shadow-black/10 mb-3 group-hover:bg-background/15 group-hover:scale-105 transition-all duration-300",children:l.jsx(o,{className:"w-5 h-5 text-accent"})}),l.jsx("p",{className:"text-lg md:text-xl font-semibold text-background",children:s.value}),l.jsx("p",{className:"text-xs text-background/50 uppercase tracking-widest mt-1",children:s.label})]})},a)})})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-background/10 to-transparent"})]})},u2t=({category:e,subcategories:t,faqs:n})=>{const{data:r}=A0(),i=(r||[]).filter(a=>a.media_type==="stock_photo"),s=e.stats_json||[];return l.jsxs(l.Fragment,{children:[e.intro_text&&l.jsx("section",{className:"py-16 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-4xl",children:l.jsx(_e,{children:l.jsx("p",{className:"text-body text-foreground/75 text-lg leading-relaxed text-left",children:e.intro_text.split(`

`)[0]})})})}),l.jsx(n$,{stats:s}),l.jsx("section",{className:"py-12 md:py-20 bg-secondary/20",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-12",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Explore Communities"}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light",children:"Grand Rapids Area Neighborhoods"}),l.jsx("div",{className:"w-12 h-px bg-accent mx-auto mt-4"})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 lg:gap-8",children:t.map((a,o)=>{const c=a.cover_image_id?i.find(h=>h.id===a.cover_image_id):null,u=c?kc(c.file_path):null,d=a.stats_json||[];return l.jsx(_e,{delay:o*.06,variant:"lift",children:l.jsxs(St,{to:`/neighborhoods/${a.slug}`,className:"group block bg-card border border-border/40 rounded-lg overflow-hidden shadow-sm hover:shadow-lg transition-all duration-300 hover:border-accent/40",children:[l.jsxs("div",{className:"relative aspect-[16/9] overflow-hidden",children:[u?l.jsx("img",{src:u,alt:`${a.name} neighborhood`,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"}):l.jsx("div",{className:"w-full h-full bg-gradient-to-br from-secondary/60 to-secondary/30 flex items-center justify-center",children:l.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Add cover image"})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-5",children:l.jsxs("h3",{className:"font-serif text-xl md:text-2xl text-white font-light flex items-center gap-2",children:[a.icon&&l.jsx("span",{children:a.icon}),a.name]})})]}),l.jsxs("div",{className:"p-5 md:p-6",children:[a.description&&l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-4 line-clamp-3",children:a.description}),d.length>0&&l.jsx("div",{className:"flex flex-wrap gap-3 mb-4",children:d.slice(0,3).map((h,A)=>l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 bg-secondary/60 border border-border/60 text-xs text-foreground/70",children:[l.jsx("span",{className:"font-medium",children:h.value}),l.jsx("span",{className:"text-muted-foreground",children:"·"}),l.jsx("span",{children:h.label})]},A))}),l.jsxs("span",{className:"inline-flex items-center gap-2 text-caption text-accent uppercase tracking-wider font-medium group-hover:gap-3 transition-all",children:["Explore ",a.name,l.jsx(Xa,{size:14,className:"transition-transform group-hover:translate-x-1"})]})]})]})},a.id)})})]})}),n.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsx("div",{className:"text-center mb-12",children:l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-3 text-foreground",children:e.faq_title||"Common Questions About Grand Rapids Neighborhoods"})})}),l.jsx(_e,{delay:.1,children:l.jsx(Pf,{type:"single",collapsible:!0,className:"space-y-4",children:n.map((a,o)=>l.jsxs(Ka,{value:`faq-${o}`,className:"border border-border/60 px-6 md:px-8 transition-all duration-300 bg-background shadow-md shadow-foreground/[0.06] hover:shadow-lg hover:shadow-foreground/[0.08]",children:[l.jsx(qa,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:a.question}),l.jsx(Wa,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:a.answer})]},o))})})]})})]})};function d2t(e){var r;const t=((r=e.split(/[.!?]/)[0])==null?void 0:r.trim())||"",n=t.split(/\s+/);return n.length<=8?t:n.slice(0,6).join(" ")+"…"}const h2t=({category:e,parentCategory:t,pages:n,faqs:r})=>{var h;const i=e.stats_json||[],s=((h=e.intro_text)==null?void 0:h.split(`

`).filter(Boolean))||[],a=e.section_headings||[],{data:o}=A0(),c=(o||[]).filter(A=>A.media_type==="stock_photo"),u=e.content_image_ids||[],d=c.filter(A=>{var f,p;return((f=A.tags)==null?void 0:f.includes(e.slug))||((p=A.tags)==null?void 0:p.includes("content"))});return l.jsxs(l.Fragment,{children:[l.jsx(n$,{stats:i}),s.length>0&&l.jsx("div",{className:"bg-background",children:s.map((A,f)=>{const p=f%2===1,m=u[f],y=(m?c.find(x=>x.id===m):null)||d[f],v=y?kc(y.file_path):null;return l.jsx("section",{className:`py-16 md:py-24 ${f%2===0?"bg-background":"bg-secondary/20"}`,children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-center ${p?"lg:[direction:rtl]":""}`,children:[l.jsxs(_e,{className:p?"lg:[direction:ltr]":"",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:e.name}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-4 leading-snug",children:a[f]||d2t(A)}),l.jsx("div",{className:"w-10 h-px bg-accent mb-6"}),l.jsx("p",{className:"text-body text-foreground/75 leading-relaxed text-lg",children:A})]}),l.jsx(_e,{delay:.15,className:p?"lg:[direction:ltr]":"",children:v?l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:l.jsx("img",{src:v,alt:(y==null?void 0:y.alt_text)||`${e.name} — section ${f+1}`,className:"w-full h-full object-cover",loading:"lazy"})}):l.jsx("div",{className:"aspect-[4/3] bg-gradient-to-br from-secondary/60 to-secondary/30 border border-border/40 flex items-center justify-center",children:l.jsxs("div",{className:"text-center px-8",children:[l.jsx("div",{className:"w-12 h-12 mx-auto mb-3 border border-accent/30 flex items-center justify-center",children:l.jsx("span",{className:"text-accent text-lg font-serif",children:f+1})}),l.jsx("span",{className:"text-xs text-muted-foreground tracking-wider uppercase",children:"Upload image via Media Library"})]})})})]})})},f)})}),r.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsx("div",{className:"text-center mb-12",children:l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-3 text-foreground",children:e.faq_title||`Common Questions About ${e.name}`})})}),l.jsx(_e,{delay:.1,children:l.jsx(Pf,{type:"single",collapsible:!0,className:"space-y-4",children:r.map((A,f)=>l.jsxs(Ka,{value:`faq-${f}`,className:"border border-border/60 px-6 md:px-8 transition-all duration-300 bg-background shadow-md shadow-foreground/[0.06] hover:shadow-lg hover:shadow-foreground/[0.08]",children:[l.jsx(qa,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:A.question}),l.jsx(Wa,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:A.answer})]},f))})})]})}),n&&n.length>0&&l.jsx("section",{className:"py-12 md:py-16 bg-secondary/20",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Dive Deeper"}),l.jsxs("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-2",children:["Explore ",e.name," Topics"]}),l.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map((A,f)=>l.jsx(_e,{delay:f*.06,children:l.jsxs(St,{to:`/neighborhoods/${e.slug}/${A.slug}`,className:"group flex items-center gap-4 px-5 py-4 border-l-4 border-l-accent bg-accent/[0.07] hover:bg-accent/[0.13] border border-accent/20 hover:border-accent/40 transition-all duration-300 rounded-r-lg shadow-sm hover:shadow-md",children:[l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"font-serif text-sm md:text-base group-hover:text-accent transition-colors leading-snug",children:A.h1||A.title})}),l.jsx(Xa,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},A.id))})]})})]})};function KX(e){var r;const t=((r=e.split(/[.!?]/)[0])==null?void 0:r.trim())||"",n=t.split(/\s+/);return n.length<=8?t:n.slice(0,6).join(" ")+"…"}function f2t(e){try{const t=new URL(e);if(t.hostname.includes("youtu.be"))return`https://www.youtube.com/embed${t.pathname}`;const n=t.searchParams.get("v");if(n)return`https://www.youtube.com/embed/${n}`;const r=t.pathname.match(/\/shorts\/([^/?&]+)/);if(r)return`https://www.youtube.com/embed/${r[1]}`}catch{}return null}function A2t(e){try{const t=new URL(e);if(t.hostname.includes("youtu.be"))return t.pathname.replace(/^\//,"").split("/")[0]||null;const n=t.searchParams.get("v");if(n)return n;const r=t.pathname.match(/\/shorts\/([^/?&]+)/);if(r)return r[1];const i=t.pathname.match(/\/embed\/([^/?&]+)/);if(i)return i[1]}catch{}return null}const wye=({subcategorySlug:e,categoryOverride:t}={})=>{var Y;const n=gm(),r=t||n.category;if(r==="about"&&!e)return l.jsx(vy,{to:"/about",replace:!0});const{configMap:i}=oa(),s=i.agent_name,a=i.agent_email,o=i.agent_phone,c=i.booking_url,{data:u,isLoading:d}=tA(),h=u==null?void 0:u.find(X=>X.slug===r&&!X.parent_id),A=e?u==null?void 0:u.find(X=>X.slug===e&&X.parent_id===(h==null?void 0:h.id)):h,{data:f}=Cqe(e||A==null?void 0:A.id),{data:p,isLoading:m}=Br({queryKey:["category-parents",A==null?void 0:A.id],enabled:!!A,queryFn:async()=>{const{data:X,error:V}=await Me.from("aeo_pages").select("id, title, slug, h1, subheadline, intro_text, is_parent, display_order").eq("category_id",A.id).eq("status","published").order("display_order");if(V)throw V;return X}}),{data:g}=A0(),y=(g||[]).filter(X=>X.media_type==="stock_photo"),v=(A==null?void 0:A.cover_image_id)||null,x=(A==null?void 0:A.content_image_ids)||[],b=v?y.find(X=>X.id===v):null,w=y.filter(X=>{var V,Z;return((V=X.tags)==null?void 0:V.includes(r||""))||((Z=X.tags)==null?void 0:Z.includes("featured"))}),k=w.filter(X=>{var V;return(V=X.tags)==null?void 0:V.includes("cover")}),j=y.filter(X=>{var V;return(V=X.tags)==null?void 0:V.includes("cover")}),B=w.filter(X=>{var V;return(V=X.tags)==null?void 0:V.includes("content")}),E=y.filter(X=>{var V;return(V=X.tags)==null?void 0:V.includes("content")});if(!A&&!m&&!d)return l.jsx(un,{children:l.jsxs("div",{className:"container-page section-padding text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Category Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground",children:"This page doesn't exist yet."})]})});const P=(A==null?void 0:A.name)||(r==null?void 0:r.replace(/-/g," "))||"",T=(A==null?void 0:A.faq_json)||[],N=((Y=A==null?void 0:A.intro_text)==null?void 0:Y.split(`

`).filter(Boolean))||[],F=(A==null?void 0:A.section_headings)||[],L=A!=null&&A.video_url?f2t(A.video_url):null,U=A!=null&&A.video_url?A2t(A.video_url):null,H=`https://www.holdengr.com/${r}${e?`/${e}`:""}`,W=T.length>0?{"@context":"https://schema.org","@type":"FAQPage",mainEntityOfPage:{"@type":"WebPage","@id":H},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:T.map(X=>({"@type":"Question",name:X.question,acceptedAnswer:{"@type":"Answer",text:X.answer}}))}:null,$=A!=null&&A.video_url&&L?{"@context":"https://schema.org","@type":"VideoObject",name:A.video_headline||`${P} Video`,description:A.description||`Video about ${P} — Grand Rapids real estate.`,thumbnailUrl:U?`https://i.ytimg.com/vi/${U}/hqdefault.jpg`:"https://www.holdengr.com/og-image-1200x630.png",embedUrl:L,...U&&{contentUrl:`https://www.youtube.com/watch?v=${U}`},uploadDate:A.created_at,publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US",isAccessibleForFree:!0,...A.video_transcript?{transcript:A.video_transcript}:{}}:null,Q=r?{buyers:{name:"How to buy a home in Grand Rapids, Michigan",totalTime:"P60D",tool:["Pre-approval letter","Buyer's agent","Home inspector"],supply:["Down payment funds","Earnest money (typically 1–2% of purchase price)","Closing cost reserves"]},sellers:{name:"How to sell a home in Grand Rapids, Michigan",totalTime:"P90D",tool:["Comparative market analysis (CMA)","Listing agent","Professional photographer"],supply:["Staging budget","Pre-listing inspection (optional)","Closing-cost reserves for prorations and concessions"]}}[r]:void 0,ce=!e&&Q&&F.length>0&&F.length===N.length?{"@context":"https://schema.org","@type":"HowTo",name:Q.name,description:(A==null?void 0:A.description)||Q.name,totalTime:Q.totalTime,...Q.tool&&{tool:Q.tool.map(X=>({"@type":"HowToTool",name:X}))},...Q.supply&&{supply:Q.supply.map(X=>({"@type":"HowToSupply",name:X}))},step:N.map((X,V)=>({"@type":"HowToStep",position:V+1,name:F[V]||KX(X),text:X,url:`${H}#step-${V+1}`})),about:{"@id":"https://www.holdengr.com/#agent"},mainEntityOfPage:{"@type":"WebPage","@id":H}}:null,R=[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:(h==null?void 0:h.name)||P,item:`https://www.holdengr.com/${r}`}];e&&A&&R.push({"@type":"ListItem",position:3,name:A.name,item:H});const M={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:R};return l.jsxs(un,{children:[l.jsxs(Vn,{children:[l.jsxs("title",{children:[P," | Grand Rapids Area Real Estate"]}),l.jsx("meta",{name:"description",content:(A==null?void 0:A.description)||`${P} — Expert real estate guidance for the Grand Rapids area.`}),l.jsx("link",{rel:"canonical",href:H}),l.jsx("meta",{property:"og:title",content:`${P} | Grand Rapids Area Real Estate`}),l.jsx("meta",{property:"og:description",content:(A==null?void 0:A.description)||`${P} — Expert real estate guidance for the Grand Rapids area.`}),l.jsx("meta",{property:"og:url",content:H}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:`${P} | Grand Rapids Area Real Estate`}),l.jsx("meta",{name:"twitter:description",content:(A==null?void 0:A.description)||`${P} — Expert real estate guidance.`}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify(M)}),W&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(W)}),$&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify($)}),ce&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(ce)})]}),(()=>{const X=b||k[0]||j[0],V=X?kc(X.file_path):null;return l.jsxs("section",{className:"relative text-background py-20 md:py-28 -mt-20 pt-32 md:pt-40 overflow-hidden min-h-[50vh] flex items-end",children:[V?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${V})`}}),l.jsx("div",{className:`absolute inset-0 ${r==="buyers"?"bg-black/55":"bg-black/40"}`})]}):l.jsx("div",{className:"absolute inset-0 bg-black"}),l.jsxs("div",{className:"container-page relative z-10 w-full",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-background/50 mb-4 uppercase tracking-widest",children:"Grand Rapids Area Real Estate"})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"font-sans text-4xl md:text-5xl lg:text-6xl font-semibold leading-tight mb-4 max-w-4xl capitalize",children:P}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-4 mb-6"})]}),(A==null?void 0:A.description)&&l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-lg md:text-xl text-background/65 max-w-3xl",children:A.description})}),!V&&l.jsxs("div",{className:"mt-6 inline-flex items-center gap-2 px-4 py-2 border border-background/20 rounded text-xs text-background/40 uppercase tracking-wider",children:[l.jsx("span",{children:"📷"}),' Tag an image "hero" + "',r,'" in Media Library for cover photo']})]})]})})(),!(r==="neighborhoods"&&!e)&&l.jsx(n$,{stats:(A==null?void 0:A.stats_json)||[]}),r==="neighborhoods"&&!e&&A&&f&&f.length>0?l.jsxs(l.Fragment,{children:[l.jsx(u2t,{category:A,subcategories:f,faqs:T}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:s?`${s} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[c&&l.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Cl,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&l.jsx("a",{href:`mailto:${a}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(Yk,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&l.jsx("a",{href:`tel:${o}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(kp,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(St,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(df,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]}):r==="neighborhoods"&&e&&A&&h?l.jsxs(l.Fragment,{children:[l.jsx(h2t,{category:A,parentCategory:h,pages:p||[],faqs:T}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:s?`${s} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[c&&l.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Cl,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&l.jsx("a",{href:`mailto:${a}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(Yk,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&l.jsx("a",{href:`tel:${o}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(kp,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(St,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(df,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]}):e==="news"&&A?l.jsx(Yle,{categoryId:A.id,parentCategorySlug:r||"about"}):l.jsxs(l.Fragment,{children:[N.length>0&&l.jsx("div",{className:N.length>0?"bg-background":"",children:N.map((X,V)=>{const Z=V%2===1,de=x[V],se=(de?y.find(Ce=>Ce.id===de):null)||B[V]||E[V],he=se?kc(se.file_path):null,ie=ce?`step-${V+1}`:void 0;return l.jsx("section",{id:ie,className:`py-16 md:py-24 ${V%2===0?"bg-background":"bg-secondary/20"} scroll-mt-24`,children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-center ${Z?"lg:[direction:rtl]":""}`,children:[l.jsxs(_e,{className:Z?"lg:[direction:ltr]":"",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:ce?`Step ${V+1} of ${N.length}`:P}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-4 leading-snug",children:F[V]||KX(X)}),l.jsx("div",{className:"w-10 h-px bg-accent mb-6"}),l.jsx("p",{className:"text-body text-foreground/75 leading-relaxed text-lg",children:X})]}),l.jsx(_e,{delay:.15,className:Z?"lg:[direction:ltr]":"",children:he?l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:l.jsx("img",{src:he,alt:(se==null?void 0:se.alt_text)||`${P} — section ${V+1}`,className:"w-full h-full object-cover",loading:"lazy"})}):l.jsx("div",{className:"aspect-[4/3] bg-gradient-to-br from-secondary/60 to-secondary/30 border border-border/40 flex items-center justify-center",children:l.jsxs("div",{className:"text-center px-8",children:[l.jsx("div",{className:"w-12 h-12 mx-auto mb-3 border border-accent/30 flex items-center justify-center",children:l.jsx("span",{className:"text-accent text-lg font-semibold",children:V+1})}),l.jsx("span",{className:"text-xs text-muted-foreground tracking-wider uppercase",children:"Upload image via Media Library"})]})})})]})})},V)})}),T.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-12",children:[l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-3 text-foreground",children:(A==null?void 0:A.faq_title)||`Common Questions About ${P}`}),(A==null?void 0:A.description)&&l.jsx("p",{className:"text-sm text-muted-foreground max-w-2xl mx-auto",children:A.description})]})}),l.jsx(_e,{delay:.1,children:l.jsx(Pf,{type:"single",collapsible:!0,className:"space-y-4",children:T.map((X,V)=>l.jsxs(Ka,{value:`faq-${V}`,className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(qa,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:X.question}),l.jsx(Wa,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:X.answer})]},V))})})]})}),T.length>0&&L&&l.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),L&&l.jsx("section",{className:"py-16 md:py-24 bg-secondary/20",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsxs(_e,{children:[(A==null?void 0:A.video_headline)&&l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-8 text-center",children:A.video_headline}),l.jsx("div",{className:`mx-auto ${(A==null?void 0:A.video_orientation)==="vertical"?"max-w-sm":"max-w-4xl"}`,children:l.jsx("div",{className:`relative overflow-hidden ${(A==null?void 0:A.video_orientation)==="vertical"?"aspect-[9/16]":"aspect-video"}`,children:l.jsx("iframe",{src:L,title:(A==null?void 0:A.video_headline)||`${P} Video`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full",loading:"lazy"})})})]}),(A==null?void 0:A.video_transcript)&&l.jsx(_e,{delay:.1,children:l.jsx("div",{className:"mt-8 max-w-3xl mx-auto",children:l.jsx(Pf,{type:"single",collapsible:!0,children:l.jsxs(Ka,{value:"transcript",className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(qa,{className:"text-left text-sm font-medium hover:no-underline py-4 text-foreground/75 hover:text-foreground",children:"View Video Transcript"}),l.jsx(Wa,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1 whitespace-pre-line",children:A.video_transcript})]})})})})]})}),l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Dive Deeper"}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-2",children:["Explore ",P," Topics"]}),l.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),m?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(X=>l.jsx(ht,{className:"h-24 w-full"},X))}):p&&p.length>0||f&&f.length>0?l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[!e&&(f==null?void 0:f.map((X,V)=>l.jsx(_e,{delay:V*.06,children:l.jsxs(St,{to:`/${r}/${X.slug}`,className:"group flex items-center gap-4 px-5 py-4 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("div",{className:"w-1 h-8 bg-accent shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("h3",{className:"text-sm md:text-base font-medium group-hover:text-accent transition-colors leading-snug",children:[X.icon&&l.jsx("span",{className:"mr-1",children:X.icon}),X.name]}),X.description&&l.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1",children:X.description})]}),l.jsx(Xa,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},X.id))),p==null?void 0:p.map((X,V)=>{const Z=e?`/${r}/${e}`:`/${r}`;return l.jsx(_e,{delay:((f==null?void 0:f.length)||0+V)*.06,children:l.jsxs(St,{to:`${Z}/${X.slug}`,className:"group flex items-center gap-4 px-5 py-4 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("div",{className:"w-1 h-8 bg-accent shrink-0"}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"text-sm md:text-base font-medium group-hover:text-accent transition-colors leading-snug",children:X.h1||X.title})}),l.jsx(Xa,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},X.id)})]}):l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"Content for this category is coming soon."})})]})}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:s?`${s} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[c&&l.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Cl,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&l.jsx("a",{href:`mailto:${a}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(Yk,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&l.jsx("a",{href:`tel:${o}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(kp,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(St,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(df,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]})]})},p2t=()=>{const{category:e,slug:t}=gm(),{data:n,isLoading:r}=Br({queryKey:["aeo-resolve",e,t],enabled:!!e&&!!t,queryFn:async()=>{const{data:i}=await Me.from("aeo_categories").select("id").eq("slug",e).is("parent_id",null).maybeSingle();if(!i)return{type:"page"};const{data:s}=await Me.from("aeo_categories").select("id, slug").eq("slug",t).eq("parent_id",i.id).eq("enabled",!0).maybeSingle();return s?{type:"subcategory",subcategoryId:s.id}:{type:"page"}},staleTime:1e3*60*5});return r?l.jsx(un,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(ht,{className:"h-12 w-3/4 mb-6"}),l.jsx(ht,{className:"h-64 w-full"})]})}):(n==null?void 0:n.type)==="subcategory"?l.jsx(wye,{subcategorySlug:t}):l.jsx(y_,{})};function m2t({value:e,label:t,lens:n}){const r=Math.max(0,Math.min(100,e)),i=r>=75?"hsl(0 70% 55%)":r>=50?"hsl(35 80% 55%)":r>=25?"hsl(85 50% 50%)":"hsl(195 60% 50%)";return l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:n==="seller"?"Seller Market Heat":"Buyer Difficulty"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground/70",children:"0–100"})]}),l.jsxs("div",{className:"flex items-end gap-4",children:[l.jsx("div",{className:"text-5xl font-bold text-foreground tabular-nums",style:{color:i},children:r}),l.jsx("div",{className:"text-sm text-foreground/80 pb-2",children:t})]}),l.jsx("div",{className:"mt-4 h-2 bg-muted rounded-none overflow-hidden",children:l.jsx("div",{className:"h-full transition-all duration-700",style:{width:`${r}%`,background:i}})}),l.jsxs("div",{className:"flex justify-between text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60 mt-2",children:[l.jsx("span",{children:"Cold"}),l.jsx("span",{children:"Balanced"}),l.jsx("span",{children:"Hot"})]})]})}function g2t(e){return e>=20?0:e>=15?.3:e>=10?.41:e>=5?.62:1}function y2t(e){const t=e.homePrice*(e.downPaymentPct/100),n=Math.max(0,e.homePrice-t),r=e.ratePct/100/12,i=e.termYears*12,s=r===0?n/i:n*(r*Math.pow(1+r,i))/(Math.pow(1+r,i)-1),a=e.homePrice*(e.propertyTaxRatePct/100)/12,o=e.annualInsurance/12,c=g2t(e.downPaymentPct),u=n*(c/100)/12,d=e.monthlyHoa??0;return{loanAmount:n,downPayment:t,monthlyPI:s,monthlyTax:a,monthlyInsurance:o,monthlyPmi:u,monthlyHoa:d,monthlyTotal:s+a+o+u+d,pmiRatePct:c}}const O0=e=>e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}),qX=e=>e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2}),oh=({label:e,value:t,sub:n})=>l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-2",children:e}),l.jsx("div",{className:"text-2xl font-bold text-foreground tabular-nums",children:t}),n&&l.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:n})]});function v2t({snapshot:e,lens:t}){return e.yoy_pct>=0,l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Market Snapshot"}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"AI-researched · Not MLS-verified"})]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:[l.jsx(oh,{label:"Median Sale Price",value:O0(e.median_sale_price),sub:`${e.yoy_pct>=0?"+":""}${e.yoy_pct.toFixed(1)}% YoY`}),l.jsx(oh,{label:"Homes Sold (30d)",value:String(e.homes_sold_30d)}),l.jsx(oh,{label:"Median Days on Market",value:`${e.median_dom}d`}),l.jsx(oh,{label:"List-to-Sale Ratio",value:`${e.list_to_sale_pct.toFixed(1)}%`}),l.jsx(oh,{label:"Active Inventory",value:String(e.active_inventory),sub:e.months_supply?`${e.months_supply.toFixed(1)} mo supply`:void 0}),t==="buyer"&&e.pct_above_ask!==void 0&&l.jsx(oh,{label:"Selling Above Ask",value:`${e.pct_above_ask.toFixed(0)}%`}),t==="buyer"&&e.new_listings_7d!==void 0&&l.jsx(oh,{label:"New Listings (7d)",value:String(e.new_listings_7d)}),t==="buyer"&&e.price_reduced_7d!==void 0&&l.jsx(oh,{label:"Price Reduced (7d)",value:String(e.price_reduced_7d)})]})]})}function x2t({data:e}){return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Median Sale Price · 24-Month Trend"})}),l.jsx("div",{style:{width:"100%",height:260},children:l.jsx(gQ,{children:l.jsxs(qge,{data:e,margin:{top:10,right:12,left:12,bottom:0},children:[l.jsx(lT,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),l.jsx(jm,{dataKey:"month",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),l.jsx(Bm,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},tickFormatter:t=>`$${(t/1e3).toFixed(0)}k`,width:60}),l.jsx(ul,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))"},formatter:t=>O0(t)}),l.jsx(I0,{type:"monotone",dataKey:"value",stroke:"hsl(var(--primary))",strokeWidth:2,dot:{r:2}})]})})})]})}function w2t({data:e}){return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-4",children:"Homes Sold per Month · 12-Month"}),l.jsx("div",{style:{width:"100%",height:220},children:l.jsx(gQ,{children:l.jsxs(Bbt,{data:e,margin:{top:10,right:12,left:0,bottom:0},children:[l.jsx(lT,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),l.jsx(jm,{dataKey:"month",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),l.jsx(Bm,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},width:40}),l.jsx(ul,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))"}}),l.jsx(_m,{dataKey:"value",fill:"hsl(var(--primary))"})]})})})]})}function b2t({percentile:e,comps:t,zip:n}){return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-4",children:["Metro Score · How ",n," Ranks"]}),l.jsxs("div",{className:"mb-5",children:[l.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[l.jsx("span",{className:"text-4xl font-bold tabular-nums",children:Math.round(e)}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"percentile vs. GR metro"})]}),l.jsx("div",{className:"h-2 bg-muted",children:l.jsx("div",{className:"h-full bg-primary",style:{width:`${Math.max(2,Math.min(100,e))}%`}})})]}),t.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.25em] text-muted-foreground/70 mb-2",children:"Nearby Comps"}),l.jsx("ul",{className:"space-y-1.5",children:t.map(r=>l.jsxs("li",{className:"flex items-center justify-between text-sm",children:[l.jsxs("span",{className:"text-foreground/80",children:[r.zip," · ",r.label]}),l.jsx("span",{className:"tabular-nums text-foreground",children:O0(r.median_price)})]},r.zip))})]})]})}function C2t(){const[e,t]=C.useState(null),[n,r]=C.useState(!0);return C.useEffect(()=>{let i=!0;return(async()=>{try{const{data:s}=await Me.from("market_pulse_rates").select("rates, source, fetched_at").order("fetched_at",{ascending:!1}).limit(1).maybeSingle();if(!s||Date.now()-new Date(s.fetched_at).getTime()>1e3*60*60*12){await Me.functions.invoke("market-pulse-rates",{body:{}});const{data:o}=await Me.from("market_pulse_rates").select("rates, source, fetched_at").order("fetched_at",{ascending:!1}).limit(1).maybeSingle();i&&o&&t({rates:o.rates,source:o.source,fetched_at:o.fetched_at})}else i&&t({rates:s.rates,source:s.source,fetched_at:s.fetched_at})}catch(s){console.error("RatesModule load error",s)}finally{i&&r(!1)}})(),()=>{i=!1}},[]),l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Today's Mortgage Rates"}),e&&l.jsxs("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:[e.source," · ",new Date(e.fetched_at).toLocaleDateString()]})]}),n||!e?l.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading rates…"}):l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[l.jsx(Hx,{label:"30-Yr Fixed",v:e.rates.thirty_year_fixed}),l.jsx(Hx,{label:"15-Yr Fixed",v:e.rates.fifteen_year_fixed}),e.rates.seven_one_arm!==void 0&&l.jsx(Hx,{label:"7/1 ARM",v:e.rates.seven_one_arm}),e.rates.fha_thirty!==void 0&&l.jsx(Hx,{label:"FHA 30",v:e.rates.fha_thirty}),e.rates.va_thirty!==void 0&&l.jsx(Hx,{label:"VA 30",v:e.rates.va_thirty})]}),l.jsx("p",{className:"text-[10px] text-muted-foreground/60 mt-3",children:"National averages. Your actual rate depends on credit, down payment, and lender."})]})}const Hx=({label:e,v:t})=>l.jsxs("div",{className:"border border-border p-3",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-1",children:e}),l.jsxs("div",{className:"text-xl font-bold tabular-nums",children:[t.toFixed(3),"%"]})]});function bye(e){if(e<=0)return 0;if(e<=1e5)return 400+e/1e3*5.75;const t=e-1e5;return 400+100*5.75+t/1e3*3.5}function S2t(e){const t=e.salePrice*(e.listingCommissionPct/100),n=e.salePrice*(e.buyerAgentCommissionPct/100),r=e.salePrice*.0075,i=e.salePrice*.0011,s=e.titleInsuranceOverride??bye(e.salePrice),a=t+n+r+i+s+e.settlementFee+e.recordingFee+e.proratedTax+e.sellerConcessions+e.mortgagePayoff;return{salePrice:e.salePrice,listingCommission:t,buyerAgentCommission:n,stateTransferTax:r,countyTransferTax:i,titleInsurance:s,settlementFee:e.settlementFee,recordingFee:e.recordingFee,proratedTax:e.proratedTax,sellerConcessions:e.sellerConcessions,mortgagePayoff:e.mortgagePayoff,totalCosts:a,estimatedNet:e.salePrice-a}}const $u=e=>e===""||e==="-"?0:Number(e)||0;function k2t({defaultPrice:e}){const[t,n]=C.useState(String(e||35e4)),[r,i]=C.useState("180000"),[s,a]=C.useState("3"),[o,c]=C.useState("3"),[u,d]=C.useState("0"),[h,A]=C.useState("1500"),[f,p]=C.useState("400"),[m,g]=C.useState("75"),[y,v]=C.useState(""),x=C.useMemo(()=>S2t({salePrice:$u(t),mortgagePayoff:$u(r),listingCommissionPct:$u(s),buyerAgentCommissionPct:$u(o),sellerConcessions:$u(u),proratedTax:$u(h),settlementFee:$u(f),recordingFee:$u(m),titleInsuranceOverride:y?Number(y):void 0}),[t,r,s,o,u,h,f,m,y]);return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Michigan Seller Net Sheet"}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"Estimate"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(lh,{label:"Sale Price",value:t,setValue:n,prefix:"$"}),l.jsx(lh,{label:"Mortgage Payoff",value:r,setValue:i,prefix:"$"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(lh,{label:"Listing Comm. %",value:s,setValue:a,step:.25}),l.jsx(lh,{label:"Buyer Agent %",value:o,setValue:c,step:.25})]}),l.jsx(lh,{label:"Seller Concessions",value:u,setValue:d,prefix:"$"}),l.jsx(lh,{label:"Prorated Property Tax",value:h,setValue:A,prefix:"$"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(lh,{label:"Settlement Fee",value:f,setValue:p,prefix:"$"}),l.jsx(lh,{label:"Recording Fee",value:m,setValue:g,prefix:"$"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:["Title Insurance Override ",l.jsxs("span",{className:"text-muted-foreground/50",children:["(default ",O0(bye($u(t))),")"]})]}),l.jsx("input",{type:"number",value:y,onChange:b=>v(b.target.value),placeholder:"optional",className:"w-full bg-background border border-border px-3 py-2 text-sm"})]})]}),l.jsxs("div",{className:"bg-muted/40 border border-border p-4 space-y-2 text-sm",children:[l.jsx(nl,{label:"Sale Price",v:x.salePrice,bold:!0}),l.jsx(WX,{}),l.jsx(nl,{label:`Listing Commission (${s}%)`,v:-x.listingCommission}),l.jsx(nl,{label:`Buyer Agent (${o}%)`,v:-x.buyerAgentCommission}),l.jsx(nl,{label:"MI State Transfer Tax (0.75%)",v:-x.stateTransferTax}),l.jsx(nl,{label:"Kent County Transfer Tax (0.11%)",v:-x.countyTransferTax}),l.jsx(nl,{label:"Title Insurance (owner's)",v:-x.titleInsurance}),l.jsx(nl,{label:"Settlement Fee",v:-x.settlementFee}),l.jsx(nl,{label:"Recording / Deed Prep",v:-x.recordingFee}),l.jsx(nl,{label:"Prorated Property Tax",v:-x.proratedTax}),x.sellerConcessions>0&&l.jsx(nl,{label:"Seller Concessions",v:-x.sellerConcessions}),l.jsx(nl,{label:"Mortgage Payoff",v:-x.mortgagePayoff}),l.jsx(WX,{}),l.jsx(nl,{label:"Estimated Net Proceeds",v:x.estimatedNet,bold:!0,highlight:!0}),l.jsx("p",{className:"text-[10px] text-muted-foreground/70 mt-3 leading-relaxed",children:"Estimate only — confirm exact figures with your title company. Transfer taxes shown are MI State + Kent County. Other counties may differ."})]})]})]})}const lh=({label:e,value:t,setValue:n,prefix:r,step:i})=>l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:e}),l.jsxs("div",{className:"relative",children:[r&&l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:r}),l.jsx("input",{type:"text",inputMode:"decimal",step:i??1,value:t,onChange:s=>{const a=s.target.value;(a===""||/^-?\d*\.?\d*$/.test(a))&&n(a)},onBlur:s=>{(s.target.value===""||s.target.value==="-"||s.target.value===".")&&n("0")},className:`w-full bg-background border border-border py-2 text-sm ${r?"pl-7 pr-3":"px-3"}`})]})]}),nl=({label:e,v:t,bold:n,highlight:r})=>l.jsxs("div",{className:`flex items-center justify-between ${n?"font-bold":""} ${r?"text-lg pt-1":""}`,children:[l.jsx("span",{className:r?"text-foreground":"text-foreground/80",children:e}),l.jsx("span",{className:`tabular-nums ${t<0?"text-foreground/70":"text-foreground"}`,children:O0(t)})]}),WX=()=>l.jsx("div",{className:"h-px bg-border my-1"}),vg=e=>e===""||e==="-"||e==="."?0:Number(e)||0;function _2t({defaultPrice:e}){const[t,n]=C.useState(String(e||325e3)),[r,i]=C.useState("10"),[s,a]=C.useState("6.875"),[o,c]=C.useState(30),[u,d]=C.useState("1.45"),[h,A]=C.useState("1400"),[f,p]=C.useState("0");C.useEffect(()=>{(async()=>{var x;const{data:y}=await Me.from("market_pulse_rates").select("rates").order("fetched_at",{ascending:!1}).limit(1).maybeSingle(),v=(x=y==null?void 0:y.rates)==null?void 0:x.thirty_year_fixed;typeof v=="number"&&a(String(v))})()},[]);const m=C.useMemo(()=>y2t({homePrice:vg(t),downPaymentPct:vg(r),ratePct:vg(s),termYears:o,propertyTaxRatePct:vg(u),annualInsurance:vg(h),monthlyHoa:vg(f)}),[t,r,s,o,u,h,f]),g=[{key:"P&I",v:m.monthlyPI,color:"hsl(var(--primary))"},{key:"Tax",v:m.monthlyTax,color:"hsl(35 80% 55%)"},{key:"Insurance",v:m.monthlyInsurance,color:"hsl(195 60% 50%)"},{key:"PMI",v:m.monthlyPmi,color:"hsl(0 70% 55%)"},{key:"HOA",v:m.monthlyHoa,color:"hsl(85 50% 50%)"}].filter(y=>y.v>0);return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"PITI + PMI Mortgage Calculator"}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"Estimate"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(xg,{label:"Home Price",v:t,set:n,prefix:"$"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(xg,{label:"Down Payment %",v:r,set:i,step:.5}),l.jsx(xg,{label:"Rate %",v:s,set:a,step:.125})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:"Term"}),l.jsxs("select",{value:o,onChange:y=>c(Number(y.target.value)),className:"w-full bg-background border border-border px-3 py-2 text-sm",children:[l.jsx("option",{value:30,children:"30 years"}),l.jsx("option",{value:15,children:"15 years"})]})]}),l.jsx(xg,{label:"Property Tax %",v:u,set:d,step:.05})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(xg,{label:"Annual Insurance",v:h,set:A,prefix:"$"}),l.jsx(xg,{label:"Monthly HOA",v:f,set:p,prefix:"$"})]}),m.pmiRatePct>0&&l.jsxs("p",{className:"text-[11px] text-muted-foreground bg-muted/40 border border-border p-2",children:["Down payment under 20% — PMI applied at ",l.jsxs("strong",{children:[m.pmiRatePct.toFixed(2),"%/yr"]}),"."]})]}),l.jsxs("div",{className:"bg-muted/40 border border-border p-4",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-2",children:"Estimated Monthly Payment"}),l.jsx("div",{className:"text-4xl font-bold tabular-nums mb-4",children:qX(m.monthlyTotal)}),l.jsxs("div",{className:"space-y-1.5 text-sm mb-4",children:[l.jsx(IA,{label:"Principal & Interest",v:m.monthlyPI}),l.jsx(IA,{label:"Property Tax",v:m.monthlyTax}),l.jsx(IA,{label:"Insurance",v:m.monthlyInsurance}),m.monthlyPmi>0&&l.jsx(IA,{label:"PMI",v:m.monthlyPmi}),m.monthlyHoa>0&&l.jsx(IA,{label:"HOA",v:m.monthlyHoa})]}),l.jsx("div",{className:"flex h-3 overflow-hidden border border-border",children:g.map(y=>l.jsx("div",{title:`${y.key}: ${qX(y.v)}`,style:{width:`${y.v/m.monthlyTotal*100}%`,background:y.color}},y.key))}),l.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mt-2 text-[10px] uppercase tracking-[0.15em]",children:g.map(y=>l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2",style:{background:y.color}}),l.jsx("span",{className:"text-muted-foreground",children:y.key})]},y.key))}),l.jsxs("div",{className:"mt-4 pt-3 border-t border-border text-sm space-y-1",children:[l.jsx(IA,{label:"Down Payment",v:m.downPayment}),l.jsx(IA,{label:"Loan Amount",v:m.loanAmount})]})]})]})]})}const xg=({label:e,v:t,set:n,prefix:r,step:i})=>l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:e}),l.jsxs("div",{className:"relative",children:[r&&l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:r}),l.jsx("input",{type:"text",inputMode:"decimal",step:i??1,value:t,onChange:s=>{const a=s.target.value;(a===""||/^-?\d*\.?\d*$/.test(a))&&n(a)},onBlur:s=>{(s.target.value===""||s.target.value==="-"||s.target.value===".")&&n("0")},className:`w-full bg-background border border-border py-2 text-sm ${r?"pl-7 pr-3":"px-3"}`})]})]}),IA=({label:e,v:t})=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-foreground/80",children:e}),l.jsx("span",{className:"tabular-nums",children:O0(t)})]});function j2t({md:e,area:t}){return l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx("img",{src:Gae,alt:"Holden Richardson",className:"w-12 h-12 rounded-full object-cover object-top border border-border"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground",children:"Holden's Take"}),l.jsxs("div",{className:"text-sm font-medium",children:["On ",t]})]})]}),l.jsx("div",{className:"prose prose-sm max-w-none prose-p:text-foreground/85 prose-p:leading-relaxed prose-headings:text-foreground prose-strong:text-foreground",children:l.jsx(U6,{children:e})})]})}const B2t=[{t:"Pre-Listing Walkthrough",d:"I walk your home, identify quick-win prep items, and recommend pricing strategy backed by live comps."},{t:"Strategic Pricing",d:"We price to attract showings in the first 10 days — that's where the strongest offers come from."},{t:"Marketing Launch",d:"Pro photos, video, social campaigns, and syndication to all major portals + my buyer database."},{t:"Negotiation",d:"I negotiate offer terms, inspection requests, and appraisal gaps to protect your bottom line."},{t:"Smooth Close",d:"I coordinate title, lender, inspectors, and movers so your closing day is the easy day."}],N2t=[{t:"Search Strategy Session",d:"We map your must-haves, deal-breakers, neighborhoods, and budget — and align on timeline."},{t:"Lender Connect",d:"I introduce you to 2–3 vetted local lenders so you get a competitive pre-approval, not just any pre-approval."},{t:"Showings + Off-Market",d:"I tour properties with you and tap my agent network for off-market opportunities."},{t:"Offer + Negotiation",d:"I structure offers that win without overpaying — escalation, concessions, and inspection terms tuned to the market."},{t:"Inspection → Close",d:"I manage inspections, repair negotiations, and the closing timeline so nothing slips."}];function E2t({lens:e}){const t=e==="seller"?B2t:N2t,{configMap:n}=oa(),r=n.booking_url;return l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsxs("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-1",children:["My Plan to ",e==="seller"?"Sell Your Home":"Help You Buy"]}),l.jsxs("p",{className:"text-sm text-foreground/80 mb-5",children:["Here's how I work with ",e==="seller"?"sellers":"buyers"," — start to close."]}),l.jsx("ol",{className:"space-y-4",children:t.map((i,s)=>l.jsxs("li",{className:"flex gap-3",children:[l.jsx("div",{className:"shrink-0 w-7 h-7 border border-border flex items-center justify-center text-xs font-bold text-foreground",children:s+1}),l.jsxs("div",{children:[l.jsxs("div",{className:"text-sm font-semibold flex items-center gap-2",children:[l.jsx(e0,{size:14,className:"text-foreground/70"})," ",i.t]}),l.jsx("p",{className:"text-sm text-foreground/75 mt-0.5",children:i.d})]})]},i.t))}),l.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[r&&l.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-5 py-3 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-primary/90",children:e==="seller"?"Book a Listing Consult":"Start with a Buyer Strategy Call"}),l.jsx("a",{href:"sms:6164036393",className:"inline-flex items-center justify-center px-5 py-3 border border-border text-foreground text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-muted",children:"Text Holden"})]})]})}function T2t(){const{configMap:e}=oa(),t=e.booking_url;return l.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 bg-primary text-primary-foreground border-t border-primary-foreground/10 shadow-2xl",children:l.jsxs("div",{className:"container-page py-3 flex items-center justify-between gap-3",children:[l.jsx("div",{className:"hidden md:block text-[11px] uppercase tracking-[0.2em] text-primary-foreground/80",children:"Questions about this report?"}),l.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[l.jsxs("a",{href:"sms:6164036393",className:"inline-flex items-center gap-2 px-3 md:px-4 py-2 border border-primary-foreground/30 text-primary-foreground text-[10px] md:text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-primary-foreground/10",children:[l.jsx(nj,{size:14})," Text"]}),l.jsxs("a",{href:"tel:+16164036393",className:"inline-flex items-center gap-2 px-3 md:px-4 py-2 border border-primary-foreground/30 text-primary-foreground text-[10px] md:text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-primary-foreground/10",children:[l.jsx(kp,{size:14})," Call"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-3 md:px-4 py-2 bg-gold text-primary text-[10px] md:text-[11px] uppercase tracking-[0.2em] font-medium hover:opacity-90",children:[l.jsx(Cl,{size:14})," Book"]})]})]})})}const I2t="modulepreload",P2t=function(e){return"/"+e},GX={},v_=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=P2t(c),c in GX)return;GX[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":I2t,u||(h.as="script"),h.crossOrigin="",h.href=c,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((A,f)=>{h.addEventListener("load",A),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};function Zn(e){"@babel/helpers - typeof";return Zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(e)}var _c=Uint8Array,Lo=Uint16Array,r$=Int32Array,i$=new _c([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s$=new _c([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),YX=new _c([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cye=function(e,t){for(var n=new Lo(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new r$(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},Sye=Cye(i$,2),O2t=Sye.b,mR=Sye.r;O2t[28]=258,mR[258]=28;var F2t=Cye(s$,0),XX=F2t.r,gR=new Lo(32768);for(var Lr=0;Lr<32768;++Lr){var ch=(Lr&43690)>>1|(Lr&21845)<<1;ch=(ch&52428)>>2|(ch&13107)<<2,ch=(ch&61680)>>4|(ch&3855)<<4,gR[Lr]=((ch&65280)>>8|(ch&255)<<8)>>1}var sb=function(e,t,n){for(var r=e.length,i=0,s=new Lo(t);i<r;++i)e[i]&&++s[e[i]-1];var a=new Lo(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new Lo(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],h=a[e[i]-1]++<<d,A=h|(1<<d)-1;h<=A;++h)o[gR[h]>>c]=u}else for(o=new Lo(r),i=0;i<r;++i)e[i]&&(o[i]=gR[a[e[i]-1]++]>>15-e[i]);return o},um=new _c(288);for(var Lr=0;Lr<144;++Lr)um[Lr]=8;for(var Lr=144;Lr<256;++Lr)um[Lr]=9;for(var Lr=256;Lr<280;++Lr)um[Lr]=7;for(var Lr=280;Lr<288;++Lr)um[Lr]=8;var BN=new _c(32);for(var Lr=0;Lr<32;++Lr)BN[Lr]=5;var M2t=sb(um,9,0),L2t=sb(BN,5,0),kye=function(e){return(e+7)/8|0},R2t=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new _c(e.subarray(t,n))},zu=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Qx=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Q4=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return{t:jye,l:0};if(i==1){var a=new _c(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(w,k){return w.f-k.f}),n.push({s:-1,f:25001});var o=n[0],c=n[1],u=0,d=1,h=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};d!=i-1;)o=n[n[u].f<n[h].f?u++:h++],c=n[u!=d&&n[u].f<n[h].f?u++:h++],n[d++]={s:-1,f:o.f+c.f,l:o,r:c};for(var A=s[0].s,r=1;r<i;++r)s[r].s>A&&(A=s[r].s);var f=new Lo(A+1),p=yR(n[d-1],f,0);if(p>t){var r=0,m=0,g=p-t,y=1<<g;for(s.sort(function(k,j){return f[j.s]-f[k.s]||k.f-j.f});r<i;++r){var v=s[r].s;if(f[v]>t)m+=y-(1<<p-f[v]),f[v]=t;else break}for(m>>=g;m>0;){var x=s[r].s;f[x]<t?m-=1<<t-f[x]++-1:++r}for(;r>=0&&m;--r){var b=s[r].s;f[b]==t&&(--f[b],++m)}p=t}return{t:new _c(f),l:p}},yR=function(e,t,n){return e.s==-1?Math.max(yR(e.l,t,n+1),yR(e.r,t,n+1)):t[e.s]=n},JX=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Lo(++t),r=0,i=e[0],s=1,a=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return{c:n.subarray(0,r),n:t}},$x=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},_ye=function(e,t,n){var r=n.length,i=kye(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},ZX=function(e,t,n,r,i,s,a,o,c,u,d){zu(t,d++,n),++i[256];for(var h=Q4(i,15),A=h.t,f=h.l,p=Q4(s,15),m=p.t,g=p.l,y=JX(A),v=y.c,x=y.n,b=JX(m),w=b.c,k=b.n,j=new Lo(19),B=0;B<v.length;++B)++j[v[B]&31];for(var B=0;B<w.length;++B)++j[w[B]&31];for(var E=Q4(j,7),P=E.t,T=E.l,N=19;N>4&&!P[YX[N-1]];--N);var F=u+5<<3,L=$x(i,um)+$x(s,BN)+a,U=$x(i,A)+$x(s,m)+a+14+3*N+$x(j,P)+2*j[16]+3*j[17]+7*j[18];if(c>=0&&F<=L&&F<=U)return _ye(t,d,e.subarray(c,c+u));var H,W,$,z;if(zu(t,d,1+(U<L)),d+=2,U<L){H=sb(A,f,0),W=A,$=sb(m,g,0),z=m;var Q=sb(P,T,0);zu(t,d,x-257),zu(t,d+5,k-1),zu(t,d+10,N-4),d+=14;for(var B=0;B<N;++B)zu(t,d+3*B,P[YX[B]]);d+=3*N;for(var ce=[v,w],R=0;R<2;++R)for(var M=ce[R],B=0;B<M.length;++B){var Y=M[B]&31;zu(t,d,Q[Y]),d+=P[Y],Y>15&&(zu(t,d,M[B]>>5&127),d+=M[B]>>12)}}else H=M2t,W=um,$=L2t,z=BN;for(var B=0;B<o;++B){var X=r[B];if(X>255){var Y=X>>18&31;Qx(t,d,H[Y+257]),d+=W[Y+257],Y>7&&(zu(t,d,X>>23&31),d+=i$[Y]);var V=X&31;Qx(t,d,$[V]),d+=z[V],V>3&&(Qx(t,d,X>>5&8191),d+=s$[V])}else Qx(t,d,H[X]),d+=W[X]}return Qx(t,d,H[256]),d+W[256]},D2t=new r$([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jye=new _c(0),U2t=function(e,t,n,r,i,s){var a=s.z||e.length,o=new _c(r+a+5*(1+Math.ceil(a/7e3))+i),c=o.subarray(r,o.length-i),u=s.l,d=(s.r||0)&7;if(t){d&&(c[0]=s.r>>3);for(var h=D2t[t-1],A=h>>13,f=h&8191,p=(1<<n)-1,m=s.p||new Lo(32768),g=s.h||new Lo(p+1),y=Math.ceil(n/3),v=2*y,x=function(Ie){return(e[Ie]^e[Ie+1]<<y^e[Ie+2]<<v)&p},b=new r$(25e3),w=new Lo(288),k=new Lo(32),j=0,B=0,E=s.i||0,P=0,T=s.w||0,N=0;E+2<a;++E){var F=x(E),L=E&32767,U=g[F];if(m[L]=U,g[F]=L,T<=E){var H=a-E;if((j>7e3||P>24576)&&(H>423||!u)){d=ZX(e,c,0,b,w,k,B,P,N,E-N,d),P=j=B=0,N=E;for(var W=0;W<286;++W)w[W]=0;for(var W=0;W<30;++W)k[W]=0}var $=2,z=0,Q=f,ce=L-U&32767;if(H>2&&F==x(E-ce))for(var R=Math.min(A,H)-1,M=Math.min(32767,E),Y=Math.min(258,H);ce<=M&&--Q&&L!=U;){if(e[E+$]==e[E+$-ce]){for(var X=0;X<Y&&e[E+X]==e[E+X-ce];++X);if(X>$){if($=X,z=ce,X>R)break;for(var V=Math.min(ce,X-2),Z=0,W=0;W<V;++W){var de=E-ce+W&32767,ue=m[de],se=de-ue&32767;se>Z&&(Z=se,U=de)}}}L=U,U=m[L],ce+=L-U&32767}if(z){b[P++]=268435456|mR[$]<<18|XX[z];var he=mR[$]&31,ie=XX[z]&31;B+=i$[he]+s$[ie],++w[257+he],++k[ie],T=E+$,++j}else b[P++]=e[E],++w[e[E]]}}for(E=Math.max(E,T);E<a;++E)b[P++]=e[E],++w[e[E]];d=ZX(e,c,u,b,w,k,B,P,N,E-N,d),u||(s.r=d&7|c[d/8|0]<<3,d-=7,s.h=g,s.p=m,s.i=E,s.w=T)}else{for(var E=s.w||0;E<a+u;E+=65535){var Ce=E+65535;Ce>=a&&(c[d/8|0]=u,Ce=a),d=_ye(c,d+1,e.subarray(E,Ce))}s.i=a}return R2t(o,0,r+kye(d)+i)},Bye=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length|0,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=r+=n[a];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},H2t=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new _c(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return U2t(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Nye=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Q2t=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=Bye();i.p(t.dictionary),Nye(e,2,i.d())}};function vR(e,t){t||(t={});var n=Bye();n.p(e);var r=H2t(e,t,t.dictionary?6:2,4);return Q2t(r,t),Nye(r,r.length-4,n.d()),r}var $2t=typeof TextDecoder<"u"&&new TextDecoder,z2t=0;try{$2t.decode(jye,{stream:!0}),z2t=1}catch{}function V2t(e){if(Array.isArray(e))return e}function K2t(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function eJ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function q2t(e,t){if(e){if(typeof e=="string")return eJ(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eJ(e,t):void 0}}function W2t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tJ(e,t){return V2t(e)||K2t(e,t)||q2t(e,t)||W2t()}function nJ(e,t="utf8"){return new TextDecoder(t).decode(e)}const G2t=new TextEncoder;function Y2t(e){return G2t.encode(e)}const X2t=1024*8,J2t=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),$4={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class a${constructor(t=X2t,n={}){bn(this,"buffer");bn(this,"byteLength");bn(this,"byteOffset");bn(this,"length");bn(this,"offset");bn(this,"lastWrittenByte");bn(this,"littleEndian");bn(this,"_data");bn(this,"_mark");bn(this,"_marks");let r=!1;typeof t=="number"?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);const i=n.offset?n.offset>>>0:0,s=t.byteLength-i;let a=i;(ArrayBuffer.isView(t)||t instanceof a$)&&(t.byteLength!==t.buffer.byteLength&&(a=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=t,this.length=s,this.byteLength=s,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,s),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const r=(this.offset+t)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,n){const r=$4[n].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,s=this.buffer.slice(i,i+r);if(this.littleEndian===J2t&&n!=="uint8"&&n!=="int8"){const o=new Uint8Array(this.buffer.slice(i,i+r));o.reverse();const c=new $4[n](o.buffer);return this.offset+=r,c.reverse(),c}const a=new $4[n](s);return this.offset+=r,a}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let n="";for(let r=0;r<t;r++)n+=this.readChar();return n}readUtf8(t=1){return nJ(this.readBytes(t))}decodeText(t=1,n="utf8"){return nJ(this.readBytes(t),n)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let n=0;n<t.length;n++)this._data.setUint8(this.offset++,t[n]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let n=0;n<t.length;n++)this.writeUint8(t.charCodeAt(n));return this}writeUtf8(t){return this.writeBytes(Y2t(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z2t=4,rJ=0,iJ=1,eCt=2;function F0(e){let t=e.length;for(;--t>=0;)e[t]=0}const tCt=0,Eye=1,nCt=2,rCt=3,iCt=258,o$=29,J2=256,X1=J2+1+o$,My=30,l$=19,Tye=2*X1+1,cp=15,z4=16,sCt=7,c$=256,Iye=16,Pye=17,Oye=18,xR=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),x_=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),aCt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Fye=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oCt=512,ed=new Array((X1+2)*2);F0(ed);const ab=new Array(My*2);F0(ab);const J1=new Array(oCt);F0(J1);const Z1=new Array(iCt-rCt+1);F0(Z1);const u$=new Array(o$);F0(u$);const NN=new Array(My);F0(NN);function V4(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let Mye,Lye,Rye;function K4(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const Dye=e=>e<256?J1[e]:J1[256+(e>>>7)],e2=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},no=(e,t,n)=>{e.bi_valid>z4-n?(e.bi_buf|=t<<e.bi_valid&65535,e2(e,e.bi_buf),e.bi_buf=t>>z4-e.bi_valid,e.bi_valid+=n-z4):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},tu=(e,t,n)=>{no(e,n[t*2],n[t*2+1])},Uye=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},lCt=e=>{e.bi_valid===16?(e2(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},cCt=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,h,A,f,p,m=0;for(A=0;A<=cp;A++)e.bl_count[A]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<Tye;u++)d=e.heap[u],A=n[n[d*2+1]*2+1]+1,A>c&&(A=c,m++),n[d*2+1]=A,!(d>r)&&(e.bl_count[A]++,f=0,d>=o&&(f=a[d-o]),p=n[d*2],e.opt_len+=p*(A+f),s&&(e.static_len+=p*(i[d*2+1]+f)));if(m!==0){do{for(A=c-1;e.bl_count[A]===0;)A--;e.bl_count[A]--,e.bl_count[A+1]+=2,e.bl_count[c]--,m-=2}while(m>0);for(A=c;A!==0;A--)for(d=e.bl_count[A];d!==0;)h=e.heap[--u],!(h>r)&&(n[h*2+1]!==A&&(e.opt_len+=(A-n[h*2+1])*n[h*2],n[h*2+1]=A),d--)}},Hye=(e,t,n)=>{const r=new Array(cp+1);let i=0,s,a;for(s=1;s<=cp;s++)i=i+n[s-1]<<1,r[s]=i;for(a=0;a<=t;a++){let o=e[a*2+1];o!==0&&(e[a*2]=Uye(r[o]++,o))}},uCt=()=>{let e,t,n,r,i;const s=new Array(cp+1);for(n=0,r=0;r<o$-1;r++)for(u$[r]=n,e=0;e<1<<xR[r];e++)Z1[n++]=r;for(Z1[n-1]=r,i=0,r=0;r<16;r++)for(NN[r]=i,e=0;e<1<<x_[r];e++)J1[i++]=r;for(i>>=7;r<My;r++)for(NN[r]=i<<7,e=0;e<1<<x_[r]-7;e++)J1[256+i++]=r;for(t=0;t<=cp;t++)s[t]=0;for(e=0;e<=143;)ed[e*2+1]=8,e++,s[8]++;for(;e<=255;)ed[e*2+1]=9,e++,s[9]++;for(;e<=279;)ed[e*2+1]=7,e++,s[7]++;for(;e<=287;)ed[e*2+1]=8,e++,s[8]++;for(Hye(ed,X1+1,s),e=0;e<My;e++)ab[e*2+1]=5,ab[e*2]=Uye(e,5);Mye=new V4(ed,xR,J2+1,X1,cp),Lye=new V4(ab,x_,0,My,cp),Rye=new V4(new Array(0),aCt,0,l$,sCt)},Qye=e=>{let t;for(t=0;t<X1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<My;t++)e.dyn_dtree[t*2]=0;for(t=0;t<l$;t++)e.bl_tree[t*2]=0;e.dyn_ltree[c$*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},$ye=e=>{e.bi_valid>8?e2(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},sJ=(e,t,n,r)=>{const i=t*2,s=n*2;return e[i]<e[s]||e[i]===e[s]&&r[t]<=r[n]},q4=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&sJ(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!sJ(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},aJ=(e,t,n)=>{let r,i,s=0,a,o;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+s++]&255,r+=(e.pending_buf[e.sym_buf+s++]&255)<<8,i=e.pending_buf[e.sym_buf+s++],r===0?tu(e,i,t):(a=Z1[i],tu(e,a+J2+1,t),o=xR[a],o!==0&&(i-=u$[a],no(e,i,o)),r--,a=Dye(r),tu(e,a,n),o=x_[a],o!==0&&(r-=NN[a],no(e,r,o)));while(s<e.sym_next);tu(e,c$,t)},wR=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,c=-1,u;for(e.heap_len=0,e.heap_max=Tye,a=0;a<s;a++)n[a*2]!==0?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)q4(e,n,a);u=s;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],q4(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,n[u*2]=n[a*2]+n[o*2],e.depth[u]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,n[a*2+1]=n[o*2+1]=u,e.heap[1]=u++,q4(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],cCt(e,t),Hye(n,c,e.bl_count)},oJ=(e,t,n)=>{let r,i=-1,s,a=t[0*2+1],o=0,c=7,u=4;for(a===0&&(c=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)s=a,a=t[(r+1)*2+1],!(++o<c&&s===a)&&(o<u?e.bl_tree[s*2]+=o:s!==0?(s!==i&&e.bl_tree[s*2]++,e.bl_tree[Iye*2]++):o<=10?e.bl_tree[Pye*2]++:e.bl_tree[Oye*2]++,o=0,i=s,a===0?(c=138,u=3):s===a?(c=6,u=3):(c=7,u=4))},lJ=(e,t,n)=>{let r,i=-1,s,a=t[0*2+1],o=0,c=7,u=4;for(a===0&&(c=138,u=3),r=0;r<=n;r++)if(s=a,a=t[(r+1)*2+1],!(++o<c&&s===a)){if(o<u)do tu(e,s,e.bl_tree);while(--o!==0);else s!==0?(s!==i&&(tu(e,s,e.bl_tree),o--),tu(e,Iye,e.bl_tree),no(e,o-3,2)):o<=10?(tu(e,Pye,e.bl_tree),no(e,o-3,3)):(tu(e,Oye,e.bl_tree),no(e,o-11,7));o=0,i=s,a===0?(c=138,u=3):s===a?(c=6,u=3):(c=7,u=4)}},dCt=e=>{let t;for(oJ(e,e.dyn_ltree,e.l_desc.max_code),oJ(e,e.dyn_dtree,e.d_desc.max_code),wR(e,e.bl_desc),t=l$-1;t>=3&&e.bl_tree[Fye[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},hCt=(e,t,n,r)=>{let i;for(no(e,t-257,5),no(e,n-1,5),no(e,r-4,4),i=0;i<r;i++)no(e,e.bl_tree[Fye[i]*2+1],3);lJ(e,e.dyn_ltree,t-1),lJ(e,e.dyn_dtree,n-1)},fCt=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return rJ;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return iJ;for(n=32;n<J2;n++)if(e.dyn_ltree[n*2]!==0)return iJ;return rJ};let cJ=!1;const ACt=e=>{cJ||(uCt(),cJ=!0),e.l_desc=new K4(e.dyn_ltree,Mye),e.d_desc=new K4(e.dyn_dtree,Lye),e.bl_desc=new K4(e.bl_tree,Rye),e.bi_buf=0,e.bi_valid=0,Qye(e)},zye=(e,t,n,r)=>{no(e,(tCt<<1)+(r?1:0),3),$ye(e),e2(e,n),e2(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},pCt=e=>{no(e,Eye<<1,3),tu(e,c$,ed),lCt(e)},mCt=(e,t,n,r)=>{let i,s,a=0;e.level>0?(e.strm.data_type===eCt&&(e.strm.data_type=fCt(e)),wR(e,e.l_desc),wR(e,e.d_desc),a=dCt(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&t!==-1?zye(e,t,n,r):e.strategy===Z2t||s===i?(no(e,(Eye<<1)+(r?1:0),3),aJ(e,ed,ab)):(no(e,(nCt<<1)+(r?1:0),3),hCt(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),aJ(e,e.dyn_ltree,e.dyn_dtree)),Qye(e),r&&$ye(e)},gCt=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Z1[n]+J2+1)*2]++,e.dyn_dtree[Dye(t)*2]++),e.sym_next===e.sym_end);var yCt=ACt,vCt=zye,xCt=mCt,wCt=gCt,bCt=pCt,CCt={_tr_init:yCt,_tr_stored_block:vCt,_tr_flush_block:xCt,_tr_tally:wCt,_tr_align:bCt};const SCt=(e,t,n,r)=>{let i=e&65535|0,s=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do i=i+t[r++]|0,s=s+i|0;while(--a);i%=65521,s%=65521}return i|s<<16|0};var t2=SCt;const kCt=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},_Ct=new Uint32Array(kCt()),jCt=(e,t,n,r)=>{const i=_Ct,s=r+n;e^=-1;for(let a=r;a<s;a++)e=e>>>8^i[(e^t[a])&255];return e^-1};var is=jCt,Kv={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Z2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:BCt,_tr_stored_block:bR,_tr_flush_block:NCt,_tr_tally:bf,_tr_align:ECt}=CCt,{Z_NO_FLUSH:Cf,Z_PARTIAL_FLUSH:TCt,Z_FULL_FLUSH:ICt,Z_FINISH:ml,Z_BLOCK:uJ,Z_OK:ks,Z_STREAM_END:dJ,Z_STREAM_ERROR:fu,Z_DATA_ERROR:PCt,Z_BUF_ERROR:W4,Z_DEFAULT_COMPRESSION:OCt,Z_FILTERED:FCt,Z_HUFFMAN_ONLY:rk,Z_RLE:MCt,Z_FIXED:LCt,Z_DEFAULT_STRATEGY:RCt,Z_UNKNOWN:DCt,Z_DEFLATED:dT}=Z2,UCt=9,HCt=15,QCt=8,$Ct=29,zCt=256,CR=zCt+1+$Ct,VCt=30,KCt=19,qCt=2*CR+1,WCt=15,En=3,Xh=258,Au=Xh+En+1,GCt=32,qv=42,d$=57,SR=69,kR=73,_R=91,jR=103,up=113,dw=666,Ba=1,M0=2,dm=3,L0=4,YCt=3,dp=(e,t)=>(e.msg=Kv[t],t),hJ=e=>e*2-(e>4?9:0),Th=e=>{let t=e.length;for(;--t>=0;)e[t]=0},XCt=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let JCt=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Sf=JCt;const Bo=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Ro=(e,t)=>{NCt(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bo(e.strm)},Hn=(e,t)=>{e.pending_buf[e.pending++]=t},zx=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},BR=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=t2(e.adler,t,i,n):e.state.wrap===2&&(e.adler=is(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Vye=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,s,a=e.prev_length,o=e.nice_match;const c=e.strstart>e.w_size-Au?e.strstart-(e.w_size-Au):0,u=e.window,d=e.w_mask,h=e.prev,A=e.strstart+Xh;let f=u[r+a-1],p=u[r+a];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(u[i+a]!==p||u[i+a-1]!==f||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<A);if(s=Xh-(A-r),r=A-Xh,s>a){if(e.match_start=t,a=s,s>=o)break;f=u[r+a-1],p=u[r+a]}}while((t=h[t&d])>c&&--n!==0);return a<=e.lookahead?a:e.lookahead},Wv=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Au)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),XCt(e),r+=t),e.strm.avail_in===0)break;if(n=BR(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=En)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Sf(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Sf(e,e.ins_h,e.window[i+En-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<En)););}while(e.lookahead<Au&&e.strm.avail_in!==0)},Kye=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,s,a=0,o=e.strm.avail_in;do{if(r=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s||(s=e.strm.avail_out-s,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>s&&(r=s),r<n&&(r===0&&t!==ml||t===Cf||r!==i+e.strm.avail_in)))break;a=t===ml&&r===i+e.strm.avail_in?1:0,bR(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Bo(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(BR(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?L0:t!==Cf&&t!==ml&&e.strm.avail_in===0&&e.strstart===e.block_start?M0:(s=e.window_size-e.strstart,e.strm.avail_in>s&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(BR(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,n=s>e.w_size?e.w_size:s,i=e.strstart-e.block_start,(i>=n||(i||t===ml)&&t!==Cf&&e.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,a=t===ml&&e.strm.avail_in===0&&r===i?1:0,bR(e,e.block_start,r,a),e.block_start+=r,Bo(e.strm)),a?dm:Ba)},G4=(e,t)=>{let n,r;for(;;){if(e.lookahead<Au){if(Wv(e),e.lookahead<Au&&t===Cf)return Ba;if(e.lookahead===0)break}if(n=0,e.lookahead>=En&&(e.ins_h=Sf(e,e.ins_h,e.window[e.strstart+En-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Au&&(e.match_length=Vye(e,n)),e.match_length>=En)if(r=bf(e,e.strstart-e.match_start,e.match_length-En),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=En){e.match_length--;do e.strstart++,e.ins_h=Sf(e,e.ins_h,e.window[e.strstart+En-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Sf(e,e.ins_h,e.window[e.strstart+1]);else r=bf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Ro(e,!1),e.strm.avail_out===0))return Ba}return e.insert=e.strstart<En-1?e.strstart:En-1,t===ml?(Ro(e,!0),e.strm.avail_out===0?dm:L0):e.sym_next&&(Ro(e,!1),e.strm.avail_out===0)?Ba:M0},wg=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Au){if(Wv(e),e.lookahead<Au&&t===Cf)return Ba;if(e.lookahead===0)break}if(n=0,e.lookahead>=En&&(e.ins_h=Sf(e,e.ins_h,e.window[e.strstart+En-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=En-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Au&&(e.match_length=Vye(e,n),e.match_length<=5&&(e.strategy===FCt||e.match_length===En&&e.strstart-e.match_start>4096)&&(e.match_length=En-1)),e.prev_length>=En&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-En,r=bf(e,e.strstart-1-e.prev_match,e.prev_length-En),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Sf(e,e.ins_h,e.window[e.strstart+En-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=En-1,e.strstart++,r&&(Ro(e,!1),e.strm.avail_out===0))return Ba}else if(e.match_available){if(r=bf(e,0,e.window[e.strstart-1]),r&&Ro(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Ba}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=bf(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<En-1?e.strstart:En-1,t===ml?(Ro(e,!0),e.strm.avail_out===0?dm:L0):e.sym_next&&(Ro(e,!1),e.strm.avail_out===0)?Ba:M0},ZCt=(e,t)=>{let n,r,i,s;const a=e.window;for(;;){if(e.lookahead<=Xh){if(Wv(e),e.lookahead<=Xh&&t===Cf)return Ba;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=En&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){s=e.strstart+Xh;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<s);e.match_length=Xh-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=En?(n=bf(e,1,e.match_length-En),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=bf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Ro(e,!1),e.strm.avail_out===0))return Ba}return e.insert=0,t===ml?(Ro(e,!0),e.strm.avail_out===0?dm:L0):e.sym_next&&(Ro(e,!1),e.strm.avail_out===0)?Ba:M0},eSt=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Wv(e),e.lookahead===0)){if(t===Cf)return Ba;break}if(e.match_length=0,n=bf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Ro(e,!1),e.strm.avail_out===0))return Ba}return e.insert=0,t===ml?(Ro(e,!0),e.strm.avail_out===0?dm:L0):e.sym_next&&(Ro(e,!1),e.strm.avail_out===0)?Ba:M0};function $c(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const hw=[new $c(0,0,0,0,Kye),new $c(4,4,8,4,G4),new $c(4,5,16,8,G4),new $c(4,6,32,32,G4),new $c(4,4,16,16,wg),new $c(8,16,32,32,wg),new $c(8,16,128,128,wg),new $c(8,32,128,256,wg),new $c(32,128,258,1024,wg),new $c(32,258,258,4096,wg)],tSt=e=>{e.window_size=2*e.w_size,Th(e.head),e.max_lazy_match=hw[e.level].max_lazy,e.good_match=hw[e.level].good_length,e.nice_match=hw[e.level].nice_length,e.max_chain_length=hw[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=En-1,e.match_available=0,e.ins_h=0};function nSt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=dT,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(qCt*2),this.dyn_dtree=new Uint16Array((2*VCt+1)*2),this.bl_tree=new Uint16Array((2*KCt+1)*2),Th(this.dyn_ltree),Th(this.dyn_dtree),Th(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(WCt+1),this.heap=new Uint16Array(2*CR+1),Th(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*CR+1),Th(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const eC=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==qv&&t.status!==d$&&t.status!==SR&&t.status!==kR&&t.status!==_R&&t.status!==jR&&t.status!==up&&t.status!==dw?1:0},qye=e=>{if(eC(e))return dp(e,fu);e.total_in=e.total_out=0,e.data_type=DCt;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?d$:t.wrap?qv:up,e.adler=t.wrap===2?0:1,t.last_flush=-2,BCt(t),ks},Wye=e=>{const t=qye(e);return t===ks&&tSt(e.state),t},rSt=(e,t)=>eC(e)||e.state.wrap!==2?fu:(e.state.gzhead=t,ks),Gye=(e,t,n,r,i,s)=>{if(!e)return fu;let a=1;if(t===OCt&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>UCt||n!==dT||r<8||r>15||t<0||t>9||s<0||s>LCt||r===8&&a!==1)return dp(e,fu);r===8&&(r=9);const o=new nSt;return e.state=o,o.strm=e,o.status=qv,o.wrap=a,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+En-1)/En),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=t,o.strategy=s,o.method=n,Wye(e)},iSt=(e,t)=>Gye(e,t,dT,HCt,QCt,RCt),sSt=(e,t)=>{if(eC(e)||t>uJ||t<0)return e?dp(e,fu):fu;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===dw&&t!==ml)return dp(e,e.avail_out===0?W4:fu);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Bo(e),e.avail_out===0)return n.last_flush=-1,ks}else if(e.avail_in===0&&hJ(t)<=hJ(r)&&t!==ml)return dp(e,W4);if(n.status===dw&&e.avail_in!==0)return dp(e,W4);if(n.status===qv&&n.wrap===0&&(n.status=up),n.status===qv){let i=dT+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=rk||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=GCt),i+=31-i%31,zx(n,i),n.strstart!==0&&(zx(n,e.adler>>>16),zx(n,e.adler&65535)),e.adler=1,n.status=up,Bo(e),n.pending!==0)return n.last_flush=-1,ks}if(n.status===d$){if(e.adler=0,Hn(n,31),Hn(n,139),Hn(n,8),n.gzhead)Hn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Hn(n,n.gzhead.time&255),Hn(n,n.gzhead.time>>8&255),Hn(n,n.gzhead.time>>16&255),Hn(n,n.gzhead.time>>24&255),Hn(n,n.level===9?2:n.strategy>=rk||n.level<2?4:0),Hn(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Hn(n,n.gzhead.extra.length&255),Hn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=is(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=SR;else if(Hn(n,0),Hn(n,0),Hn(n,0),Hn(n,0),Hn(n,0),Hn(n,n.level===9?2:n.strategy>=rk||n.level<2?4:0),Hn(n,YCt),n.status=up,Bo(e),n.pending!==0)return n.last_flush=-1,ks}if(n.status===SR){if(n.gzhead.extra){let i=n.pending,s=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=is(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=o,Bo(e),n.pending!==0)return n.last_flush=-1,ks;i=0,s-=o}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>i&&(e.adler=is(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=kR}if(n.status===kR){if(n.gzhead.name){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=is(e.adler,n.pending_buf,n.pending-i,i)),Bo(e),n.pending!==0)return n.last_flush=-1,ks;i=0}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,Hn(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=is(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=_R}if(n.status===_R){if(n.gzhead.comment){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=is(e.adler,n.pending_buf,n.pending-i,i)),Bo(e),n.pending!==0)return n.last_flush=-1,ks;i=0}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,Hn(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=is(e.adler,n.pending_buf,n.pending-i,i))}n.status=jR}if(n.status===jR){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Bo(e),n.pending!==0))return n.last_flush=-1,ks;Hn(n,e.adler&255),Hn(n,e.adler>>8&255),e.adler=0}if(n.status=up,Bo(e),n.pending!==0)return n.last_flush=-1,ks}if(e.avail_in!==0||n.lookahead!==0||t!==Cf&&n.status!==dw){let i=n.level===0?Kye(n,t):n.strategy===rk?eSt(n,t):n.strategy===MCt?ZCt(n,t):hw[n.level].func(n,t);if((i===dm||i===L0)&&(n.status=dw),i===Ba||i===dm)return e.avail_out===0&&(n.last_flush=-1),ks;if(i===M0&&(t===TCt?ECt(n):t!==uJ&&(bR(n,0,0,!1),t===ICt&&(Th(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Bo(e),e.avail_out===0))return n.last_flush=-1,ks}return t!==ml?ks:n.wrap<=0?dJ:(n.wrap===2?(Hn(n,e.adler&255),Hn(n,e.adler>>8&255),Hn(n,e.adler>>16&255),Hn(n,e.adler>>24&255),Hn(n,e.total_in&255),Hn(n,e.total_in>>8&255),Hn(n,e.total_in>>16&255),Hn(n,e.total_in>>24&255)):(zx(n,e.adler>>>16),zx(n,e.adler&65535)),Bo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ks:dJ)},aSt=e=>{if(eC(e))return fu;const t=e.state.status;return e.state=null,t===up?dp(e,PCt):ks},oSt=(e,t)=>{let n=t.length;if(eC(e))return fu;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==qv||r.lookahead)return fu;if(i===1&&(e.adler=t2(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Th(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const s=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Wv(r);r.lookahead>=En;){let c=r.strstart,u=r.lookahead-(En-1);do r.ins_h=Sf(r,r.ins_h,r.window[c+En-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--u);r.strstart=c,r.lookahead=En-1,Wv(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=En-1,r.match_available=0,e.next_in=a,e.input=o,e.avail_in=s,r.wrap=i,ks};var lSt=iSt,cSt=Gye,uSt=Wye,dSt=qye,hSt=rSt,fSt=sSt,ASt=aSt,pSt=oSt,mSt="pako deflate (from Nodeca project)",ob={deflateInit:lSt,deflateInit2:cSt,deflateReset:uSt,deflateResetKeep:dSt,deflateSetHeader:hSt,deflate:fSt,deflateEnd:ASt,deflateSetDictionary:pSt,deflateInfo:mSt};const gSt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ySt=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)gSt(n,r)&&(e[r]=n[r])}}return e},vSt=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,s=e.length;r<s;r++){let a=e[r];n.set(a,i),i+=a.length}return n},hT={assign:ySt,flattenChunks:vSt};let Yye=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Yye=!1}const n2=new Uint8Array(256);for(let e=0;e<256;e++)n2[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;n2[254]=n2[254]=1;var xSt=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,s,a=e.length,o=0;for(i=0;i<a;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(o),s=0,i=0;s<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[s++]=n:n<2048?(t[s++]=192|n>>>6,t[s++]=128|n&63):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|n&63):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|n&63);return t};const wSt=(e,t)=>{if(t<65534&&e.subarray&&Yye)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var bSt=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const s=new Array(n*2);for(i=0,r=0;r<n;){let a=e[r++];if(a<128){s[i++]=a;continue}let o=n2[a];if(o>4){s[i++]=65533,r+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&r<n;)a=a<<6|e[r++]&63,o--;if(o>1){s[i++]=65533;continue}a<65536?s[i++]=a:(a-=65536,s[i++]=55296|a>>10&1023,s[i++]=56320|a&1023)}return wSt(s,i)},CSt=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+n2[e[n]]>t?n:t},r2={string2buf:xSt,buf2string:bSt,utf8border:CSt};function SSt(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Xye=SSt;const Jye=Object.prototype.toString,{Z_NO_FLUSH:kSt,Z_SYNC_FLUSH:_St,Z_FULL_FLUSH:jSt,Z_FINISH:BSt,Z_OK:EN,Z_STREAM_END:NSt,Z_DEFAULT_COMPRESSION:ESt,Z_DEFAULT_STRATEGY:TSt,Z_DEFLATED:ISt}=Z2;function h$(e){this.options=hT.assign({level:ESt,method:ISt,chunkSize:16384,windowBits:15,memLevel:8,strategy:TSt},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xye,this.strm.avail_out=0;let n=ob.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==EN)throw new Error(Kv[n]);if(t.header&&ob.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=r2.string2buf(t.dictionary):Jye.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=ob.deflateSetDictionary(this.strm,r),n!==EN)throw new Error(Kv[n]);this._dict_set=!0}}h$.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?BSt:kSt,typeof e=="string"?n.input=r2.string2buf(e):Jye.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===_St||s===jSt)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=ob.deflate(n,s),i===NSt)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=ob.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===EN;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};h$.prototype.onData=function(e){this.chunks.push(e)};h$.prototype.onEnd=function(e){e===EN&&(this.result=hT.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const ik=16209,PSt=16191;var OSt=function(t,n){let r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,b,w,k,j,B,E,P;const T=t.state;r=t.next_in,E=t.input,i=r+(t.avail_in-5),s=t.next_out,P=t.output,a=s-(n-t.avail_out),o=s+(t.avail_out-257),c=T.dmax,u=T.wsize,d=T.whave,h=T.wnext,A=T.window,f=T.hold,p=T.bits,m=T.lencode,g=T.distcode,y=(1<<T.lenbits)-1,v=(1<<T.distbits)-1;e:do{p<15&&(f+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),x=m[f&y];t:for(;;){if(b=x>>>24,f>>>=b,p-=b,b=x>>>16&255,b===0)P[s++]=x&65535;else if(b&16){w=x&65535,b&=15,b&&(p<b&&(f+=E[r++]<<p,p+=8),w+=f&(1<<b)-1,f>>>=b,p-=b),p<15&&(f+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),x=g[f&v];n:for(;;){if(b=x>>>24,f>>>=b,p-=b,b=x>>>16&255,b&16){if(k=x&65535,b&=15,p<b&&(f+=E[r++]<<p,p+=8,p<b&&(f+=E[r++]<<p,p+=8)),k+=f&(1<<b)-1,k>c){t.msg="invalid distance too far back",T.mode=ik;break e}if(f>>>=b,p-=b,b=s-a,k>b){if(b=k-b,b>d&&T.sane){t.msg="invalid distance too far back",T.mode=ik;break e}if(j=0,B=A,h===0){if(j+=u-b,b<w){w-=b;do P[s++]=A[j++];while(--b);j=s-k,B=P}}else if(h<b){if(j+=u+h-b,b-=h,b<w){w-=b;do P[s++]=A[j++];while(--b);if(j=0,h<w){b=h,w-=b;do P[s++]=A[j++];while(--b);j=s-k,B=P}}}else if(j+=h-b,b<w){w-=b;do P[s++]=A[j++];while(--b);j=s-k,B=P}for(;w>2;)P[s++]=B[j++],P[s++]=B[j++],P[s++]=B[j++],w-=3;w&&(P[s++]=B[j++],w>1&&(P[s++]=B[j++]))}else{j=s-k;do P[s++]=P[j++],P[s++]=P[j++],P[s++]=P[j++],w-=3;while(w>2);w&&(P[s++]=P[j++],w>1&&(P[s++]=P[j++]))}}else if(b&64){t.msg="invalid distance code",T.mode=ik;break e}else{x=g[(x&65535)+(f&(1<<b)-1)];continue n}break}}else if(b&64)if(b&32){T.mode=PSt;break e}else{t.msg="invalid literal/length code",T.mode=ik;break e}else{x=m[(x&65535)+(f&(1<<b)-1)];continue t}break}}while(r<i&&s<o);w=p>>3,r-=w,p-=w<<3,f&=(1<<p)-1,t.next_in=r,t.next_out=s,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=s<o?257+(o-s):257-(s-o),T.hold=f,T.bits=p};const bg=15,fJ=852,AJ=592,pJ=0,Y4=1,mJ=2,FSt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),MSt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),LSt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),RSt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),DSt=(e,t,n,r,i,s,a,o)=>{const c=o.bits;let u=0,d=0,h=0,A=0,f=0,p=0,m=0,g=0,y=0,v=0,x,b,w,k,j,B=null,E;const P=new Uint16Array(bg+1),T=new Uint16Array(bg+1);let N=null,F,L,U;for(u=0;u<=bg;u++)P[u]=0;for(d=0;d<r;d++)P[t[n+d]]++;for(f=c,A=bg;A>=1&&P[A]===0;A--);if(f>A&&(f=A),A===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,o.bits=1,0;for(h=1;h<A&&P[h]===0;h++);for(f<h&&(f=h),g=1,u=1;u<=bg;u++)if(g<<=1,g-=P[u],g<0)return-1;if(g>0&&(e===pJ||A!==1))return-1;for(T[1]=0,u=1;u<bg;u++)T[u+1]=T[u]+P[u];for(d=0;d<r;d++)t[n+d]!==0&&(a[T[t[n+d]]++]=d);if(e===pJ?(B=N=a,E=20):e===Y4?(B=FSt,N=MSt,E=257):(B=LSt,N=RSt,E=0),v=0,d=0,u=h,j=s,p=f,m=0,w=-1,y=1<<f,k=y-1,e===Y4&&y>fJ||e===mJ&&y>AJ)return 1;for(;;){F=u-m,a[d]+1<E?(L=0,U=a[d]):a[d]>=E?(L=N[a[d]-E],U=B[a[d]-E]):(L=96,U=0),x=1<<u-m,b=1<<p,h=b;do b-=x,i[j+(v>>m)+b]=F<<24|L<<16|U|0;while(b!==0);for(x=1<<u-1;v&x;)x>>=1;if(x!==0?(v&=x-1,v+=x):v=0,d++,--P[u]===0){if(u===A)break;u=t[n+a[d]]}if(u>f&&(v&k)!==w){for(m===0&&(m=f),j+=h,p=u-m,g=1<<p;p+m<A&&(g-=P[p+m],!(g<=0));)p++,g<<=1;if(y+=1<<p,e===Y4&&y>fJ||e===mJ&&y>AJ)return 1;w=v&k,i[w]=f<<24|p<<16|j-s|0}}return v!==0&&(i[j+v]=u-m<<24|64<<16|0),o.bits=f,0};var lb=DSt;const USt=0,Zye=1,eve=2,{Z_FINISH:gJ,Z_BLOCK:HSt,Z_TREES:sk,Z_OK:hm,Z_STREAM_END:QSt,Z_NEED_DICT:$St,Z_STREAM_ERROR:Ml,Z_DATA_ERROR:tve,Z_MEM_ERROR:nve,Z_BUF_ERROR:zSt,Z_DEFLATED:yJ}=Z2,fT=16180,vJ=16181,xJ=16182,wJ=16183,bJ=16184,CJ=16185,SJ=16186,kJ=16187,_J=16188,jJ=16189,TN=16190,Vu=16191,X4=16192,BJ=16193,J4=16194,NJ=16195,EJ=16196,TJ=16197,IJ=16198,ak=16199,ok=16200,PJ=16201,OJ=16202,FJ=16203,MJ=16204,LJ=16205,Z4=16206,RJ=16207,DJ=16208,Hr=16209,rve=16210,ive=16211,VSt=852,KSt=592,qSt=15,WSt=qSt,UJ=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function GSt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Nm=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<fT||t.mode>ive?1:0},sve=e=>{if(Nm(e))return Ml;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=fT,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(VSt),t.distcode=t.distdyn=new Int32Array(KSt),t.sane=1,t.back=-1,hm},ave=e=>{if(Nm(e))return Ml;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,sve(e)},ove=(e,t)=>{let n;if(Nm(e))return Ml;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Ml:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ave(e))},lve=(e,t)=>{if(!e)return Ml;const n=new GSt;e.state=n,n.strm=e,n.window=null,n.mode=fT;const r=ove(e,t);return r!==hm&&(e.state=null),r},YSt=e=>lve(e,WSt);let HJ=!0,eO,tO;const XSt=e=>{if(HJ){eO=new Int32Array(512),tO=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(lb(Zye,e.lens,0,288,eO,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;lb(eve,e.lens,0,32,tO,0,e.work,{bits:5}),HJ=!1}e.lencode=eO,e.lenbits=9,e.distcode=tO,e.distbits=5},cve=(e,t,n,r)=>{let i;const s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(t.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(t.subarray(n-r,n-r+i),s.wnext),r-=i,r?(s.window.set(t.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},JSt=(e,t)=>{let n,r,i,s,a,o,c,u,d,h,A,f,p,m,g=0,y,v,x,b,w,k,j,B;const E=new Uint8Array(4);let P,T;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Nm(e)||!e.output||!e.input&&e.avail_in!==0)return Ml;n=e.state,n.mode===Vu&&(n.mode=X4),a=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,d=n.bits,h=o,A=c,B=hm;e:for(;;)switch(n.mode){case fT:if(n.wrap===0){n.mode=X4;break}for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,E[0]=u&255,E[1]=u>>>8&255,n.check=is(n.check,E,2,0),u=0,d=0,n.mode=vJ;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Hr;break}if((u&15)!==yJ){e.msg="unknown compression method",n.mode=Hr;break}if(u>>>=4,d-=4,j=(u&15)+8,n.wbits===0&&(n.wbits=j),j>15||j>n.wbits){e.msg="invalid window size",n.mode=Hr;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?jJ:Vu,u=0,d=0;break;case vJ:for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==yJ){e.msg="unknown compression method",n.mode=Hr;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Hr;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,n.check=is(n.check,E,2,0)),u=0,d=0,n.mode=xJ;case xJ:for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,n.check=is(n.check,E,4,0)),u=0,d=0,n.mode=wJ;case wJ:for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,n.check=is(n.check,E,2,0)),u=0,d=0,n.mode=bJ;case bJ:if(n.flags&1024){for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,n.check=is(n.check,E,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=CJ;case CJ:if(n.flags&1024&&(f=n.length,f>o&&(f=o),f&&(n.head&&(j=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+f),j)),n.flags&512&&n.wrap&4&&(n.check=is(n.check,r,f,s)),o-=f,s+=f,n.length-=f),n.length))break e;n.length=0,n.mode=SJ;case SJ:if(n.flags&2048){if(o===0)break e;f=0;do j=r[s+f++],n.head&&j&&n.length<65536&&(n.head.name+=String.fromCharCode(j));while(j&&f<o);if(n.flags&512&&n.wrap&4&&(n.check=is(n.check,r,f,s)),o-=f,s+=f,j)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=kJ;case kJ:if(n.flags&4096){if(o===0)break e;f=0;do j=r[s+f++],n.head&&j&&n.length<65536&&(n.head.comment+=String.fromCharCode(j));while(j&&f<o);if(n.flags&512&&n.wrap&4&&(n.check=is(n.check,r,f,s)),o-=f,s+=f,j)break e}else n.head&&(n.head.comment=null);n.mode=_J;case _J:if(n.flags&512){for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&4&&u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Hr;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Vu;break;case jJ:for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}e.adler=n.check=UJ(u),u=0,d=0,n.mode=TN;case TN:if(n.havedict===0)return e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,$St;e.adler=n.check=1,n.mode=Vu;case Vu:if(t===HSt||t===sk)break e;case X4:if(n.last){u>>>=d&7,d-=d&7,n.mode=Z4;break}for(;d<3;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}switch(n.last=u&1,u>>>=1,d-=1,u&3){case 0:n.mode=BJ;break;case 1:if(XSt(n),n.mode=ak,t===sk){u>>>=2,d-=2;break e}break;case 2:n.mode=EJ;break;case 3:e.msg="invalid block type",n.mode=Hr}u>>>=2,d-=2;break;case BJ:for(u>>>=d&7,d-=d&7;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Hr;break}if(n.length=u&65535,u=0,d=0,n.mode=J4,t===sk)break e;case J4:n.mode=NJ;case NJ:if(f=n.length,f){if(f>o&&(f=o),f>c&&(f=c),f===0)break e;i.set(r.subarray(s,s+f),a),o-=f,s+=f,c-=f,a+=f,n.length-=f;break}n.mode=Vu;break;case EJ:for(;d<14;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.nlen=(u&31)+257,u>>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Hr;break}n.have=0,n.mode=TJ;case TJ:for(;n.have<n.ncode;){for(;d<3;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.lens[N[n.have++]]=u&7,u>>>=3,d-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},B=lb(USt,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,B){e.msg="invalid code lengths set",n.mode=Hr;break}n.have=0,n.mode=IJ;case IJ:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[u&(1<<n.lenbits)-1],y=g>>>24,v=g>>>16&255,x=g&65535,!(y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(x<16)u>>>=y,d-=y,n.lens[n.have++]=x;else{if(x===16){for(T=y+2;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(u>>>=y,d-=y,n.have===0){e.msg="invalid bit length repeat",n.mode=Hr;break}j=n.lens[n.have-1],f=3+(u&3),u>>>=2,d-=2}else if(x===17){for(T=y+3;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=y,d-=y,j=0,f=3+(u&7),u>>>=3,d-=3}else{for(T=y+7;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=y,d-=y,j=0,f=11+(u&127),u>>>=7,d-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Hr;break}for(;f--;)n.lens[n.have++]=j}}if(n.mode===Hr)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Hr;break}if(n.lenbits=9,P={bits:n.lenbits},B=lb(Zye,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,B){e.msg="invalid literal/lengths set",n.mode=Hr;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},B=lb(eve,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,B){e.msg="invalid distances set",n.mode=Hr;break}if(n.mode=ak,t===sk)break e;case ak:n.mode=ok;case ok:if(o>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,OSt(e,A),a=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,d=n.bits,n.mode===Vu&&(n.back=-1);break}for(n.back=0;g=n.lencode[u&(1<<n.lenbits)-1],y=g>>>24,v=g>>>16&255,x=g&65535,!(y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(v&&!(v&240)){for(b=y,w=v,k=x;g=n.lencode[k+((u&(1<<b+w)-1)>>b)],y=g>>>24,v=g>>>16&255,x=g&65535,!(b+y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=b,d-=b,n.back+=b}if(u>>>=y,d-=y,n.back+=y,n.length=x,v===0){n.mode=LJ;break}if(v&32){n.back=-1,n.mode=Vu;break}if(v&64){e.msg="invalid literal/length code",n.mode=Hr;break}n.extra=v&15,n.mode=PJ;case PJ:if(n.extra){for(T=n.extra;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=OJ;case OJ:for(;g=n.distcode[u&(1<<n.distbits)-1],y=g>>>24,v=g>>>16&255,x=g&65535,!(y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(!(v&240)){for(b=y,w=v,k=x;g=n.distcode[k+((u&(1<<b+w)-1)>>b)],y=g>>>24,v=g>>>16&255,x=g&65535,!(b+y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=b,d-=b,n.back+=b}if(u>>>=y,d-=y,n.back+=y,v&64){e.msg="invalid distance code",n.mode=Hr;break}n.offset=x,n.extra=v&15,n.mode=FJ;case FJ:if(n.extra){for(T=n.extra;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Hr;break}n.mode=MJ;case MJ:if(c===0)break e;if(f=A-c,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Hr;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),m=n.window}else m=i,p=a-n.offset,f=n.length;f>c&&(f=c),c-=f,n.length-=f;do i[a++]=m[p++];while(--f);n.length===0&&(n.mode=ok);break;case LJ:if(c===0)break e;i[a++]=n.length,c--,n.mode=ok;break;case Z4:if(n.wrap){for(;d<32;){if(o===0)break e;o--,u|=r[s++]<<d,d+=8}if(A-=c,e.total_out+=A,n.total+=A,n.wrap&4&&A&&(e.adler=n.check=n.flags?is(n.check,i,A,a-A):t2(n.check,i,A,a-A)),A=c,n.wrap&4&&(n.flags?u:UJ(u))!==n.check){e.msg="incorrect data check",n.mode=Hr;break}u=0,d=0}n.mode=RJ;case RJ:if(n.wrap&&n.flags){for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&4&&u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Hr;break}u=0,d=0}n.mode=DJ;case DJ:B=QSt;break e;case Hr:B=tve;break e;case rve:return nve;case ive:default:return Ml}return e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,(n.wsize||A!==e.avail_out&&n.mode<Hr&&(n.mode<Z4||t!==gJ))&&cve(e,e.output,e.next_out,A-e.avail_out),h-=e.avail_in,A-=e.avail_out,e.total_in+=h,e.total_out+=A,n.total+=A,n.wrap&4&&A&&(e.adler=n.check=n.flags?is(n.check,i,A,e.next_out-A):t2(n.check,i,A,e.next_out-A)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Vu?128:0)+(n.mode===ak||n.mode===J4?256:0),(h===0&&A===0||t===gJ)&&B===hm&&(B=zSt),B},ZSt=e=>{if(Nm(e))return Ml;let t=e.state;return t.window&&(t.window=null),e.state=null,hm},ekt=(e,t)=>{if(Nm(e))return Ml;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,hm):Ml},tkt=(e,t)=>{const n=t.length;let r,i,s;return Nm(e)||(r=e.state,r.wrap!==0&&r.mode!==TN)?Ml:r.mode===TN&&(i=1,i=t2(i,t,n,0),i!==r.check)?tve:(s=cve(e,t,n,n),s?(r.mode=rve,nve):(r.havedict=1,hm))};var nkt=ave,rkt=ove,ikt=sve,skt=YSt,akt=lve,okt=JSt,lkt=ZSt,ckt=ekt,ukt=tkt,dkt="pako inflate (from Nodeca project)",td={inflateReset:nkt,inflateReset2:rkt,inflateResetKeep:ikt,inflateInit:skt,inflateInit2:akt,inflate:okt,inflateEnd:lkt,inflateGetHeader:ckt,inflateSetDictionary:ukt,inflateInfo:dkt};function hkt(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var fkt=hkt;const uve=Object.prototype.toString,{Z_NO_FLUSH:Akt,Z_FINISH:pkt,Z_OK:i2,Z_STREAM_END:nO,Z_NEED_DICT:rO,Z_STREAM_ERROR:mkt,Z_DATA_ERROR:QJ,Z_MEM_ERROR:gkt}=Z2;function tC(e){this.options=hT.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Xye,this.strm.avail_out=0;let n=td.inflateInit2(this.strm,t.windowBits);if(n!==i2)throw new Error(Kv[n]);if(this.header=new fkt,td.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=r2.string2buf(t.dictionary):uve.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=td.inflateSetDictionary(this.strm,t.dictionary),n!==i2)))throw new Error(Kv[n])}tC.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?pkt:Akt,uve.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=td.inflate(n,a),s===rO&&i&&(s=td.inflateSetDictionary(n,i),s===i2?s=td.inflate(n,a):s===QJ&&(s=rO));n.avail_in>0&&s===nO&&n.state.wrap>0&&e[n.next_in]!==0;)td.inflateReset(n),s=td.inflate(n,a);switch(s){case mkt:case QJ:case rO:case gkt:return this.onEnd(s),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||s===nO))if(this.options.to==="string"){let c=r2.utf8border(n.output,n.next_out),u=n.next_out-c,d=r2.buf2string(n.output,c);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(c,c+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===i2&&o===0)){if(s===nO)return s=td.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};tC.prototype.onData=function(e){this.chunks.push(e)};tC.prototype.onEnd=function(e){e===i2&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=hT.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function f$(e,t){const n=new tC(t);if(n.push(e),n.err)throw n.msg||Kv[n.err];return n.result}function ykt(e,t){return t=t||{},t.raw=!0,f$(e,t)}var vkt=tC,xkt=f$,wkt=ykt,bkt=f$,Ckt=Z2,Skt={Inflate:vkt,inflate:xkt,inflateRaw:wkt,ungzip:bkt,constants:Ckt};const{Inflate:kkt,inflate:_kt,inflateRaw:KTt,ungzip:qTt}=Skt;var $J=kkt,jkt=_kt;const dve=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;dve[e]=t}const zJ=4294967295;function Bkt(e,t,n){let r=e;for(let i=0;i<n;i++)r=dve[(r^t[i])&255]^r>>>8;return r}function Nkt(e,t){return(Bkt(zJ,e,t)^zJ)>>>0}function VJ(e,t,n){const r=e.readUint32(),i=Nkt(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function hve(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function fve(e,t,n,r){let i=0;for(;i<r;i++)t[i]=e[i];for(;i<n;i++)t[i]=e[i]+t[i-r]&255}function Ave(e,t,n,r){let i=0;if(n.length===0)for(;i<r;i++)t[i]=e[i];else for(;i<r;i++)t[i]=e[i]+n[i]&255}function pve(e,t,n,r,i){let s=0;if(n.length===0){for(;s<i;s++)t[s]=e[s];for(;s<r;s++)t[s]=e[s]+(t[s-i]>>1)&255}else{for(;s<i;s++)t[s]=e[s]+(n[s]>>1)&255;for(;s<r;s++)t[s]=e[s]+(t[s-i]+n[s]>>1)&255}}function mve(e,t,n,r,i){let s=0;if(n.length===0){for(;s<i;s++)t[s]=e[s];for(;s<r;s++)t[s]=e[s]+t[s-i]&255}else{for(;s<i;s++)t[s]=e[s]+n[s]&255;for(;s<r;s++)t[s]=e[s]+Ekt(t[s-i],n[s],n[s-i])&255}}function Ekt(e,t,n){const r=e+t-n,i=Math.abs(r-e),s=Math.abs(r-t),a=Math.abs(r-n);return i<=s&&i<=a?e:s<=a?t:n}function Tkt(e,t,n,r,i,s){switch(e){case 0:hve(t,n,i);break;case 1:fve(t,n,i,s);break;case 2:Ave(t,n,r,i);break;case 3:pve(t,n,r,i,s);break;case 4:mve(t,n,r,i,s);break;default:throw new Error(`Unsupported filter: ${e}`)}}const Ikt=new Uint16Array([255]),Pkt=new Uint8Array(Ikt.buffer),Okt=Pkt[0]===255;function Fkt(e){const{data:t,width:n,height:r,channels:i,depth:s}=e,a=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],o=Math.ceil(s/8)*i,c=new Uint8Array(r*n*o);let u=0;for(let d=0;d<7;d++){const h=a[d],A=Math.ceil((n-h.x)/h.xStep),f=Math.ceil((r-h.y)/h.yStep);if(A<=0||f<=0)continue;const p=A*o,m=new Uint8Array(p);for(let g=0;g<f;g++){const y=t[u++],v=t.subarray(u,u+p);u+=p;const x=new Uint8Array(p);Tkt(y,v,x,m,p,o),m.set(x);for(let b=0;b<A;b++){const w=h.x+b*h.xStep,k=h.y+g*h.yStep;if(!(w>=n||k>=r))for(let j=0;j<o;j++)c[(k*n+w)*o+j]=x[b*o+j]}}}if(s===16){const d=new Uint16Array(c.buffer);if(Okt)for(let h=0;h<d.length;h++)d[h]=Mkt(d[h]);return d}else return c}function Mkt(e){return(e&255)<<8|e>>8&255}const Lkt=new Uint16Array([255]),Rkt=new Uint8Array(Lkt.buffer),Dkt=Rkt[0]===255,Ukt=new Uint8Array(0);function KJ(e){const{data:t,width:n,height:r,channels:i,depth:s}=e,a=Math.ceil(s/8)*i,o=Math.ceil(s/8*i*n),c=new Uint8Array(r*o);let u=Ukt,d=0,h,A;for(let f=0;f<r;f++){switch(h=t.subarray(d+1,d+1+o),A=c.subarray(f*o,(f+1)*o),t[d]){case 0:hve(h,A,o);break;case 1:fve(h,A,o,a);break;case 2:Ave(h,A,u,o);break;case 3:pve(h,A,u,o,a);break;case 4:mve(h,A,u,o,a);break;default:throw new Error(`Unsupported filter: ${t[d]}`)}u=A,d+=o+1}if(s===16){const f=new Uint16Array(c.buffer);if(Dkt)for(let p=0;p<f.length;p++)f[p]=Hkt(f[p]);return f}else return c}function Hkt(e){return(e&255)<<8|e>>8&255}const w_=Uint8Array.of(137,80,78,71,13,10,26,10);function qJ(e){if(!Qkt(e.readBytes(w_.length)))throw new Error("wrong PNG signature")}function Qkt(e){if(e.length<w_.length)return!1;for(let t=0;t<w_.length;t++)if(e[t]!==w_[t])return!1;return!0}const $kt="tEXt",zkt=0,gve=new TextDecoder("latin1");function Vkt(e){if(qkt(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const Kkt=/^[\u0000-\u00FF]*$/;function qkt(e){if(!Kkt.test(e))throw new Error("invalid latin1 text")}function Wkt(e,t,n){const r=yve(t);e[r]=Gkt(t,n-r.length-1)}function yve(e){for(e.mark();e.readByte()!==zkt;);const t=e.offset;e.reset();const n=gve.decode(e.readBytes(t-e.offset-1));return e.skip(1),Vkt(n),n}function Gkt(e,t){return gve.decode(e.readBytes(t))}const bo={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},iO={UNKNOWN:-1,DEFLATE:0},WJ={UNKNOWN:-1,ADAPTIVE:0},sO={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},lk={NONE:0,BACKGROUND:1,PREVIOUS:2},aO={SOURCE:0,OVER:1};class Ykt extends a${constructor(n,r={}){super(n);bn(this,"_checkCrc");bn(this,"_inflator");bn(this,"_png");bn(this,"_apng");bn(this,"_end");bn(this,"_hasPalette");bn(this,"_palette");bn(this,"_hasTransparency");bn(this,"_transparency");bn(this,"_compressionMethod");bn(this,"_filterMethod");bn(this,"_interlaceMethod");bn(this,"_colorType");bn(this,"_isAnimated");bn(this,"_numberOfFrames");bn(this,"_numberOfPlays");bn(this,"_frames");bn(this,"_writingDataChunks");const{checkCrc:i=!1}=r;this._checkCrc=i,this._inflator=new $J,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=iO.UNKNOWN,this._filterMethod=WJ.UNKNOWN,this._interlaceMethod=sO.UNKNOWN,this._colorType=bo.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(qJ(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeChunk(n,r)}return this.decodeImage(),this._png}decodeApng(){for(qJ(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(n,r)}return this.decodeApngImage(),this._apng}decodeChunk(n,r){const i=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(n);break;case"IDAT":this.decodeIDAT(n);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(n);break;case"iCCP":this.decodeiCCP(n);break;case $kt:Wkt(this._png.text,this,n);break;case"pHYs":this.decodepHYs();break;default:this.skip(n);break}if(this.offset-i!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?VJ(this,n+4,r):this.skip(4)}decodeApngChunk(n,r){const i=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(n);break;default:this.decodeChunk(n,r),this.offset=i+n;break}if(this.offset-i!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?VJ(this,n+4,r):this.skip(4)}decodeIHDR(){const n=this._png;n.width=this.readUint32(),n.height=this.readUint32(),n.depth=Xkt(this.readUint8());const r=this.readUint8();this._colorType=r;let i;switch(r){case bo.GREYSCALE:i=1;break;case bo.TRUECOLOUR:i=3;break;case bo.INDEXED_COLOUR:i=1;break;case bo.GREYSCALE_ALPHA:i=2;break;case bo.TRUECOLOUR_ALPHA:i=4;break;case bo.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==iO.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const n={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(n)}decodePLTE(n){if(n%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${n}`);const r=n/3;this._hasPalette=!0;const i=[];this._palette=i;for(let s=0;s<r;s++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(n){this._writingDataChunks=!0;const r=n,i=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodeFDAT(n){this._writingDataChunks=!0;let r=n,i=this.offset+this.byteOffset;if(i+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodetRNS(n){switch(this._colorType){case bo.GREYSCALE:case bo.TRUECOLOUR:{if(n%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${n}`);if(n/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${n/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(n/2);for(let r=0;r<n/2;r++)this._transparency[r]=this.readUint16();break}case bo.INDEXED_COLOUR:{if(n>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${n} vs ${this._palette.length})`);let r=0;for(;r<n;r++){const i=this.readByte();this._palette[r].push(i)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case bo.UNKNOWN:case bo.GREYSCALE_ALPHA:case bo.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(n){const r=yve(this),i=this.readUint8();if(i!==iO.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${i}`);const s=this.readBytes(n-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:jkt(s)}}decodepHYs(){const n=this.readUint32(),r=this.readUint32(),i=this.readByte();this._png.resolution={x:n,y:r,unit:i}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let n=0;n<this._numberOfFrames;n++){const r={sequenceNumber:this._frames[n].sequenceNumber,delayNumber:this._frames[n].delayNumber,delayDenominator:this._frames[n].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},i=this._frames.at(n);if(i){if(i.data=KJ({data:i.data,width:i.width,height:i.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),n===0||i.xOffset===0&&i.yOffset===0&&i.width===this._png.width&&i.height===this._png.height)r.data=i.data;else{const s=this._apng.frames.at(n-1);this.disposeFrame(i,s,r),this.addFrameDataToCanvas(r,i)}this._apng.frames.push(r)}}return this._apng}disposeFrame(n,r,i){switch(n.disposeOp){case lk.NONE:break;case lk.BACKGROUND:for(let s=0;s<this._png.height;s++)for(let a=0;a<this._png.width;a++){const o=(s*n.width+a)*this._png.channels;for(let c=0;c<this._png.channels;c++)i.data[o+c]=0}break;case lk.PREVIOUS:i.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(n,r){const i=1<<this._png.depth,s=(a,o)=>{const c=((a+r.yOffset)*this._png.width+r.xOffset+o)*this._png.channels,u=(a*r.width+o)*this._png.channels;return{index:c,frameIndex:u}};switch(r.blendOp){case aO.SOURCE:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:c,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++)n.data[c+d]=r.data[u+d]}break;case aO.OVER:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:c,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++){const h=r.data[u+this._png.channels-1]/i,A=d%(this._png.channels-1)===0?1:r.data[u+d],f=Math.floor(h*A+(1-h)*n.data[c+d]);n.data[c+d]+=f}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const n=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==WJ.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===sO.NO_INTERLACE)this._png.data=KJ({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===sO.ADAM7)this._png.data=Fkt({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const n=this._inflator.result,r=this._frames.at(-1);r?r.data=n:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:lk.NONE,blendOp:aO.SOURCE,data:n}),this._inflator=new $J,this._writingDataChunks=!1}}function Xkt(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var GJ;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(GJ||(GJ={}));function Jkt(e,t){return new Ykt(e,t).decode()}var Jt=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function oO(){Jt.console&&typeof Jt.console.log=="function"&&Jt.console.log.apply(Jt.console,arguments)}var dr={log:oO,warn:function(e){Jt.console&&(typeof Jt.console.warn=="function"?Jt.console.warn.apply(Jt.console,arguments):oO.call(null,arguments))},error:function(e){Jt.console&&(typeof Jt.console.error=="function"?Jt.console.error.apply(Jt.console,arguments):oO(e))}};function lO(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){QA(r.response,t,n)},r.onerror=function(){dr.error("could not download file")},r.send()}function YJ(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function ck(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var QA=Jt.saveAs||((typeof window>"u"?"undefined":Zn(window))!=="object"||window!==Jt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=Jt.URL||Jt.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin!==location.origin?YJ(i.href)?lO(e,t,n):ck(i,i.target="_blank"):ck(i)):(i.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){ck(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e=="string")if(YJ(e))lO(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){ck(r)})}else navigator.msSaveOrOpenBlob(function(i,s){return s===void 0?s={autoBom:!1}:Zn(s)!=="object"&&(dr.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(e,n),t)}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return lO(e,t,n);var i=e.type==="application/octet-stream",s=/constructor/i.test(Jt.HTMLElement)||Jt.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||i&&s)&&(typeof FileReader>"u"?"undefined":Zn(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var d=o.result;d=a?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=d:location=d,r=null},o.readAsDataURL(e)}else{var c=Jt.URL||Jt.webkitURL,u=c.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){c.revokeObjectURL(u)},4e4)}});/**
 * A class to parse color values
 * @author Stoyan Stefanov <sstoo@gmail.com>
 * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
 * @license Use it if you like it
 */function vve(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,s=n[r].process,a=i.exec(e);a&&(t=s(a),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var o=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return o.length==1&&(o="0"+o),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+o+c+u}}var b_=Jt.atob.bind(Jt),XJ=Jt.btoa.bind(Jt);/**
 * @license
 * Joseph Myers does not specify a particular license for his work.
 *
 * Author: Joseph Myers
 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
 *
 * Modified by: Owen Leong
 */function cO(e,t){var n=e[0],r=e[1],i=e[2],s=e[3];n=$s(n,r,i,s,t[0],7,-680876936),s=$s(s,n,r,i,t[1],12,-389564586),i=$s(i,s,n,r,t[2],17,606105819),r=$s(r,i,s,n,t[3],22,-1044525330),n=$s(n,r,i,s,t[4],7,-176418897),s=$s(s,n,r,i,t[5],12,1200080426),i=$s(i,s,n,r,t[6],17,-1473231341),r=$s(r,i,s,n,t[7],22,-45705983),n=$s(n,r,i,s,t[8],7,1770035416),s=$s(s,n,r,i,t[9],12,-1958414417),i=$s(i,s,n,r,t[10],17,-42063),r=$s(r,i,s,n,t[11],22,-1990404162),n=$s(n,r,i,s,t[12],7,1804603682),s=$s(s,n,r,i,t[13],12,-40341101),i=$s(i,s,n,r,t[14],17,-1502002290),n=zs(n,r=$s(r,i,s,n,t[15],22,1236535329),i,s,t[1],5,-165796510),s=zs(s,n,r,i,t[6],9,-1069501632),i=zs(i,s,n,r,t[11],14,643717713),r=zs(r,i,s,n,t[0],20,-373897302),n=zs(n,r,i,s,t[5],5,-701558691),s=zs(s,n,r,i,t[10],9,38016083),i=zs(i,s,n,r,t[15],14,-660478335),r=zs(r,i,s,n,t[4],20,-405537848),n=zs(n,r,i,s,t[9],5,568446438),s=zs(s,n,r,i,t[14],9,-1019803690),i=zs(i,s,n,r,t[3],14,-187363961),r=zs(r,i,s,n,t[8],20,1163531501),n=zs(n,r,i,s,t[13],5,-1444681467),s=zs(s,n,r,i,t[2],9,-51403784),i=zs(i,s,n,r,t[7],14,1735328473),n=Vs(n,r=zs(r,i,s,n,t[12],20,-1926607734),i,s,t[5],4,-378558),s=Vs(s,n,r,i,t[8],11,-2022574463),i=Vs(i,s,n,r,t[11],16,1839030562),r=Vs(r,i,s,n,t[14],23,-35309556),n=Vs(n,r,i,s,t[1],4,-1530992060),s=Vs(s,n,r,i,t[4],11,1272893353),i=Vs(i,s,n,r,t[7],16,-155497632),r=Vs(r,i,s,n,t[10],23,-1094730640),n=Vs(n,r,i,s,t[13],4,681279174),s=Vs(s,n,r,i,t[0],11,-358537222),i=Vs(i,s,n,r,t[3],16,-722521979),r=Vs(r,i,s,n,t[6],23,76029189),n=Vs(n,r,i,s,t[9],4,-640364487),s=Vs(s,n,r,i,t[12],11,-421815835),i=Vs(i,s,n,r,t[15],16,530742520),n=Ks(n,r=Vs(r,i,s,n,t[2],23,-995338651),i,s,t[0],6,-198630844),s=Ks(s,n,r,i,t[7],10,1126891415),i=Ks(i,s,n,r,t[14],15,-1416354905),r=Ks(r,i,s,n,t[5],21,-57434055),n=Ks(n,r,i,s,t[12],6,1700485571),s=Ks(s,n,r,i,t[3],10,-1894986606),i=Ks(i,s,n,r,t[10],15,-1051523),r=Ks(r,i,s,n,t[1],21,-2054922799),n=Ks(n,r,i,s,t[8],6,1873313359),s=Ks(s,n,r,i,t[15],10,-30611744),i=Ks(i,s,n,r,t[6],15,-1560198380),r=Ks(r,i,s,n,t[13],21,1309151649),n=Ks(n,r,i,s,t[4],6,-145523070),s=Ks(s,n,r,i,t[11],10,-1120210379),i=Ks(i,s,n,r,t[2],15,718787259),r=Ks(r,i,s,n,t[9],21,-343485551),e[0]=Jh(n,e[0]),e[1]=Jh(r,e[1]),e[2]=Jh(i,e[2]),e[3]=Jh(s,e[3])}function AT(e,t,n,r,i,s){return t=Jh(Jh(t,e),Jh(r,s)),Jh(t<<i|t>>>32-i,n)}function $s(e,t,n,r,i,s,a){return AT(t&n|~t&r,e,t,i,s,a)}function zs(e,t,n,r,i,s,a){return AT(t&r|n&~r,e,t,i,s,a)}function Vs(e,t,n,r,i,s,a){return AT(t^n^r,e,t,i,s,a)}function Ks(e,t,n,r,i,s,a){return AT(n^(t|~r),e,t,i,s,a)}function xve(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)cO(r,Zkt(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(cO(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,cO(r,i),r}function Zkt(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}var JJ="0123456789abcdef".split("");function e_t(e){for(var t="",n=0;n<4;n++)t+=JJ[e>>8*n+4&15]+JJ[e>>8*n&15];return t}function t_t(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function NR(e){return xve(e).map(t_t).join("")}var n_t=function(e){for(var t=0;t<e.length;t++)e[t]=e_t(e[t]);return e.join("")}(xve("hello"))!="5d41402abc4b2a76b9719d911017c592";function Jh(e,t){if(n_t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}/**
 * @license
 * FPDF is released under a permissive license: there is no usage restriction.
 * You may embed it freely in your application (commercial or not), with or
 * without modifications.
 *
 * Reference: http://www.fpdf.org/en/script/script37.php
 */function ER(e,t){var n,r,i,s;if(e!==n){for(var a=(i=e,s=1+(256/e.length|0),new Array(s+1).join(i)),o=[],c=0;c<256;c++)o[c]=c;var u=0;for(c=0;c<256;c++){var d=o[c];u=(u+d+a.charCodeAt(c))%256,o[c]=o[u],o[u]=d}n=e,r=o}else o=r;var h=t.length,A=0,f=0,p="";for(c=0;c<h;c++)f=(f+(d=o[A=(A+1)%256]))%256,o[A]=o[f],o[f]=d,a=o[(o[A]+o[f])%256],p+=String.fromCharCode(t.charCodeAt(c)^a);return p}/**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 * Author: Owen Leong (@owenl131)
 * Date: 15 Oct 2020
 * References:
 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
 * http://www.fpdf.org/en/script/script37.php
 */var ZJ={print:4,modify:8,copy:16,"annot-forms":32};function Rg(e,t,n,r){this.v=1,this.r=2;var i=192;e.forEach(function(o){if(ZJ.perm!==void 0)throw new Error("Invalid permission: "+o);i+=ZJ[o]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(t+this.padding).substr(0,32),a=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,a),this.P=-(1+(255^i)),this.encryptionKey=NR(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=ER(this.encryptionKey,this.padding)}function Dg(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,r=0;r<n;r++){var i=e.charCodeAt(r);t+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):e[r]}return t}function eZ(e){if(Zn(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(n,r,i){if(i=i||!1,typeof n!="string"||typeof r!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(n)||(t[n]={});var s=Math.random().toString(35);return t[n][s]=[r,!!i],s},this.unsubscribe=function(n){for(var r in t)if(t[r][n])return delete t[r][n],Object.keys(t[r]).length===0&&delete t[r],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var s in t[n]){var a=t[n][s];try{a[0].apply(e,r)}catch(o){Jt.console&&dr.error("jsPDF PubSub Error",o.message,o)}a[1]&&i.push(s)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function IN(e){if(!(this instanceof IN))return new IN(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function wve(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function qA(e,t,n,r,i){if(!(this instanceof qA))return new qA(e,t,n,r,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=n,wve.call(this,r,i)}function cy(e,t,n,r,i){if(!(this instanceof cy))return new cy(e,t,n,r,i);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,wve.call(this,r,i)}function Ot(e){var t,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],s=arguments[3],a=[],o=1,c=16,u="S",d=null;Zn(e=e||{})==="object"&&(n=e.orientation,r=e.unit||r,i=e.format||i,s=e.compress||e.compressPdf||s,(d=e.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),o=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(c=e.floatPrecision),u=e.defaultPathOperation||"S"),a=e.filters||(s===!0?["FlateEncode"]:a),r=r||"mm",n=(""+(n||"P")).toLowerCase();var h=e.putOnlyUsedFonts||!1,A={},f={internal:{},__private__:{}};f.__private__.PubSub=eZ;var p="1.3",m=f.__private__.getPdfVersion=function(){return p};f.__private__.setPdfVersion=function(I){p=I};var g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};f.__private__.getPageFormats=function(){return g};var y=f.__private__.getPageFormat=function(I){return g[I]};i=i||"a4";var v="compat",x="advanced",b=v;function w(){this.saveGraphicsState(),te(new At(Ze,0,0,-Ze,0,hA()*Ze).toString()+" cm"),this.setFontSize(this.getFontSize()/Ze),u="n",b=x}function k(){this.restoreGraphicsState(),u="S",b=v}var j=f.__private__.combineFontStyleAndFontWeight=function(I,K){if(I=="bold"&&K=="normal"||I=="bold"&&K==400||I=="normal"&&K=="italic"||I=="bold"&&K=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return K&&(I=K==400||K==="normal"?I==="italic"?"italic":"normal":K!=700&&K!=="bold"||I!=="normal"?(K==700?"bold":K)+""+I:"bold"),I};f.advancedAPI=function(I){var K=b===v;return K&&w.call(this),typeof I!="function"||(I(this),K&&k.call(this)),this},f.compatAPI=function(I){var K=b===x;return K&&k.call(this),typeof I!="function"||(I(this),K&&w.call(this)),this},f.isAdvancedAPI=function(){return b===x};var B,E=function(I){if(b!==x)throw new Error(I+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},P=f.roundToPrecision=f.__private__.roundToPrecision=function(I,K){var ae=t||K;if(isNaN(I)||isNaN(ae))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return I.toFixed(ae).replace(/0+$/,"")};B=f.hpf=f.__private__.hpf=typeof c=="number"?function(I){if(isNaN(I))throw new Error("Invalid argument passed to jsPDF.hpf");return P(I,c)}:c==="smart"?function(I){if(isNaN(I))throw new Error("Invalid argument passed to jsPDF.hpf");return P(I,I>-1&&I<1?16:5)}:function(I){if(isNaN(I))throw new Error("Invalid argument passed to jsPDF.hpf");return P(I,16)};var T=f.f2=f.__private__.f2=function(I){if(isNaN(I))throw new Error("Invalid argument passed to jsPDF.f2");return P(I,2)},N=f.__private__.f3=function(I){if(isNaN(I))throw new Error("Invalid argument passed to jsPDF.f3");return P(I,3)},F=f.scale=f.__private__.scale=function(I){if(isNaN(I))throw new Error("Invalid argument passed to jsPDF.scale");return b===v?I*Ze:b===x?I:void 0},L=function(I){return F(function(K){return b===v?hA()-K:b===x?K:void 0}(I))};f.__private__.setPrecision=f.setPrecision=function(I){typeof parseInt(I,10)=="number"&&(t=parseInt(I,10))};var U,H="00000000000000000000000000000000",W=f.__private__.getFileId=function(){return H},$=f.__private__.setFileId=function(I){return H=I!==void 0&&/^[a-fA-F0-9]{32}$/.test(I)?I.toUpperCase():H.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(ms=new Rg(d.userPermissions,d.userPassword,d.ownerPassword,H)),H};f.setFileId=function(I){return $(I),this},f.getFileId=function(){return W()};var z=f.__private__.convertDateToPDFDate=function(I){var K=I.getTimezoneOffset(),ae=K<0?"+":"-",fe=Math.floor(Math.abs(K/60)),ve=Math.abs(K%60),Ee=[ae,Y(fe),"'",Y(ve),"'"].join("");return["D:",I.getFullYear(),Y(I.getMonth()+1),Y(I.getDate()),Y(I.getHours()),Y(I.getMinutes()),Y(I.getSeconds()),Ee].join("")},Q=f.__private__.convertPDFDateToDate=function(I){var K=parseInt(I.substr(2,4),10),ae=parseInt(I.substr(6,2),10)-1,fe=parseInt(I.substr(8,2),10),ve=parseInt(I.substr(10,2),10),Ee=parseInt(I.substr(12,2),10),Le=parseInt(I.substr(14,2),10);return new Date(K,ae,fe,ve,Ee,Le,0)},ce=f.__private__.setCreationDate=function(I){var K;if(I===void 0&&(I=new Date),I instanceof Date)K=z(I);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(I))throw new Error("Invalid argument passed to jsPDF.setCreationDate");K=I}return U=K},R=f.__private__.getCreationDate=function(I){var K=U;return I==="jsDate"&&(K=Q(U)),K};f.setCreationDate=function(I){return ce(I),this},f.getCreationDate=function(I){return R(I)};var M,Y=f.__private__.padd2=function(I){return("0"+parseInt(I)).slice(-2)},X=f.__private__.padd2Hex=function(I){return("00"+(I=I.toString())).substr(I.length)},V=0,Z=[],de=[],ue=0,se=[],he=[],ie=!1,Ce=de;f.__private__.setCustomOutputDestination=function(I){ie=!0,Ce=I};var Ie=function(I){ie||(Ce=I)};f.__private__.resetCustomOutputDestination=function(){ie=!1,Ce=de};var te=f.__private__.out=function(I){return I=I.toString(),ue+=I.length+1,Ce.push(I),Ce},je=f.__private__.write=function(I){return te(arguments.length===1?I.toString():Array.prototype.join.call(arguments," "))},nt=f.__private__.getArrayBuffer=function(I){for(var K=I.length,ae=new ArrayBuffer(K),fe=new Uint8Array(ae);K--;)fe[K]=I.charCodeAt(K);return ae},rt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];f.__private__.getStandardFonts=function(){return rt};var Ne=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(I){return Ne=b===x?I/Ze:I,this};var st,we=f.__private__.getFontSize=f.getFontSize=function(){return b===v?Ne:Ne*Ze},He=e.R2L||!1;f.__private__.setR2L=f.setR2L=function(I){return He=I,this},f.__private__.getR2L=f.getR2L=function(){return He};var Ve,Dt=f.__private__.setZoomMode=function(I){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(I))st=I;else if(isNaN(I)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(I)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+I+'" is not recognized.');st=I}else st=parseInt(I,10)};f.__private__.getZoomMode=function(){return st};var pt,ye=f.__private__.setPageMode=function(I){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(I)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+I+'" is not recognized.');Ve=I};f.__private__.getPageMode=function(){return Ve};var Be=f.__private__.setLayoutMode=function(I){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(I)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+I+'" is not recognized.');pt=I};f.__private__.getLayoutMode=function(){return pt},f.__private__.setDisplayMode=f.setDisplayMode=function(I,K,ae){return Dt(I),Be(K),ye(ae),this};var Ge={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(I){if(Object.keys(Ge).indexOf(I)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Ge[I]},f.__private__.getDocumentProperties=function(){return Ge},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(I){for(var K in Ge)Ge.hasOwnProperty(K)&&I[K]&&(Ge[K]=I[K]);return this},f.__private__.setDocumentProperty=function(I,K){if(Object.keys(Ge).indexOf(I)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Ge[I]=K};var Ue,Ze,pe,mt,ft,wt={},Rt={},zt=[],gt={},Lt={},Mt={},qt={},nr=null,tn=0,Bt=[],jn=new eZ(f),Ut=e.hotfixes||[],Wt={},wn={},Nr=[],At=function I(K,ae,fe,ve,Ee,Le){if(!(this instanceof I))return new I(K,ae,fe,ve,Ee,Le);isNaN(K)&&(K=1),isNaN(ae)&&(ae=0),isNaN(fe)&&(fe=0),isNaN(ve)&&(ve=1),isNaN(Ee)&&(Ee=0),isNaN(Le)&&(Le=0),this._matrix=[K,ae,fe,ve,Ee,Le]};Object.defineProperty(At.prototype,"sx",{get:function(){return this._matrix[0]},set:function(I){this._matrix[0]=I}}),Object.defineProperty(At.prototype,"shy",{get:function(){return this._matrix[1]},set:function(I){this._matrix[1]=I}}),Object.defineProperty(At.prototype,"shx",{get:function(){return this._matrix[2]},set:function(I){this._matrix[2]=I}}),Object.defineProperty(At.prototype,"sy",{get:function(){return this._matrix[3]},set:function(I){this._matrix[3]=I}}),Object.defineProperty(At.prototype,"tx",{get:function(){return this._matrix[4]},set:function(I){this._matrix[4]=I}}),Object.defineProperty(At.prototype,"ty",{get:function(){return this._matrix[5]},set:function(I){this._matrix[5]=I}}),Object.defineProperty(At.prototype,"a",{get:function(){return this._matrix[0]},set:function(I){this._matrix[0]=I}}),Object.defineProperty(At.prototype,"b",{get:function(){return this._matrix[1]},set:function(I){this._matrix[1]=I}}),Object.defineProperty(At.prototype,"c",{get:function(){return this._matrix[2]},set:function(I){this._matrix[2]=I}}),Object.defineProperty(At.prototype,"d",{get:function(){return this._matrix[3]},set:function(I){this._matrix[3]=I}}),Object.defineProperty(At.prototype,"e",{get:function(){return this._matrix[4]},set:function(I){this._matrix[4]=I}}),Object.defineProperty(At.prototype,"f",{get:function(){return this._matrix[5]},set:function(I){this._matrix[5]=I}}),Object.defineProperty(At.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(At.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(At.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(At.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),At.prototype.join=function(I){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(B).join(I)},At.prototype.multiply=function(I){var K=I.sx*this.sx+I.shy*this.shx,ae=I.sx*this.shy+I.shy*this.sy,fe=I.shx*this.sx+I.sy*this.shx,ve=I.shx*this.shy+I.sy*this.sy,Ee=I.tx*this.sx+I.ty*this.shx+this.tx,Le=I.tx*this.shy+I.ty*this.sy+this.ty;return new At(K,ae,fe,ve,Ee,Le)},At.prototype.decompose=function(){var I=this.sx,K=this.shy,ae=this.shx,fe=this.sy,ve=this.tx,Ee=this.ty,Le=Math.sqrt(I*I+K*K),jt=(I/=Le)*ae+(K/=Le)*fe;ae-=I*jt,fe-=K*jt;var kt=Math.sqrt(ae*ae+fe*fe);return jt/=kt,I*(fe/=kt)<K*(ae/=kt)&&(I=-I,K=-K,jt=-jt,Le=-Le),{scale:new At(Le,0,0,kt,0,0),translate:new At(1,0,0,1,ve,Ee),rotate:new At(I,K,-K,I,0,0),skew:new At(1,0,jt,1,0,0)}},At.prototype.toString=function(I){return this.join(" ")},At.prototype.inversed=function(){var I=this.sx,K=this.shy,ae=this.shx,fe=this.sy,ve=this.tx,Ee=this.ty,Le=1/(I*fe-K*ae),jt=fe*Le,kt=-K*Le,nn=-ae*Le,ln=I*Le;return new At(jt,kt,nn,ln,-jt*ve-nn*Ee,-kt*ve-ln*Ee)},At.prototype.applyToPoint=function(I){var K=I.x*this.sx+I.y*this.shx+this.tx,ae=I.x*this.shy+I.y*this.sy+this.ty;return new dA(K,ae)},At.prototype.applyToRectangle=function(I){var K=this.applyToPoint(I),ae=this.applyToPoint(new dA(I.x+I.w,I.y+I.h));return new q0(K.x,K.y,ae.x-K.x,ae.y-K.y)},At.prototype.clone=function(){var I=this.sx,K=this.shy,ae=this.shx,fe=this.sy,ve=this.tx,Ee=this.ty;return new At(I,K,ae,fe,ve,Ee)},f.Matrix=At;var Ur=f.matrixMult=function(I,K){return K.multiply(I)},Ln=new At(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=Ln;var gr=function(I,K){if(!Lt[I]){var ae=(K instanceof qA?"Sh":"P")+(Object.keys(gt).length+1).toString(10);K.id=ae,Lt[I]=ae,gt[ae]=K,jn.publish("addPattern",K)}};f.ShadingPattern=qA,f.TilingPattern=cy,f.addShadingPattern=function(I,K){return E("addShadingPattern()"),gr(I,K),this},f.beginTilingPattern=function(I){E("beginTilingPattern()"),W0(I.boundingBox[0],I.boundingBox[1],I.boundingBox[2]-I.boundingBox[0],I.boundingBox[3]-I.boundingBox[1],I.matrix)},f.endTilingPattern=function(I,K){E("endTilingPattern()"),K.stream=he[M].join(`
`),gr(I,K),jn.publish("endTilingPattern",K),Nr.pop().restore()};var or,xn=f.__private__.newObject=function(){var I=Ye();return Gn(I,!0),I},Ye=f.__private__.newObjectDeferred=function(){return V++,Z[V]=function(){return ue},V},Gn=function(I,K){return K=typeof K=="boolean"&&K,Z[I]=ue,K&&te(I+" 0 obj"),I},lr=f.__private__.newAdditionalObject=function(){var I={objId:Ye(),content:""};return se.push(I),I},ni=Ye(),ns=Ye(),Ma=f.__private__.decodeColorString=function(I){var K=I.split(" ");if(K.length!==2||K[1]!=="g"&&K[1]!=="G")K.length!==5||K[4]!=="k"&&K[4]!=="K"||(K=[(1-K[0])*(1-K[3]),(1-K[1])*(1-K[3]),(1-K[2])*(1-K[3]),"r"]);else{var ae=parseFloat(K[0]);K=[ae,ae,ae,"r"]}for(var fe="#",ve=0;ve<3;ve++)fe+=("0"+Math.floor(255*parseFloat(K[ve])).toString(16)).slice(-2);return fe},Hl=f.__private__.encodeColorString=function(I){var K;typeof I=="string"&&(I={ch1:I});var ae=I.ch1,fe=I.ch2,ve=I.ch3,Ee=I.ch4,Le=I.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof ae=="string"&&ae.charAt(0)!=="#"){var jt=new vve(ae);if(jt.ok)ae=jt.toHex();else if(!/^\d*\.?\d*$/.test(ae))throw new Error('Invalid color "'+ae+'" passed to jsPDF.encodeColorString.')}if(typeof ae=="string"&&/^#[0-9A-Fa-f]{3}$/.test(ae)&&(ae="#"+ae[1]+ae[1]+ae[2]+ae[2]+ae[3]+ae[3]),typeof ae=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ae)){var kt=parseInt(ae.substr(1),16);ae=kt>>16&255,fe=kt>>8&255,ve=255&kt}if(fe===void 0||Ee===void 0&&ae===fe&&fe===ve)K=typeof ae=="string"?ae+" "+Le[0]:I.precision===2?T(ae/255)+" "+Le[0]:N(ae/255)+" "+Le[0];else if(Ee===void 0||Zn(Ee)==="object"){if(Ee&&!isNaN(Ee.a)&&Ee.a===0)return["1.","1.","1.",Le[1]].join(" ");K=typeof ae=="string"?[ae,fe,ve,Le[1]].join(" "):I.precision===2?[T(ae/255),T(fe/255),T(ve/255),Le[1]].join(" "):[N(ae/255),N(fe/255),N(ve/255),Le[1]].join(" ")}else K=typeof ae=="string"?[ae,fe,ve,Ee,Le[2]].join(" "):I.precision===2?[T(ae),T(fe),T(ve),T(Ee),Le[2]].join(" "):[N(ae),N(fe),N(ve),N(Ee),Le[2]].join(" ");return K},Ql=f.__private__.getFilters=function(){return a},qo=f.__private__.putStream=function(I){var K=(I=I||{}).data||"",ae=I.filters||Ql(),fe=I.alreadyAppliedFilters||[],ve=I.addLength1||!1,Ee=K.length,Le=I.objectId,jt=function(Er){return Er};if(d!==null&&Le===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(jt=ms.encryptor(Le,0));var kt={};ae===!0&&(ae=["FlateEncode"]);var nn=I.additionalKeyValues||[],ln=(kt=Ot.API.processDataByFilters!==void 0?Ot.API.processDataByFilters(K,ae):{data:K,reverseChain:[]}).reverseChain+(Array.isArray(fe)?fe.join(" "):fe.toString());if(kt.data.length!==0&&(nn.push({key:"Length",value:kt.data.length}),ve===!0&&nn.push({key:"Length1",value:Ee})),ln.length!=0)if(ln.split("/").length-1==1)nn.push({key:"Filter",value:ln});else{nn.push({key:"Filter",value:"["+ln+"]"});for(var In=0;In<nn.length;In+=1)if(nn[In].key==="DecodeParms"){for(var Bi=[],cr=0;cr<kt.reverseChain.split("/").length-1;cr+=1)Bi.push("null");Bi.push(nn[In].value),nn[In].value="["+Bi.join(" ")+"]"}}te("<<");for(var rr=0;rr<nn.length;rr++)te("/"+nn[rr].key+" "+nn[rr].value);te(">>"),kt.data.length!==0&&(te("stream"),te(jt(kt.data)),te("endstream"))},lA=f.__private__.putPage=function(I){var K=I.number,ae=I.data,fe=I.objId,ve=I.contentsObjId;Gn(fe,!0),te("<</Type /Page"),te("/Parent "+I.rootDictionaryObjId+" 0 R"),te("/Resources "+I.resourceDictionaryObjId+" 0 R"),te("/MediaBox ["+parseFloat(B(I.mediaBox.bottomLeftX))+" "+parseFloat(B(I.mediaBox.bottomLeftY))+" "+B(I.mediaBox.topRightX)+" "+B(I.mediaBox.topRightY)+"]"),I.cropBox!==null&&te("/CropBox ["+B(I.cropBox.bottomLeftX)+" "+B(I.cropBox.bottomLeftY)+" "+B(I.cropBox.topRightX)+" "+B(I.cropBox.topRightY)+"]"),I.bleedBox!==null&&te("/BleedBox ["+B(I.bleedBox.bottomLeftX)+" "+B(I.bleedBox.bottomLeftY)+" "+B(I.bleedBox.topRightX)+" "+B(I.bleedBox.topRightY)+"]"),I.trimBox!==null&&te("/TrimBox ["+B(I.trimBox.bottomLeftX)+" "+B(I.trimBox.bottomLeftY)+" "+B(I.trimBox.topRightX)+" "+B(I.trimBox.topRightY)+"]"),I.artBox!==null&&te("/ArtBox ["+B(I.artBox.bottomLeftX)+" "+B(I.artBox.bottomLeftY)+" "+B(I.artBox.topRightX)+" "+B(I.artBox.topRightY)+"]"),typeof I.userUnit=="number"&&I.userUnit!==1&&te("/UserUnit "+I.userUnit),jn.publish("putPage",{objId:fe,pageContext:Bt[K],pageNumber:K,page:ae}),te("/Contents "+ve+" 0 R"),te(">>"),te("endobj");var Ee=ae.join(`
`);return b===x&&(Ee+=`
Q`),Gn(ve,!0),qo({data:Ee,filters:Ql(),objectId:ve}),te("endobj"),fe},Oc=f.__private__.putPages=function(){var I,K,ae=[];for(I=1;I<=tn;I++)Bt[I].objId=Ye(),Bt[I].contentsObjId=Ye();for(I=1;I<=tn;I++)ae.push(lA({number:I,data:he[I],objId:Bt[I].objId,contentsObjId:Bt[I].contentsObjId,mediaBox:Bt[I].mediaBox,cropBox:Bt[I].cropBox,bleedBox:Bt[I].bleedBox,trimBox:Bt[I].trimBox,artBox:Bt[I].artBox,userUnit:Bt[I].userUnit,rootDictionaryObjId:ni,resourceDictionaryObjId:ns}));Gn(ni,!0),te("<</Type /Pages");var fe="/Kids [";for(K=0;K<tn;K++)fe+=ae[K]+" 0 R ";te(fe+"]"),te("/Count "+tn),te(">>"),te("endobj"),jn.publish("postPutPages")},cA=function(I){jn.publish("putFont",{font:I,out:te,newObject:xn,putStream:qo}),I.isAlreadyPutted!==!0&&(I.objectNumber=xn(),te("<<"),te("/Type /Font"),te("/BaseFont /"+Dg(I.postScriptName)),te("/Subtype /Type1"),typeof I.encoding=="string"&&te("/Encoding /"+I.encoding),te("/FirstChar 32"),te("/LastChar 255"),te(">>"),te("endobj"))},Tm=function(I){I.objectNumber=xn();var K=[];K.push({key:"Type",value:"/XObject"}),K.push({key:"Subtype",value:"/Form"}),K.push({key:"BBox",value:"["+[B(I.x),B(I.y),B(I.x+I.width),B(I.y+I.height)].join(" ")+"]"}),K.push({key:"Matrix",value:"["+I.matrix.toString()+"]"});var ae=I.pages[1].join(`
`);qo({data:ae,additionalKeyValues:K,objectId:I.objectNumber}),te("endobj")},Im=function(I,K){K||(K=21);var ae=xn(),fe=function(Le,jt){var kt,nn=[],ln=1/(jt-1);for(kt=0;kt<1;kt+=ln)nn.push(kt);if(nn.push(1),Le[0].offset!=0){var In={offset:0,color:Le[0].color};Le.unshift(In)}if(Le[Le.length-1].offset!=1){var Bi={offset:1,color:Le[Le.length-1].color};Le.push(Bi)}for(var cr="",rr=0,Er=0;Er<nn.length;Er++){for(kt=nn[Er];kt>Le[rr+1].offset;)rr++;var Kr=Le[rr].offset,qr=(kt-Kr)/(Le[rr+1].offset-Kr),Ls=Le[rr].color,Iu=Le[rr+1].color;cr+=X(Math.round((1-qr)*Ls[0]+qr*Iu[0]).toString(16))+X(Math.round((1-qr)*Ls[1]+qr*Iu[1]).toString(16))+X(Math.round((1-qr)*Ls[2]+qr*Iu[2]).toString(16))}return cr.trim()}(I.colors,K),ve=[];ve.push({key:"FunctionType",value:"0"}),ve.push({key:"Domain",value:"[0.0 1.0]"}),ve.push({key:"Size",value:"["+K+"]"}),ve.push({key:"BitsPerSample",value:"8"}),ve.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ve.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),qo({data:fe,additionalKeyValues:ve,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ae}),te("endobj"),I.objectNumber=xn(),te("<< /ShadingType "+I.type),te("/ColorSpace /DeviceRGB");var Ee="/Coords ["+B(parseFloat(I.coords[0]))+" "+B(parseFloat(I.coords[1]))+" ";I.type===2?Ee+=B(parseFloat(I.coords[2]))+" "+B(parseFloat(I.coords[3])):Ee+=B(parseFloat(I.coords[2]))+" "+B(parseFloat(I.coords[3]))+" "+B(parseFloat(I.coords[4]))+" "+B(parseFloat(I.coords[5])),te(Ee+="]"),I.matrix&&te("/Matrix ["+I.matrix.toString()+"]"),te("/Function "+ae+" 0 R"),te("/Extend [true true]"),te(">>"),te("endobj")},Pm=function(I,K){var ae=Ye(),fe=xn();K.push({resourcesOid:ae,objectOid:fe}),I.objectNumber=fe;var ve=[];ve.push({key:"Type",value:"/Pattern"}),ve.push({key:"PatternType",value:"1"}),ve.push({key:"PaintType",value:"1"}),ve.push({key:"TilingType",value:"1"}),ve.push({key:"BBox",value:"["+I.boundingBox.map(B).join(" ")+"]"}),ve.push({key:"XStep",value:B(I.xStep)}),ve.push({key:"YStep",value:B(I.yStep)}),ve.push({key:"Resources",value:ae+" 0 R"}),I.matrix&&ve.push({key:"Matrix",value:"["+I.matrix.toString()+"]"}),qo({data:I.stream,additionalKeyValues:ve,objectId:I.objectNumber}),te("endobj")},kT=function(I){for(var K in I.objectNumber=xn(),te("<<"),I)switch(K){case"opacity":te("/ca "+T(I[K]));break;case"stroke-opacity":te("/CA "+T(I[K]))}te(">>"),te("endobj")},D0=function(I){Gn(I.resourcesOid,!0),te("<<"),te("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var K in te("/Font <<"),wt)wt.hasOwnProperty(K)&&(h===!1||h===!0&&A.hasOwnProperty(K))&&te("/"+K+" "+wt[K].objectNumber+" 0 R");te(">>")}(),function(){if(Object.keys(gt).length>0){for(var K in te("/Shading <<"),gt)gt.hasOwnProperty(K)&&gt[K]instanceof qA&&gt[K].objectNumber>=0&&te("/"+K+" "+gt[K].objectNumber+" 0 R");jn.publish("putShadingPatternDict"),te(">>")}}(),function(K){if(Object.keys(gt).length>0){for(var ae in te("/Pattern <<"),gt)gt.hasOwnProperty(ae)&&gt[ae]instanceof f.TilingPattern&&gt[ae].objectNumber>=0&&gt[ae].objectNumber<K&&te("/"+ae+" "+gt[ae].objectNumber+" 0 R");jn.publish("putTilingPatternDict"),te(">>")}}(I.objectOid),function(){if(Object.keys(Mt).length>0){var K;for(K in te("/ExtGState <<"),Mt)Mt.hasOwnProperty(K)&&Mt[K].objectNumber>=0&&te("/"+K+" "+Mt[K].objectNumber+" 0 R");jn.publish("putGStateDict"),te(">>")}}(),function(){for(var K in te("/XObject <<"),Wt)Wt.hasOwnProperty(K)&&Wt[K].objectNumber>=0&&te("/"+K+" "+Wt[K].objectNumber+" 0 R");jn.publish("putXobjectDict"),te(">>")}(),te(">>"),te("endobj")},iC=function(I){Rt[I.fontName]=Rt[I.fontName]||{},Rt[I.fontName][I.fontStyle]=I.id},sC=function(I,K,ae,fe,ve){var Ee={id:"F"+(Object.keys(wt).length+1).toString(10),postScriptName:I,fontName:K,fontStyle:ae,encoding:fe,isStandardFont:ve||!1,metadata:{}};return jn.publish("addFont",{font:Ee,instance:this}),wt[Ee.id]=Ee,iC(Ee),Ee.id},Wo=f.__private__.pdfEscape=f.pdfEscape=function(I,K){return function(ae,fe){var ve,Ee,Le,jt,kt,nn,ln,In,Bi;if(Le=(fe=fe||{}).sourceEncoding||"Unicode",kt=fe.outputEncoding,(fe.autoencode||kt)&&wt[Ue].metadata&&wt[Ue].metadata[Le]&&wt[Ue].metadata[Le].encoding&&(jt=wt[Ue].metadata[Le].encoding,!kt&&wt[Ue].encoding&&(kt=wt[Ue].encoding),!kt&&jt.codePages&&(kt=jt.codePages[0]),typeof kt=="string"&&(kt=jt[kt]),kt)){for(ln=!1,nn=[],ve=0,Ee=ae.length;ve<Ee;ve++)(In=kt[ae.charCodeAt(ve)])?nn.push(String.fromCharCode(In)):nn.push(ae[ve]),nn[ve].charCodeAt(0)>>8&&(ln=!0);ae=nn.join("")}for(ve=ae.length;ln===void 0&&ve!==0;)ae.charCodeAt(ve-1)>>8&&(ln=!0),ve--;if(!ln)return ae;for(nn=fe.noBOM?[]:[254,255],ve=0,Ee=ae.length;ve<Ee;ve++){if((Bi=(In=ae.charCodeAt(ve))>>8)>>8)throw new Error("Character at position "+ve+" of string '"+ae+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");nn.push(Bi),nn.push(In-(Bi<<8))}return String.fromCharCode.apply(void 0,nn)}(I,K).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},U0=f.__private__.beginPage=function(I){he[++tn]=[],Bt[tn]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(I[0]),topRightY:Number(I[1])}},oC(tn),Ie(he[M])},aC=function(I,K){var ae,fe,ve;switch(n=K||n,typeof I=="string"&&(ae=y(I.toLowerCase()),Array.isArray(ae)&&(fe=ae[0],ve=ae[1])),Array.isArray(I)&&(fe=I[0]*Ze,ve=I[1]*Ze),isNaN(fe)&&(fe=i[0],ve=i[1]),(fe>14400||ve>14400)&&(dr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),fe=Math.min(14400,fe),ve=Math.min(14400,ve)),i=[fe,ve],n.substr(0,1)){case"l":ve>fe&&(i=[ve,fe]);break;case"p":fe>ve&&(i=[ve,fe])}U0(i),FT(Xt),te(Dm),V0!==0&&te(V0+" J"),Qd!==0&&te(Qd+" j"),jn.publish("addPage",{pageNumber:tn})},H0=function(I){I>0&&I<=tn&&(he.splice(I,1),Bt.splice(I,1),tn--,M>tn&&(M=tn),this.setPage(M))},oC=function(I){I>0&&I<=tn&&(M=I)},lC=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return he.length-1},cC=function(I,K,ae){var fe,ve=void 0;return ae=ae||{},I=I!==void 0?I:wt[Ue].fontName,K=K!==void 0?K:wt[Ue].fontStyle,fe=I.toLowerCase(),Rt[fe]!==void 0&&Rt[fe][K]!==void 0?ve=Rt[fe][K]:Rt[I]!==void 0&&Rt[I][K]!==void 0?ve=Rt[I][K]:ae.disableWarning===!1&&dr.warn("Unable to look up font label for font '"+I+"', '"+K+"'. Refer to getFontList() for available fonts."),ve||ae.noFallback||(ve=Rt.times[K])==null&&(ve=Rt.times.normal),ve},Fc=f.__private__.putInfo=function(){var I=xn(),K=function(fe){return fe};for(var ae in d!==null&&(K=ms.encryptor(I,0)),te("<<"),te("/Producer ("+Wo(K("jsPDF "+Ot.version))+")"),Ge)Ge.hasOwnProperty(ae)&&Ge[ae]&&te("/"+ae.substr(0,1).toUpperCase()+ae.substr(1)+" ("+Wo(K(Ge[ae]))+")");te("/CreationDate ("+Wo(K(U))+")"),te(">>"),te("endobj")},Om=f.__private__.putCatalog=function(I){var K=(I=I||{}).rootDictionaryObjId||ni;switch(xn(),te("<<"),te("/Type /Catalog"),te("/Pages "+K+" 0 R"),st||(st="fullwidth"),st){case"fullwidth":te("/OpenAction [3 0 R /FitH null]");break;case"fullheight":te("/OpenAction [3 0 R /FitV null]");break;case"fullpage":te("/OpenAction [3 0 R /Fit]");break;case"original":te("/OpenAction [3 0 R /XYZ null null 1]");break;default:var ae=""+st;ae.substr(ae.length-1)==="%"&&(st=parseInt(st)/100),typeof st=="number"&&te("/OpenAction [3 0 R /XYZ null null "+T(st)+"]")}switch(pt||(pt="continuous"),pt){case"continuous":te("/PageLayout /OneColumn");break;case"single":te("/PageLayout /SinglePage");break;case"two":case"twoleft":te("/PageLayout /TwoColumnLeft");break;case"tworight":te("/PageLayout /TwoColumnRight")}Ve&&te("/PageMode /"+Ve),jn.publish("putCatalog"),te(">>"),te("endobj")},_T=f.__private__.putTrailer=function(){te("trailer"),te("<<"),te("/Size "+(V+1)),te("/Root "+V+" 0 R"),te("/Info "+(V-1)+" 0 R"),d!==null&&te("/Encrypt "+ms.oid+" 0 R"),te("/ID [ <"+H+"> <"+H+"> ]"),te(">>")},ji=f.__private__.putHeader=function(){te("%PDF-"+p),te("%ºß¬à")},uC=f.__private__.putXRef=function(){var I="0000000000";te("xref"),te("0 "+(V+1)),te("0000000000 65535 f ");for(var K=1;K<=V;K++)typeof Z[K]=="function"?te((I+Z[K]()).slice(-10)+" 00000 n "):Z[K]!==void 0?te((I+Z[K]).slice(-10)+" 00000 n "):te("0000000000 00000 n ")},Mc=f.__private__.buildDocument=function(){var I;V=0,ue=0,de=[],Z=[],se=[],ni=Ye(),ns=Ye(),Ie(de),jn.publish("buildDocument"),ji(),Oc(),function(){jn.publish("putAdditionalObjects");for(var ae=0;ae<se.length;ae++){var fe=se[ae];Gn(fe.objId,!0),te(fe.content),te("endobj")}jn.publish("postPutAdditionalObjects")}(),I=[],function(){for(var ae in wt)wt.hasOwnProperty(ae)&&(h===!1||h===!0&&A.hasOwnProperty(ae))&&cA(wt[ae])}(),function(){var ae;for(ae in Mt)Mt.hasOwnProperty(ae)&&kT(Mt[ae])}(),function(){for(var ae in Wt)Wt.hasOwnProperty(ae)&&Tm(Wt[ae])}(),function(ae){var fe;for(fe in gt)gt.hasOwnProperty(fe)&&(gt[fe]instanceof qA?Im(gt[fe]):gt[fe]instanceof cy&&Pm(gt[fe],ae))}(I),jn.publish("putResources"),I.forEach(D0),D0({resourcesOid:ns,objectOid:Number.MAX_SAFE_INTEGER}),jn.publish("postPutResources"),d!==null&&(ms.oid=xn(),te("<<"),te("/Filter /Standard"),te("/V "+ms.v),te("/R "+ms.r),te("/U <"+ms.toHexString(ms.U)+">"),te("/O <"+ms.toHexString(ms.O)+">"),te("/P "+ms.P),te(">>"),te("endobj")),Fc(),Om();var K=ue;return uC(),_T(),te("startxref"),te(""+K),te("%%EOF"),Ie(he[M]),de.join(`
`)},Fm=f.__private__.getBlob=function(I){return new Blob([nt(I)],{type:"application/pdf"})},Q0=function(I){for(;I.firstChild;)I.removeChild(I.firstChild)},Ao=function(I){var K,ae=I.document,fe=ae.documentElement,ve=ae.head,Ee=ae.body;return ve||(ve=ae.createElement("head"),fe.appendChild(ve)),Ee||(Ee=ae.createElement("body"),fe.appendChild(Ee)),Q0(ve),Q0(Ee),(K=ae.createElement("style")).appendChild(ae.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),ve.appendChild(K),{document:ae,body:Ee}},Mm=f.output=f.__private__.output=(or=function(I,K){switch(typeof(K=K||{})=="string"?K={filename:K}:K.filename=K.filename||"generated.pdf",I){case void 0:return Mc();case"save":f.save(K.filename);break;case"arraybuffer":return nt(Mc());case"blob":return Fm(Mc());case"bloburi":case"bloburl":if(Jt.URL!==void 0&&typeof Jt.URL.createObjectURL=="function")return Jt.URL&&Jt.URL.createObjectURL(Fm(Mc()))||void 0;dr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ae="",fe=Mc();try{ae=XJ(fe)}catch{ae=XJ(unescape(encodeURIComponent(fe)))}return"data:application/pdf;filename="+encodeURIComponent(K.filename)+";base64,"+ae;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Jt)==="[object Window]"){var ve="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ee=!K.pdfObjectUrl;Ee||(ve=K.pdfObjectUrl);var Le=Jt.open();if(Le!==null){var jt=Ao(Le),kt=jt.document.createElement("script"),nn=this;kt.src=ve,Ee&&(kt.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",kt.crossOrigin="anonymous"),kt.onload=function(){Le.PDFObject.embed(nn.output("dataurlstring"),K)},jt.body.appendChild(kt)}return Le}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Jt)==="[object Window]"){var ln=K.pdfJsUrl||"examples/PDF.js/web/viewer.html",In=Jt.open();if(In!==null){var Bi=Ao(In),cr=Bi.document.createElement("iframe"),rr=ln.indexOf("?")===-1?"?":"&";nn=this,cr.id="pdfViewer",cr.width="500px",cr.height="400px",cr.src=ln+rr+"file=&downloadName="+encodeURIComponent(K.filename),cr.onload=function(){In.document.title=K.filename,cr.contentWindow.PDFViewerApplication.open(nn.output("bloburl"))},Bi.body.appendChild(cr)}return In}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Jt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Er=Jt.open();if(Er!==null){var Kr=Ao(Er),qr=Kr.document.createElement("iframe");qr.src=this.output("datauristring",K),Kr.body.appendChild(qr),Er.document.title=K.filename}if(Er||typeof safari>"u")return Er;break;case"datauri":case"dataurl":return Jt.document.location.href=this.output("datauristring",K);default:return null}},or.foo=function(){try{return or.apply(this,arguments)}catch(ae){var I=ae.stack||"";~I.indexOf(" at ")&&(I=I.split(" at ")[1]);var K="Error in function "+I.split(`
`)[0].split("<")[0]+": "+ae.message;if(!Jt.console)throw new Error(K);Jt.console.error(K,ae),Jt.alert&&alert(K)}},or.foo.bar=or,or.foo),ju=function(I){return Array.isArray(Ut)===!0&&Ut.indexOf(I)>-1};switch(r){case"pt":Ze=1;break;case"mm":Ze=72/25.4;break;case"cm":Ze=72/2.54;break;case"in":Ze=72;break;case"px":Ze=ju("px_scaling")==1?.75:96/72;break;case"pc":case"em":Ze=12;break;case"ex":Ze=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);Ze=r}var ms=null;ce(),$();var dC=f.__private__.getPageInfo=f.getPageInfo=function(I){if(isNaN(I)||I%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Bt[I].objId,pageNumber:I,pageContext:Bt[I]}},jT=f.__private__.getPageInfoByObjId=function(I){if(isNaN(I)||I%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var K in Bt)if(Bt[K].objId===I)break;return dC(K)},BT=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:Bt[M].objId,pageNumber:M,pageContext:Bt[M]}};f.addPage=function(){return aC.apply(this,arguments),this},f.setPage=function(){return oC.apply(this,arguments),Ie.call(this,he[M]),this},f.insertPage=function(I){return this.addPage(),this.movePage(M,I),this},f.movePage=function(I,K){var ae,fe;if(I>K){ae=he[I],fe=Bt[I];for(var ve=I;ve>K;ve--)he[ve]=he[ve-1],Bt[ve]=Bt[ve-1];he[K]=ae,Bt[K]=fe,this.setPage(K)}else if(I<K){ae=he[I],fe=Bt[I];for(var Ee=I;Ee<K;Ee++)he[Ee]=he[Ee+1],Bt[Ee]=Bt[Ee+1];he[K]=ae,Bt[K]=fe,this.setPage(K)}return this},f.deletePage=function(){return H0.apply(this,arguments),this},f.__private__.text=f.text=function(I,K,ae,fe,ve){var Ee,Le,jt,kt,nn,ln,In,Bi,cr,rr=(fe=fe||{}).scope||this;if(typeof I=="number"&&typeof K=="number"&&(typeof ae=="string"||Array.isArray(ae))){var Er=ae;ae=K,K=I,I=Er}if(arguments[3]instanceof At==0?(jt=arguments[4],kt=arguments[5],Zn(In=arguments[3])==="object"&&In!==null||(typeof jt=="string"&&(kt=jt,jt=null),typeof In=="string"&&(kt=In,In=null),typeof In=="number"&&(jt=In,In=null),fe={flags:In,angle:jt,align:kt})):(E("The transform parameter of text() with a Matrix value"),cr=ve),isNaN(K)||isNaN(ae)||I==null)throw new Error("Invalid arguments passed to jsPDF.text");if(I.length===0)return rr;var Kr,qr="",Ls=typeof fe.lineHeightFactor=="number"?fe.lineHeightFactor:uA,Iu=rr.internal.scaleFactor;function G0(yr){return yr=yr.split("	").join(Array(fe.TabLen||9).join(" ")),Wo(yr,In)}function fA(yr){for(var vr,Ai=yr.concat(),Ui=[],Ou=Ai.length;Ou--;)typeof(vr=Ai.shift())=="string"?Ui.push(vr):Array.isArray(yr)&&(vr.length===1||vr[1]===void 0&&vr[2]===void 0)?Ui.push(vr[0]):Ui.push([vr[0],vr[1],vr[2]]);return Ui}function AA(yr,vr){var Ai;if(typeof yr=="string")Ai=vr(yr)[0];else if(Array.isArray(yr)){for(var Ui,Ou,tx=yr.concat(),Xm=[],wC=tx.length;wC--;)typeof(Ui=tx.shift())=="string"?Xm.push(vr(Ui)[0]):Array.isArray(Ui)&&typeof Ui[0]=="string"&&(Ou=vr(Ui[0],Ui[1],Ui[2]),Xm.push([Ou[0],Ou[1],Ou[2]]));Ai=Xm}return Ai}var $d=!1,pA=!0;if(typeof I=="string")$d=!0;else if(Array.isArray(I)){var $m=I.concat();Le=[];for(var zm,Rs=$m.length;Rs--;)(typeof(zm=$m.shift())!="string"||Array.isArray(zm)&&typeof zm[0]!="string")&&(pA=!1);$d=pA}if($d===!1)throw new Error('Type of text must be string or Array. "'+I+'" is not recognized.');typeof I=="string"&&(I=I.match(/[\r?\n]/)?I.split(/\r\n|\r|\n/g):[I]);var mA=Ne/rr.internal.scaleFactor,gA=mA*(Ls-1);switch(fe.baseline){case"bottom":ae-=gA;break;case"top":ae+=mA-gA;break;case"hanging":ae+=mA-2*gA;break;case"middle":ae+=mA/2-gA}if((ln=fe.maxWidth||0)>0&&(typeof I=="string"?I=rr.splitTextToSize(I,ln):Object.prototype.toString.call(I)==="[object Array]"&&(I=I.reduce(function(yr,vr){return yr.concat(rr.splitTextToSize(vr,ln))},[]))),Ee={text:I,x:K,y:ae,options:fe,mutex:{pdfEscape:Wo,activeFontKey:Ue,fonts:wt,activeFontSize:Ne}},jn.publish("preProcessText",Ee),I=Ee.text,jt=(fe=Ee.options).angle,cr instanceof At==0&&jt&&typeof jt=="number"){jt*=Math.PI/180,fe.rotationDirection===0&&(jt=-jt),b===x&&(jt=-jt);var Y0=Math.cos(jt),Dc=Math.sin(jt);cr=new At(Y0,Dc,-Dc,Y0,0,0)}else jt&&jt instanceof At&&(cr=jt);b!==x||cr||(cr=Ln),(nn=fe.charSpace||Um)!==void 0&&(qr+=B(F(nn))+` Tc
`,this.setCharSpace(this.getCharSpace()||0)),(Bi=fe.horizontalScale)!==void 0&&(qr+=B(100*Bi)+` Tz
`),fe.lang;var ua=-1,vC=fe.renderingMode!==void 0?fe.renderingMode:fe.stroke,Vm=rr.internal.getCurrentPageInfo().pageContext;switch(vC){case 0:case!1:case"fill":ua=0;break;case 1:case!0:case"stroke":ua=1;break;case 2:case"fillThenStroke":ua=2;break;case 3:case"invisible":ua=3;break;case 4:case"fillAndAddForClipping":ua=4;break;case 5:case"strokeAndAddPathForClipping":ua=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":ua=6;break;case 7:case"addToPathForClipping":ua=7}var xC=Vm.usedRenderingMode!==void 0?Vm.usedRenderingMode:-1;ua!==-1?qr+=ua+` Tr
`:xC!==-1&&(qr+=`0 Tr
`),ua!==-1&&(Vm.usedRenderingMode=ua),kt=fe.align||"left";var Go,yA=Ne*Ls,X0=rr.internal.pageSize.getWidth(),Km=wt[Ue];nn=fe.charSpace||Um,ln=fe.maxWidth||0,In=Object.assign({autoencode:!0,noBOM:!0},fe.flags);var vA=[],J0=function(yr){return rr.getStringUnitWidth(yr,{font:Km,charSpace:nn,fontSize:Ne,doKerning:!1})*Ne/Iu};if(Object.prototype.toString.call(I)==="[object Array]"){var da;Le=fA(I),kt!=="left"&&(Go=Le.map(J0));var La,qm=0;if(kt==="right"){K-=Go[0],I=[],Rs=Le.length;for(var zd=0;zd<Rs;zd++)zd===0?(La=Bu(K),da=Nu(ae)):(La=F(qm-Go[zd]),da=-yA),I.push([Le[zd],La,da]),qm=Go[zd]}else if(kt==="center"){K-=Go[0]/2,I=[],Rs=Le.length;for(var Vd=0;Vd<Rs;Vd++)Vd===0?(La=Bu(K),da=Nu(ae)):(La=F((qm-Go[Vd])/2),da=-yA),I.push([Le[Vd],La,da]),qm=Go[Vd]}else if(kt==="left"){I=[],Rs=Le.length;for(var Wm=0;Wm<Rs;Wm++)I.push(Le[Wm])}else if(kt==="justify"&&Km.encoding==="Identity-H"){I=[],Rs=Le.length,ln=ln!==0?ln:X0;for(var xA=0,Ni=0;Ni<Rs;Ni++)if(da=Ni===0?Nu(ae):-yA,La=Ni===0?Bu(K):xA,Ni<Rs-1){var $T=F((ln-Go[Ni])/(Le[Ni].split(" ").length-1)),Uc=Le[Ni].split(" ");I.push([Uc[0]+" ",La,da]),xA=0;for(var $l=1;$l<Uc.length;$l++){var wA=(J0(Uc[$l-1]+" "+Uc[$l])-J0(Uc[$l]))*Iu+$T;$l==Uc.length-1?I.push([Uc[$l],wA,0]):I.push([Uc[$l]+" ",wA,0]),xA-=wA}}else I.push([Le[Ni],La,da]);I.push(["",xA,0])}else{if(kt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(I=[],Rs=Le.length,ln=ln!==0?ln:X0,Ni=0;Ni<Rs;Ni++){da=Ni===0?Nu(ae):-yA,La=Ni===0?Bu(K):0;var Z0=Le[Ni].split(" ").length-1,ex=Z0>0?(ln-Go[Ni])/Z0:0;Ni<Rs-1?vA.push(B(F(ex))):vA.push(0),I.push([Le[Ni],La,da])}}}(typeof fe.R2L=="boolean"?fe.R2L:He)===!0&&(I=AA(I,function(yr,vr,Ai){return[yr.split("").reverse().join(""),vr,Ai]})),Ee={text:I,x:K,y:ae,options:fe,mutex:{pdfEscape:Wo,activeFontKey:Ue,fonts:wt,activeFontSize:Ne}},jn.publish("postProcessText",Ee),I=Ee.text,Kr=Ee.mutex.isHex||!1;var Gm=wt[Ue].encoding;Gm!=="WinAnsiEncoding"&&Gm!=="StandardEncoding"||(I=AA(I,function(yr,vr,Ai){return[G0(yr),vr,Ai]})),Le=fA(I),I=[];for(var bA,CA,Kd,Pu=Array.isArray(Le[0])?1:0,qd="",Ym=function(yr,vr,Ai){var Ui="";return Ai instanceof At?(Ai=typeof fe.angle=="number"?Ur(Ai,new At(1,0,0,1,yr,vr)):Ur(new At(1,0,0,1,yr,vr),Ai),b===x&&(Ai=Ur(new At(1,0,0,-1,0,0),Ai)),Ui=Ai.join(" ")+` Tm
`):Ui=B(yr)+" "+B(vr)+` Td
`,Ui},Ds=0;Ds<Le.length;Ds++){switch(qd="",Pu){case 1:Kd=(Kr?"<":"(")+Le[Ds][0]+(Kr?">":")"),bA=parseFloat(Le[Ds][1]),CA=parseFloat(Le[Ds][2]);break;case 0:Kd=(Kr?"<":"(")+Le[Ds]+(Kr?">":")"),bA=Bu(K),CA=Nu(ae)}vA!==void 0&&vA[Ds]!==void 0&&(qd=vA[Ds]+` Tw
`),Ds===0?I.push(qd+Ym(bA,CA,cr)+Kd):Pu===0?I.push(qd+Kd):Pu===1&&I.push(qd+Ym(bA,CA,cr)+Kd)}I=Pu===0?I.join(` Tj
T* `):I.join(` Tj
`),I+=` Tj
`;var Hc=`BT
/`;return Hc+=Ue+" "+Ne+` Tf
`,Hc+=B(Ne*Ls)+` TL
`,Hc+=Rc+`
`,Hc+=qr,Hc+=I,te(Hc+="ET"),A[Ue]=!0,rr};var NT=f.__private__.clip=f.clip=function(I){return te(I==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return NT("evenodd")},f.__private__.discardPath=f.discardPath=function(){return te("n"),this};var Lc=f.__private__.isValidStyle=function(I){var K=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(I)!==-1&&(K=!0),K};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(I){return Lc(I)&&(u=I),this};var hC=f.__private__.getStyle=f.getStyle=function(I){var K=u;switch(I){case"D":case"S":K="S";break;case"F":K="f";break;case"FD":case"DF":K="B";break;case"f":case"f*":case"B":case"B*":K=I}return K},Lm=f.close=function(){return te("h"),this};f.stroke=function(){return te("S"),this},f.fill=function(I){return Rm("f",I),this},f.fillEvenOdd=function(I){return Rm("f*",I),this},f.fillStroke=function(I){return Rm("B",I),this},f.fillStrokeEvenOdd=function(I){return Rm("B*",I),this};var Rm=function(I,K){Zn(K)==="object"?TT(K,I):te(I)},$0=function(I){I===null||b===x&&I===void 0||(I=hC(I),te(I))};function ET(I,K,ae,fe,ve){var Ee=new cy(K||this.boundingBox,ae||this.xStep,fe||this.yStep,this.gState,ve||this.matrix);Ee.stream=this.stream;var Le=I+"$$"+this.cloneIndex+++"$$";return gr(Le,Ee),Ee}var TT=function(I,K){var ae=Lt[I.key],fe=gt[ae];if(fe instanceof qA)te("q"),te(IT(K)),fe.gState&&f.setGState(fe.gState),te(I.matrix.toString()+" cm"),te("/"+ae+" sh"),te("Q");else if(fe instanceof cy){var ve=new At(1,0,0,-1,0,hA());I.matrix&&(ve=ve.multiply(I.matrix||Ln),ae=ET.call(fe,I.key,I.boundingBox,I.xStep,I.yStep,ve).id),te("q"),te("/Pattern cs"),te("/"+ae+" scn"),fe.gState&&f.setGState(fe.gState),te(K),te("Q")}},IT=function(I){switch(I){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Ud=f.moveTo=function(I,K){return te(B(F(I))+" "+B(L(K))+" m"),this},fC=f.lineTo=function(I,K){return te(B(F(I))+" "+B(L(K))+" l"),this},Hd=f.curveTo=function(I,K,ae,fe,ve,Ee){return te([B(F(I)),B(L(K)),B(F(ae)),B(L(fe)),B(F(ve)),B(L(Ee)),"c"].join(" ")),this};f.__private__.line=f.line=function(I,K,ae,fe,ve){if(isNaN(I)||isNaN(K)||isNaN(ae)||isNaN(fe)||!Lc(ve))throw new Error("Invalid arguments passed to jsPDF.line");return b===v?this.lines([[ae-I,fe-K]],I,K,[1,1],ve||"S"):this.lines([[ae-I,fe-K]],I,K,[1,1]).stroke()},f.__private__.lines=f.lines=function(I,K,ae,fe,ve,Ee){var Le,jt,kt,nn,ln,In,Bi,cr,rr,Er,Kr,qr;if(typeof I=="number"&&(qr=ae,ae=K,K=I,I=qr),fe=fe||[1,1],Ee=Ee||!1,isNaN(K)||isNaN(ae)||!Array.isArray(I)||!Array.isArray(fe)||!Lc(ve)||typeof Ee!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Ud(K,ae),Le=fe[0],jt=fe[1],nn=I.length,Er=K,Kr=ae,kt=0;kt<nn;kt++)(ln=I[kt]).length===2?(Er=ln[0]*Le+Er,Kr=ln[1]*jt+Kr,fC(Er,Kr)):(In=ln[0]*Le+Er,Bi=ln[1]*jt+Kr,cr=ln[2]*Le+Er,rr=ln[3]*jt+Kr,Er=ln[4]*Le+Er,Kr=ln[5]*jt+Kr,Hd(In,Bi,cr,rr,Er,Kr));return Ee&&Lm(),$0(ve),this},f.path=function(I){for(var K=0;K<I.length;K++){var ae=I[K],fe=ae.c;switch(ae.op){case"m":Ud(fe[0],fe[1]);break;case"l":fC(fe[0],fe[1]);break;case"c":Hd.apply(this,fe);break;case"h":Lm()}}return this},f.__private__.rect=f.rect=function(I,K,ae,fe,ve){if(isNaN(I)||isNaN(K)||isNaN(ae)||isNaN(fe)||!Lc(ve))throw new Error("Invalid arguments passed to jsPDF.rect");return b===v&&(fe=-fe),te([B(F(I)),B(L(K)),B(F(ae)),B(F(fe)),"re"].join(" ")),$0(ve),this},f.__private__.triangle=f.triangle=function(I,K,ae,fe,ve,Ee,Le){if(isNaN(I)||isNaN(K)||isNaN(ae)||isNaN(fe)||isNaN(ve)||isNaN(Ee)||!Lc(Le))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[ae-I,fe-K],[ve-ae,Ee-fe],[I-ve,K-Ee]],I,K,[1,1],Le,!0),this},f.__private__.roundedRect=f.roundedRect=function(I,K,ae,fe,ve,Ee,Le){if(isNaN(I)||isNaN(K)||isNaN(ae)||isNaN(fe)||isNaN(ve)||isNaN(Ee)||!Lc(Le))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var jt=4/3*(Math.SQRT2-1);return ve=Math.min(ve,.5*ae),Ee=Math.min(Ee,.5*fe),this.lines([[ae-2*ve,0],[ve*jt,0,ve,Ee-Ee*jt,ve,Ee],[0,fe-2*Ee],[0,Ee*jt,-ve*jt,Ee,-ve,Ee],[2*ve-ae,0],[-ve*jt,0,-ve,-Ee*jt,-ve,-Ee],[0,2*Ee-fe],[0,-Ee*jt,ve*jt,-Ee,ve,-Ee]],I+ve,K,[1,1],Le,!0),this},f.__private__.ellipse=f.ellipse=function(I,K,ae,fe,ve){if(isNaN(I)||isNaN(K)||isNaN(ae)||isNaN(fe)||!Lc(ve))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ee=4/3*(Math.SQRT2-1)*ae,Le=4/3*(Math.SQRT2-1)*fe;return Ud(I+ae,K),Hd(I+ae,K-Le,I+Ee,K-fe,I,K-fe),Hd(I-Ee,K-fe,I-ae,K-Le,I-ae,K),Hd(I-ae,K+Le,I-Ee,K+fe,I,K+fe),Hd(I+Ee,K+fe,I+ae,K+Le,I+ae,K),$0(ve),this},f.__private__.circle=f.circle=function(I,K,ae,fe){if(isNaN(I)||isNaN(K)||isNaN(ae)||!Lc(fe))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(I,K,ae,ae,fe)},f.setFont=function(I,K,ae){return ae&&(K=j(K,ae)),Ue=cC(I,K,{disableWarning:!1}),this};var PT=f.__private__.getFont=f.getFont=function(){return wt[cC.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var I,K,ae={};for(I in Rt)if(Rt.hasOwnProperty(I))for(K in ae[I]=[],Rt[I])Rt[I].hasOwnProperty(K)&&ae[I].push(K);return ae},f.addFont=function(I,K,ae,fe,ve){var Ee=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ee.indexOf(arguments[3])!==-1?ve=arguments[3]:arguments[3]&&Ee.indexOf(arguments[3])==-1&&(ae=j(ae,fe)),sC.call(this,I,K,ae,ve=ve||"Identity-H")};var uA,Xt=e.lineWidth||.200025,OT=f.__private__.getLineWidth=f.getLineWidth=function(){return Xt},FT=f.__private__.setLineWidth=f.setLineWidth=function(I){return Xt=I,te(B(F(I))+" w"),this};f.__private__.setLineDash=Ot.API.setLineDash=Ot.API.setLineDashPattern=function(I,K){if(I=I||[],K=K||0,isNaN(K)||!Array.isArray(I))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return I=I.map(function(ae){return B(F(ae))}).join(" "),K=B(F(K)),te("["+I+"] "+K+" d"),this};var MT=f.__private__.getLineHeight=f.getLineHeight=function(){return Ne*uA};f.__private__.getLineHeight=f.getLineHeight=function(){return Ne*uA};var LT=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function(I){return typeof(I=I||1.15)=="number"&&(uA=I),this},RT=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return uA};LT(e.lineHeight);var Bu=f.__private__.getHorizontalCoordinate=function(I){return F(I)},Nu=f.__private__.getVerticalCoordinate=function(I){return b===x?I:Bt[M].mediaBox.topRightY-Bt[M].mediaBox.bottomLeftY-F(I)},DT=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function(I){return B(Bu(I))},UT=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function(I){return B(Nu(I))},Dm=e.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return Ma(Dm)},f.__private__.setStrokeColor=f.setDrawColor=function(I,K,ae,fe){return Dm=Hl({ch1:I,ch2:K,ch3:ae,ch4:fe,pdfColorType:"draw",precision:2}),te(Dm),this};var z0=e.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return Ma(z0)},f.__private__.setFillColor=f.setFillColor=function(I,K,ae,fe){return z0=Hl({ch1:I,ch2:K,ch3:ae,ch4:fe,pdfColorType:"fill",precision:2}),te(z0),this};var Rc=e.textColor||"0 g",HT=f.__private__.getTextColor=f.getTextColor=function(){return Ma(Rc)};f.__private__.setTextColor=f.setTextColor=function(I,K,ae,fe){return Rc=Hl({ch1:I,ch2:K,ch3:ae,ch4:fe,pdfColorType:"text",precision:3}),this};var Um=e.charSpace,QT=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(Um||0)};f.__private__.setCharSpace=f.setCharSpace=function(I){if(isNaN(I))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Um=I,this};var V0=0;f.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},f.__private__.setLineCap=f.setLineCap=function(I){var K=f.CapJoinStyles[I];if(K===void 0)throw new Error("Line cap style of '"+I+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return V0=K,te(K+" J"),this};var Qd=0;f.__private__.setLineJoin=f.setLineJoin=function(I){var K=f.CapJoinStyles[I];if(K===void 0)throw new Error("Line join style of '"+I+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Qd=K,te(K+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function(I){if(I=I||0,isNaN(I))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return te(B(F(I))+" M"),this},f.GState=IN,f.setGState=function(I){(I=typeof I=="string"?Mt[qt[I]]:K0(null,I)).equals(nr)||(te("/"+I.id+" gs"),nr=I)};var K0=function(I,K){if(!I||!qt[I]){var ae=!1;for(var fe in Mt)if(Mt.hasOwnProperty(fe)&&Mt[fe].equals(K)){ae=!0;break}if(ae)K=Mt[fe];else{var ve="GS"+(Object.keys(Mt).length+1).toString(10);Mt[ve]=K,K.id=ve}return I&&(qt[I]=K.id),jn.publish("addGState",K),K}};f.addGState=function(I,K){return K0(I,K),this},f.saveGraphicsState=function(){return te("q"),zt.push({key:Ue,size:Ne,color:Rc}),this},f.restoreGraphicsState=function(){te("Q");var I=zt.pop();return Ue=I.key,Ne=I.size,Rc=I.color,nr=null,this},f.setCurrentTransformationMatrix=function(I){return te(I.toString()+" cm"),this},f.comment=function(I){return te("#"+I),this};var dA=function(I,K){var ae=I||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return ae},set:function(Ee){isNaN(Ee)||(ae=parseFloat(Ee))}});var fe=K||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return fe},set:function(Ee){isNaN(Ee)||(fe=parseFloat(Ee))}});var ve="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return ve},set:function(Ee){ve=Ee.toString()}}),this},q0=function(I,K,ae,fe){dA.call(this,I,K),this.type="rect";var ve=ae||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return ve},set:function(Le){isNaN(Le)||(ve=parseFloat(Le))}});var Ee=fe||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ee},set:function(Le){isNaN(Le)||(Ee=parseFloat(Le))}}),this},Hm=function(){this.page=tn,this.currentPage=M,this.pages=he.slice(0),this.pagesContext=Bt.slice(0),this.x=pe,this.y=mt,this.matrix=ft,this.width=AC(M),this.height=Tu(M),this.outputDestination=Ce,this.id="",this.objectNumber=-1};Hm.prototype.restore=function(){tn=this.page,M=this.currentPage,Bt=this.pagesContext,he=this.pages,pe=this.x,mt=this.y,ft=this.matrix,Eu(M,this.width),pC(M,this.height),Ce=this.outputDestination};var W0=function(I,K,ae,fe,ve){Nr.push(new Hm),tn=M=0,he=[],pe=I,mt=K,ft=ve,U0([ae,fe])};for(var Qm in f.beginFormObject=function(I,K,ae,fe,ve){return W0(I,K,ae,fe,ve),this},f.endFormObject=function(I){return function(K){if(wn[K])Nr.pop().restore();else{var ae=new Hm,fe="Xo"+(Object.keys(Wt).length+1).toString(10);ae.id=fe,wn[K]=fe,Wt[fe]=ae,jn.publish("addFormObject",ae),Nr.pop().restore()}}(I),this},f.doFormObject=function(I,K){var ae=Wt[wn[I]];return te("q"),te(K.toString()+" cm"),te("/"+ae.id+" Do"),te("Q"),this},f.getFormObject=function(I){var K=Wt[wn[I]];return{x:K.x,y:K.y,width:K.width,height:K.height,matrix:K.matrix}},f.save=function(I,K){return I=I||"generated.pdf",(K=K||{}).returnPromise=K.returnPromise||!1,K.returnPromise===!1?(QA(Fm(Mc()),I),typeof QA.unload=="function"&&Jt.setTimeout&&setTimeout(QA.unload,911),this):new Promise(function(ae,fe){try{var ve=QA(Fm(Mc()),I);typeof QA.unload=="function"&&Jt.setTimeout&&setTimeout(QA.unload,911),ae(ve)}catch(Ee){fe(Ee.message)}})},Ot.API)Ot.API.hasOwnProperty(Qm)&&(Qm==="events"&&Ot.API.events.length?function(I,K){var ae,fe,ve;for(ve=K.length-1;ve!==-1;ve--)ae=K[ve][0],fe=K[ve][1],I.subscribe.apply(I,[ae].concat(typeof fe=="function"?[fe]:fe))}(jn,Ot.API.events):f[Qm]=Ot.API[Qm]);function AC(I){return Bt[I].mediaBox.topRightX-Bt[I].mediaBox.bottomLeftX}function Eu(I,K){Bt[I].mediaBox.topRightX=K+Bt[I].mediaBox.bottomLeftX}function Tu(I){return Bt[I].mediaBox.topRightY-Bt[I].mediaBox.bottomLeftY}function pC(I,K){Bt[I].mediaBox.topRightY=K+Bt[I].mediaBox.bottomLeftY}var mC=f.getPageWidth=function(I){return AC(I=I||M)/Ze},gC=f.setPageWidth=function(I,K){Eu(I,K*Ze)},hA=f.getPageHeight=function(I){return Tu(I=I||M)/Ze},yC=f.setPageHeight=function(I,K){pC(I,K*Ze)};return f.internal={pdfEscape:Wo,getStyle:hC,getFont:PT,getFontSize:we,getCharSpace:QT,getTextColor:HT,getLineHeight:MT,getLineHeightFactor:RT,getLineWidth:OT,write:je,getHorizontalCoordinate:Bu,getVerticalCoordinate:Nu,getCoordinateString:DT,getVerticalCoordinateString:UT,collections:{},newObject:xn,newAdditionalObject:lr,newObjectDeferred:Ye,newObjectDeferredBegin:Gn,getFilters:Ql,putStream:qo,events:jn,scaleFactor:Ze,pageSize:{getWidth:function(){return mC(M)},setWidth:function(I){gC(M,I)},getHeight:function(){return hA(M)},setHeight:function(I){yC(M,I)}},encryptionOptions:d,encryption:ms,getEncryptor:function(I){return d!==null?ms.encryptor(I,0):function(K){return K}},output:Mm,getNumberOfPages:lC,get pages(){return he},out:te,f2:T,f3:N,getPageInfo:dC,getPageInfoByObjId:jT,getCurrentPageInfo:BT,getPDFVersion:m,Point:dA,Rectangle:q0,Matrix:At,hasHotfix:ju},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return mC(M)},set:function(I){gC(M,I)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return hA(M)},set:function(I){yC(M,I)},enumerable:!0,configurable:!0}),(function(I){for(var K=0,ae=rt.length;K<ae;K++){var fe=sC.call(this,I[K][0],I[K][1],I[K][2],rt[K][3],!0);h===!1&&(A[fe]=!0);var ve=I[K][0].split("-");iC({id:fe,fontName:ve[0],fontStyle:ve[1]||""})}jn.publish("addFonts",{fonts:wt,dictionary:Rt})}).call(f,rt),Ue="F1",aC(i,n),jn.publish("initialized"),f}Rg.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},Rg.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Rg.prototype.hexToBytes=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},Rg.prototype.processOwnerPassword=function(e,t){return ER(NR(t).substr(0,5),e)},Rg.prototype.encryptor=function(e,t){var n=NR(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(r){return ER(n,r)}},IN.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||Zn(e)!==Zn(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return r===0},Ot.API={events:[]},Ot.version="4.2.1";var oi=Ot.API,A$=1,Em=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Cg=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},fm=function(e){return e.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(t){var n=t.charCodeAt(0).toString(16).toUpperCase();return"#"+(n.length===1?"0"+n:n)})},an=function(e){return e.toFixed(2)},uh=function(e){return e.toFixed(5)};oi.__acroform__={};var fo=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},tZ=function(e){return e*A$},Vc=function(e){var t=new Cve,n=Ct.internal.getHeight(e)||0,r=Ct.internal.getWidth(e)||0;return t.BBox=[0,0,Number(an(r)),Number(an(n))],t},r_t=oi.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},i_t=oi.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},s_t=oi.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},wi=oi.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return s_t(e,t-1)},bi=oi.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return r_t(e,t-1)},Ci=oi.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return i_t(e,t-1)},a_t=oi.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,i=e[0],s=e[1],a=e[2],o=e[3],c={};return c.lowerLeft_X=n(i)||0,c.lowerLeft_Y=r(s+o)||0,c.upperRight_X=n(i+a)||0,c.upperRight_Y=r(s)||0,[Number(an(c.lowerLeft_X)),Number(an(c.lowerLeft_Y)),Number(an(c.upperRight_X)),Number(an(c.upperRight_Y))]},o_t=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=TR(e,n),i=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+i+" "+an(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var s=Vc(e);return s.scope=e.scope,s.stream=t.join(`
`),s}},TR=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},i=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");i=e.multiline?i.map(function(T){return T.split(`
`)}):i.map(function(T){return[T]});var s=n,a=Ct.internal.getHeight(e)||0;a=a<0?-a:a;var o=Ct.internal.getWidth(e)||0;o=o<0?-o:o;var c=function(T,N,F){if(T+1<i.length){var L=N+" "+i[T+1][0];return uk(L,e,F).width<=o-4}return!1};s++;e:for(;s>0;){t="",s--;var u,d,h=uk("3",e,s).height,A=e.multiline?a-s:(a-h)/2,f=A+=2,p=0,m=0,g=0;if(s<=0){t=`(...) Tj
`,t+="% Width of Text: "+uk(t,e,s=12).width+", FieldWidth:"+o+`
`;break}for(var y="",v=0,x=0;x<i.length;x++)if(i.hasOwnProperty(x)){var b=!1;if(i[x].length!==1&&g!==i[x].length-1){if((h+2)*(v+2)+2>a)continue e;y+=i[x][g],b=!0,m=x,x--}else{y=(y+=i[x][g]+" ").substr(y.length-1)==" "?y.substr(0,y.length-1):y;var w=parseInt(x),k=c(w,y,s),j=x>=i.length-1;if(k&&!j){y+=" ",g=0;continue}if(k||j){if(j)m=w;else if(e.multiline&&(h+2)*(v+2)+2>a)continue e}else{if(!e.multiline||(h+2)*(v+2)+2>a)continue e;m=w}}for(var B="",E=p;E<=m;E++){var P=i[E];if(e.multiline){if(E===m){B+=P[g]+" ",g=(g+1)%P.length;continue}if(E===p){B+=P[P.length-1]+" ";continue}}B+=P[0]+" "}switch(B=B.substr(B.length-1)==" "?B.substr(0,B.length-1):B,d=uk(B,e,s).width,e.textAlign){case"right":u=o-d-2;break;case"center":u=(o-d)/2;break;default:u=2}t+=an(u)+" "+an(f)+` Td
`,t+="("+Em(B)+`) Tj
`,t+=-an(u)+` 0 Td
`,f=-(s+2),d=0,p=b?m:m+1,v++,y=""}break}return r.text=t,r.fontSize=s,r},uk=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},l_t={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},c_t=function(e,t){var n={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},u_t=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(Tc.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(l_t)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");A$=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new Sve,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];s.objId=void 0,s.hasAnnotation&&c_t(s,n)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(n){(function(r,i){var s=!r;for(var a in r||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(a)){var o=r[a],c=[],u=o.Rect;if(o.Rect&&(o.Rect=a_t(o.Rect,i)),i.internal.newObjectDeferredBegin(o.objId,!0),o.DA=Ct.createDefaultAppearanceStream(o),Zn(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(c=o.getKeyValueListForStream()),o.Rect=u,o.hasAppearanceStream&&!o.appearanceStreamContent){var d=o_t(o);c.push({key:"AP",value:"<</N "+d+">>"}),i.internal.acroformPlugin.xForms.push(d)}if(o.appearanceStreamContent){var h="";for(var A in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(A)){var f=o.appearanceStreamContent[A];if(h+="/"+A+" ",h+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var a in f)if(f.hasOwnProperty(a)){var p=f[a];typeof p=="function"&&(p=p.call(i,o)),h+="/"+a+" "+p+" ",i.internal.acroformPlugin.xForms.indexOf(p)>=0||i.internal.acroformPlugin.xForms.push(p)}}else typeof(p=f)=="function"&&(p=p.call(i,o)),h+="/"+a+" "+p,i.internal.acroformPlugin.xForms.indexOf(p)>=0||i.internal.acroformPlugin.xForms.push(p);h+=">>"}c.push({key:"AP",value:`<<
`+h+">>"})}i.internal.putStream({additionalKeyValues:c,objectId:o.objId}),i.internal.out("endobj")}s&&function(m,g){for(var y in m)if(m.hasOwnProperty(y)){var v=y,x=m[y];g.internal.newObjectDeferredBegin(x.objId,!0),Zn(x)==="object"&&typeof x.putStream=="function"&&x.putStream(),delete m[v]}}(i.internal.acroformPlugin.xForms,i)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},bve=oi.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(a){return a};if(Array.isArray(e)){for(var i="[",s=0;s<e.length;s++)switch(s!==0&&(i+=" "),Zn(e[s])){case"boolean":case"number":case"object":i+=e[s].toString();break;case"string":e[s].substr(0,1)==="/"?i+="/"+fm(e[s].substr(1)):(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),i+="("+Em(r(e[s].toString()))+")")}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},uO=function(e,t,n){var r=function(i){return i};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),"("+Em(r(e))+")"},su=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};su.prototype.toString=function(){return this.objId+" 0 R"},su.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},su.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(s){return s!="content"&&s!="appearanceStreamContent"&&s!="scope"&&s!="objId"&&s.substring(0,1)!="_"});for(var n in t)if(Object.getOwnPropertyDescriptor(this,t[n]).configurable===!1){var r=t[n],i=this[r];i&&(Array.isArray(i)?e.push({key:r,value:bve(i,this.objId,this.scope)}):i instanceof su?(i.scope=this.scope,e.push({key:r,value:i.objId+" 0 R"})):typeof i!="function"&&e.push({key:r,value:i}))}return e};var Cve=function(){su.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){e=n.trim()},get:function(){return e||null}})};fo(Cve,su);var Sve=function(){su.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Em(n(e))+")"}},set:function(n){e=n}})};fo(Sve,su);var Tc=function e(){su.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute F supplied.');t=y}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!wi(t,3)},set:function(y){y?this.F=bi(t,3):this.F=Ci(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute Ff supplied.');n=y}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(y){r=y!==void 0?y:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(y){r[0]=y}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(y){r[1]=y}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(y){r[2]=y}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(y){r[3]=y}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(y){switch(y){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=y;break;default:throw new Error('Invalid value "'+y+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof PN)return;s="FieldObject"+e.FieldNum++}var y=function(v){return v};return this.scope&&(y=this.scope.internal.getEncryptor(this.objId)),"("+Em(y(s))+")"},set:function(y){s=y.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(y){s=y}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(y){a=y}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(y){o=y}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(y){c=y}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/A$:u},set:function(y){u=y}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(y){d=y}});var h="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof PN||this instanceof Mp))return uO(h,this.objId,this.scope)},set:function(y){y=y.toString(),h=y}});var A=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(A)return this instanceof ls==0?uO(A,this.objId,this.scope):A},set:function(y){y=y.toString(),A=this instanceof ls==0?y.substr(0,1)==="("?Cg(y.substr(1,y.length-2)):Cg(y):y}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof ls==1?Cg(A.substr(1,A.length-1)):A},set:function(y){y=y.toString(),A=this instanceof ls==1?"/"+fm(y):y}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(y){this.V=y}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof ls==0?uO(f,this.objId,this.scope):f},set:function(y){y=y.toString(),f=this instanceof ls==0?y.substr(0,1)==="("?Cg(y.substr(1,y.length-2)):Cg(y):y}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof ls==1?Cg(f.substr(1,f.length-1)):f},set:function(y){y=y.toString(),f=this instanceof ls==1?"/"+fm(y):y}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var p,m=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return m},set:function(y){y=!!y,m=y}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(p)return p},set:function(y){p=y}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,1)},set:function(y){y?this.Ff=bi(this.Ff,1):this.Ff=Ci(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,2)},set:function(y){y?this.Ff=bi(this.Ff,2):this.Ff=Ci(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,3)},set:function(y){y?this.Ff=bi(this.Ff,3):this.Ff=Ci(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(g!==null)return g},set:function(y){if([0,1,2].indexOf(y)===-1)throw new Error('Invalid value "'+y+'" for attribute Q supplied.');g=y}}),Object.defineProperty(this,"textAlign",{get:function(){var y;switch(g){case 0:default:y="left";break;case 1:y="center";break;case 2:y="right"}return y},configurable:!0,enumerable:!0,set:function(y){switch(y){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};fo(Tc,su);var Ly=function(){Tc.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(n){e=n}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return bve(t,this.objId,this.scope)},set:function(n){var r,i;i=[],typeof(r=n)=="string"&&(i=function(s,a,o){o||(o=1);for(var c,u=[];c=a.exec(s);)u.push(c[o]);return u}(r,/\((.*?)\)/g)),t=i}}),this.getOptions=function(){return t},this.setOptions=function(n){t=n,this.sort&&t.sort()},this.addOption=function(n){n=(n=n||"").toString(),t.push(n),this.sort&&t.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();t.indexOf(n)!==-1&&(t.splice(t.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,18)},set:function(n){n?this.Ff=bi(this.Ff,18):this.Ff=Ci(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=bi(this.Ff,19):this.Ff=Ci(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,20)},set:function(n){n?(this.Ff=bi(this.Ff,20),t.sort()):this.Ff=Ci(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,22)},set:function(n){n?this.Ff=bi(this.Ff,22):this.Ff=Ci(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,23)},set:function(n){n?this.Ff=bi(this.Ff,23):this.Ff=Ci(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,27)},set:function(n){n?this.Ff=bi(this.Ff,27):this.Ff=Ci(this.Ff,27)}}),this.hasAppearanceStream=!1};fo(Ly,Tc);var Ry=function(){Ly.call(this),this.fontName="helvetica",this.combo=!1};fo(Ry,Ly);var Dy=function(){Ry.call(this),this.combo=!0};fo(Dy,Ry);var C_=function(){Dy.call(this),this.edit=!0};fo(C_,Dy);var ls=function(){Tc.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,15)},set:function(n){n?this.Ff=bi(this.Ff,15):this.Ff=Ci(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,16)},set:function(n){n?this.Ff=bi(this.Ff,16):this.Ff=Ci(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,17)},set:function(n){n?this.Ff=bi(this.Ff,17):this.Ff=Ci(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,26)},set:function(n){n?this.Ff=bi(this.Ff,26):this.Ff=Ci(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(s){return s};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var r,i=[];for(r in i.push("<<"),t)i.push("/"+r+" ("+Em(n(t[r]))+")");return i.push(">>"),i.join(`
`)}},set:function(n){Zn(n)==="object"&&(t=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(n){typeof n=="string"&&(t.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(n){var r=n==null?"":n.toString();r.substr(0,1)==="/"&&(r=r.substr(1)),e="/"+fm(r)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(n){e="/"+fm(n)}})};fo(ls,Tc);var S_=function(){ls.call(this),this.pushButton=!0};fo(S_,ls);var Uy=function(){ls.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};fo(Uy,ls);var PN=function(){var e,t;Tc.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(i){e=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(i){t=i}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(o){return o};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var s,a=[];for(s in a.push("<<"),r)a.push("/"+s+" ("+Em(i(r[s]))+")");return a.push(">>"),a.join(`
`)},set:function(i){Zn(i)==="object"&&(r=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(i){typeof i=="string"&&(r.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+fm(s)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+fm(s)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Ct.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};fo(PN,Tc),Uy.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},Uy.prototype.createOption=function(e){var t=new PN;return t.Parent=this,t.optionName=e,this.Kids.push(t),d_t.call(this.scope,t),t};var k_=function(){ls.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Ct.CheckBox.createAppearanceStream()};fo(k_,ls);var Mp=function(){Tc.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,13)},set:function(t){t?this.Ff=bi(this.Ff,13):this.Ff=Ci(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,21)},set:function(t){t?this.Ff=bi(this.Ff,21):this.Ff=Ci(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,23)},set:function(t){t?this.Ff=bi(this.Ff,23):this.Ff=Ci(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,24)},set:function(t){t?this.Ff=bi(this.Ff,24):this.Ff=Ci(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,25)},set:function(t){t?this.Ff=bi(this.Ff,25):this.Ff=Ci(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,26)},set:function(t){t?this.Ff=bi(this.Ff,26):this.Ff=Ci(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};fo(Mp,Tc);var __=function(){Mp.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!wi(this.Ff,14)},set:function(e){e?this.Ff=bi(this.Ff,14):this.Ff=Ci(this.Ff,14)}}),this.password=!0};fo(__,Mp);var Ct={CheckBox:{createAppearanceStream:function(){return{N:{On:Ct.CheckBox.YesNormal},D:{On:Ct.CheckBox.YesPushDown,Off:Ct.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Vc(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),s=TR(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+an(Ct.internal.getWidth(e))+" "+an(Ct.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+an(s.fontSize)+" Tf "+i),n.push("BT"),n.push(s.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join(`
`),t},YesNormal:function(e){var t=Vc(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],s=Ct.internal.getHeight(e),a=Ct.internal.getWidth(e),o=TR(e,e.caption);return i.push("1 g"),i.push("0 0 "+an(a)+" "+an(s)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+an(a-1)+" "+an(s-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+an(o.fontSize)+" Tf "+r),i.push(o.text),i.push("ET"),i.push("Q"),t.stream=i.join(`
`),t},OffPushDown:function(e){var t=Vc(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+an(Ct.internal.getWidth(e))+" "+an(Ct.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Ct.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Ct.RadioButton.Circle.YesNormal,t.D[e]=Ct.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Vc(e);t.scope=e.scope;var n=[],r=Ct.internal.getWidth(e)<=Ct.internal.getHeight(e)?Ct.internal.getWidth(e)/4:Ct.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Ct.internal.Bezier_C,s=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+uh(Ct.internal.getWidth(e)/2)+" "+uh(Ct.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t},YesPushDown:function(e){var t=Vc(e);t.scope=e.scope;var n=[],r=Ct.internal.getWidth(e)<=Ct.internal.getHeight(e)?Ct.internal.getWidth(e)/4:Ct.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*Ct.internal.Bezier_C).toFixed(5)),a=Number((r*Ct.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+uh(Ct.internal.getWidth(e)/2)+" "+uh(Ct.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+uh(Ct.internal.getWidth(e)/2)+" "+uh(Ct.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t},OffPushDown:function(e){var t=Vc(e);t.scope=e.scope;var n=[],r=Ct.internal.getWidth(e)<=Ct.internal.getHeight(e)?Ct.internal.getWidth(e)/4:Ct.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*Ct.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+uh(Ct.internal.getWidth(e)/2)+" "+uh(Ct.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Ct.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Ct.RadioButton.Cross.YesNormal,t.D[e]=Ct.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Vc(e);t.scope=e.scope;var n=[],r=Ct.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+an(Ct.internal.getWidth(e)-2)+" "+an(Ct.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(an(r.x1.x)+" "+an(r.x1.y)+" m"),n.push(an(r.x2.x)+" "+an(r.x2.y)+" l"),n.push(an(r.x4.x)+" "+an(r.x4.y)+" m"),n.push(an(r.x3.x)+" "+an(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
`),t},YesPushDown:function(e){var t=Vc(e);t.scope=e.scope;var n=Ct.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+an(Ct.internal.getWidth(e))+" "+an(Ct.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+an(Ct.internal.getWidth(e)-2)+" "+an(Ct.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(an(n.x1.x)+" "+an(n.x1.y)+" m"),r.push(an(n.x2.x)+" "+an(n.x2.y)+" l"),r.push(an(n.x4.x)+" "+an(n.x4.y)+" m"),r.push(an(n.x3.x)+" "+an(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
`),t},OffPushDown:function(e){var t=Vc(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+an(Ct.internal.getWidth(e))+" "+an(Ct.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};Ct.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Ct.internal.getWidth(e),n=Ct.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},Ct.internal.getWidth=function(e){var t=0;return Zn(e)==="object"&&(t=tZ(e.Rect[2])),t},Ct.internal.getHeight=function(e){var t=0;return Zn(e)==="object"&&(t=tZ(e.Rect[3])),t};var d_t=oi.addField=function(e){if(u_t(this,e),!(e instanceof Tc))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};oi.AcroFormChoiceField=Ly,oi.AcroFormListBox=Ry,oi.AcroFormComboBox=Dy,oi.AcroFormEditBox=C_,oi.AcroFormButton=ls,oi.AcroFormPushButton=S_,oi.AcroFormRadioButton=Uy,oi.AcroFormCheckBox=k_,oi.AcroFormTextField=Mp,oi.AcroFormPasswordField=__,oi.AcroFormAppearance=Ct,oi.AcroForm={ChoiceField:Ly,ListBox:Ry,ComboBox:Dy,EditBox:C_,Button:ls,PushButton:S_,RadioButton:Uy,CheckBox:k_,TextField:Mp,PasswordField:__,Appearance:Ct},Ot.AcroForm={ChoiceField:Ly,ListBox:Ry,ComboBox:Dy,EditBox:C_,Button:ls,PushButton:S_,RadioButton:Uy,CheckBox:k_,TextField:Mp,PasswordField:__,Appearance:Ct};function kve(e){return e.reduce(function(t,n,r){return t[n]=r,t},{})}(function(e){var t="addImage_";e.__addimage__={};var n="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=e.__addimage__.getImageFileTypeByImageData=function(T,N){var F,L,U,H,W,$=n;if((N=N||n)==="RGBA"||T.data!==void 0&&T.data instanceof Uint8ClampedArray&&"height"in T&&"width"in T)return"RGBA";if(k(T))for(W in r)for(U=r[W],F=0;F<U.length;F+=1){for(H=!0,L=0;L<U[F].length;L+=1)if(U[F][L]!==void 0&&U[F][L]!==T[L]){H=!1;break}if(H===!0){$=W;break}}else for(W in r)for(U=r[W],F=0;F<U.length;F+=1){for(H=!0,L=0;L<U[F].length;L+=1)if(U[F][L]!==void 0&&U[F][L]!==T.charCodeAt(L)){H=!1;break}if(H===!0){$=W;break}}return $===n&&N!==n&&($=N),$},s=function T(N){for(var F=this.internal.write,L=this.internal.putStream,U=(0,this.internal.getFilters)();U.indexOf("FlateEncode")!==-1;)U.splice(U.indexOf("FlateEncode"),1);N.objectId=this.internal.newObject();var H=[];if(H.push({key:"Type",value:"/XObject"}),H.push({key:"Subtype",value:"/Image"}),H.push({key:"Width",value:N.width}),H.push({key:"Height",value:N.height}),N.colorSpace===y.INDEXED?H.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(N.palette.length/3-1)+" "+("sMask"in N&&N.sMask!==void 0?N.objectId+2:N.objectId+1)+" 0 R]"}):(H.push({key:"ColorSpace",value:"/"+N.colorSpace}),N.colorSpace===y.DEVICE_CMYK&&H.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),H.push({key:"BitsPerComponent",value:N.bitsPerComponent}),"decodeParameters"in N&&N.decodeParameters!==void 0&&H.push({key:"DecodeParms",value:"<<"+N.decodeParameters+">>"}),"transparency"in N&&Array.isArray(N.transparency)&&N.transparency.length>0){for(var W="",$=0,z=N.transparency.length;$<z;$++)W+=N.transparency[$]+" "+N.transparency[$]+" ";H.push({key:"Mask",value:"["+W+"]"})}N.sMask!==void 0&&H.push({key:"SMask",value:N.objectId+1+" 0 R"});var Q=N.filter!==void 0?["/"+N.filter]:void 0;if(L({data:N.data,additionalKeyValues:H,alreadyAppliedFilters:Q,objectId:N.objectId}),F("endobj"),"sMask"in N&&N.sMask!==void 0){var ce,R=(ce=N.sMaskBitsPerComponent)!==null&&ce!==void 0?ce:N.bitsPerComponent,M={width:N.width,height:N.height,colorSpace:"DeviceGray",bitsPerComponent:R,data:N.sMask};"filter"in N&&(M.decodeParameters="/Predictor ".concat(N.predictor," /Colors 1 /BitsPerComponent ").concat(R," /Columns ").concat(N.width),M.filter=N.filter),T.call(this,M)}if(N.colorSpace===y.INDEXED){var Y=this.internal.newObject();L({data:B(new Uint8Array(N.palette)),objectId:Y}),F("endobj")}},a=function(){var T=this.internal.collections[t+"images"];for(var N in T)s.call(this,T[N])},o=function(){var T,N=this.internal.collections[t+"images"],F=this.internal.write;for(var L in N)F("/I"+(T=N[L]).index,T.objectId,"0","R")},c=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var T=this.internal.collections[t+"images"];return c.call(this),T},d=function(){return Object.keys(this.internal.collections[t+"images"]).length},h=function(T){return typeof e["process"+T.toUpperCase()]=="function"},A=function(T){return Zn(T)==="object"&&T.nodeType===1},f=function(T,N){if(T.nodeName==="IMG"&&T.hasAttribute("src")){var F=""+T.getAttribute("src");if(F.indexOf("data:image/")===0)return b_(unescape(F).split("base64,").pop());var L=e.loadFile(F,!0);if(L!==void 0)return L}if(T.nodeName==="CANVAS"){if(T.width===0||T.height===0)throw new Error("Given canvas must have data. Canvas width: "+T.width+", height: "+T.height);var U;switch(N){case"PNG":U="image/png";break;case"WEBP":U="image/webp";break;default:U="image/jpeg"}return b_(T.toDataURL(U,1).split("base64,").pop())}},p=function(T){var N=this.internal.collections[t+"images"];if(N){for(var F in N)if(T===N[F].alias)return N[F]}},m=function(T,N,F){return T||N||(T=-96,N=-96),T<0&&(T=-1*F.width*72/T/this.internal.scaleFactor),N<0&&(N=-1*F.height*72/N/this.internal.scaleFactor),T===0&&(T=N*F.width/F.height),N===0&&(N=T*F.height/F.width),[T,N]},g=function(T,N,F,L,U,H){var W=m.call(this,F,L,U),$=this.internal.getCoordinateString,z=this.internal.getVerticalCoordinateString,Q=u.call(this);if(F=W[0],L=W[1],Q[U.index]=U,H){H*=Math.PI/180;var ce=Math.cos(H),R=Math.sin(H),M=function(X){return X.toFixed(4)},Y=[M(ce),M(R),M(-1*R),M(ce),0,0,"cm"]}this.internal.write("q"),H?(this.internal.write([1,"0","0",1,$(T),z(N+L),"cm"].join(" ")),this.internal.write(Y.join(" ")),this.internal.write([$(F),"0","0",$(L),"0","0","cm"].join(" "))):this.internal.write([$(F),"0","0",$(L),$(T),z(N+L),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+U.index+" Do"),this.internal.write("Q")},y=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var v=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},x=e.__addimage__.sHashCode=function(T){var N,F,L=0;if(typeof T=="string")for(F=T.length,N=0;N<F;N++)L=(L<<5)-L+T.charCodeAt(N),L|=0;else if(k(T))for(F=T.byteLength/2,N=0;N<F;N++)L=(L<<5)-L+T[N],L|=0;return L},b=e.__addimage__.validateStringAsBase64=function(T){(T=T||"").toString().trim();var N=!0;return T.length===0&&(N=!1),T.length%4!=0&&(N=!1),/^[A-Za-z0-9+/]+$/.test(T.substr(0,T.length-2))===!1&&(N=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(T.substr(-2))===!1&&(N=!1),N},w=e.__addimage__.extractImageFromDataUrl=function(T){if(T==null||!(T=T.trim()).startsWith("data:"))return null;var N=T.indexOf(",");return N<0?null:T.substring(0,N).trim().endsWith("base64")?T.substring(N+1):null};e.__addimage__.isArrayBuffer=function(T){return T instanceof ArrayBuffer};var k=e.__addimage__.isArrayBufferView=function(T){return T instanceof Int8Array||T instanceof Uint8Array||T instanceof Uint8ClampedArray||T instanceof Int16Array||T instanceof Uint16Array||T instanceof Int32Array||T instanceof Uint32Array||T instanceof Float32Array||T instanceof Float64Array},j=e.__addimage__.binaryStringToUint8Array=function(T){for(var N=T.length,F=new Uint8Array(N),L=0;L<N;L++)F[L]=T.charCodeAt(L);return F},B=e.__addimage__.arrayBufferToBinaryString=function(T){for(var N="",F=k(T)?T:new Uint8Array(T),L=0;L<F.length;L+=8192)N+=String.fromCharCode.apply(null,F.subarray(L,L+8192));return N};e.addImage=function(){var T,N,F,L,U,H,W,$,z;if(typeof arguments[1]=="number"?(N=n,F=arguments[1],L=arguments[2],U=arguments[3],H=arguments[4],W=arguments[5],$=arguments[6],z=arguments[7]):(N=arguments[1],F=arguments[2],L=arguments[3],U=arguments[4],H=arguments[5],W=arguments[6],$=arguments[7],z=arguments[8]),Zn(T=arguments[0])==="object"&&!A(T)&&"imageData"in T){var Q=T;T=Q.imageData,N=Q.format||N||n,F=Q.x||F||0,L=Q.y||L||0,U=Q.w||Q.width||U,H=Q.h||Q.height||H,W=Q.alias||W,$=Q.compression||$,z=Q.rotation||Q.angle||z}var ce=this.internal.getFilters();if($===void 0&&ce.indexOf("FlateEncode")!==-1&&($="SLOW"),isNaN(F)||isNaN(L))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var R=E.call(this,T,N,W,$);return g.call(this,F,L,U,H,R,z),this};var E=function(T,N,F,L){var U,H,W;if(typeof T=="string"&&i(T)===n){T=unescape(T);var $=P(T,!1);($!==""||($=e.loadFile(T,!0))!==void 0)&&(T=$)}if(A(T)&&(T=f(T,N)),N=i(T,N),!h(N))throw new Error("addImage does not support files of type '"+N+"', please ensure that a plugin for '"+N+"' support is added.");if(((W=F)==null||W.length===0)&&(F=function(z){return typeof z=="string"||k(z)?x(z):k(z.data)?x(z.data):null}(T)),(U=p.call(this,F))||(T instanceof Uint8Array||N==="RGBA"||(H=T,T=j(T)),U=this["process"+N.toUpperCase()](T,d.call(this),F,function(z){return z&&typeof z=="string"&&(z=z.toUpperCase()),z in e.image_compression?z:v.NONE}(L),H)),!U)throw new Error("An unknown error occurred whilst processing the image.");return U},P=e.__addimage__.convertBase64ToBinaryString=function(T,N){N=typeof N!="boolean"||N;var F,L="";if(typeof T=="string"){var U;F=(U=w(T))!==null&&U!==void 0?U:T;try{L=b_(F)}catch(H){if(N)throw b(F)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+H.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return L};e.getImageProperties=function(T){var N,F,L="";if(A(T)&&(T=f(T)),typeof T=="string"&&i(T)===n&&((L=P(T,!1))===""&&(L=e.loadFile(T)||""),T=L),F=i(T),!h(F))throw new Error("addImage does not support files of type '"+F+"', please ensure that a plugin for '"+F+"' support is added.");if(T instanceof Uint8Array||(T=j(T)),!(N=this["process"+F.toUpperCase()](T)))throw new Error("An unknown error occurred whilst processing the image");return N.fileType=F,N}})(Ot.API),function(e){var t=function(n){if(n!==void 0&&n!="")return!0};Ot.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(n){for(var r,i,s,a=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(n.objId),u=n.pageContext.annotations,d=!1,h=0;h<u.length&&!d;h++)switch((r=u[h]).type){case"link":(t(r.options.url)||t(r.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var A=0;A<u.length;A++){r=u[A];var f=this.internal.pdfEscape,p=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var m=this.internal.newAdditionalObject(),g=this.internal.newAdditionalObject(),y=this.internal.getEncryptor(m.objId),v=r.title||"Note";s="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y)+"] ")+"/Contents ("+f(y(r.contents))+")",s+=" /Popup "+g.objId+" 0 R",s+=" /P "+c.objId+" 0 R",s+=" /T ("+f(y(v))+") >>",m.content=s;var x=m.objId+" 0 R";s="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(r.bounds.x+30)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w+30)+" "+o(r.bounds.y)+"] ")+" /Parent "+x,r.open&&(s+=" /Open true"),s+=" >>",g.content=s,this.internal.write(m.objId,"0 R",g.objId,"0 R");break;case"freetext":i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y+r.bounds.h)+"] ";var b="font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+(r.color||"#000000");s="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(p(r.contents))+")",s+=" /DS("+f(p(b))+")",s+=" /Border [0 0 0]",s+=" >>",this.internal.write(s);break;case"link":if(r.options.name){var w=this.annotations._nameMap[r.options.name];r.options.pageNumber=w.page,r.options.top=w.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",s="",r.options.url)s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+f(p(r.options.url))+") >>";else if(r.options.pageNumber)switch(s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":s+=" /Fit]";break;case"FitH":s+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,s+=" /FitV "+r.options.left+"]";break;default:var k=o(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),s+=" /XYZ "+r.options.left+" "+k+" "+r.options.zoom+"]"}s!=""&&(s+=" >>",this.internal.write(s))}}this.internal.write("]")}}]),e.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},e.link=function(n,r,i,s,a){var o=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:c(n),y:u(r),w:c(n+i),h:u(r+s)},options:a,type:"link"})},e.textWithLink=function(n,r,i,s){var a,o,c=this.getTextWidth(n),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(s.maxWidth!==void 0){o=s.maxWidth;var d=this.splitTextToSize(n,o).length;a=Math.ceil(u*d)}else o=c,a=u;return this.text(n,r,i,s),i+=.2*u,s.align==="center"&&(r-=c/2),s.align==="right"&&(r-=c),this.link(r,i-u,o,a,s),c},e.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}}(Ot.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var s=e.__arabicParser__.isInArabicSubstitutionA=function(m){return t[m.charCodeAt(0)]!==void 0},a=e.__arabicParser__.isArabicLetter=function(m){return typeof m=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(m)},o=e.__arabicParser__.isArabicEndLetter=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(m){return a(m)&&i.indexOf(m.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length>=3};var d=e.__arabicParser__.arabicLetterHasMedialForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length==4},h=e.__arabicParser__.resolveLigatures=function(m){var g=0,y=n,v="",x=0;for(g=0;g<m.length;g+=1)y[m.charCodeAt(g)]!==void 0?(x++,typeof(y=y[m.charCodeAt(g)])=="number"&&(v+=String.fromCharCode(y),y=n,x=0),g===m.length-1&&(y=n,v+=m.charAt(g-(x-1)),g-=x-1,x=0)):(y=n,v+=m.charAt(g-x),g-=x,x=0);return v};e.__arabicParser__.isArabicDiacritic=function(m){return m!==void 0&&r[m.charCodeAt(0)]!==void 0};var A=e.__arabicParser__.getCorrectForm=function(m,g,y){return a(m)?s(m)===!1?-1:!u(m)||!a(g)&&!a(y)||!a(y)&&o(g)||o(m)&&!a(g)||o(m)&&c(g)||o(m)&&o(g)?0:d(m)&&a(g)&&!o(g)&&a(y)&&u(y)?3:o(m)||!a(y)?1:2:-1},f=function(m){var g=0,y=0,v=0,x="",b="",w="",k=(m=m||"").split("\\s+"),j=[];for(g=0;g<k.length;g+=1){for(j.push(""),y=0;y<k[g].length;y+=1)x=k[g][y],b=k[g][y-1],w=k[g][y+1],a(x)?(v=A(x,b,w),j[g]+=v!==-1?String.fromCharCode(t[x.charCodeAt(0)][v]):x):j[g]+=x;j[g]=h(j[g])}return j.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var m,g=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,y=[];if(Array.isArray(g)){var v=0;for(y=[],v=0;v<g.length;v+=1)Array.isArray(g[v])?y.push([f(g[v][0]),g[v][1],g[v][2]]):y.push([f(g[v])]);m=y}else m=f(g);return typeof arguments[0]=="string"?m:(arguments[0].text=m,arguments[0])};e.events.push(["preProcessText",p])}(Ot.API),Ot.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})),this},function(e){var t=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(o){n=o}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(o){r=isNaN(o)||Number.isInteger(o)===!1||o<0?150:o,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(o){i=isNaN(o)||Number.isInteger(o)===!1||o<0?300:o,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var s=[];Object.defineProperty(this,"childNodes",{get:function(){return s},set:function(o){s=o}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(o){a=o}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(n,r){var i;if((n=n||"2d")!=="2d")return null;for(i in r)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=r[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Ot.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(m){c=m}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(m){u=m}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(m){d=m}});var h=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return h},set:function(m){h=m}});var A=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return A},set:function(m){A=m}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(m){f=m}});var p=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return p},set:function(m){p=m}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(c){return r.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,u){r.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),h=u.font||this.getFont(),A=u.scaleFactor||this.internal.scaleFactor,f=0,p=0,m=0,g=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var y=u.maxWidth;y>0?typeof c=="string"?c=this.splitTextToSize(c,y):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(x,b){return x.concat(g.splitTextToSize(b,y))},[])):c=Array.isArray(c)?c:[c];for(var v=0;v<c.length;v++)f<(m=this.getStringUnitWidth(c[v],{font:h})*d)&&(f=m);return f!==0&&(p=c.length),{w:f/=A,h:Math.max((p*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/A,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var c=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new s(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var c;c=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var u=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,h=this.internal.__cell__.margins||t,A=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===c.lineNumber?(c.x=(u.x||0)+(u.width||0),c.y=u.y||0):u.y+u.height+c.height+h.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=h.top,f&&A&&(this.printHeaderRow(c.lineNumber,!0),c.y+=A[0].height)):c.y=u.y+u.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,n===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};e.table=function(c,u,d,h,A){if(r.call(this),!d)throw new Error("No data for PDF table.");var f,p,m,g,y=[],v=[],x=[],b={},w={},k=[],j=[],B=(A=A||{}).autoSize||!1,E=A.printHeaders!==!1,P=A.css&&A.css["font-size"]!==void 0?16*A.css["font-size"]:A.fontSize||12,T=A.margins||Object.assign({width:this.getPageWidth()},t),N=typeof A.padding=="number"?A.padding:3,F=A.headerBackgroundColor||"#c8c8c8",L=A.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=E,this.internal.__cell__.margins=T,this.internal.__cell__.table_font_size=P,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=F,this.internal.__cell__.headerTextColor=L,this.setFontSize(P),h==null)v=y=Object.keys(d[0]),x=y.map(function(){return"left"});else if(Array.isArray(h)&&Zn(h[0])==="object")for(y=h.map(function(Q){return Q.name}),v=h.map(function(Q){return Q.prompt||Q.name||""}),x=h.map(function(Q){return Q.align||"left"}),f=0;f<h.length;f+=1)w[h[f].name]=.7499990551181103*h[f].width;else Array.isArray(h)&&typeof h[0]=="string"&&(v=y=h,x=y.map(function(){return"left"}));if(B||Array.isArray(h)&&typeof h[0]=="string")for(f=0;f<y.length;f+=1){for(b[g=y[f]]=d.map(function(Q){return Q[g]}),this.setFont(void 0,"bold"),k.push(this.getTextDimensions(v[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),p=b[g],this.setFont(void 0,"normal"),m=0;m<p.length;m+=1)k.push(this.getTextDimensions(p[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);w[g]=Math.max.apply(null,k)+N+N,k=[]}if(E){var U={};for(f=0;f<y.length;f+=1)U[y[f]]={},U[y[f]].text=v[f],U[y[f]].align=x[f];var H=o.call(this,U,w);j=y.map(function(Q){return new s(c,u,w[Q],H,U[Q].text,void 0,U[Q].align)}),this.setTableHeaderRow(j),this.printHeaderRow(1,!1)}var W=h.reduce(function(Q,ce){return Q[ce.name]=ce.align,Q},{});for(f=0;f<d.length;f+=1){"rowStart"in A&&A.rowStart instanceof Function&&A.rowStart({row:f,data:d[f]},this);var $=o.call(this,d[f],w);for(m=0;m<y.length;m+=1){var z=d[f][y[m]];"cellStart"in A&&A.cellStart instanceof Function&&A.cellStart({row:f,col:m,data:z},this),a.call(this,new s(c,u,w[y[m]],$,z,f+2,W[y[m]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=u,this};var o=function(c,u){var d=this.internal.__cell__.padding,h=this.internal.__cell__.table_font_size,A=this.internal.scaleFactor;return Object.keys(c).map(function(f){var p=c[f];return this.splitTextToSize(p.hasOwnProperty("text")?p.text:p,u[f]-d-d)},this).map(function(f){return this.getLineHeightFactor()*f.length*h/A+d+d},this).reduce(function(f,p){return Math.max(f,p)},0)};e.setTableHeaderRow=function(c){r.call(this),this.internal.__cell__.tableHeaderRow=c},e.printHeaderRow=function(c,u){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var h=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(h[0],h[1],h[2],h[3],void 0,-1)}this.setFont(void 0,"bold");for(var A=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){d=this.internal.__cell__.tableHeaderRow[f].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,A.push(d)),d.lineNumber=c;var p=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,d),this.setTextColor(p)}A.length>0&&this.setTableHeaderRow(A),this.setFont(void 0,"normal"),n=!1}}(Ot.API);var _ve={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},jve=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],IR=kve(jve),Bve=[100,200,300,400,500,600,700,800,900],h_t=kve(Bve);function dO(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(s){return _ve[s=s||"normal"]?s:"normal"}(e.style),r=function(s){return s?typeof s=="number"?s>=100&&s<=900&&s%100==0?s:400:/^\d00$/.test(s)?parseInt(s):s==="bold"?700:400:400}(e.weight),i=function(s){return typeof IR[s=s||"normal"]=="number"?s:"normal"}(e.stretch);return{family:t,style:n,weight:r,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,n,r].join(" ")}}}function nZ(e,t,n,r){var i;for(i=n;i>=0&&i<t.length;i+=r)if(e[t[i]])return e[t[i]];for(i=n;i>=0&&i<t.length;i-=r)if(e[t[i]])return e[t[i]]}var f_t={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},rZ={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function iZ(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function sZ(e){return e.trimLeft()}function A_t(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function p_t(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var Sg,dk,aZ,oZ,lZ,hO=["times"];function cZ(e,t,n,r,i){var s=4,a=dZ;switch(i){case Ot.API.image_compression.FAST:s=1,a=uZ;break;case Ot.API.image_compression.MEDIUM:s=6,a=hZ;break;case Ot.API.image_compression.SLOW:s=9,a=fZ}e=function(c,u,d,h){for(var A,f=c.length/u,p=new Uint8Array(c.length+f),m=[m_t,uZ,dZ,hZ,fZ],g=0;g<f;g+=1){var y=g*u,v=c.subarray(y,y+u);if(h)p.set(h(v,d,A),y+g);else{for(var x=m.length,b=[],w=0;w<x;w+=1)b[w]=m[w](v,d,A);var k=y_t(b.concat());p.set(b[k],y+g)}A=v}return p}(e,t,Math.ceil(n*r/8),a);var o=vR(e,{level:s});return Ot.API.__addimage__.arrayBufferToBinaryString(o)}function m_t(e){var t=Array.apply([],e);return t.unshift(0),t}function uZ(e,t){var n=e.length,r=[];r[0]=1;for(var i=0;i<n;i+=1){var s=e[i-t]||0;r[i+1]=e[i]-s+256&255}return r}function dZ(e,t,n){var r=e.length,i=[];i[0]=2;for(var s=0;s<r;s+=1){var a=n&&n[s]||0;i[s+1]=e[s]-a+256&255}return i}function hZ(e,t,n){var r=e.length,i=[];i[0]=3;for(var s=0;s<r;s+=1){var a=e[s-t]||0,o=n&&n[s]||0;i[s+1]=e[s]+256-(a+o>>>1)&255}return i}function fZ(e,t,n){var r=e.length,i=[];i[0]=4;for(var s=0;s<r;s+=1){var a=g_t(e[s-t]||0,n&&n[s]||0,n&&n[s-t]||0);i[s+1]=e[s]-a+256&255}return i}function g_t(e,t,n){if(e===t&&t===n)return e;var r=Math.abs(t-n),i=Math.abs(e-n),s=Math.abs(e+t-n-n);return r<=i&&r<=s?e:i<=s?t:n}function y_t(e){var t=e.map(function(n){return n.reduce(function(r,i){return r+Math.abs(i)},0)});return t.indexOf(Math.min.apply(null,t))}function fO(e,t,n){var r=t*n,i=Math.floor(r/8),s=16-(r-8*i+n),a=(1<<n)-1;return Nve(e,i)>>s&a}function AZ(e,t,n,r){var i=n*r,s=Math.floor(i/8),a=16-(i-8*s+r),o=(1<<r)-1,c=(t&o)<<a;(function(u,d,h){if(d+1<u.byteLength)u.setUint16(d,h,!1);else{var A=h>>8&255;u.setUint8(d,A)}})(e,s,Nve(e,s)&~(o<<a)&65535|c)}function Nve(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function v_t(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,i=e[t++],s=i>>7,a=1<<1+(7&i);e[t++],e[t++];var o=null,c=null;s&&(o=t,c=a,t+=3*a);var u=!0,d=[],h=0,A=null,f=0,p=null;for(this.width=n,this.height=r;u&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,p=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var m=e[t++];h=e[t++]|e[t++]<<8,A=e[t++],1&m||(A=null),f=m>>2&7,t++;break;case 254:for(;;){if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,x=e[t++]|e[t++]<<8,b=e[t++],w=b>>6&1,k=1<<1+(7&b),j=o,B=c,E=!1;b>>7&&(E=!0,j=t,B=k,t+=3*k);var P=t;for(t++;;){var T;if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}d.push({x:g,y,width:v,height:x,has_local_palette:E,palette_offset:j,palette_size:B,data_offset:P,data_length:t-P,transparent_index:A,interlaced:!!w,delay:h,disposal:f});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return p},this.frameInfo=function(N){if(N<0||N>=d.length)throw new Error("Frame index out of range.");return d[N]},this.decodeAndBlitFrameBGRA=function(N,F){var L=this.frameInfo(N),U=L.width*L.height;if(U>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var H=new Uint8Array(U);pZ(e,L.data_offset,H,U);var W=L.palette_offset,$=L.transparent_index;$===null&&($=256);var z=L.width,Q=n-z,ce=z,R=4*(L.y*n+L.x),M=4*((L.y+L.height)*n+L.x),Y=R,X=4*Q;L.interlaced===!0&&(X+=4*n*7);for(var V=8,Z=0,de=H.length;Z<de;++Z){var ue=H[Z];if(ce===0&&(ce=z,(Y+=X)>=M&&(X=4*Q+4*n*(V-1),Y=R+(z+Q)*(V<<1),V>>=1)),ue===$)Y+=4;else{var se=e[W+3*ue],he=e[W+3*ue+1],ie=e[W+3*ue+2];F[Y++]=ie,F[Y++]=he,F[Y++]=se,F[Y++]=255}--ce}},this.decodeAndBlitFrameRGBA=function(N,F){var L=this.frameInfo(N),U=L.width*L.height;if(U>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var H=new Uint8Array(U);pZ(e,L.data_offset,H,U);var W=L.palette_offset,$=L.transparent_index;$===null&&($=256);var z=L.width,Q=n-z,ce=z,R=4*(L.y*n+L.x),M=4*((L.y+L.height)*n+L.x),Y=R,X=4*Q;L.interlaced===!0&&(X+=4*n*7);for(var V=8,Z=0,de=H.length;Z<de;++Z){var ue=H[Z];if(ce===0&&(ce=z,(Y+=X)>=M&&(X=4*Q+4*n*(V-1),Y=R+(z+Q)*(V<<1),V>>=1)),ue===$)Y+=4;else{var se=e[W+3*ue],he=e[W+3*ue+1],ie=e[W+3*ue+2];F[Y++]=se,F[Y++]=he,F[Y++]=ie,F[Y++]=255}--ce}}}function pZ(e,t,n,r){for(var i=e[t++],s=1<<i,a=s+1,o=a+1,c=i+1,u=(1<<c)-1,d=0,h=0,A=0,f=e[t++],p=new Int32Array(4096),m=null;;){for(;d<16&&f!==0;)h|=e[t++]<<d,d+=8,f===1?f=e[t++]:--f;if(d<c)break;var g=h&u;if(h>>=c,d-=c,g!==s){if(g===a)break;for(var y=g<o?g:m,v=0,x=y;x>s;)x=p[x]>>8,++v;var b=x;if(A+v+(y!==g?1:0)>r)return void dr.log("Warning, gif stream longer than expected.");n[A++]=b;var w=A+=v;for(y!==g&&(n[A++]=b),x=y;v--;)x=p[x],n[--w]=255&x,x>>=8;m!==null&&o<4096&&(p[o++]=m<<8|b,o>=u+1&&c<12&&(++c,u=u<<1|1)),m=g}else o=a+1,u=(1<<(c=i+1))-1,m=null}return A!==r&&dr.log("Warning, gif stream shorter than expected."),n}/**
 * @license
  Copyright (c) 2008, Adobe Systems Incorporated
  All rights reserved.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions are
  met:

  * Redistributions of source code must retain the above copyright notice, 
    this list of conditions and the following disclaimer.
  
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the 
    documentation and/or other materials provided with the distribution.
  
  * Neither the name of Adobe Systems Incorporated nor the names of its 
    contributors may be used to endorse or promote products derived from 
    this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/function AO(e){var t,n,r,i,s,a=Math.floor,o=new Array(64),c=new Array(64),u=new Array(64),d=new Array(64),h=new Array(65535),A=new Array(65535),f=new Array(64),p=new Array(64),m=[],g=0,y=7,v=new Array(64),x=new Array(64),b=new Array(64),w=new Array(256),k=new Array(2048),j=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],B=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],E=[0,1,2,3,4,5,6,7,8,9,10,11],P=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],T=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],N=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],L=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],U=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function H(R,M){for(var Y=0,X=0,V=new Array,Z=1;Z<=16;Z++){for(var de=1;de<=R[Z];de++)V[M[X]]=[],V[M[X]][0]=Y,V[M[X]][1]=Z,X++,Y++;Y*=2}return V}function W(R){for(var M=R[0],Y=R[1]-1;Y>=0;)M&1<<Y&&(g|=1<<y),Y--,--y<0&&(g==255?($(255),$(0)):$(g),y=7,g=0)}function $(R){m.push(R)}function z(R){$(R>>8&255),$(255&R)}function Q(R,M,Y,X,V){for(var Z,de=V[0],ue=V[240],se=function(Ne,st){var we,He,Ve,Dt,pt,ye,Be,Ge,Ue,Ze,pe=0;for(Ue=0;Ue<8;++Ue){we=Ne[pe],He=Ne[pe+1],Ve=Ne[pe+2],Dt=Ne[pe+3],pt=Ne[pe+4],ye=Ne[pe+5],Be=Ne[pe+6];var mt=we+(Ge=Ne[pe+7]),ft=we-Ge,wt=He+Be,Rt=He-Be,zt=Ve+ye,gt=Ve-ye,Lt=Dt+pt,Mt=Dt-pt,qt=mt+Lt,nr=mt-Lt,tn=wt+zt,Bt=wt-zt;Ne[pe]=qt+tn,Ne[pe+4]=qt-tn;var jn=.707106781*(Bt+nr);Ne[pe+2]=nr+jn,Ne[pe+6]=nr-jn;var Ut=.382683433*((qt=Mt+gt)-(Bt=Rt+ft)),Wt=.5411961*qt+Ut,wn=1.306562965*Bt+Ut,Nr=.707106781*(tn=gt+Rt),At=ft+Nr,Ur=ft-Nr;Ne[pe+5]=Ur+Wt,Ne[pe+3]=Ur-Wt,Ne[pe+1]=At+wn,Ne[pe+7]=At-wn,pe+=8}for(pe=0,Ue=0;Ue<8;++Ue){we=Ne[pe],He=Ne[pe+8],Ve=Ne[pe+16],Dt=Ne[pe+24],pt=Ne[pe+32],ye=Ne[pe+40],Be=Ne[pe+48];var Ln=we+(Ge=Ne[pe+56]),gr=we-Ge,or=He+Be,xn=He-Be,Ye=Ve+ye,Gn=Ve-ye,lr=Dt+pt,ni=Dt-pt,ns=Ln+lr,Ma=Ln-lr,Hl=or+Ye,Ql=or-Ye;Ne[pe]=ns+Hl,Ne[pe+32]=ns-Hl;var qo=.707106781*(Ql+Ma);Ne[pe+16]=Ma+qo,Ne[pe+48]=Ma-qo;var lA=.382683433*((ns=ni+Gn)-(Ql=xn+gr)),Oc=.5411961*ns+lA,cA=1.306562965*Ql+lA,Tm=.707106781*(Hl=Gn+xn),Im=gr+Tm,Pm=gr-Tm;Ne[pe+40]=Pm+Oc,Ne[pe+24]=Pm-Oc,Ne[pe+8]=Im+cA,Ne[pe+56]=Im-cA,pe++}for(Ue=0;Ue<64;++Ue)Ze=Ne[Ue]*st[Ue],f[Ue]=Ze>0?Ze+.5|0:Ze-.5|0;return f}(R,M),he=0;he<64;++he)p[j[he]]=se[he];var ie=p[0]-Y;Y=p[0],ie==0?W(X[0]):(W(X[A[Z=32767+ie]]),W(h[Z]));for(var Ce=63;Ce>0&&p[Ce]==0;)Ce--;if(Ce==0)return W(de),Y;for(var Ie,te=1;te<=Ce;){for(var je=te;p[te]==0&&te<=Ce;)++te;var nt=te-je;if(nt>=16){Ie=nt>>4;for(var rt=1;rt<=Ie;++rt)W(ue);nt&=15}Z=32767+p[te],W(V[(nt<<4)+A[Z]]),W(h[Z]),te++}return Ce!=63&&W(de),Y}function ce(R){R=Math.min(Math.max(R,1),100),s!=R&&(function(M){for(var Y=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],X=0;X<64;X++){var V=a((Y[X]*M+50)/100);V=Math.min(Math.max(V,1),255),o[j[X]]=V}for(var Z=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],de=0;de<64;de++){var ue=a((Z[de]*M+50)/100);ue=Math.min(Math.max(ue,1),255),c[j[de]]=ue}for(var se=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],he=0,ie=0;ie<8;ie++)for(var Ce=0;Ce<8;Ce++)u[he]=1/(o[j[he]]*se[ie]*se[Ce]*8),d[he]=1/(c[j[he]]*se[ie]*se[Ce]*8),he++}(R<50?Math.floor(5e3/R):Math.floor(200-2*R)),s=R)}this.encode=function(R,M){M&&ce(M),m=new Array,g=0,y=7,z(65496),z(65504),z(16),$(74),$(70),$(73),$(70),$(0),$(1),$(1),$(0),z(1),z(1),$(0),$(0),function(){z(65499),z(132),$(0);for(var He=0;He<64;He++)$(o[He]);$(1);for(var Ve=0;Ve<64;Ve++)$(c[Ve])}(),function(He,Ve){z(65472),z(17),$(8),z(Ve),z(He),$(3),$(1),$(17),$(0),$(2),$(17),$(1),$(3),$(17),$(1)}(R.width,R.height),function(){z(65476),z(418),$(0);for(var He=0;He<16;He++)$(B[He+1]);for(var Ve=0;Ve<=11;Ve++)$(E[Ve]);$(16);for(var Dt=0;Dt<16;Dt++)$(P[Dt+1]);for(var pt=0;pt<=161;pt++)$(T[pt]);$(1);for(var ye=0;ye<16;ye++)$(N[ye+1]);for(var Be=0;Be<=11;Be++)$(F[Be]);$(17);for(var Ge=0;Ge<16;Ge++)$(L[Ge+1]);for(var Ue=0;Ue<=161;Ue++)$(U[Ue])}(),z(65498),z(12),$(3),$(1),$(0),$(2),$(17),$(3),$(17),$(0),$(63),$(0);var Y=0,X=0,V=0;g=0,y=7,this.encode.displayName="_encode_";for(var Z,de,ue,se,he,ie,Ce,Ie,te,je=R.data,nt=R.width,rt=R.height,Ne=4*nt,st=0;st<rt;){for(Z=0;Z<Ne;){for(he=Ne*st+Z,Ce=-1,Ie=0,te=0;te<64;te++)ie=he+(Ie=te>>3)*Ne+(Ce=4*(7&te)),st+Ie>=rt&&(ie-=Ne*(st+1+Ie-rt)),Z+Ce>=Ne&&(ie-=Z+Ce-Ne+4),de=je[ie++],ue=je[ie++],se=je[ie++],v[te]=(k[de]+k[ue+256|0]+k[se+512|0]>>16)-128,x[te]=(k[de+768|0]+k[ue+1024|0]+k[se+1280|0]>>16)-128,b[te]=(k[de+1280|0]+k[ue+1536|0]+k[se+1792|0]>>16)-128;Y=Q(v,u,Y,t,r),X=Q(x,d,X,n,i),V=Q(b,d,V,n,i),Z+=32}st+=8}if(y>=0){var we=[];we[1]=y+1,we[0]=(1<<y+1)-1,W(we)}return z(65497),new Uint8Array(m)},e=e||50,function(){for(var R=String.fromCharCode,M=0;M<256;M++)w[M]=R(M)}(),t=H(B,E),n=H(N,F),r=H(P,T),i=H(L,U),function(){for(var R=1,M=2,Y=1;Y<=15;Y++){for(var X=R;X<M;X++)A[32767+X]=Y,h[32767+X]=[],h[32767+X][1]=Y,h[32767+X][0]=X;for(var V=-(M-1);V<=-R;V++)A[32767+V]=Y,h[32767+V]=[],h[32767+V][1]=Y,h[32767+V][0]=M-1+V;R<<=1,M<<=1}}(),function(){for(var R=0;R<256;R++)k[R]=19595*R,k[R+256|0]=38470*R,k[R+512|0]=7471*R+32768,k[R+768|0]=-11059*R,k[R+1024|0]=-21709*R,k[R+1280|0]=32768*R+8421375,k[R+1536|0]=-27439*R,k[R+1792|0]=-5329*R}(),ce(e)}/**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */function Xl(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function mZ(e){function t(E){if(!E)throw Error("assert :P")}function n(E,P,T){for(var N=0;4>N;N++)if(E[P+N]!=T.charCodeAt(N))return!0;return!1}function r(E,P,T,N,F){for(var L=0;L<F;L++)E[P+L]=T[N+L]}function i(E,P,T,N){for(var F=0;F<N;F++)E[P+F]=T}function s(E){return new Int32Array(E)}function a(E,P){for(var T=[],N=0;N<E;N++)T.push(new P);return T}function o(E,P){var T=[];return function N(F,L,U){for(var H=U[L],W=0;W<H&&(F.push(U.length>L+1?[]:new P),!(U.length<L+1));W++)N(F[W],L+1,U)}(T,0,E),T}var c=function(){var E=this;function P(S,_){for(var O=1<<_-1>>>0;S&O;)O>>>=1;return O?(S&O-1)+O:S}function T(S,_,O,D,q){t(!(D%O));do S[_+(D-=O)]=q;while(0<D)}function N(S,_,O,D,q){if(t(2328>=q),512>=q)var G=s(512);else if((G=s(q))==null)return 0;return function(J,ee,ne,oe,me,ke){var le,ge,be=ee,Te=1<<ne,Se=s(16),Oe=s(16);for(t(me!=0),t(oe!=null),t(J!=null),t(0<ne),ge=0;ge<me;++ge){if(15<oe[ge])return 0;++Se[oe[ge]]}if(Se[0]==me)return 0;for(Oe[1]=0,le=1;15>le;++le){if(Se[le]>1<<le)return 0;Oe[le+1]=Oe[le]+Se[le]}for(ge=0;ge<me;++ge)le=oe[ge],0<oe[ge]&&(ke[Oe[le]++]=ge);if(Oe[15]==1)return(oe=new F).g=0,oe.value=ke[0],T(J,be,1,Te,oe),Te;var Fe,ze=-1,Re=Te-1,Pt=0,xt=1,dn=1,Nt=1<<ne;for(ge=0,le=1,me=2;le<=ne;++le,me<<=1){if(xt+=dn<<=1,0>(dn-=Se[le]))return 0;for(;0<Se[le];--Se[le])(oe=new F).g=le,oe.value=ke[ge++],T(J,be+Pt,me,Nt,oe),Pt=P(Pt,le)}for(le=ne+1,me=2;15>=le;++le,me<<=1){if(xt+=dn<<=1,0>(dn-=Se[le]))return 0;for(;0<Se[le];--Se[le]){if(oe=new F,(Pt&Re)!=ze){for(be+=Nt,Fe=1<<(ze=le)-ne;15>ze&&!(0>=(Fe-=Se[ze]));)++ze,Fe<<=1;Te+=Nt=1<<(Fe=ze-ne),J[ee+(ze=Pt&Re)].g=Fe+ne,J[ee+ze].value=be-ee-ze}oe.g=le-ne,oe.value=ke[ge++],T(J,be+(Pt>>ne),me,Nt,oe),Pt=P(Pt,le)}}return xt!=2*Oe[15]-1?0:Te}(S,_,O,D,q,G)}function F(){this.value=this.g=0}function L(){this.value=this.g=0}function U(){this.G=a(5,F),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(Km,L)}function H(S,_,O,D){t(S!=null),t(_!=null),t(2147483648>D),S.Ca=254,S.I=0,S.b=-8,S.Ka=0,S.oa=_,S.pa=O,S.Jd=_,S.Yc=O+D,S.Zc=4<=D?O+D-4+1:O,de(S)}function W(S,_){for(var O=0;0<_--;)O|=se(S,128)<<_;return O}function $(S,_){var O=W(S,_);return ue(S)?-O:O}function z(S,_,O,D){var q,G=0;for(t(S!=null),t(_!=null),t(4294967288>D),S.Sb=D,S.Ra=0,S.u=0,S.h=0,4<D&&(D=4),q=0;q<D;++q)G+=_[O+q]<<8*q;S.Ra=G,S.bb=D,S.oa=_,S.pa=O}function Q(S){for(;8<=S.u&&S.bb<S.Sb;)S.Ra>>>=8,S.Ra+=S.oa[S.pa+S.bb]<<da-8>>>0,++S.bb,S.u-=8;X(S)&&(S.h=1,S.u=0)}function ce(S,_){if(t(0<=_),!S.h&&_<=J0){var O=Y(S)&vA[_];return S.u+=_,Q(S),O}return S.h=1,S.u=0}function R(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function M(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function Y(S){return S.Ra>>>(S.u&da-1)>>>0}function X(S){return t(S.bb<=S.Sb),S.h||S.bb==S.Sb&&S.u>da}function V(S,_){S.u=_,S.h=X(S)}function Z(S){S.u>=La&&(t(S.u>=La),Q(S))}function de(S){t(S!=null&&S.oa!=null),S.pa<S.Zc?(S.I=(S.oa[S.pa++]|S.I<<8)>>>0,S.b+=8):(t(S!=null&&S.oa!=null),S.pa<S.Yc?(S.b+=8,S.I=S.oa[S.pa++]|S.I<<8):S.Ka?S.b=0:(S.I<<=8,S.b+=8,S.Ka=1))}function ue(S){return W(S,1)}function se(S,_){var O=S.Ca;0>S.b&&de(S);var D=S.b,q=O*_>>>8,G=(S.I>>>D>q)+0;for(G?(O-=q,S.I-=q+1<<D>>>0):O=q+1,D=O,q=0;256<=D;)q+=8,D>>=8;return D=7^q+qm[D],S.b-=D,S.Ca=(O<<D)-1,G}function he(S,_,O){S[_+0]=O>>24&255,S[_+1]=O>>16&255,S[_+2]=O>>8&255,S[_+3]=255&O}function ie(S,_){return S[_+0]|S[_+1]<<8}function Ce(S,_){return ie(S,_)|S[_+2]<<16}function Ie(S,_){return ie(S,_)|ie(S,_+2)<<16}function te(S,_){var O=1<<_;return t(S!=null),t(0<_),S.X=s(O),S.X==null?0:(S.Mb=32-_,S.Xa=_,1)}function je(S,_){t(S!=null),t(_!=null),t(S.Xa==_.Xa),r(_.X,0,S.X,0,1<<_.Xa)}function nt(){this.X=[],this.Xa=this.Mb=0}function rt(S,_,O,D){t(O!=null),t(D!=null);var q=O[0],G=D[0];return q==0&&(q=(S*G+_/2)/_),G==0&&(G=(_*q+S/2)/S),0>=q||0>=G?0:(O[0]=q,D[0]=G,1)}function Ne(S,_){return S+(1<<_)-1>>>_}function st(S,_){return((4278255360&S)+(4278255360&_)>>>0&4278255360)+((16711935&S)+(16711935&_)>>>0&16711935)>>>0}function we(S,_){E[_]=function(O,D,q,G,J,ee,ne){var oe;for(oe=0;oe<J;++oe){var me=E[S](ee[ne+oe-1],q,G+oe);ee[ne+oe]=st(O[D+oe],me)}}}function He(){this.ud=this.hd=this.jd=0}function Ve(S,_){return((4278124286&(S^_))>>>1)+(S&_)>>>0}function Dt(S){return 0<=S&&256>S?S:0>S?0:255<S?255:void 0}function pt(S,_){return Dt(S+(S-_+.5>>1))}function ye(S,_,O){return Math.abs(_-O)-Math.abs(S-O)}function Be(S,_,O,D,q,G,J){for(D=G[J-1],O=0;O<q;++O)G[J+O]=D=st(S[_+O],D)}function Ge(S,_,O,D,q){var G;for(G=0;G<O;++G){var J=S[_+G],ee=J>>8&255,ne=16711935&(ne=(ne=16711935&J)+((ee<<16)+ee));D[q+G]=(4278255360&J)+ne>>>0}}function Ue(S,_){_.jd=255&S,_.hd=S>>8&255,_.ud=S>>16&255}function Ze(S,_,O,D,q,G){var J;for(J=0;J<D;++J){var ee=_[O+J],ne=ee>>>8,oe=ee,me=255&(me=(me=ee>>>16)+((S.jd<<24>>24)*(ne<<24>>24)>>>5));oe=255&(oe=(oe+=(S.hd<<24>>24)*(ne<<24>>24)>>>5)+((S.ud<<24>>24)*(me<<24>>24)>>>5)),q[G+J]=(4278255360&ee)+(me<<16)+oe}}function pe(S,_,O,D,q){E[_]=function(G,J,ee,ne,oe,me,ke,le,ge){for(ne=ke;ne<le;++ne)for(ke=0;ke<ge;++ke)oe[me++]=q(ee[D(G[J++])])},E[S]=function(G,J,ee,ne,oe,me,ke){var le=8>>G.b,ge=G.Ea,be=G.K[0],Te=G.w;if(8>le)for(G=(1<<G.b)-1,Te=(1<<le)-1;J<ee;++J){var Se,Oe=0;for(Se=0;Se<ge;++Se)Se&G||(Oe=D(ne[oe++])),me[ke++]=q(be[Oe&Te]),Oe>>=le}else E["VP8LMapColor"+O](ne,oe,be,Te,me,ke,J,ee,ge)}}function mt(S,_,O,D,q){for(O=_+O;_<O;){var G=S[_++];D[q++]=G>>16&255,D[q++]=G>>8&255,D[q++]=255&G}}function ft(S,_,O,D,q){for(O=_+O;_<O;){var G=S[_++];D[q++]=G>>16&255,D[q++]=G>>8&255,D[q++]=255&G,D[q++]=G>>24&255}}function wt(S,_,O,D,q){for(O=_+O;_<O;){var G=(J=S[_++])>>16&240|J>>12&15,J=240&J|J>>28&15;D[q++]=G,D[q++]=J}}function Rt(S,_,O,D,q){for(O=_+O;_<O;){var G=(J=S[_++])>>16&248|J>>13&7,J=J>>5&224|J>>3&31;D[q++]=G,D[q++]=J}}function zt(S,_,O,D,q){for(O=_+O;_<O;){var G=S[_++];D[q++]=255&G,D[q++]=G>>8&255,D[q++]=G>>16&255}}function gt(S,_,O,D,q,G){if(G==0)for(O=_+O;_<O;)he(D,((G=S[_++])[0]>>24|G[1]>>8&65280|G[2]<<8&16711680|G[3]<<24)>>>0),q+=32;else r(D,q,S,_,O)}function Lt(S,_){E[_][0]=E[S+"0"],E[_][1]=E[S+"1"],E[_][2]=E[S+"2"],E[_][3]=E[S+"3"],E[_][4]=E[S+"4"],E[_][5]=E[S+"5"],E[_][6]=E[S+"6"],E[_][7]=E[S+"7"],E[_][8]=E[S+"8"],E[_][9]=E[S+"9"],E[_][10]=E[S+"10"],E[_][11]=E[S+"11"],E[_][12]=E[S+"12"],E[_][13]=E[S+"13"],E[_][14]=E[S+"0"],E[_][15]=E[S+"0"]}function Mt(S){return S==KT||S==qT||S==jC||S==WT}function qt(){this.eb=[],this.size=this.A=this.fb=0}function nr(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function tn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new qt,this.f.kb=new nr,this.sd=null}function Bt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function jn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Ut(S){return alert("todo:WebPSamplerProcessPlane"),S.T}function Wt(S,_){var O=S.T,D=_.ba.f.RGBA,q=D.eb,G=D.fb+S.ka*D.A,J=Xo[_.ba.S],ee=S.y,ne=S.O,oe=S.f,me=S.N,ke=S.ea,le=S.W,ge=_.cc,be=_.dc,Te=_.Mc,Se=_.Nc,Oe=S.ka,Fe=S.ka+S.T,ze=S.U,Re=ze+1>>1;for(Oe==0?J(ee,ne,null,null,oe,me,ke,le,oe,me,ke,le,q,G,null,null,ze):(J(_.ec,_.fc,ee,ne,ge,be,Te,Se,oe,me,ke,le,q,G-D.A,q,G,ze),++O);Oe+2<Fe;Oe+=2)ge=oe,be=me,Te=ke,Se=le,me+=S.Rc,le+=S.Rc,G+=2*D.A,J(ee,(ne+=2*S.fa)-S.fa,ee,ne,ge,be,Te,Se,oe,me,ke,le,q,G-D.A,q,G,ze);return ne+=S.fa,S.j+Fe<S.o?(r(_.ec,_.fc,ee,ne,ze),r(_.cc,_.dc,oe,me,Re),r(_.Mc,_.Nc,ke,le,Re),O--):1&Fe||J(ee,ne,null,null,oe,me,ke,le,oe,me,ke,le,q,G+D.A,null,null,ze),O}function wn(S,_,O){var D=S.F,q=[S.J];if(D!=null){var G=S.U,J=_.ba.S,ee=J==_C||J==jC;_=_.ba.f.RGBA;var ne=[0],oe=S.ka;ne[0]=S.T,S.Kb&&(oe==0?--ne[0]:(--oe,q[0]-=S.width),S.j+S.ka+S.T==S.o&&(ne[0]=S.o-S.j-oe));var me=_.eb;oe=_.fb+oe*_.A,S=j$(D,q[0],S.width,G,ne,me,oe+(ee?0:3),_.A),t(O==ne),S&&Mt(J)&&nx(me,oe,ee,G,ne,_.A)}return 0}function Nr(S){var _=S.ma,O=_.ba.S,D=11>O,q=O==SC||O==kC||O==_C||O==VT||O==12||Mt(O);if(_.memory=null,_.Ib=null,_.Jb=null,_.Nd=null,!Go(_.Oa,S,q?11:12))return 0;if(q&&Mt(O)&&Iu(),S.da)alert("todo:use_scaling");else{if(D){if(_.Ib=Ut,S.Kb){if(O=S.U+1>>1,_.memory=s(S.U+2*O),_.memory==null)return 0;_.ec=_.memory,_.fc=0,_.cc=_.ec,_.dc=_.fc+S.U,_.Mc=_.cc,_.Nc=_.dc+O,_.Ib=Wt,Iu()}}else alert("todo:EmitYUV");q&&(_.Jb=wn,D&&qr())}if(D&&!z$){for(S=0;256>S;++S)txe[S]=89858*(S-128)+NC>>BC,ixe[S]=-22014*(S-128)+NC,rxe[S]=-45773*(S-128),nxe[S]=113618*(S-128)+NC>>BC;for(S=ix;S<XT;++S)_=76283*(S-16)+NC>>BC,sxe[S-ix]=Fc(_,255),axe[S-ix]=Fc(_+8>>4,15);z$=1}return 1}function At(S){var _=S.ma,O=S.U,D=S.T;return t(!(1&S.ka)),0>=O||0>=D?0:(O=_.Ib(S,_),_.Jb!=null&&_.Jb(S,_,O),_.Dc+=O,1)}function Ur(S){S.ma.memory=null}function Ln(S,_,O,D){return ce(S,8)!=47?0:(_[0]=ce(S,14)+1,O[0]=ce(S,14)+1,D[0]=ce(S,1),ce(S,3)!=0?0:!S.h)}function gr(S,_){if(4>S)return S+1;var O=S-2>>1;return(2+(1&S)<<O)+ce(_,O)+1}function or(S,_){return 120<_?_-120:1<=(O=((O=H0e[_-1])>>4)*S+(8-(15&O)))?O:1;var O}function xn(S,_,O){var D=Y(O),q=S[_+=255&D].g-8;return 0<q&&(V(O,O.u+8),D=Y(O),_+=S[_].value,_+=D&(1<<q)-1),V(O,O.u+S[_].g),S[_].value}function Ye(S,_,O){return O.g+=S.g,O.value+=S.value<<_>>>0,t(8>=O.g),S.g}function Gn(S,_,O){var D=S.xc;return t((_=D==0?0:S.vc[S.md*(O>>D)+(_>>D)])<S.Wb),S.Ya[_]}function lr(S,_,O,D){var q=S.ab,G=S.c*_,J=S.C;_=J+_;var ee=O,ne=D;for(D=S.Ta,O=S.Ua;0<q--;){var oe=S.gc[q],me=J,ke=_,le=ee,ge=ne,be=(ne=D,ee=O,oe.Ea);switch(t(me<ke),t(ke<=oe.nc),oe.hc){case 2:Wm(le,ge,(ke-me)*be,ne,ee);break;case 0:var Te=me,Se=ke,Oe=ne,Fe=ee,ze=(Nt=oe).Ea;Te==0&&(zd(le,ge,null,null,1,Oe,Fe),Be(le,ge+1,0,0,ze-1,Oe,Fe+1),ge+=ze,Fe+=ze,++Te);for(var Re=1<<Nt.b,Pt=Re-1,xt=Ne(ze,Nt.b),dn=Nt.K,Nt=Nt.w+(Te>>Nt.b)*xt;Te<Se;){var Bn=dn,Hi=Nt,hn=1;for(Vd(le,ge,Oe,Fe-ze,1,Oe,Fe);hn<ze;){var Et=(hn&~Pt)+Re;Et>ze&&(Et=ze),(0,$l[Bn[Hi++]>>8&15])(le,ge+ +hn,Oe,Fe+hn-ze,Et-hn,Oe,Fe+hn),hn=Et}ge+=ze,Fe+=ze,++Te&Pt||(Nt+=xt)}ke!=oe.nc&&r(ne,ee-be,ne,ee+(ke-me-1)*be,be);break;case 1:for(be=le,Se=ge,ze=(le=oe.Ea)-(Fe=le&~(Oe=(ge=1<<oe.b)-1)),Te=Ne(le,oe.b),Re=oe.K,oe=oe.w+(me>>oe.b)*Te;me<ke;){for(Pt=Re,xt=oe,dn=new He,Nt=Se+Fe,Bn=Se+le;Se<Nt;)Ue(Pt[xt++],dn),wA(dn,be,Se,ge,ne,ee),Se+=ge,ee+=ge;Se<Bn&&(Ue(Pt[xt++],dn),wA(dn,be,Se,ze,ne,ee),Se+=ze,ee+=ze),++me&Oe||(oe+=Te)}break;case 3:if(le==ne&&ge==ee&&0<oe.b){for(Se=ne,le=be=ee+(ke-me)*be-(Fe=(ke-me)*Ne(oe.Ea,oe.b)),ge=ne,Oe=ee,Te=[],Fe=(ze=Fe)-1;0<=Fe;--Fe)Te[Fe]=ge[Oe+Fe];for(Fe=ze-1;0<=Fe;--Fe)Se[le+Fe]=Te[Fe];xA(oe,me,ke,ne,be,ne,ee)}else xA(oe,me,ke,le,ge,ne,ee)}ee=D,ne=O}ne!=O&&r(D,O,ee,ne,G)}function ni(S,_){var O=S.V,D=S.Ba+S.c*S.C,q=_-S.C;if(t(_<=S.l.o),t(16>=q),0<q){var G=S.l,J=S.Ta,ee=S.Ua,ne=G.width;if(lr(S,q,O,D),q=ee=[ee],t((O=S.C)<(D=_)),t(G.v<G.va),D>G.o&&(D=G.o),O<G.j){var oe=G.j-O;O=G.j,q[0]+=oe*ne}if(O>=D?O=0:(q[0]+=4*G.v,G.ka=O-G.j,G.U=G.va-G.v,G.T=D-O,O=1),O){if(ee=ee[0],11>(O=S.ca).S){var me=O.f.RGBA,ke=(D=O.S,q=G.U,G=G.T,oe=me.eb,me.A),le=G;for(me=me.fb+S.Ma*me.A;0<le--;){var ge=J,be=ee,Te=q,Se=oe,Oe=me;switch(D){case CC:Z0(ge,be,Te,Se,Oe);break;case SC:ex(ge,be,Te,Se,Oe);break;case KT:ex(ge,be,Te,Se,Oe),nx(Se,Oe,0,Te,1,0);break;case O$:CA(ge,be,Te,Se,Oe);break;case kC:gt(ge,be,Te,Se,Oe,1);break;case qT:gt(ge,be,Te,Se,Oe,1),nx(Se,Oe,0,Te,1,0);break;case _C:gt(ge,be,Te,Se,Oe,0);break;case jC:gt(ge,be,Te,Se,Oe,0),nx(Se,Oe,1,Te,1,0);break;case VT:Gm(ge,be,Te,Se,Oe);break;case WT:Gm(ge,be,Te,Se,Oe),_$(Se,Oe,Te,1,0);break;case F$:bA(ge,be,Te,Se,Oe);break;default:t(0)}ee+=ne,me+=ke}S.Ma+=G}else alert("todo:EmitRescaledRowsYUVA");t(S.Ma<=O.height)}}S.C=_,t(S.C<=S.i)}function ns(S){var _;if(0<S.ua)return 0;for(_=0;_<S.Wb;++_){var O=S.Ya[_].G,D=S.Ya[_].H;if(0<O[1][D[1]+0].g||0<O[2][D[2]+0].g||0<O[3][D[3]+0].g)return 0}return 1}function Ma(S,_,O,D,q,G){if(S.Z!=0){var J=S.qd,ee=S.rd;for(t(Gd[S.Z]!=null);_<O;++_)Gd[S.Z](J,ee,D,q,D,q,G),J=D,ee=q,q+=G;S.qd=J,S.rd=ee}}function Hl(S,_){var O=S.l.ma,D=O.Z==0||O.Z==1?S.l.j:S.C;if(D=S.C<D?D:S.C,t(_<=S.l.o),_>D){var q=S.l.width,G=O.ca,J=O.tb+q*D,ee=S.V,ne=S.Ba+S.c*D,oe=S.gc;t(S.ab==1),t(oe[0].hc==3),$T(oe[0],D,_,ee,ne,G,J),Ma(O,D,_,G,J,q)}S.C=S.Ma=_}function Ql(S,_,O,D,q,G,J){var ee=S.$/D,ne=S.$%D,oe=S.m,me=S.s,ke=O+S.$,le=ke;q=O+D*q;var ge=O+D*G,be=280+me.ua,Te=S.Pb?ee:16777216,Se=0<me.ua?me.Wa:null,Oe=me.wc,Fe=ke<ge?Gn(me,ne,ee):null;t(S.C<G),t(ge<=q);var ze=!1;e:for(;;){for(;ze||ke<ge;){var Re=0;if(ee>=Te){var Pt=ke-O;t((Te=S).Pb),Te.wd=Te.m,Te.xd=Pt,0<Te.s.ua&&je(Te.s.Wa,Te.s.vb),Te=ee+$0e}if(ne&Oe||(Fe=Gn(me,ne,ee)),t(Fe!=null),Fe.Qb&&(_[ke]=Fe.qb,ze=!0),!ze)if(Z(oe),Fe.jc){Re=oe,Pt=_;var xt=ke,dn=Fe.pd[Y(Re)&Km-1];t(Fe.jc),256>dn.g?(V(Re,Re.u+dn.g),Pt[xt]=dn.value,Re=0):(V(Re,Re.u+dn.g-256),t(256<=dn.value),Re=dn.value),Re==0&&(ze=!0)}else Re=xn(Fe.G[0],Fe.H[0],oe);if(oe.h)break;if(ze||256>Re){if(!ze)if(Fe.nd)_[ke]=(Fe.qb|Re<<8)>>>0;else{if(Z(oe),ze=xn(Fe.G[1],Fe.H[1],oe),Z(oe),Pt=xn(Fe.G[2],Fe.H[2],oe),xt=xn(Fe.G[3],Fe.H[3],oe),oe.h)break;_[ke]=(xt<<24|ze<<16|Re<<8|Pt)>>>0}if(ze=!1,++ke,++ne>=D&&(ne=0,++ee,J!=null&&ee<=G&&!(ee%16)&&J(S,ee),Se!=null))for(;le<ke;)Re=_[le++],Se.X[(506832829*Re&4294967295)>>>Se.Mb]=Re}else if(280>Re){if(Re=gr(Re-256,oe),Pt=xn(Fe.G[4],Fe.H[4],oe),Z(oe),Pt=or(D,Pt=gr(Pt,oe)),oe.h)break;if(ke-O<Pt||q-ke<Re)break e;for(xt=0;xt<Re;++xt)_[ke+xt]=_[ke+xt-Pt];for(ke+=Re,ne+=Re;ne>=D;)ne-=D,++ee,J!=null&&ee<=G&&!(ee%16)&&J(S,ee);if(t(ke<=q),ne&Oe&&(Fe=Gn(me,ne,ee)),Se!=null)for(;le<ke;)Re=_[le++],Se.X[(506832829*Re&4294967295)>>>Se.Mb]=Re}else{if(!(Re<be))break e;for(ze=Re-280,t(Se!=null);le<ke;)Re=_[le++],Se.X[(506832829*Re&4294967295)>>>Se.Mb]=Re;Re=ke,t(!(ze>>>(Pt=Se).Xa)),_[Re]=Pt.X[ze],ze=!0}ze||t(oe.h==X(oe))}if(S.Pb&&oe.h&&ke<q)t(S.m.h),S.a=5,S.m=S.wd,S.$=S.xd,0<S.s.ua&&je(S.s.vb,S.s.Wa);else{if(oe.h)break e;J!=null&&J(S,ee>G?G:ee),S.a=0,S.$=ke-O}return 1}return S.a=3,0}function qo(S){t(S!=null),S.vc=null,S.yc=null,S.Ya=null;var _=S.Wa;_!=null&&(_.X=null),S.vb=null,t(S!=null)}function lA(){var S=new jt;return S==null?null:(S.a=0,S.xb=R$,Lt("Predictor","VP8LPredictors"),Lt("Predictor","VP8LPredictors_C"),Lt("PredictorAdd","VP8LPredictorsAdd"),Lt("PredictorAdd","VP8LPredictorsAdd_C"),Wm=Ge,wA=Ze,Z0=mt,ex=ft,Gm=wt,bA=Rt,CA=zt,E.VP8LMapColor32b=Ni,E.VP8LMapColor8b=Uc,S)}function Oc(S,_,O,D,q){var G=1,J=[S],ee=[_],ne=D.m,oe=D.s,me=null,ke=0;e:for(;;){if(O)for(;G&&ce(ne,1);){var le=J,ge=ee,be=D,Te=1,Se=be.m,Oe=be.gc[be.ab],Fe=ce(Se,2);if(be.Oc&1<<Fe)G=0;else{switch(be.Oc|=1<<Fe,Oe.hc=Fe,Oe.Ea=le[0],Oe.nc=ge[0],Oe.K=[null],++be.ab,t(4>=be.ab),Fe){case 0:case 1:Oe.b=ce(Se,3)+2,Te=Oc(Ne(Oe.Ea,Oe.b),Ne(Oe.nc,Oe.b),0,be,Oe.K),Oe.K=Oe.K[0];break;case 3:var ze,Re=ce(Se,8)+1,Pt=16<Re?0:4<Re?1:2<Re?2:3;if(le[0]=Ne(Oe.Ea,Pt),Oe.b=Pt,ze=Te=Oc(Re,1,0,be,Oe.K)){var xt,dn=Re,Nt=Oe,Bn=1<<(8>>Nt.b),Hi=s(Bn);if(Hi==null)ze=0;else{var hn=Nt.K[0],Et=Nt.w;for(Hi[0]=Nt.K[0][0],xt=1;xt<1*dn;++xt)Hi[xt]=st(hn[Et+xt],Hi[xt-1]);for(;xt<4*Bn;++xt)Hi[xt]=0;Nt.K[0]=null,Nt.K[0]=Hi,ze=1}}Te=ze;break;case 2:break;default:t(0)}G=Te}}if(J=J[0],ee=ee[0],G&&ce(ne,1)&&!(G=1<=(ke=ce(ne,4))&&11>=ke)){D.a=3;break e}var et;if(et=G)t:{var pi,cn,Pn,Tr=D,gs=J,ha=ee,ri=ke,Us=O,fa=Tr.m,Qi=Tr.s,Rn=[null],Yn=1,ii=0,Xn=Q0e[ri];n:for(;;){if(Us&&ce(fa,1)){var ys=ce(fa,3)+2,Vl=Ne(gs,ys),mi=Ne(ha,ys),Ra=Vl*mi;if(!Oc(Vl,mi,0,Tr,Rn))break n;for(Rn=Rn[0],Qi.xc=ys,pi=0;pi<Ra;++pi){var ur=Rn[pi]>>8&65535;Rn[pi]=ur,ur>=Yn&&(Yn=ur+1)}}if(fa.h)break n;for(cn=0;5>cn;++cn){var $i=M$[cn];!cn&&0<ri&&($i+=1<<ri),ii<$i&&(ii=$i)}var mo=a(Yn*Xn,F),Aa=Yn,go=a(Aa,U);if(go==null)var yo=null;else t(65536>=Aa),yo=go;var Da=s(ii);if(yo==null||Da==null||mo==null){Tr.a=1;break n}var vo=mo;for(pi=Pn=0;pi<Yn;++pi){var xr=yo[pi],xo=xr.G,Kl=xr.H,SA=0,Mu=1,vs=0;for(cn=0;5>cn;++cn){$i=M$[cn],xo[cn]=vo,Kl[cn]=Pn,!cn&&0<ri&&($i+=1<<ri);i:{var TC,JT=$i,IC=Tr,sx=Da,cxe=vo,uxe=Pn,ZT=0,Yd=IC.m,dxe=ce(Yd,1);if(i(sx,0,0,JT),dxe){var hxe=ce(Yd,1)+1,fxe=ce(Yd,1),q$=ce(Yd,fxe==0?1:8);sx[q$]=1,hxe==2&&(sx[q$=ce(Yd,8)]=1);var PC=1}else{var W$=s(19),G$=ce(Yd,4)+4;if(19<G$){IC.a=3;var OC=0;break i}for(TC=0;TC<G$;++TC)W$[U0e[TC]]=ce(Yd,3);var eI=void 0,ax=void 0,Y$=IC,Axe=W$,FC=JT,X$=sx,tI=0,Xd=Y$.m,J$=8,Z$=a(128,F);r:for(;N(Z$,0,7,Axe,19);){if(ce(Xd,1)){var pxe=2+2*ce(Xd,3);if((eI=2+ce(Xd,pxe))>FC)break r}else eI=FC;for(ax=0;ax<FC&&eI--;){Z(Xd);var e8=Z$[0+(127&Y(Xd))];V(Xd,Xd.u+e8.g);var Jm=e8.value;if(16>Jm)X$[ax++]=Jm,Jm!=0&&(J$=Jm);else{var mxe=Jm==16,t8=Jm-16,gxe=R0e[t8],n8=ce(Xd,L0e[t8])+gxe;if(ax+n8>FC)break r;for(var yxe=mxe?J$:0;0<n8--;)X$[ax++]=yxe}}tI=1;break r}tI||(Y$.a=3),PC=tI}(PC=PC&&!Yd.h)&&(ZT=N(cxe,uxe,8,sx,JT)),PC&&ZT!=0?OC=ZT:(IC.a=3,OC=0)}if(OC==0)break n;if(Mu&&D0e[cn]==1&&(Mu=vo[Pn].g==0),SA+=vo[Pn].g,Pn+=OC,3>=cn){var ox,nI=Da[0];for(ox=1;ox<$i;++ox)Da[ox]>nI&&(nI=Da[ox]);vs+=nI}}if(xr.nd=Mu,xr.Qb=0,Mu&&(xr.qb=(xo[3][Kl[3]+0].value<<24|xo[1][Kl[1]+0].value<<16|xo[2][Kl[2]+0].value)>>>0,SA==0&&256>xo[0][Kl[0]+0].value&&(xr.Qb=1,xr.qb+=xo[0][Kl[0]+0].value<<8)),xr.jc=!xr.Qb&&6>vs,xr.jc){var MC,Lu=xr;for(MC=0;MC<Km;++MC){var Jd=MC,Zd=Lu.pd[Jd],LC=Lu.G[0][Lu.H[0]+Jd];256<=LC.value?(Zd.g=LC.g+256,Zd.value=LC.value):(Zd.g=0,Zd.value=0,Jd>>=Ye(LC,8,Zd),Jd>>=Ye(Lu.G[1][Lu.H[1]+Jd],16,Zd),Jd>>=Ye(Lu.G[2][Lu.H[2]+Jd],0,Zd),Ye(Lu.G[3][Lu.H[3]+Jd],24,Zd))}}}Qi.vc=Rn,Qi.Wb=Yn,Qi.Ya=yo,Qi.yc=mo,et=1;break t}et=0}if(!(G=et)){D.a=3;break e}if(0<ke){if(oe.ua=1<<ke,!te(oe.Wa,ke)){D.a=1,G=0;break e}}else oe.ua=0;var rI=D,r8=J,vxe=ee,iI=rI.s,sI=iI.xc;if(rI.c=r8,rI.i=vxe,iI.md=Ne(r8,sI),iI.wc=sI==0?-1:(1<<sI)-1,O){D.xb=Y0e;break e}if((me=s(J*ee))==null){D.a=1,G=0;break e}G=(G=Ql(D,me,0,J,ee,ee,null))&&!ne.h;break e}return G?(q!=null?q[0]=me:(t(me==null),t(O)),D.$=0,O||qo(oe)):qo(oe),G}function cA(S,_){var O=S.c*S.i,D=O+_+16*_;return t(S.c<=_),S.V=s(D),S.V==null?(S.Ta=null,S.Ua=0,S.a=1,0):(S.Ta=S.V,S.Ua=S.Ba+O+_,1)}function Tm(S,_){var O=S.C,D=_-O,q=S.V,G=S.Ba+S.c*O;for(t(_<=S.l.o);0<D;){var J=16<D?16:D,ee=S.l.ma,ne=S.l.width,oe=ne*J,me=ee.ca,ke=ee.tb+ne*O,le=S.Ta,ge=S.Ua;lr(S,J,q,G),B$(le,ge,me,ke,oe),Ma(ee,O,O+J,me,ke,ne),D-=J,q+=J*S.c,O+=J}t(O==_),S.C=S.Ma=_}function Im(){this.ub=this.yd=this.td=this.Rb=0}function Pm(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function kT(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function D0(){this.Yb=function(){var S=[];return function _(O,D,q){for(var G=q[D],J=0;J<G&&(O.push(q.length>D+1?[]:0),!(q.length<D+1));J++)_(O[J],D+1,q)}(S,0,[3,11]),S}()}function iC(){this.jb=s(3),this.Wc=o([4,8],D0),this.Xc=o([4,17],D0)}function sC(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function Wo(){this.ld=this.La=this.dd=this.tc=0}function U0(){this.Na=this.la=0}function aC(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function H0(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function oC(){this.uc=this.M=this.Nb=0,this.wa=Array(new Wo),this.Y=0,this.ya=Array(new H0),this.aa=0,this.l=new Om}function lC(){this.y=s(16),this.f=s(8),this.ea=s(8)}function cC(){this.cb=this.a=0,this.sc="",this.m=new R,this.Od=new Im,this.Kc=new Pm,this.ed=new sC,this.Qa=new kT,this.Ic=this.$c=this.Aa=0,this.D=new oC,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,R),this.ia=0,this.pb=a(4,aC),this.Pa=new iC,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new lC),this.Hd=0,this.rb=Array(new U0),this.sb=0,this.wa=Array(new Wo),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new H0),this.L=this.aa=0,this.gd=o([4,2],Wo),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Fc(S,_){return 0>S?0:S>_?_:S}function Om(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function _T(){var S=new cC;return S!=null&&(S.a=0,S.sc="OK",S.cb=0,S.Xb=0,rx||(rx=Fm)),S}function ji(S,_,O){return S.a==0&&(S.a=_,S.sc=O,S.cb=0),0}function uC(S,_,O){return 3<=O&&S[_+0]==157&&S[_+1]==1&&S[_+2]==42}function Mc(S,_){if(S==null)return 0;if(S.a=0,S.sc="OK",_==null)return ji(S,2,"null VP8Io passed to VP8GetHeaders()");var O=_.data,D=_.w,q=_.ha;if(4>q)return ji(S,7,"Truncated header.");var G=O[D+0]|O[D+1]<<8|O[D+2]<<16,J=S.Od;if(J.Rb=!(1&G),J.td=G>>1&7,J.yd=G>>4&1,J.ub=G>>5,3<J.td)return ji(S,3,"Incorrect keyframe parameters.");if(!J.yd)return ji(S,4,"Frame not displayable.");D+=3,q-=3;var ee=S.Kc;if(J.Rb){if(7>q)return ji(S,7,"cannot parse picture header");if(!uC(O,D,q))return ji(S,3,"Bad code word");ee.c=16383&(O[D+4]<<8|O[D+3]),ee.Td=O[D+4]>>6,ee.i=16383&(O[D+6]<<8|O[D+5]),ee.Ud=O[D+6]>>6,D+=7,q-=7,S.za=ee.c+15>>4,S.Ub=ee.i+15>>4,_.width=ee.c,_.height=ee.i,_.Da=0,_.j=0,_.v=0,_.va=_.width,_.o=_.height,_.da=0,_.ib=_.width,_.hb=_.height,_.U=_.width,_.T=_.height,i((G=S.Pa).jb,0,255,G.jb.length),t((G=S.Qa)!=null),G.Cb=0,G.Bb=0,G.Fb=1,i(G.Zb,0,0,G.Zb.length),i(G.Lb,0,0,G.Lb)}if(J.ub>q)return ji(S,7,"bad partition length");H(G=S.m,O,D,J.ub),D+=J.ub,q-=J.ub,J.Rb&&(ee.Ld=ue(G),ee.Kd=ue(G)),ee=S.Qa;var ne,oe=S.Pa;if(t(G!=null),t(ee!=null),ee.Cb=ue(G),ee.Cb){if(ee.Bb=ue(G),ue(G)){for(ee.Fb=ue(G),ne=0;4>ne;++ne)ee.Zb[ne]=ue(G)?$(G,7):0;for(ne=0;4>ne;++ne)ee.Lb[ne]=ue(G)?$(G,6):0}if(ee.Bb)for(ne=0;3>ne;++ne)oe.jb[ne]=ue(G)?W(G,8):255}else ee.Bb=0;if(G.Ka)return ji(S,3,"cannot parse segment header");if((ee=S.ed).zd=ue(G),ee.Tb=W(G,6),ee.wb=W(G,3),ee.Pc=ue(G),ee.Pc&&ue(G)){for(oe=0;4>oe;++oe)ue(G)&&(ee.vd[oe]=$(G,6));for(oe=0;4>oe;++oe)ue(G)&&(ee.od[oe]=$(G,6))}if(S.L=ee.Tb==0?0:ee.zd?1:2,G.Ka)return ji(S,3,"cannot parse filter header");var me=q;if(q=ne=D,D=ne+me,ee=me,S.Xb=(1<<W(S.m,2))-1,me<3*(oe=S.Xb))O=7;else{for(ne+=3*oe,ee-=3*oe,me=0;me<oe;++me){var ke=O[q+0]|O[q+1]<<8|O[q+2]<<16;ke>ee&&(ke=ee),H(S.Jc[+me],O,ne,ke),ne+=ke,ee-=ke,q+=3}H(S.Jc[+oe],O,ne,ee),O=ne<D?0:5}if(O!=0)return ji(S,O,"cannot parse partitions");for(O=W(ne=S.m,7),q=ue(ne)?$(ne,4):0,D=ue(ne)?$(ne,4):0,ee=ue(ne)?$(ne,4):0,oe=ue(ne)?$(ne,4):0,ne=ue(ne)?$(ne,4):0,me=S.Qa,ke=0;4>ke;++ke){if(me.Cb){var le=me.Zb[ke];me.Fb||(le+=O)}else{if(0<ke){S.pb[ke]=S.pb[0];continue}le=O}var ge=S.pb[ke];ge.Sc[0]=GT[Fc(le+q,127)],ge.Sc[1]=YT[Fc(le+0,127)],ge.Eb[0]=2*GT[Fc(le+D,127)],ge.Eb[1]=101581*YT[Fc(le+ee,127)]>>16,8>ge.Eb[1]&&(ge.Eb[1]=8),ge.Qc[0]=GT[Fc(le+oe,117)],ge.Qc[1]=YT[Fc(le+ne,127)],ge.lc=le+ne}if(!J.Rb)return ji(S,4,"Not a key frame.");for(ue(G),J=S.Pa,O=0;4>O;++O){for(q=0;8>q;++q)for(D=0;3>D;++D)for(ee=0;11>ee;++ee)oe=se(G,W0e[O][q][D][ee])?W(G,8):K0e[O][q][D][ee],J.Wc[O][q].Yb[D][ee]=oe;for(q=0;17>q;++q)J.Xc[O][q]=J.Wc[O][G0e[q]]}return S.kc=ue(G),S.kc&&(S.Bd=W(G,8)),S.cb=1}function Fm(S,_,O,D,q,G,J){var ee=_[q].Yb[O];for(O=0;16>q;++q){if(!se(S,ee[O+0]))return q;for(;!se(S,ee[O+1]);)if(ee=_[++q].Yb[0],O=0,q==16)return 16;var ne=_[q+1].Yb;if(se(S,ee[O+2])){var oe=S,me=0;if(se(oe,(le=ee)[(ke=O)+3]))if(se(oe,le[ke+6])){for(ee=0,ke=2*(me=se(oe,le[ke+8]))+(le=se(oe,le[ke+9+me])),me=0,le=z0e[ke];le[ee];++ee)me+=me+se(oe,le[ee]);me+=3+(8<<ke)}else se(oe,le[ke+7])?(me=7+2*se(oe,165),me+=se(oe,145)):me=5+se(oe,159);else me=se(oe,le[ke+4])?3+se(oe,le[ke+5]):2;ee=ne[2]}else me=1,ee=ne[1];ne=J+V0e[q],0>(oe=S).b&&de(oe);var ke,le=oe.b,ge=(ke=oe.Ca>>1)-(oe.I>>le)>>31;--oe.b,oe.Ca+=ge,oe.Ca|=1,oe.I-=(ke+1&ge)<<le,G[ne]=((me^ge)-ge)*D[(0<q)+0]}return 16}function Q0(S){var _=S.rb[S.sb-1];_.la=0,_.Na=0,i(S.zc,0,0,S.zc.length),S.ja=0}function Ao(S,_,O,D,q){q=S[_+O+32*D]+(q>>3),S[_+O+32*D]=-256&q?0>q?0:255:q}function Mm(S,_,O,D,q,G){Ao(S,_,0,O,D+q),Ao(S,_,1,O,D+G),Ao(S,_,2,O,D-G),Ao(S,_,3,O,D-q)}function ju(S){return(20091*S>>16)+S}function ms(S,_,O,D){var q,G=0,J=s(16);for(q=0;4>q;++q){var ee=S[_+0]+S[_+8],ne=S[_+0]-S[_+8],oe=(35468*S[_+4]>>16)-ju(S[_+12]),me=ju(S[_+4])+(35468*S[_+12]>>16);J[G+0]=ee+me,J[G+1]=ne+oe,J[G+2]=ne-oe,J[G+3]=ee-me,G+=4,_++}for(q=G=0;4>q;++q)ee=(S=J[G+0]+4)+J[G+8],ne=S-J[G+8],oe=(35468*J[G+4]>>16)-ju(J[G+12]),Ao(O,D,0,0,ee+(me=ju(J[G+4])+(35468*J[G+12]>>16))),Ao(O,D,1,0,ne+oe),Ao(O,D,2,0,ne-oe),Ao(O,D,3,0,ee-me),G++,D+=32}function dC(S,_,O,D){var q=S[_+0]+4,G=35468*S[_+4]>>16,J=ju(S[_+4]),ee=35468*S[_+1]>>16;Mm(O,D,0,q+J,S=ju(S[_+1]),ee),Mm(O,D,1,q+G,S,ee),Mm(O,D,2,q-G,S,ee),Mm(O,D,3,q-J,S,ee)}function jT(S,_,O,D,q){ms(S,_,O,D),q&&ms(S,_+16,O,D+4)}function BT(S,_,O,D){Pu(S,_+0,O,D,1),Pu(S,_+32,O,D+128,1)}function NT(S,_,O,D){var q;for(S=S[_+0]+4,q=0;4>q;++q)for(_=0;4>_;++_)Ao(O,D,_,q,S)}function Lc(S,_,O,D){S[_+0]&&Ds(S,_+0,O,D),S[_+16]&&Ds(S,_+16,O,D+4),S[_+32]&&Ds(S,_+32,O,D+128),S[_+48]&&Ds(S,_+48,O,D+128+4)}function hC(S,_,O,D){var q,G=s(16);for(q=0;4>q;++q){var J=S[_+0+q]+S[_+12+q],ee=S[_+4+q]+S[_+8+q],ne=S[_+4+q]-S[_+8+q],oe=S[_+0+q]-S[_+12+q];G[0+q]=J+ee,G[8+q]=J-ee,G[4+q]=oe+ne,G[12+q]=oe-ne}for(q=0;4>q;++q)J=(S=G[0+4*q]+3)+G[3+4*q],ee=G[1+4*q]+G[2+4*q],ne=G[1+4*q]-G[2+4*q],oe=S-G[3+4*q],O[D+0]=J+ee>>3,O[D+16]=oe+ne>>3,O[D+32]=J-ee>>3,O[D+48]=oe-ne>>3,D+=64}function Lm(S,_,O){var D,q=_-32,G=po,J=255-S[q-1];for(D=0;D<O;++D){var ee,ne=G,oe=J+S[_-1];for(ee=0;ee<O;++ee)S[_+ee]=ne[oe+S[q+ee]];_+=32}}function Rm(S,_){Lm(S,_,4)}function $0(S,_){Lm(S,_,8)}function ET(S,_){Lm(S,_,16)}function TT(S,_){var O;for(O=0;16>O;++O)r(S,_+32*O,S,_-32,16)}function IT(S,_){var O;for(O=16;0<O;--O)i(S,_,S[_-1],16),_+=32}function Ud(S,_,O){var D;for(D=0;16>D;++D)i(_,O+32*D,S,16)}function fC(S,_){var O,D=16;for(O=0;16>O;++O)D+=S[_-1+32*O]+S[_+O-32];Ud(D>>5,S,_)}function Hd(S,_){var O,D=8;for(O=0;16>O;++O)D+=S[_-1+32*O];Ud(D>>4,S,_)}function PT(S,_){var O,D=8;for(O=0;16>O;++O)D+=S[_+O-32];Ud(D>>4,S,_)}function uA(S,_){Ud(128,S,_)}function Xt(S,_,O){return S+2*_+O+2>>2}function OT(S,_){var O,D=_-32;for(D=new Uint8Array([Xt(S[D-1],S[D+0],S[D+1]),Xt(S[D+0],S[D+1],S[D+2]),Xt(S[D+1],S[D+2],S[D+3]),Xt(S[D+2],S[D+3],S[D+4])]),O=0;4>O;++O)r(S,_+32*O,D,0,D.length)}function FT(S,_){var O=S[_-1],D=S[_-1+32],q=S[_-1+64],G=S[_-1+96];he(S,_+0,16843009*Xt(S[_-1-32],O,D)),he(S,_+32,16843009*Xt(O,D,q)),he(S,_+64,16843009*Xt(D,q,G)),he(S,_+96,16843009*Xt(q,G,G))}function MT(S,_){var O,D=4;for(O=0;4>O;++O)D+=S[_+O-32]+S[_-1+32*O];for(D>>=3,O=0;4>O;++O)i(S,_+32*O,D,4)}function LT(S,_){var O=S[_-1+0],D=S[_-1+32],q=S[_-1+64],G=S[_-1-32],J=S[_+0-32],ee=S[_+1-32],ne=S[_+2-32],oe=S[_+3-32];S[_+0+96]=Xt(D,q,S[_-1+96]),S[_+1+96]=S[_+0+64]=Xt(O,D,q),S[_+2+96]=S[_+1+64]=S[_+0+32]=Xt(G,O,D),S[_+3+96]=S[_+2+64]=S[_+1+32]=S[_+0+0]=Xt(J,G,O),S[_+3+64]=S[_+2+32]=S[_+1+0]=Xt(ee,J,G),S[_+3+32]=S[_+2+0]=Xt(ne,ee,J),S[_+3+0]=Xt(oe,ne,ee)}function RT(S,_){var O=S[_+1-32],D=S[_+2-32],q=S[_+3-32],G=S[_+4-32],J=S[_+5-32],ee=S[_+6-32],ne=S[_+7-32];S[_+0+0]=Xt(S[_+0-32],O,D),S[_+1+0]=S[_+0+32]=Xt(O,D,q),S[_+2+0]=S[_+1+32]=S[_+0+64]=Xt(D,q,G),S[_+3+0]=S[_+2+32]=S[_+1+64]=S[_+0+96]=Xt(q,G,J),S[_+3+32]=S[_+2+64]=S[_+1+96]=Xt(G,J,ee),S[_+3+64]=S[_+2+96]=Xt(J,ee,ne),S[_+3+96]=Xt(ee,ne,ne)}function Bu(S,_){var O=S[_-1+0],D=S[_-1+32],q=S[_-1+64],G=S[_-1-32],J=S[_+0-32],ee=S[_+1-32],ne=S[_+2-32],oe=S[_+3-32];S[_+0+0]=S[_+1+64]=G+J+1>>1,S[_+1+0]=S[_+2+64]=J+ee+1>>1,S[_+2+0]=S[_+3+64]=ee+ne+1>>1,S[_+3+0]=ne+oe+1>>1,S[_+0+96]=Xt(q,D,O),S[_+0+64]=Xt(D,O,G),S[_+0+32]=S[_+1+96]=Xt(O,G,J),S[_+1+32]=S[_+2+96]=Xt(G,J,ee),S[_+2+32]=S[_+3+96]=Xt(J,ee,ne),S[_+3+32]=Xt(ee,ne,oe)}function Nu(S,_){var O=S[_+0-32],D=S[_+1-32],q=S[_+2-32],G=S[_+3-32],J=S[_+4-32],ee=S[_+5-32],ne=S[_+6-32],oe=S[_+7-32];S[_+0+0]=O+D+1>>1,S[_+1+0]=S[_+0+64]=D+q+1>>1,S[_+2+0]=S[_+1+64]=q+G+1>>1,S[_+3+0]=S[_+2+64]=G+J+1>>1,S[_+0+32]=Xt(O,D,q),S[_+1+32]=S[_+0+96]=Xt(D,q,G),S[_+2+32]=S[_+1+96]=Xt(q,G,J),S[_+3+32]=S[_+2+96]=Xt(G,J,ee),S[_+3+64]=Xt(J,ee,ne),S[_+3+96]=Xt(ee,ne,oe)}function DT(S,_){var O=S[_-1+0],D=S[_-1+32],q=S[_-1+64],G=S[_-1+96];S[_+0+0]=O+D+1>>1,S[_+2+0]=S[_+0+32]=D+q+1>>1,S[_+2+32]=S[_+0+64]=q+G+1>>1,S[_+1+0]=Xt(O,D,q),S[_+3+0]=S[_+1+32]=Xt(D,q,G),S[_+3+32]=S[_+1+64]=Xt(q,G,G),S[_+3+64]=S[_+2+64]=S[_+0+96]=S[_+1+96]=S[_+2+96]=S[_+3+96]=G}function UT(S,_){var O=S[_-1+0],D=S[_-1+32],q=S[_-1+64],G=S[_-1+96],J=S[_-1-32],ee=S[_+0-32],ne=S[_+1-32],oe=S[_+2-32];S[_+0+0]=S[_+2+32]=O+J+1>>1,S[_+0+32]=S[_+2+64]=D+O+1>>1,S[_+0+64]=S[_+2+96]=q+D+1>>1,S[_+0+96]=G+q+1>>1,S[_+3+0]=Xt(ee,ne,oe),S[_+2+0]=Xt(J,ee,ne),S[_+1+0]=S[_+3+32]=Xt(O,J,ee),S[_+1+32]=S[_+3+64]=Xt(D,O,J),S[_+1+64]=S[_+3+96]=Xt(q,D,O),S[_+1+96]=Xt(G,q,D)}function Dm(S,_){var O;for(O=0;8>O;++O)r(S,_+32*O,S,_-32,8)}function z0(S,_){var O;for(O=0;8>O;++O)i(S,_,S[_-1],8),_+=32}function Rc(S,_,O){var D;for(D=0;8>D;++D)i(_,O+32*D,S,8)}function HT(S,_){var O,D=8;for(O=0;8>O;++O)D+=S[_+O-32]+S[_-1+32*O];Rc(D>>4,S,_)}function Um(S,_){var O,D=4;for(O=0;8>O;++O)D+=S[_+O-32];Rc(D>>3,S,_)}function QT(S,_){var O,D=4;for(O=0;8>O;++O)D+=S[_-1+32*O];Rc(D>>3,S,_)}function V0(S,_){Rc(128,S,_)}function Qd(S,_,O){var D=S[_-O],q=S[_+0],G=3*(q-D)+zT[1020+S[_-2*O]-S[_+O]],J=bC[112+(G+4>>3)];S[_-O]=po[255+D+bC[112+(G+3>>3)]],S[_+0]=po[255+q-J]}function K0(S,_,O,D){var q=S[_+0],G=S[_+O];return Yo[255+S[_-2*O]-S[_-O]]>D||Yo[255+G-q]>D}function dA(S,_,O,D){return 4*Yo[255+S[_-O]-S[_+0]]+Yo[255+S[_-2*O]-S[_+O]]<=D}function q0(S,_,O,D,q){var G=S[_-3*O],J=S[_-2*O],ee=S[_-O],ne=S[_+0],oe=S[_+O],me=S[_+2*O],ke=S[_+3*O];return 4*Yo[255+ee-ne]+Yo[255+J-oe]>D?0:Yo[255+S[_-4*O]-G]<=q&&Yo[255+G-J]<=q&&Yo[255+J-ee]<=q&&Yo[255+ke-me]<=q&&Yo[255+me-oe]<=q&&Yo[255+oe-ne]<=q}function Hm(S,_,O,D){var q=2*D+1;for(D=0;16>D;++D)dA(S,_+D,O,q)&&Qd(S,_+D,O)}function W0(S,_,O,D){var q=2*D+1;for(D=0;16>D;++D)dA(S,_+D*O,1,q)&&Qd(S,_+D*O,1)}function Qm(S,_,O,D){var q;for(q=3;0<q;--q)Hm(S,_+=4*O,O,D)}function AC(S,_,O,D){var q;for(q=3;0<q;--q)W0(S,_+=4,O,D)}function Eu(S,_,O,D,q,G,J,ee){for(G=2*G+1;0<q--;){if(q0(S,_,O,G,J))if(K0(S,_,O,ee))Qd(S,_,O);else{var ne=S,oe=_,me=O,ke=ne[oe-2*me],le=ne[oe-me],ge=ne[oe+0],be=ne[oe+me],Te=ne[oe+2*me],Se=27*(Fe=zT[1020+3*(ge-le)+zT[1020+ke-be]])+63>>7,Oe=18*Fe+63>>7,Fe=9*Fe+63>>7;ne[oe-3*me]=po[255+ne[oe-3*me]+Fe],ne[oe-2*me]=po[255+ke+Oe],ne[oe-me]=po[255+le+Se],ne[oe+0]=po[255+ge-Se],ne[oe+me]=po[255+be-Oe],ne[oe+2*me]=po[255+Te-Fe]}_+=D}}function Tu(S,_,O,D,q,G,J,ee){for(G=2*G+1;0<q--;){if(q0(S,_,O,G,J))if(K0(S,_,O,ee))Qd(S,_,O);else{var ne=S,oe=_,me=O,ke=ne[oe-me],le=ne[oe+0],ge=ne[oe+me],be=bC[112+(4+(Te=3*(le-ke))>>3)],Te=bC[112+(Te+3>>3)],Se=be+1>>1;ne[oe-2*me]=po[255+ne[oe-2*me]+Se],ne[oe-me]=po[255+ke+Te],ne[oe+0]=po[255+le-be],ne[oe+me]=po[255+ge-Se]}_+=D}}function pC(S,_,O,D,q,G){Eu(S,_,O,1,16,D,q,G)}function mC(S,_,O,D,q,G){Eu(S,_,1,O,16,D,q,G)}function gC(S,_,O,D,q,G){var J;for(J=3;0<J;--J)Tu(S,_+=4*O,O,1,16,D,q,G)}function hA(S,_,O,D,q,G){var J;for(J=3;0<J;--J)Tu(S,_+=4,1,O,16,D,q,G)}function yC(S,_,O,D,q,G,J,ee){Eu(S,_,q,1,8,G,J,ee),Eu(O,D,q,1,8,G,J,ee)}function I(S,_,O,D,q,G,J,ee){Eu(S,_,1,q,8,G,J,ee),Eu(O,D,1,q,8,G,J,ee)}function K(S,_,O,D,q,G,J,ee){Tu(S,_+4*q,q,1,8,G,J,ee),Tu(O,D+4*q,q,1,8,G,J,ee)}function ae(S,_,O,D,q,G,J,ee){Tu(S,_+4,1,q,8,G,J,ee),Tu(O,D+4,1,q,8,G,J,ee)}function fe(){this.ba=new tn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new jn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function ve(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Ee(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Le(){this.ua=0,this.Wa=new nt,this.vb=new nt,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new U,this.yc=new F}function jt(){this.xb=this.a=0,this.l=new Om,this.ca=new tn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new M,this.Pb=0,this.wd=new M,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Le,this.ab=0,this.gc=a(4,Ee),this.Oc=0}function kt(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Om,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function nn(S,_,O,D,q,G,J){for(S=S==null?0:S[_+0],_=0;_<J;++_)q[G+_]=S+O[D+_]&255,S=q[G+_]}function ln(S,_,O,D,q,G,J){var ee;if(S==null)nn(null,null,O,D,q,G,J);else for(ee=0;ee<J;++ee)q[G+ee]=S[_+ee]+O[D+ee]&255}function In(S,_,O,D,q,G,J){if(S==null)nn(null,null,O,D,q,G,J);else{var ee,ne=S[_+0],oe=ne,me=ne;for(ee=0;ee<J;++ee)oe=me+(ne=S[_+ee])-oe,me=O[D+ee]+(-256&oe?0>oe?0:255:oe)&255,oe=ne,q[G+ee]=me}}function Bi(S,_,O,D){var q=_.width,G=_.o;if(t(S!=null&&_!=null),0>O||0>=D||O+D>G)return null;if(!S.Cc){if(S.ga==null){var J;if(S.ga=new kt,(J=S.ga==null)||(J=_.width*_.o,t(S.Gb.length==0),S.Gb=s(J),S.Uc=0,S.Gb==null?J=0:(S.mb=S.Gb,S.nb=S.Uc,S.rc=null,J=1),J=!J),!J){J=S.ga;var ee=S.Fa,ne=S.P,oe=S.qc,me=S.mb,ke=S.nb,le=ne+1,ge=oe-1,be=J.l;if(t(ee!=null&&me!=null&&_!=null),Gd[0]=null,Gd[1]=nn,Gd[2]=ln,Gd[3]=In,J.ca=me,J.tb=ke,J.c=_.width,J.i=_.height,t(0<J.c&&0<J.i),1>=oe)_=0;else if(J.$a=3&ee[ne+0],J.Z=ee[ne+0]>>2&3,J.Lc=ee[ne+0]>>4&3,ne=ee[ne+0]>>6&3,0>J.$a||1<J.$a||4<=J.Z||1<J.Lc||ne)_=0;else if(be.put=At,be.ac=Nr,be.bc=Ur,be.ma=J,be.width=_.width,be.height=_.height,be.Da=_.Da,be.v=_.v,be.va=_.va,be.j=_.j,be.o=_.o,J.$a)e:{t(J.$a==1),_=lA();t:for(;;){if(_==null){_=0;break e}if(t(J!=null),J.mc=_,_.c=J.c,_.i=J.i,_.l=J.l,_.l.ma=J,_.l.width=J.c,_.l.height=J.i,_.a=0,z(_.m,ee,le,ge),!Oc(J.c,J.i,1,_,null)||(_.ab==1&&_.gc[0].hc==3&&ns(_.s)?(J.ic=1,ee=_.c*_.i,_.Ta=null,_.Ua=0,_.V=s(ee),_.Ba=0,_.V==null?(_.a=1,_=0):_=1):(J.ic=0,_=cA(_,J.c)),!_))break t;_=1;break e}J.mc=null,_=0}else _=ge>=J.c*J.i;J=!_}if(J)return null;S.ga.Lc!=1?S.Ga=0:D=G-O}t(S.ga!=null),t(O+D<=G);e:{if(_=(ee=S.ga).c,G=ee.l.o,ee.$a==0){if(le=S.rc,ge=S.Vc,be=S.Fa,ne=S.P+1+O*_,oe=S.mb,me=S.nb+O*_,t(ne<=S.P+S.qc),ee.Z!=0)for(t(Gd[ee.Z]!=null),J=0;J<D;++J)Gd[ee.Z](le,ge,be,ne,oe,me,_),le=oe,ge=me,me+=_,ne+=_;else for(J=0;J<D;++J)r(oe,me,be,ne,_),le=oe,ge=me,me+=_,ne+=_;S.rc=le,S.Vc=ge}else{if(t(ee.mc!=null),_=O+D,t((J=ee.mc)!=null),t(_<=J.i),J.C>=_)_=1;else if(ee.ic||qr(),ee.ic){ee=J.V,le=J.Ba,ge=J.c;var Te=J.i,Se=(be=1,ne=J.$/ge,oe=J.$%ge,me=J.m,ke=J.s,J.$),Oe=ge*Te,Fe=ge*_,ze=ke.wc,Re=Se<Fe?Gn(ke,oe,ne):null;t(Se<=Oe),t(_<=Te),t(ns(ke));t:for(;;){for(;!me.h&&Se<Fe;){if(oe&ze||(Re=Gn(ke,oe,ne)),t(Re!=null),Z(me),256>(Te=xn(Re.G[0],Re.H[0],me)))ee[le+Se]=Te,++Se,++oe>=ge&&(oe=0,++ne<=_&&!(ne%16)&&Hl(J,ne));else{if(!(280>Te)){be=0;break t}Te=gr(Te-256,me);var Pt,xt=xn(Re.G[4],Re.H[4],me);if(Z(me),!(Se>=(xt=or(ge,xt=gr(xt,me)))&&Oe-Se>=Te)){be=0;break t}for(Pt=0;Pt<Te;++Pt)ee[le+Se+Pt]=ee[le+Se+Pt-xt];for(Se+=Te,oe+=Te;oe>=ge;)oe-=ge,++ne<=_&&!(ne%16)&&Hl(J,ne);Se<Fe&&oe&ze&&(Re=Gn(ke,oe,ne))}t(me.h==X(me))}Hl(J,ne>_?_:ne);break t}!be||me.h&&Se<Oe?(be=0,J.a=me.h?5:3):J.$=Se,_=be}else _=Ql(J,J.V,J.Ba,J.c,J.i,_,Tm);if(!_){D=0;break e}}O+D>=G&&(S.Cc=1),D=1}if(!D)return null;if(S.Cc&&((D=S.ga)!=null&&(D.mc=null),S.ga=null,0<S.Ga))return alert("todo:WebPDequantizeLevels"),null}return S.nb+O*q}function cr(S,_,O,D,q,G){for(;0<q--;){var J,ee=S,ne=_+(O?1:0),oe=S,me=_+(O?0:3);for(J=0;J<D;++J){var ke=oe[me+4*J];ke!=255&&(ke*=32897,ee[ne+4*J+0]=ee[ne+4*J+0]*ke>>23,ee[ne+4*J+1]=ee[ne+4*J+1]*ke>>23,ee[ne+4*J+2]=ee[ne+4*J+2]*ke>>23)}_+=G}}function rr(S,_,O,D,q){for(;0<D--;){var G;for(G=0;G<O;++G){var J=S[_+2*G+0],ee=15&(oe=S[_+2*G+1]),ne=4369*ee,oe=(240&oe|oe>>4)*ne>>16;S[_+2*G+0]=(240&J|J>>4)*ne>>16&240|(15&J|J<<4)*ne>>16>>4&15,S[_+2*G+1]=240&oe|ee}_+=q}}function Er(S,_,O,D,q,G,J,ee){var ne,oe,me=255;for(oe=0;oe<q;++oe){for(ne=0;ne<D;++ne){var ke=S[_+ne];G[J+4*ne]=ke,me&=ke}_+=O,J+=ee}return me!=255}function Kr(S,_,O,D,q){var G;for(G=0;G<q;++G)O[D+G]=S[_+G]>>8}function qr(){nx=cr,_$=rr,j$=Er,B$=Kr}function Ls(S,_,O){E[S]=function(D,q,G,J,ee,ne,oe,me,ke,le,ge,be,Te,Se,Oe,Fe,ze){var Re,Pt=ze-1>>1,xt=ee[ne+0]|oe[me+0]<<16,dn=ke[le+0]|ge[be+0]<<16;t(D!=null);var Nt=3*xt+dn+131074>>2;for(_(D[q+0],255&Nt,Nt>>16,Te,Se),G!=null&&(Nt=3*dn+xt+131074>>2,_(G[J+0],255&Nt,Nt>>16,Oe,Fe)),Re=1;Re<=Pt;++Re){var Bn=ee[ne+Re]|oe[me+Re]<<16,Hi=ke[le+Re]|ge[be+Re]<<16,hn=xt+Bn+dn+Hi+524296,Et=hn+2*(Bn+dn)>>3;Nt=Et+xt>>1,xt=(hn=hn+2*(xt+Hi)>>3)+Bn>>1,_(D[q+2*Re-1],255&Nt,Nt>>16,Te,Se+(2*Re-1)*O),_(D[q+2*Re-0],255&xt,xt>>16,Te,Se+(2*Re-0)*O),G!=null&&(Nt=hn+dn>>1,xt=Et+Hi>>1,_(G[J+2*Re-1],255&Nt,Nt>>16,Oe,Fe+(2*Re-1)*O),_(G[J+2*Re+0],255&xt,xt>>16,Oe,Fe+(2*Re+0)*O)),xt=Bn,dn=Hi}1&ze||(Nt=3*xt+dn+131074>>2,_(D[q+ze-1],255&Nt,Nt>>16,Te,Se+(ze-1)*O),G!=null&&(Nt=3*dn+xt+131074>>2,_(G[J+ze-1],255&Nt,Nt>>16,Oe,Fe+(ze-1)*O)))}}function Iu(){Xo[CC]=X0e,Xo[SC]=D$,Xo[O$]=J0e,Xo[kC]=U$,Xo[_C]=H$,Xo[VT]=Q$,Xo[F$]=Z0e,Xo[KT]=D$,Xo[qT]=U$,Xo[jC]=H$,Xo[WT]=Q$}function G0(S){return S&~exe?0>S?0:255:S>>$$}function fA(S,_){return G0((19077*S>>8)+(26149*_>>8)-14234)}function AA(S,_,O){return G0((19077*S>>8)-(6419*_>>8)-(13320*O>>8)+8708)}function $d(S,_){return G0((19077*S>>8)+(33050*_>>8)-17685)}function pA(S,_,O,D,q){D[q+0]=fA(S,O),D[q+1]=AA(S,_,O),D[q+2]=$d(S,_)}function $m(S,_,O,D,q){D[q+0]=$d(S,_),D[q+1]=AA(S,_,O),D[q+2]=fA(S,O)}function zm(S,_,O,D,q){var G=AA(S,_,O);_=G<<3&224|$d(S,_)>>3,D[q+0]=248&fA(S,O)|G>>5,D[q+1]=_}function Rs(S,_,O,D,q){var G=240&$d(S,_)|15;D[q+0]=240&fA(S,O)|AA(S,_,O)>>4,D[q+1]=G}function mA(S,_,O,D,q){D[q+0]=255,pA(S,_,O,D,q+1)}function gA(S,_,O,D,q){$m(S,_,O,D,q),D[q+3]=255}function Y0(S,_,O,D,q){pA(S,_,O,D,q),D[q+3]=255}function Dc(S,_,O){E[S]=function(D,q,G,J,ee,ne,oe,me,ke){for(var le=me+(-2&ke)*O;me!=le;)_(D[q+0],G[J+0],ee[ne+0],oe,me),_(D[q+1],G[J+0],ee[ne+0],oe,me+O),q+=2,++J,++ne,me+=2*O;1&ke&&_(D[q+0],G[J+0],ee[ne+0],oe,me)}}function ua(S,_,O){return O==0?S==0?_==0?6:5:_==0?4:0:O}function vC(S,_,O,D,q){switch(S>>>30){case 3:Pu(_,O,D,q,0);break;case 2:qd(_,O,D,q);break;case 1:Ds(_,O,D,q)}}function Vm(S,_){var O,D,q=_.M,G=_.Nb,J=S.oc,ee=S.pc+40,ne=S.oc,oe=S.pc+584,me=S.oc,ke=S.pc+600;for(O=0;16>O;++O)J[ee+32*O-1]=129;for(O=0;8>O;++O)ne[oe+32*O-1]=129,me[ke+32*O-1]=129;for(0<q?J[ee-1-32]=ne[oe-1-32]=me[ke-1-32]=129:(i(J,ee-32-1,127,21),i(ne,oe-32-1,127,9),i(me,ke-32-1,127,9)),D=0;D<S.za;++D){var le=_.ya[_.aa+D];if(0<D){for(O=-1;16>O;++O)r(J,ee+32*O-4,J,ee+32*O+12,4);for(O=-1;8>O;++O)r(ne,oe+32*O-4,ne,oe+32*O+4,4),r(me,ke+32*O-4,me,ke+32*O+4,4)}var ge=S.Gd,be=S.Hd+D,Te=le.ad,Se=le.Hc;if(0<q&&(r(J,ee-32,ge[be].y,0,16),r(ne,oe-32,ge[be].f,0,8),r(me,ke-32,ge[be].ea,0,8)),le.Za){var Oe=J,Fe=ee-32+16;for(0<q&&(D>=S.za-1?i(Oe,Fe,ge[be].y[15],4):r(Oe,Fe,ge[be+1].y,0,4)),O=0;4>O;O++)Oe[Fe+128+O]=Oe[Fe+256+O]=Oe[Fe+384+O]=Oe[Fe+0+O];for(O=0;16>O;++O,Se<<=2)Oe=J,Fe=ee+V$[O],zl[le.Ob[O]](Oe,Fe),vC(Se,Te,16*+O,Oe,Fe)}else if(Oe=ua(D,q,le.Ob[0]),Wd[Oe](J,ee),Se!=0)for(O=0;16>O;++O,Se<<=2)vC(Se,Te,16*+O,J,ee+V$[O]);for(O=le.Gc,Oe=ua(D,q,le.Dd),Fu[Oe](ne,oe),Fu[Oe](me,ke),Se=Te,Oe=ne,Fe=oe,255&(le=0|O)&&(170&le?Ym(Se,256,Oe,Fe):Hc(Se,256,Oe,Fe)),le=me,Se=ke,255&(O>>=8)&&(170&O?Ym(Te,320,le,Se):Hc(Te,320,le,Se)),q<S.Ub-1&&(r(ge[be].y,0,J,ee+480,16),r(ge[be].f,0,ne,oe+224,8),r(ge[be].ea,0,me,ke+224,8)),O=8*G*S.B,ge=S.sa,be=S.ta+16*D+16*G*S.R,Te=S.qa,le=S.ra+8*D+O,Se=S.Ha,Oe=S.Ia+8*D+O,O=0;16>O;++O)r(ge,be+O*S.R,J,ee+32*O,16);for(O=0;8>O;++O)r(Te,le+O*S.B,ne,oe+32*O,8),r(Se,Oe+O*S.B,me,ke+32*O,8)}}function xC(S,_,O,D,q,G,J,ee,ne){var oe=[0],me=[0],ke=0,le=ne!=null?ne.kd:0,ge=ne??new ve;if(S==null||12>O)return 7;ge.data=S,ge.w=_,ge.ha=O,_=[_],O=[O],ge.gb=[ge.gb];e:{var be=_,Te=O,Se=ge.gb;if(t(S!=null),t(Te!=null),t(Se!=null),Se[0]=0,12<=Te[0]&&!n(S,be[0],"RIFF")){if(n(S,be[0]+8,"WEBP")){Se=3;break e}var Oe=Ie(S,be[0]+4);if(12>Oe||4294967286<Oe){Se=3;break e}if(le&&Oe>Te[0]-8){Se=7;break e}Se[0]=Oe,be[0]+=12,Te[0]-=12}Se=0}if(Se!=0)return Se;for(Oe=0<ge.gb[0],O=O[0];;){e:{var Fe=S;Te=_,Se=O;var ze=oe,Re=me,Pt=be=[0];if((Nt=ke=[ke])[0]=0,8>Se[0])Se=7;else{if(!n(Fe,Te[0],"VP8X")){if(Ie(Fe,Te[0]+4)!=10){Se=3;break e}if(18>Se[0]){Se=7;break e}var xt=Ie(Fe,Te[0]+8),dn=1+Ce(Fe,Te[0]+12);if(2147483648<=dn*(Fe=1+Ce(Fe,Te[0]+15))){Se=3;break e}Pt!=null&&(Pt[0]=xt),ze!=null&&(ze[0]=dn),Re!=null&&(Re[0]=Fe),Te[0]+=18,Se[0]-=18,Nt[0]=1}Se=0}}if(ke=ke[0],be=be[0],Se!=0)return Se;if(Te=!!(2&be),!Oe&&ke)return 3;if(G!=null&&(G[0]=!!(16&be)),J!=null&&(J[0]=Te),ee!=null&&(ee[0]=0),J=oe[0],be=me[0],ke&&Te&&ne==null){Se=0;break}if(4>O){Se=7;break}if(Oe&&ke||!Oe&&!ke&&!n(S,_[0],"ALPH")){O=[O],ge.na=[ge.na],ge.P=[ge.P],ge.Sa=[ge.Sa];e:{xt=S,Se=_,Oe=O;var Nt=ge.gb;ze=ge.na,Re=ge.P,Pt=ge.Sa,dn=22,t(xt!=null),t(Oe!=null),Fe=Se[0];var Bn=Oe[0];for(t(ze!=null),t(Pt!=null),ze[0]=null,Re[0]=null,Pt[0]=0;;){if(Se[0]=Fe,Oe[0]=Bn,8>Bn){Se=7;break e}var Hi=Ie(xt,Fe+4);if(4294967286<Hi){Se=3;break e}var hn=8+Hi+1&-2;if(dn+=hn,0<Nt&&dn>Nt){Se=3;break e}if(!n(xt,Fe,"VP8 ")||!n(xt,Fe,"VP8L")){Se=0;break e}if(Bn[0]<hn){Se=7;break e}n(xt,Fe,"ALPH")||(ze[0]=xt,Re[0]=Fe+8,Pt[0]=Hi),Fe+=hn,Bn-=hn}}if(O=O[0],ge.na=ge.na[0],ge.P=ge.P[0],ge.Sa=ge.Sa[0],Se!=0)break}O=[O],ge.Ja=[ge.Ja],ge.xa=[ge.xa];e:if(Nt=S,Se=_,Oe=O,ze=ge.gb[0],Re=ge.Ja,Pt=ge.xa,xt=Se[0],Fe=!n(Nt,xt,"VP8 "),dn=!n(Nt,xt,"VP8L"),t(Nt!=null),t(Oe!=null),t(Re!=null),t(Pt!=null),8>Oe[0])Se=7;else{if(Fe||dn){if(Nt=Ie(Nt,xt+4),12<=ze&&Nt>ze-12){Se=3;break e}if(le&&Nt>Oe[0]-8){Se=7;break e}Re[0]=Nt,Se[0]+=8,Oe[0]-=8,Pt[0]=dn}else Pt[0]=5<=Oe[0]&&Nt[xt+0]==47&&!(Nt[xt+4]>>5),Re[0]=Oe[0];Se=0}if(O=O[0],ge.Ja=ge.Ja[0],ge.xa=ge.xa[0],_=_[0],Se!=0)break;if(4294967286<ge.Ja)return 3;if(ee==null||Te||(ee[0]=ge.xa?2:1),J=[J],be=[be],ge.xa){if(5>O){Se=7;break}ee=J,le=be,Te=G,S==null||5>O?S=0:5<=O&&S[_+0]==47&&!(S[_+4]>>5)?(Oe=[0],Nt=[0],ze=[0],z(Re=new M,S,_,O),Ln(Re,Oe,Nt,ze)?(ee!=null&&(ee[0]=Oe[0]),le!=null&&(le[0]=Nt[0]),Te!=null&&(Te[0]=ze[0]),S=1):S=0):S=0}else{if(10>O){Se=7;break}ee=be,S==null||10>O||!uC(S,_+3,O-3)?S=0:(le=S[_+0]|S[_+1]<<8|S[_+2]<<16,Te=16383&(S[_+7]<<8|S[_+6]),S=16383&(S[_+9]<<8|S[_+8]),1&le||3<(le>>1&7)||!(le>>4&1)||le>>5>=ge.Ja||!Te||!S?S=0:(J&&(J[0]=Te),ee&&(ee[0]=S),S=1))}if(!S||(J=J[0],be=be[0],ke&&(oe[0]!=J||me[0]!=be)))return 3;ne!=null&&(ne[0]=ge,ne.offset=_-ne.w,t(4294967286>_-ne.w),t(ne.offset==ne.ha-O));break}return Se==0||Se==7&&ke&&ne==null?(G!=null&&(G[0]|=ge.na!=null&&0<ge.na.length),D!=null&&(D[0]=J),q!=null&&(q[0]=be),0):Se}function Go(S,_,O){var D=_.width,q=_.height,G=0,J=0,ee=D,ne=q;if(_.Da=S!=null&&0<S.Da,_.Da&&(ee=S.cd,ne=S.bd,G=S.v,J=S.j,11>O||(G&=-2,J&=-2),0>G||0>J||0>=ee||0>=ne||G+ee>D||J+ne>q))return 0;if(_.v=G,_.j=J,_.va=G+ee,_.o=J+ne,_.U=ee,_.T=ne,_.da=S!=null&&0<S.da,_.da){if(!rt(ee,ne,O=[S.ib],G=[S.hb]))return 0;_.ib=O[0],_.hb=G[0]}return _.ob=S!=null&&S.ob,_.Kb=S==null||!S.Sd,_.da&&(_.ob=_.ib<3*D/4&&_.hb<3*q/4,_.Kb=0),1}function yA(S){if(S==null)return 2;if(11>S.S){var _=S.f.RGBA;_.fb+=(S.height-1)*_.A,_.A=-_.A}else _=S.f.kb,S=S.height,_.O+=(S-1)*_.fa,_.fa=-_.fa,_.N+=(S-1>>1)*_.Ab,_.Ab=-_.Ab,_.W+=(S-1>>1)*_.Db,_.Db=-_.Db,_.F!=null&&(_.J+=(S-1)*_.lb,_.lb=-_.lb);return 0}function X0(S,_,O,D){if(D==null||0>=S||0>=_)return 2;if(O!=null){if(O.Da){var q=O.cd,G=O.bd,J=-2&O.v,ee=-2&O.j;if(0>J||0>ee||0>=q||0>=G||J+q>S||ee+G>_)return 2;S=q,_=G}if(O.da){if(!rt(S,_,q=[O.ib],G=[O.hb]))return 2;S=q[0],_=G[0]}}D.width=S,D.height=_;e:{var ne=D.width,oe=D.height;if(S=D.S,0>=ne||0>=oe||!(S>=CC&&13>S))S=2;else{if(0>=D.Rd&&D.sd==null){J=G=q=_=0;var me=(ee=ne*K$[S])*oe;if(11>S||(G=(oe+1)/2*(_=(ne+1)/2),S==12&&(J=(q=ne)*oe)),(oe=s(me+2*G+J))==null){S=1;break e}D.sd=oe,11>S?((ne=D.f.RGBA).eb=oe,ne.fb=0,ne.A=ee,ne.size=me):((ne=D.f.kb).y=oe,ne.O=0,ne.fa=ee,ne.Fd=me,ne.f=oe,ne.N=0+me,ne.Ab=_,ne.Cd=G,ne.ea=oe,ne.W=0+me+G,ne.Db=_,ne.Ed=G,S==12&&(ne.F=oe,ne.J=0+me+2*G),ne.Tc=J,ne.lb=q)}if(_=1,q=D.S,G=D.width,J=D.height,q>=CC&&13>q)if(11>q)S=D.f.RGBA,_&=(ee=Math.abs(S.A))*(J-1)+G<=S.size,_&=ee>=G*K$[q],_&=S.eb!=null;else{S=D.f.kb,ee=(G+1)/2,me=(J+1)/2,ne=Math.abs(S.fa),oe=Math.abs(S.Ab);var ke=Math.abs(S.Db),le=Math.abs(S.lb),ge=le*(J-1)+G;_&=ne*(J-1)+G<=S.Fd,_&=oe*(me-1)+ee<=S.Cd,_=(_&=ke*(me-1)+ee<=S.Ed)&ne>=G&oe>=ee&ke>=ee,_&=S.y!=null,_&=S.f!=null,_&=S.ea!=null,q==12&&(_&=le>=G,_&=ge<=S.Tc,_&=S.F!=null)}else _=0;S=_?0:2}}return S!=0||O!=null&&O.fd&&(S=yA(D)),S}var Km=64,vA=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],J0=24,da=32,La=8,qm=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];we("Predictor0","PredictorAdd0"),E.Predictor0=function(){return 4278190080},E.Predictor1=function(S){return S},E.Predictor2=function(S,_,O){return _[O+0]},E.Predictor3=function(S,_,O){return _[O+1]},E.Predictor4=function(S,_,O){return _[O-1]},E.Predictor5=function(S,_,O){return Ve(Ve(S,_[O+1]),_[O+0])},E.Predictor6=function(S,_,O){return Ve(S,_[O-1])},E.Predictor7=function(S,_,O){return Ve(S,_[O+0])},E.Predictor8=function(S,_,O){return Ve(_[O-1],_[O+0])},E.Predictor9=function(S,_,O){return Ve(_[O+0],_[O+1])},E.Predictor10=function(S,_,O){return Ve(Ve(S,_[O-1]),Ve(_[O+0],_[O+1]))},E.Predictor11=function(S,_,O){var D=_[O+0];return 0>=ye(D>>24&255,S>>24&255,(_=_[O-1])>>24&255)+ye(D>>16&255,S>>16&255,_>>16&255)+ye(D>>8&255,S>>8&255,_>>8&255)+ye(255&D,255&S,255&_)?D:S},E.Predictor12=function(S,_,O){var D=_[O+0];return(Dt((S>>24&255)+(D>>24&255)-((_=_[O-1])>>24&255))<<24|Dt((S>>16&255)+(D>>16&255)-(_>>16&255))<<16|Dt((S>>8&255)+(D>>8&255)-(_>>8&255))<<8|Dt((255&S)+(255&D)-(255&_)))>>>0},E.Predictor13=function(S,_,O){var D=_[O-1];return(pt((S=Ve(S,_[O+0]))>>24&255,D>>24&255)<<24|pt(S>>16&255,D>>16&255)<<16|pt(S>>8&255,D>>8&255)<<8|pt(255&S,255&D))>>>0};var zd=E.PredictorAdd0;E.PredictorAdd1=Be,we("Predictor2","PredictorAdd2"),we("Predictor3","PredictorAdd3"),we("Predictor4","PredictorAdd4"),we("Predictor5","PredictorAdd5"),we("Predictor6","PredictorAdd6"),we("Predictor7","PredictorAdd7"),we("Predictor8","PredictorAdd8"),we("Predictor9","PredictorAdd9"),we("Predictor10","PredictorAdd10"),we("Predictor11","PredictorAdd11"),we("Predictor12","PredictorAdd12"),we("Predictor13","PredictorAdd13");var Vd=E.PredictorAdd2;pe("ColorIndexInverseTransform","MapARGB","32b",function(S){return S>>8&255},function(S){return S}),pe("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(S){return S},function(S){return S>>8&255});var Wm,xA=E.ColorIndexInverseTransform,Ni=E.MapARGB,$T=E.VP8LColorIndexInverseTransformAlpha,Uc=E.MapAlpha,$l=E.VP8LPredictorsAdd=[];$l.length=16,(E.VP8LPredictors=[]).length=16,(E.VP8LPredictorsAdd_C=[]).length=16,(E.VP8LPredictors_C=[]).length=16;var wA,Z0,ex,Gm,bA,CA,Kd,Pu,qd,Ym,Ds,Hc,yr,vr,Ai,Ui,Ou,tx,Xm,wC,b$,C$,S$,k$,nx,_$,j$,B$,N$=s(511),E$=s(2041),T$=s(225),I$=s(767),P$=0,zT=E$,bC=T$,po=I$,Yo=N$,CC=0,SC=1,O$=2,kC=3,_C=4,VT=5,F$=6,KT=7,qT=8,jC=9,WT=10,L0e=[2,3,7],R0e=[3,3,11],M$=[280,256,256,256,40],D0e=[0,1,1,1,0],U0e=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],H0e=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Q0e=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],$0e=8,GT=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],YT=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],rx=null,z0e=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],V0e=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],L$=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],K0e=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],q0e=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],W0e=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],G0e=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Wd=[],zl=[],Fu=[],Y0e=1,R$=2,Gd=[],Xo=[];Ls("UpsampleRgbLinePair",pA,3),Ls("UpsampleBgrLinePair",$m,3),Ls("UpsampleRgbaLinePair",Y0,4),Ls("UpsampleBgraLinePair",gA,4),Ls("UpsampleArgbLinePair",mA,4),Ls("UpsampleRgba4444LinePair",Rs,2),Ls("UpsampleRgb565LinePair",zm,2);var X0e=E.UpsampleRgbLinePair,J0e=E.UpsampleBgrLinePair,D$=E.UpsampleRgbaLinePair,U$=E.UpsampleBgraLinePair,H$=E.UpsampleArgbLinePair,Q$=E.UpsampleRgba4444LinePair,Z0e=E.UpsampleRgb565LinePair,BC=16,NC=1<<BC-1,ix=-227,XT=482,$$=6,exe=(256<<$$)-1,z$=0,txe=s(256),nxe=s(256),rxe=s(256),ixe=s(256),sxe=s(XT-ix),axe=s(XT-ix);Dc("YuvToRgbRow",pA,3),Dc("YuvToBgrRow",$m,3),Dc("YuvToRgbaRow",Y0,4),Dc("YuvToBgraRow",gA,4),Dc("YuvToArgbRow",mA,4),Dc("YuvToRgba4444Row",Rs,2),Dc("YuvToRgb565Row",zm,2);var V$=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],EC=[0,2,8],oxe=[8,7,6,4,4,2,2,2,1,1,1,1],lxe=1;this.WebPDecodeRGBA=function(S,_,O,D,q){var G=SC,J=new fe,ee=new tn;J.ba=ee,ee.S=G,ee.width=[ee.width],ee.height=[ee.height];var ne=ee.width,oe=ee.height,me=new Bt;if(me==null||S==null)var ke=2;else t(me!=null),ke=xC(S,_,O,me.width,me.height,me.Pd,me.Qd,me.format,null);if(ke!=0?ne=0:(ne!=null&&(ne[0]=me.width[0]),oe!=null&&(oe[0]=me.height[0]),ne=1),ne){ee.width=ee.width[0],ee.height=ee.height[0],D!=null&&(D[0]=ee.width),q!=null&&(q[0]=ee.height);e:{if(D=new Om,(q=new ve).data=S,q.w=_,q.ha=O,q.kd=1,_=[0],t(q!=null),((S=xC(q.data,q.w,q.ha,null,null,null,_,null,q))==0||S==7)&&_[0]&&(S=4),(_=S)==0){if(t(J!=null),D.data=q.data,D.w=q.w+q.offset,D.ha=q.ha-q.offset,D.put=At,D.ac=Nr,D.bc=Ur,D.ma=J,q.xa){if((S=lA())==null){J=1;break e}if(function(le,ge){var be=[0],Te=[0],Se=[0];t:for(;;){if(le==null)return 0;if(ge==null)return le.a=2,0;if(le.l=ge,le.a=0,z(le.m,ge.data,ge.w,ge.ha),!Ln(le.m,be,Te,Se)){le.a=3;break t}if(le.xb=R$,ge.width=be[0],ge.height=Te[0],!Oc(be[0],Te[0],1,le,null))break t;return 1}return t(le.a!=0),0}(S,D)){if(D=(_=X0(D.width,D.height,J.Oa,J.ba))==0){t:{D=S;n:for(;;){if(D==null){D=0;break t}if(t(D.s.yc!=null),t(D.s.Ya!=null),t(0<D.s.Wb),t((O=D.l)!=null),t((q=O.ma)!=null),D.xb!=0){if(D.ca=q.ba,D.tb=q.tb,t(D.ca!=null),!Go(q.Oa,O,kC)){D.a=2;break n}if(!cA(D,O.width)||O.da)break n;if((O.da||Mt(D.ca.S))&&qr(),11>D.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),D.ca.f.kb.F!=null&&qr()),D.Pb&&0<D.s.ua&&D.s.vb.X==null&&!te(D.s.vb,D.s.Wa.Xa)){D.a=1;break n}D.xb=0}if(!Ql(D,D.V,D.Ba,D.c,D.i,O.o,ni))break n;q.Dc=D.Ma,D=1;break t}t(D.a!=0),D=0}D=!D}D&&(_=S.a)}else _=S.a}else{if((S=new _T)==null){J=1;break e}if(S.Fa=q.na,S.P=q.P,S.qc=q.Sa,Mc(S,D)){if((_=X0(D.width,D.height,J.Oa,J.ba))==0){if(S.Aa=0,O=J.Oa,t((q=S)!=null),O!=null){if(0<(ne=0>(ne=O.Md)?0:100<ne?255:255*ne/100)){for(oe=me=0;4>oe;++oe)12>(ke=q.pb[oe]).lc&&(ke.ia=ne*oxe[0>ke.lc?0:ke.lc]>>3),me|=ke.ia;me&&(alert("todo:VP8InitRandom"),q.ia=1)}q.Ga=O.Id,100<q.Ga?q.Ga=100:0>q.Ga&&(q.Ga=0)}(function(le,ge){if(le==null)return 0;if(ge==null)return ji(le,2,"NULL VP8Io parameter in VP8Decode().");if(!le.cb&&!Mc(le,ge))return 0;if(t(le.cb),ge.ac==null||ge.ac(ge)){ge.ob&&(le.L=0);var be=EC[le.L];if(le.L==2?(le.yb=0,le.zb=0):(le.yb=ge.v-be>>4,le.zb=ge.j-be>>4,0>le.yb&&(le.yb=0),0>le.zb&&(le.zb=0)),le.Va=ge.o+15+be>>4,le.Hb=ge.va+15+be>>4,le.Hb>le.za&&(le.Hb=le.za),le.Va>le.Ub&&(le.Va=le.Ub),0<le.L){var Te=le.ed;for(be=0;4>be;++be){var Se;if(le.Qa.Cb){var Oe=le.Qa.Lb[be];le.Qa.Fb||(Oe+=Te.Tb)}else Oe=Te.Tb;for(Se=0;1>=Se;++Se){var Fe=le.gd[be][Se],ze=Oe;if(Te.Pc&&(ze+=Te.vd[0],Se&&(ze+=Te.od[0])),0<(ze=0>ze?0:63<ze?63:ze)){var Re=ze;0<Te.wb&&(Re=4<Te.wb?Re>>2:Re>>1)>9-Te.wb&&(Re=9-Te.wb),1>Re&&(Re=1),Fe.dd=Re,Fe.tc=2*ze+Re,Fe.ld=40<=ze?2:15<=ze?1:0}else Fe.tc=0;Fe.La=Se}}}be=0}else ji(le,6,"Frame setup failed"),be=le.a;if(be=be==0){if(be){le.$c=0,0<le.Aa||(le.Ic=lxe);t:{be=le.Ic,Te=4*(Re=le.za);var Pt=32*Re,xt=Re+1,dn=0<le.L?Re*(0<le.Aa?2:1):0,Nt=(le.Aa==2?2:1)*Re;if((Fe=Te+832+(Se=3*(16*be+EC[le.L])/2*Pt)+(Oe=le.Fa!=null&&0<le.Fa.length?le.Kc.c*le.Kc.i:0))!=Fe)be=0;else{if(Fe>le.Vb){if(le.Vb=0,le.Ec=s(Fe),le.Fc=0,le.Ec==null){be=ji(le,1,"no memory during frame initialization.");break t}le.Vb=Fe}Fe=le.Ec,ze=le.Fc,le.Ac=Fe,le.Bc=ze,ze+=Te,le.Gd=a(Pt,lC),le.Hd=0,le.rb=a(xt+1,U0),le.sb=1,le.wa=dn?a(dn,Wo):null,le.Y=0,le.D.Nb=0,le.D.wa=le.wa,le.D.Y=le.Y,0<le.Aa&&(le.D.Y+=Re),t(!0),le.oc=Fe,le.pc=ze,ze+=832,le.ya=a(Nt,H0),le.aa=0,le.D.ya=le.ya,le.D.aa=le.aa,le.Aa==2&&(le.D.aa+=Re),le.R=16*Re,le.B=8*Re,Re=(Pt=EC[le.L])*le.R,Pt=Pt/2*le.B,le.sa=Fe,le.ta=ze+Re,le.qa=le.sa,le.ra=le.ta+16*be*le.R+Pt,le.Ha=le.qa,le.Ia=le.ra+8*be*le.B+Pt,le.$c=0,ze+=Se,le.mb=Oe?Fe:null,le.nb=Oe?ze:null,t(ze+Oe<=le.Fc+le.Vb),Q0(le),i(le.Ac,le.Bc,0,Te),be=1}}if(be){if(ge.ka=0,ge.y=le.sa,ge.O=le.ta,ge.f=le.qa,ge.N=le.ra,ge.ea=le.Ha,ge.Vd=le.Ia,ge.fa=le.R,ge.Rc=le.B,ge.F=null,ge.J=0,!P$){for(be=-255;255>=be;++be)N$[255+be]=0>be?-be:be;for(be=-1020;1020>=be;++be)E$[1020+be]=-128>be?-128:127<be?127:be;for(be=-112;112>=be;++be)T$[112+be]=-16>be?-16:15<be?15:be;for(be=-255;510>=be;++be)I$[255+be]=0>be?0:255<be?255:be;P$=1}Kd=hC,Pu=jT,Ym=BT,Ds=NT,Hc=Lc,qd=dC,yr=pC,vr=mC,Ai=yC,Ui=I,Ou=gC,tx=hA,Xm=K,wC=ae,b$=Hm,C$=W0,S$=Qm,k$=AC,zl[0]=MT,zl[1]=Rm,zl[2]=OT,zl[3]=FT,zl[4]=LT,zl[5]=Bu,zl[6]=RT,zl[7]=Nu,zl[8]=UT,zl[9]=DT,Wd[0]=fC,Wd[1]=ET,Wd[2]=TT,Wd[3]=IT,Wd[4]=Hd,Wd[5]=PT,Wd[6]=uA,Fu[0]=HT,Fu[1]=$0,Fu[2]=Dm,Fu[3]=z0,Fu[4]=QT,Fu[5]=Um,Fu[6]=V0,be=1}else be=0}be&&(be=function(Bn,Hi){for(Bn.M=0;Bn.M<Bn.Va;++Bn.M){var hn,Et=Bn.Jc[Bn.M&Bn.Xb],et=Bn.m,pi=Bn;for(hn=0;hn<pi.za;++hn){var cn=et,Pn=pi,Tr=Pn.Ac,gs=Pn.Bc+4*hn,ha=Pn.zc,ri=Pn.ya[Pn.aa+hn];if(Pn.Qa.Bb?ri.$b=se(cn,Pn.Pa.jb[0])?2+se(cn,Pn.Pa.jb[2]):se(cn,Pn.Pa.jb[1]):ri.$b=0,Pn.kc&&(ri.Ad=se(cn,Pn.Bd)),ri.Za=!se(cn,145)+0,ri.Za){var Us=ri.Ob,fa=0;for(Pn=0;4>Pn;++Pn){var Qi,Rn=ha[0+Pn];for(Qi=0;4>Qi;++Qi){Rn=q0e[Tr[gs+Qi]][Rn];for(var Yn=L$[se(cn,Rn[0])];0<Yn;)Yn=L$[2*Yn+se(cn,Rn[Yn])];Rn=-Yn,Tr[gs+Qi]=Rn}r(Us,fa,Tr,gs,4),fa+=4,ha[0+Pn]=Rn}}else Rn=se(cn,156)?se(cn,128)?1:3:se(cn,163)?2:0,ri.Ob[0]=Rn,i(Tr,gs,Rn,4),i(ha,0,Rn,4);ri.Dd=se(cn,142)?se(cn,114)?se(cn,183)?1:3:2:0}if(pi.m.Ka)return ji(Bn,7,"Premature end-of-partition0 encountered.");for(;Bn.ja<Bn.za;++Bn.ja){if(pi=Et,cn=(et=Bn).rb[et.sb-1],Tr=et.rb[et.sb+et.ja],hn=et.ya[et.aa+et.ja],gs=et.kc?hn.Ad:0)cn.la=Tr.la=0,hn.Za||(cn.Na=Tr.Na=0),hn.Hc=0,hn.Gc=0,hn.ia=0;else{var ii,Xn;if(cn=Tr,Tr=pi,gs=et.Pa.Xc,ha=et.ya[et.aa+et.ja],ri=et.pb[ha.$b],Pn=ha.ad,Us=0,fa=et.rb[et.sb-1],Rn=Qi=0,i(Pn,Us,0,384),ha.Za)var ys=0,Vl=gs[3];else{Yn=s(16);var mi=cn.Na+fa.Na;if(mi=rx(Tr,gs[1],mi,ri.Eb,0,Yn,0),cn.Na=fa.Na=(0<mi)+0,1<mi)Kd(Yn,0,Pn,Us);else{var Ra=Yn[0]+3>>3;for(Yn=0;256>Yn;Yn+=16)Pn[Us+Yn]=Ra}ys=1,Vl=gs[0]}var ur=15&cn.la,$i=15&fa.la;for(Yn=0;4>Yn;++Yn){var mo=1&$i;for(Ra=Xn=0;4>Ra;++Ra)ur=ur>>1|(mo=(mi=rx(Tr,Vl,mi=mo+(1&ur),ri.Sc,ys,Pn,Us))>ys)<<7,Xn=Xn<<2|(3<mi?3:1<mi?2:Pn[Us+0]!=0),Us+=16;ur>>=4,$i=$i>>1|mo<<7,Qi=(Qi<<8|Xn)>>>0}for(Vl=ur,ys=$i>>4,ii=0;4>ii;ii+=2){for(Xn=0,ur=cn.la>>4+ii,$i=fa.la>>4+ii,Yn=0;2>Yn;++Yn){for(mo=1&$i,Ra=0;2>Ra;++Ra)mi=mo+(1&ur),ur=ur>>1|(mo=0<(mi=rx(Tr,gs[2],mi,ri.Qc,0,Pn,Us)))<<3,Xn=Xn<<2|(3<mi?3:1<mi?2:Pn[Us+0]!=0),Us+=16;ur>>=2,$i=$i>>1|mo<<5}Rn|=Xn<<4*ii,Vl|=ur<<4<<ii,ys|=(240&$i)<<ii}cn.la=Vl,fa.la=ys,ha.Hc=Qi,ha.Gc=Rn,ha.ia=43690&Rn?0:ri.ia,gs=!(Qi|Rn)}if(0<et.L&&(et.wa[et.Y+et.ja]=et.gd[hn.$b][hn.Za],et.wa[et.Y+et.ja].La|=!gs),pi.Ka)return ji(Bn,7,"Premature end-of-file encountered.")}if(Q0(Bn),et=Hi,pi=1,hn=(Et=Bn).D,cn=0<Et.L&&Et.M>=Et.zb&&Et.M<=Et.Va,Et.Aa==0)t:{if(hn.M=Et.M,hn.uc=cn,Vm(Et,hn),pi=1,hn=(Xn=Et.D).Nb,cn=(Rn=EC[Et.L])*Et.R,Tr=Rn/2*Et.B,Yn=16*hn*Et.R,Ra=8*hn*Et.B,gs=Et.sa,ha=Et.ta-cn+Yn,ri=Et.qa,Pn=Et.ra-Tr+Ra,Us=Et.Ha,fa=Et.Ia-Tr+Ra,$i=(ur=Xn.M)==0,Qi=ur>=Et.Va-1,Et.Aa==2&&Vm(Et,Xn),Xn.uc)for(mo=(mi=Et).D.M,t(mi.D.uc),Xn=mi.yb;Xn<mi.Hb;++Xn){ys=Xn,Vl=mo;var Aa=(go=(vs=mi).D).Nb;ii=vs.R;var go=go.wa[go.Y+ys],yo=vs.sa,Da=vs.ta+16*Aa*ii+16*ys,vo=go.dd,xr=go.tc;if(xr!=0)if(t(3<=xr),vs.L==1)0<ys&&C$(yo,Da,ii,xr+4),go.La&&k$(yo,Da,ii,xr),0<Vl&&b$(yo,Da,ii,xr+4),go.La&&S$(yo,Da,ii,xr);else{var xo=vs.B,Kl=vs.qa,SA=vs.ra+8*Aa*xo+8*ys,Mu=vs.Ha,vs=vs.Ia+8*Aa*xo+8*ys;Aa=go.ld,0<ys&&(vr(yo,Da,ii,xr+4,vo,Aa),Ui(Kl,SA,Mu,vs,xo,xr+4,vo,Aa)),go.La&&(tx(yo,Da,ii,xr,vo,Aa),wC(Kl,SA,Mu,vs,xo,xr,vo,Aa)),0<Vl&&(yr(yo,Da,ii,xr+4,vo,Aa),Ai(Kl,SA,Mu,vs,xo,xr+4,vo,Aa)),go.La&&(Ou(yo,Da,ii,xr,vo,Aa),Xm(Kl,SA,Mu,vs,xo,xr,vo,Aa))}}if(Et.ia&&alert("todo:DitherRow"),et.put!=null){if(Xn=16*ur,ur=16*(ur+1),$i?(et.y=Et.sa,et.O=Et.ta+Yn,et.f=Et.qa,et.N=Et.ra+Ra,et.ea=Et.Ha,et.W=Et.Ia+Ra):(Xn-=Rn,et.y=gs,et.O=ha,et.f=ri,et.N=Pn,et.ea=Us,et.W=fa),Qi||(ur-=Rn),ur>et.o&&(ur=et.o),et.F=null,et.J=null,Et.Fa!=null&&0<Et.Fa.length&&Xn<ur&&(et.J=Bi(Et,et,Xn,ur-Xn),et.F=Et.mb,et.F==null&&et.F.length==0)){pi=ji(Et,3,"Could not decode alpha data.");break t}Xn<et.j&&(Rn=et.j-Xn,Xn=et.j,t(!(1&Rn)),et.O+=Et.R*Rn,et.N+=Et.B*(Rn>>1),et.W+=Et.B*(Rn>>1),et.F!=null&&(et.J+=et.width*Rn)),Xn<ur&&(et.O+=et.v,et.N+=et.v>>1,et.W+=et.v>>1,et.F!=null&&(et.J+=et.v),et.ka=Xn-et.j,et.U=et.va-et.v,et.T=ur-Xn,pi=et.put(et))}hn+1!=Et.Ic||Qi||(r(Et.sa,Et.ta-cn,gs,ha+16*Et.R,cn),r(Et.qa,Et.ra-Tr,ri,Pn+8*Et.B,Tr),r(Et.Ha,Et.Ia-Tr,Us,fa+8*Et.B,Tr))}if(!pi)return ji(Bn,6,"Output aborted.")}return 1}(le,ge)),ge.bc!=null&&ge.bc(ge),be&=1}return be?(le.cb=0,be):0})(S,D)||(_=S.a)}}else _=S.a}_==0&&J.Oa!=null&&J.Oa.fd&&(_=yA(J.ba))}J=_}G=J!=0?null:11>G?ee.f.RGBA.eb:ee.f.kb.y}else G=null;return G};var K$=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(E,P){for(var T="",N=0;N<4;N++)T+=String.fromCharCode(E[P++]);return T}function d(E,P){return E[P+0]|E[P+1]<<8}function h(E,P){return(E[P+0]|E[P+1]<<8|E[P+2]<<16)>>>0}function A(E,P){return(E[P+0]|E[P+1]<<8|E[P+2]<<16|E[P+3]<<24)>>>0}new c;var f=[0],p=[0],m=[],g=new c,y=e,v=function(E,P){var T={},N=0,F=!1,L=0,U=0;if(T.frames=[],!function(R,M){for(var Y=0;Y<4;Y++)if(R[M+Y]!="RIFF".charCodeAt(Y))return!0;return!1}(E,P)){for(A(E,P+=4),P+=8;P<E.length;){var H=u(E,P),W=A(E,P+=4);P+=4;var $=W+(1&W);switch(H){case"VP8 ":case"VP8L":T.frames[N]===void 0&&(T.frames[N]={}),(ce=T.frames[N]).src_off=F?U:P-8,ce.src_size=L+W+8,N++,F&&(F=!1,L=0,U=0);break;case"VP8X":(ce=T.header={}).feature_flags=E[P];var z=P+4;ce.canvas_width=1+h(E,z),z+=3,ce.canvas_height=1+h(E,z),z+=3;break;case"ALPH":F=!0,L=$+8,U=P-8;break;case"ANIM":(ce=T.header).bgcolor=A(E,P),z=P+4,ce.loop_count=d(E,z),z+=2;break;case"ANMF":var Q,ce;(ce=T.frames[N]={}).offset_x=2*h(E,P),P+=3,ce.offset_y=2*h(E,P),P+=3,ce.width=1+h(E,P),P+=3,ce.height=1+h(E,P),P+=3,ce.duration=h(E,P),P+=3,Q=E[P++],ce.dispose=1&Q,ce.blend=Q>>1&1}H!="ANMF"&&(P+=$)}return T}}(y,0);v.response=y,v.rgbaoutput=!0,v.dataurl=!1;var x=v.header?v.header:null,b=v.frames?v.frames:null;if(x){x.loop_counter=x.loop_count,f=[x.canvas_height],p=[x.canvas_width];for(var w=0;w<b.length&&b[w].blend!=0;w++);}var k=b[0],j=g.WebPDecodeRGBA(y,k.src_off,k.src_size,p,f);k.rgba=j,k.imgwidth=p[0],k.imgheight=f[0];for(var B=0;B<p[0]*f[0]*4;B++)m[B]=j[B];return this.width=p,this.height=f,this.data=m,this}/** ====================================================================
 * @license
 * jsPDF XMP metadata plugin
 * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */function x_t(){var e,t=this.internal.__metadata__.metadata,n=unescape(encodeURIComponent(t));e=this.internal.__metadata__.rawXml?n:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceUri+'"><jspdf:metadata>'+n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+e.length+" >>"),this.internal.write("stream"),this.internal.write(e),this.internal.write("endstream"),this.internal.write("endobj")}function w_t(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(e){var t,n,r,i,s,a,o,c,u,d=function(R){return R=R||{},this.isStrokeTransparent=R.isStrokeTransparent||!1,this.strokeOpacity=R.strokeOpacity||1,this.strokeStyle=R.strokeStyle||"#000000",this.fillStyle=R.fillStyle||"#000000",this.isFillTransparent=R.isFillTransparent||!1,this.fillOpacity=R.fillOpacity||1,this.font=R.font||"10px sans-serif",this.textBaseline=R.textBaseline||"alphabetic",this.textAlign=R.textAlign||"left",this.lineWidth=R.lineWidth||1,this.lineJoin=R.lineJoin||"miter",this.lineCap=R.lineCap||"butt",this.path=R.path||[],this.transform=R.transform!==void 0?R.transform.clone():new c,this.globalCompositeOperation=R.globalCompositeOperation||"normal",this.globalAlpha=R.globalAlpha||1,this.clip_path=R.clip_path||[],this.currentPoint=R.currentPoint||new a,this.miterLimit=R.miterLimit||10,this.lastPoint=R.lastPoint||new a,this.lineDashOffset=R.lineDashOffset||0,this.lineDash=R.lineDash||[],this.margin=R.margin||[0,0,0,0],this.prevPageLastElemOffset=R.prevPageLastElemOffset||0,this.ignoreClearRect=typeof R.ignoreClearRect!="boolean"||R.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new h(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,a=this.internal.Point,o=this.internal.Rectangle,c=this.internal.Matrix,u=new d}]);var h=function(R){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var M=R;Object.defineProperty(this,"pdf",{get:function(){return M}});var Y=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Y},set:function(te){Y=!!te}});var X=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return X},set:function(te){X=!!te}});var V=0;Object.defineProperty(this,"posX",{get:function(){return V},set:function(te){isNaN(te)||(V=te)}});var Z=0;Object.defineProperty(this,"posY",{get:function(){return Z},set:function(te){isNaN(te)||(Z=te)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(te){var je;typeof te=="number"?je=[te,te,te,te]:((je=new Array(4))[0]=te[0],je[1]=te.length>=2?te[1]:je[0],je[2]=te.length>=3?te[2]:je[0],je[3]=te.length>=4?te[3]:je[1]),u.margin=je}});var de=!1;Object.defineProperty(this,"autoPaging",{get:function(){return de},set:function(te){de=te}});var ue=0;Object.defineProperty(this,"lastBreak",{get:function(){return ue},set:function(te){ue=te}});var se=[];Object.defineProperty(this,"pageBreaks",{get:function(){return se},set:function(te){se=te}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(te){te instanceof d&&(u=te)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(te){u.path=te}});var he=[];Object.defineProperty(this,"ctxStack",{get:function(){return he},set:function(te){he=te}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(te){var je;je=A(te),this.ctx.fillStyle=je.style,this.ctx.isFillTransparent=je.a===0,this.ctx.fillOpacity=je.a,this.pdf.setFillColor(je.r,je.g,je.b,{a:je.a}),this.pdf.setTextColor(je.r,je.g,je.b,{a:je.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(te){var je=A(te);this.ctx.strokeStyle=je.style,this.ctx.isStrokeTransparent=je.a===0,this.ctx.strokeOpacity=je.a,je.a===0?this.pdf.setDrawColor(255,255,255):(je.a,this.pdf.setDrawColor(je.r,je.g,je.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(te){["butt","round","square"].indexOf(te)!==-1&&(this.ctx.lineCap=te,this.pdf.setLineCap(te))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(te){isNaN(te)||(this.ctx.lineWidth=te,this.pdf.setLineWidth(te))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(te){["bevel","round","miter"].indexOf(te)!==-1&&(this.ctx.lineJoin=te,this.pdf.setLineJoin(te))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(te){isNaN(te)||(this.ctx.miterLimit=te,this.pdf.setMiterLimit(te))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(te){this.ctx.textBaseline=te}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(te){["right","end","center","left","start"].indexOf(te)!==-1&&(this.ctx.textAlign=te)}});var ie=null,Ce=null,Ie=null;Object.defineProperty(this,"fontFaces",{get:function(){return Ie},set:function(te){ie=null,Ce=null,Ie=te}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(te){var je;if(this.ctx.font=te,(je=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(te))!==null){var nt=je[1];je[2];var rt=je[3],Ne=je[4];je[5];var st=je[6],we=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ne)[2];Ne=Math.floor(we==="px"?parseFloat(Ne)*this.pdf.internal.scaleFactor:we==="em"?parseFloat(Ne)*this.pdf.getFontSize():parseFloat(Ne)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ne);var He=function(pe){var mt,ft,wt=[],Rt=pe.trim();if(Rt==="")return hO;if(Rt in rZ)return[rZ[Rt]];for(;Rt!=="";){switch(ft=null,mt=(Rt=sZ(Rt)).charAt(0)){case'"':case"'":ft=A_t(Rt.substring(1),mt);break;default:ft=p_t(Rt)}if(ft===null||(wt.push(ft[0]),(Rt=sZ(ft[1]))!==""&&Rt.charAt(0)!==","))return hO;Rt=Rt.replace(/^,/,"")}return wt}(st);if(this.fontFaces){var Ve=function(pe,mt){var ft=pe.getFontList(),wt=JSON.stringify(ft);if(ie===null||Ce!==wt){var Rt=function(zt){var gt=[];return Object.keys(zt).forEach(function(Lt){zt[Lt].forEach(function(Mt){var qt=null;switch(Mt){case"bold":qt={family:Lt,weight:"bold"};break;case"italic":qt={family:Lt,style:"italic"};break;case"bolditalic":qt={family:Lt,weight:"bold",style:"italic"};break;case"":case"normal":qt={family:Lt}}qt!==null&&(qt.ref={name:Lt,style:Mt},gt.push(qt))})}),gt}(ft);ie=function(zt){for(var gt={},Lt=0;Lt<zt.length;++Lt){var Mt=dO(zt[Lt]),qt=Mt.family,nr=Mt.stretch,tn=Mt.style,Bt=Mt.weight;gt[qt]=gt[qt]||{},gt[qt][nr]=gt[qt][nr]||{},gt[qt][nr][tn]=gt[qt][nr][tn]||{},gt[qt][nr][tn][Bt]=Mt}return gt}(Rt.concat(mt)),Ce=wt}return ie}(this.pdf,this.fontFaces),Dt=He.map(function(pe){return{family:pe,stretch:"normal",weight:rt,style:nt}}),pt=function(pe,mt,ft){for(var wt=(ft=ft||{}).defaultFontFamily||"times",Rt=Object.assign({},f_t,ft.genericFontFamilies||{}),zt=null,gt=null,Lt=0;Lt<mt.length;++Lt)if(Rt[(zt=dO(mt[Lt])).family]&&(zt.family=Rt[zt.family]),pe.hasOwnProperty(zt.family)){gt=pe[zt.family];break}if(!(gt=gt||pe[wt]))throw new Error("Could not find a font-family for the rule '"+iZ(zt)+"' and default family '"+wt+"'.");if(gt=function(Mt,qt){if(qt[Mt])return qt[Mt];var nr=IR[Mt],tn=nr<=IR.normal?-1:1,Bt=nZ(qt,jve,nr,tn);if(!Bt)throw new Error("Could not find a matching font-stretch value for "+Mt);return Bt}(zt.stretch,gt),gt=function(Mt,qt){if(qt[Mt])return qt[Mt];for(var nr=_ve[Mt],tn=0;tn<nr.length;++tn)if(qt[nr[tn]])return qt[nr[tn]];throw new Error("Could not find a matching font-style for "+Mt)}(zt.style,gt),!(gt=function(Mt,qt){if(qt[Mt])return qt[Mt];if(Mt===400&&qt[500])return qt[500];if(Mt===500&&qt[400])return qt[400];var nr=h_t[Mt],tn=nZ(qt,Bve,nr,Mt<400?-1:1);if(!tn)throw new Error("Could not find a matching font-weight for value "+Mt);return tn}(zt.weight,gt)))throw new Error("Failed to resolve a font for the rule '"+iZ(zt)+"'.");return gt}(Ve,Dt);this.pdf.setFont(pt.ref.name,pt.ref.style)}else{var ye="";(rt==="bold"||parseInt(rt,10)>=700||nt==="bold")&&(ye="bold"),nt==="italic"&&(ye+="italic"),ye.length===0&&(ye="normal");for(var Be="",Ge={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Ue=0;Ue<He.length;Ue++){if(this.pdf.internal.getFont(He[Ue],ye,{noFallback:!0,disableWarning:!0})!==void 0){Be=He[Ue];break}if(ye==="bolditalic"&&this.pdf.internal.getFont(He[Ue],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Be=He[Ue],ye="bold";else if(this.pdf.internal.getFont(He[Ue],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Be=He[Ue],ye="normal";break}}if(Be===""){for(var Ze=0;Ze<He.length;Ze++)if(Ge[He[Ze]]){Be=Ge[He[Ze]];break}}Be=Be===""?"Times":Be,this.pdf.setFont(Be,ye)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(te){this.ctx.globalCompositeOperation=te}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(te){this.ctx.globalAlpha=te}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(te){this.ctx.lineDashOffset=te,ce.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(te){this.ctx.lineDash=te,ce.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(te){this.ctx.ignoreClearRect=!!te}})};h.prototype.setLineDash=function(R){this.lineDash=R},h.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},h.prototype.fill=function(){b.call(this,"fill",!1)},h.prototype.stroke=function(){b.call(this,"stroke",!1)},h.prototype.beginPath=function(){this.path=[{type:"begin"}]},h.prototype.moveTo=function(R,M){if(isNaN(R)||isNaN(M))throw dr.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Y=this.ctx.transform.applyToPoint(new a(R,M));this.path.push({type:"mt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new a(R,M)},h.prototype.closePath=function(){var R=new a(0,0),M=0;for(M=this.path.length-1;M!==-1;M--)if(this.path[M].type==="begin"&&Zn(this.path[M+1])==="object"&&typeof this.path[M+1].x=="number"){R=new a(this.path[M+1].x,this.path[M+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(R.x,R.y)},h.prototype.lineTo=function(R,M){if(isNaN(R)||isNaN(M))throw dr.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Y=this.ctx.transform.applyToPoint(new a(R,M));this.path.push({type:"lt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new a(Y.x,Y.y)},h.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),b.call(this,null,!0)},h.prototype.quadraticCurveTo=function(R,M,Y,X){if(isNaN(Y)||isNaN(X)||isNaN(R)||isNaN(M))throw dr.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var V=this.ctx.transform.applyToPoint(new a(Y,X)),Z=this.ctx.transform.applyToPoint(new a(R,M));this.path.push({type:"qct",x1:Z.x,y1:Z.y,x:V.x,y:V.y}),this.ctx.lastPoint=new a(V.x,V.y)},h.prototype.bezierCurveTo=function(R,M,Y,X,V,Z){if(isNaN(V)||isNaN(Z)||isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw dr.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var de=this.ctx.transform.applyToPoint(new a(V,Z)),ue=this.ctx.transform.applyToPoint(new a(R,M)),se=this.ctx.transform.applyToPoint(new a(Y,X));this.path.push({type:"bct",x1:ue.x,y1:ue.y,x2:se.x,y2:se.y,x:de.x,y:de.y}),this.ctx.lastPoint=new a(de.x,de.y)},h.prototype.arc=function(R,M,Y,X,V,Z){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X)||isNaN(V))throw dr.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Z=!!Z,!this.ctx.transform.isIdentity){var de=this.ctx.transform.applyToPoint(new a(R,M));R=de.x,M=de.y;var ue=this.ctx.transform.applyToPoint(new a(0,Y)),se=this.ctx.transform.applyToPoint(new a(0,0));Y=Math.sqrt(Math.pow(ue.x-se.x,2)+Math.pow(ue.y-se.y,2))}Math.abs(V-X)>=2*Math.PI&&(X=0,V=2*Math.PI),this.path.push({type:"arc",x:R,y:M,radius:Y,startAngle:X,endAngle:V,counterclockwise:Z})},h.prototype.arcTo=function(R,M,Y,X,V){throw new Error("arcTo not implemented.")},h.prototype.rect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw dr.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(R,M),this.lineTo(R+Y,M),this.lineTo(R+Y,M+X),this.lineTo(R,M+X),this.lineTo(R,M),this.lineTo(R+Y,M),this.lineTo(R,M)},h.prototype.fillRect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw dr.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var V={};this.lineCap!=="butt"&&(V.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(V.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(R,M,Y,X),this.fill(),V.hasOwnProperty("lineCap")&&(this.lineCap=V.lineCap),V.hasOwnProperty("lineJoin")&&(this.lineJoin=V.lineJoin)}},h.prototype.strokeRect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw dr.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(R,M,Y,X),this.stroke())},h.prototype.clearRect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw dr.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(R,M,Y,X))},h.prototype.save=function(R){R=typeof R!="boolean"||R;for(var M=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("q");if(this.pdf.setPage(M),R){this.ctx.fontSize=this.pdf.internal.getFontSize();var X=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=X}},h.prototype.restore=function(R){R=typeof R!="boolean"||R;for(var M=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("Q");this.pdf.setPage(M),R&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},h.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var A=function(R){var M,Y,X,V;if(R.isCanvasGradient===!0&&(R=R.getColor()),!R)return{r:0,g:0,b:0,a:0,style:R};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(R))M=0,Y=0,X=0,V=0;else{var Z=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(R);if(Z!==null)M=parseInt(Z[1]),Y=parseInt(Z[2]),X=parseInt(Z[3]),V=1;else if((Z=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(R))!==null)M=parseInt(Z[1]),Y=parseInt(Z[2]),X=parseInt(Z[3]),V=parseFloat(Z[4]);else{if(V=1,typeof R=="string"&&R.charAt(0)!=="#"){var de=new vve(R);R=de.ok?de.toHex():"#000000"}R.length===4?(M=R.substring(1,2),M+=M,Y=R.substring(2,3),Y+=Y,X=R.substring(3,4),X+=X):(M=R.substring(1,3),Y=R.substring(3,5),X=R.substring(5,7)),M=parseInt(M,16),Y=parseInt(Y,16),X=parseInt(X,16)}}return{r:M,g:Y,b:X,a:V,style:R}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};h.prototype.fillText=function(R,M,Y,X){if(isNaN(M)||isNaN(Y)||typeof R!="string")throw dr.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(X=isNaN(X)?void 0:X,!f.call(this)){var V=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;N.call(this,{text:R,x:M,y:Y,scale:Z,angle:V,align:this.textAlign,maxWidth:X})}},h.prototype.strokeText=function(R,M,Y,X){if(isNaN(M)||isNaN(Y)||typeof R!="string")throw dr.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){X=isNaN(X)?void 0:X;var V=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;N.call(this,{text:R,x:M,y:Y,scale:Z,renderingMode:"stroke",angle:V,align:this.textAlign,maxWidth:X})}},h.prototype.measureText=function(R){if(typeof R!="string")throw dr.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var M=this.pdf,Y=this.pdf.internal.scaleFactor,X=M.internal.getFontSize(),V=M.getStringUnitWidth(R)*X/M.internal.scaleFactor;return new function(Z){var de=(Z=Z||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return de}}),this}({width:V*=Math.round(96*Y/72*1e4)/1e4})},h.prototype.scale=function(R,M){if(isNaN(R)||isNaN(M))throw dr.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Y=new c(R,0,0,M,0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},h.prototype.rotate=function(R){if(isNaN(R))throw dr.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var M=new c(Math.cos(R),Math.sin(R),-Math.sin(R),Math.cos(R),0,0);this.ctx.transform=this.ctx.transform.multiply(M)},h.prototype.translate=function(R,M){if(isNaN(R)||isNaN(M))throw dr.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Y=new c(1,0,0,1,R,M);this.ctx.transform=this.ctx.transform.multiply(Y)},h.prototype.transform=function(R,M,Y,X,V,Z){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X)||isNaN(V)||isNaN(Z))throw dr.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var de=new c(R,M,Y,X,V,Z);this.ctx.transform=this.ctx.transform.multiply(de)},h.prototype.setTransform=function(R,M,Y,X,V,Z){R=isNaN(R)?1:R,M=isNaN(M)?0:M,Y=isNaN(Y)?0:Y,X=isNaN(X)?1:X,V=isNaN(V)?0:V,Z=isNaN(Z)?0:Z,this.ctx.transform=new c(R,M,Y,X,V,Z)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};h.prototype.drawImage=function(R,M,Y,X,V,Z,de,ue,se){var he=this.pdf.getImageProperties(R),ie=1,Ce=1,Ie=1,te=1;X!==void 0&&ue!==void 0&&(Ie=ue/X,te=se/V,ie=he.width/X*ue/X,Ce=he.height/V*se/V),Z===void 0&&(Z=M,de=Y,M=0,Y=0),X!==void 0&&ue===void 0&&(ue=X,se=V),X===void 0&&ue===void 0&&(ue=he.width,se=he.height);var je=this.ctx.transform.decompose(),nt=$(je.rotate.shx),rt=new c,Ne=(rt=(rt=(rt=rt.multiply(je.translate)).multiply(je.skew)).multiply(je.scale)).applyToRectangle(new o(Z-M*Ie,de-Y*te,X*ie,V*Ce));if(this.autoPaging){for(var st,we=g.call(this,Ne),He=[],Ve=0;Ve<we.length;Ve+=1)He.indexOf(we[Ve])===-1&&He.push(we[Ve]);x(He);for(var Dt=He[0],pt=He[He.length-1],ye=Dt;ye<pt+1;ye++){this.pdf.setPage(ye);var Be=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ge=ye===1?this.posY+this.margin[0]:this.margin[0],Ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ze=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],pe=ye===1?0:Ue+(ye-2)*Ze;if(this.ctx.clip_path.length!==0){var mt=this.path;st=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(st,this.posX+this.margin[3],-pe+Ge+this.ctx.prevPageLastElemOffset),w.call(this,"fill",!0),this.path=mt}var ft=JSON.parse(JSON.stringify(Ne));ft=v([ft],this.posX+this.margin[3],-pe+Ge+this.ctx.prevPageLastElemOffset)[0];var wt=(ye>Dt||ye<pt)&&m.call(this);wt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Be,Ze,null).clip().discardPath()),this.pdf.addImage(R,"JPEG",ft.x,ft.y,ft.w,ft.h,null,null,nt),wt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(R,"JPEG",Ne.x,Ne.y,Ne.w,Ne.h,null,null,nt)};var g=function(R,M,Y){var X=[];M=M||this.pdf.internal.pageSize.width,Y=Y||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var V=this.posY+this.ctx.prevPageLastElemOffset;switch(R.type){default:case"mt":case"lt":X.push(Math.floor((R.y+V)/Y)+1);break;case"arc":X.push(Math.floor((R.y+V-R.radius)/Y)+1),X.push(Math.floor((R.y+V+R.radius)/Y)+1);break;case"qct":var Z=z(this.ctx.lastPoint.x,this.ctx.lastPoint.y,R.x1,R.y1,R.x,R.y);X.push(Math.floor((Z.y+V)/Y)+1),X.push(Math.floor((Z.y+Z.h+V)/Y)+1);break;case"bct":var de=Q(this.ctx.lastPoint.x,this.ctx.lastPoint.y,R.x1,R.y1,R.x2,R.y2,R.x,R.y);X.push(Math.floor((de.y+V)/Y)+1),X.push(Math.floor((de.y+de.h+V)/Y)+1);break;case"rect":X.push(Math.floor((R.y+V)/Y)+1),X.push(Math.floor((R.y+R.h+V)/Y)+1)}for(var ue=0;ue<X.length;ue+=1)for(;this.pdf.internal.getNumberOfPages()<X[ue];)y.call(this);return X},y=function(){var R=this.fillStyle,M=this.strokeStyle,Y=this.font,X=this.lineCap,V=this.lineWidth,Z=this.lineJoin;this.pdf.addPage(),this.fillStyle=R,this.strokeStyle=M,this.font=Y,this.lineCap=X,this.lineWidth=V,this.lineJoin=Z},v=function(R,M,Y){for(var X=0;X<R.length;X++)switch(R[X].type){case"bct":R[X].x2+=M,R[X].y2+=Y;case"qct":R[X].x1+=M,R[X].y1+=Y;default:R[X].x+=M,R[X].y+=Y}return R},x=function(R){return R.sort(function(M,Y){return M-Y})},b=function(R,M){var Y=this.fillStyle,X=this.strokeStyle,V=this.lineCap,Z=this.lineWidth,de=Math.abs(Z*this.ctx.transform.scaleX),ue=this.lineJoin;if(this.autoPaging){for(var se,he,ie=JSON.parse(JSON.stringify(this.path)),Ce=JSON.parse(JSON.stringify(this.path)),Ie=[],te=0;te<Ce.length;te++)if(Ce[te].x!==void 0)for(var je=g.call(this,Ce[te]),nt=0;nt<je.length;nt+=1)Ie.indexOf(je[nt])===-1&&Ie.push(je[nt]);for(var rt=0;rt<Ie.length;rt++)for(;this.pdf.internal.getNumberOfPages()<Ie[rt];)y.call(this);x(Ie);for(var Ne=Ie[0],st=Ie[Ie.length-1],we=Ne;we<st+1;we++){this.pdf.setPage(we),this.fillStyle=Y,this.strokeStyle=X,this.lineCap=V,this.lineWidth=de,this.lineJoin=ue;var He=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ve=we===1?this.posY+this.margin[0]:this.margin[0],Dt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],pt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ye=we===1?0:Dt+(we-2)*pt;if(this.ctx.clip_path.length!==0){var Be=this.path;se=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(se,this.posX+this.margin[3],-ye+Ve+this.ctx.prevPageLastElemOffset),w.call(this,R,!0),this.path=Be}if(he=JSON.parse(JSON.stringify(ie)),this.path=v(he,this.posX+this.margin[3],-ye+Ve+this.ctx.prevPageLastElemOffset),M===!1||we===0){var Ge=(we>Ne||we<st)&&m.call(this);Ge&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],He,pt,null).clip().discardPath()),w.call(this,R,M),Ge&&this.pdf.restoreGraphicsState()}this.lineWidth=Z}this.path=ie}else this.lineWidth=de,w.call(this,R,M),this.lineWidth=Z},w=function(R,M){if((R!=="stroke"||M||!p.call(this))&&(R==="stroke"||M||!f.call(this))){for(var Y,X,V=[],Z=this.path,de=0;de<Z.length;de++){var ue=Z[de];switch(ue.type){case"begin":V.push({begin:!0});break;case"close":V.push({close:!0});break;case"mt":V.push({start:ue,deltas:[],abs:[]});break;case"lt":var se=V.length;if(Z[de-1]&&!isNaN(Z[de-1].x)&&(Y=[ue.x-Z[de-1].x,ue.y-Z[de-1].y],se>0)){for(;se>=0;se--)if(V[se-1].close!==!0&&V[se-1].begin!==!0){V[se-1].deltas.push(Y),V[se-1].abs.push(ue);break}}break;case"bct":Y=[ue.x1-Z[de-1].x,ue.y1-Z[de-1].y,ue.x2-Z[de-1].x,ue.y2-Z[de-1].y,ue.x-Z[de-1].x,ue.y-Z[de-1].y],V[V.length-1].deltas.push(Y);break;case"qct":var he=Z[de-1].x+2/3*(ue.x1-Z[de-1].x),ie=Z[de-1].y+2/3*(ue.y1-Z[de-1].y),Ce=ue.x+2/3*(ue.x1-ue.x),Ie=ue.y+2/3*(ue.y1-ue.y),te=ue.x,je=ue.y;Y=[he-Z[de-1].x,ie-Z[de-1].y,Ce-Z[de-1].x,Ie-Z[de-1].y,te-Z[de-1].x,je-Z[de-1].y],V[V.length-1].deltas.push(Y);break;case"arc":V.push({deltas:[],abs:[],arc:!0}),Array.isArray(V[V.length-1].abs)&&V[V.length-1].abs.push(ue)}}X=M?null:R==="stroke"?"stroke":"fill";for(var nt=!1,rt=0;rt<V.length;rt++)if(V[rt].arc)for(var Ne=V[rt].abs,st=0;st<Ne.length;st++){var we=Ne[st];we.type==="arc"?B.call(this,we.x,we.y,we.radius,we.startAngle,we.endAngle,we.counterclockwise,void 0,M,!nt):F.call(this,we.x,we.y),nt=!0}else if(V[rt].close===!0)this.pdf.internal.out("h"),nt=!1;else if(V[rt].begin!==!0){var He=V[rt].start.x,Ve=V[rt].start.y;L.call(this,V[rt].deltas,He,Ve),nt=!0}X&&E.call(this,X),M&&P.call(this)}},k=function(R){var M=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Y=M*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return R-Y;case"top":return R+M-Y;case"hanging":return R+M-2*Y;case"middle":return R+M/2-Y;default:return R}},j=function(R){return R+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};h.prototype.createLinearGradient=function(){var R=function(){};return R.colorStops=[],R.addColorStop=function(M,Y){this.colorStops.push([M,Y])},R.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},R.isCanvasGradient=!0,R},h.prototype.createPattern=function(){return this.createLinearGradient()},h.prototype.createRadialGradient=function(){return this.createLinearGradient()};var B=function(R,M,Y,X,V,Z,de,ue,se){for(var he=H.call(this,Y,X,V,Z),ie=0;ie<he.length;ie++){var Ce=he[ie];ie===0&&(se?T.call(this,Ce.x1+R,Ce.y1+M):F.call(this,Ce.x1+R,Ce.y1+M)),U.call(this,R,M,Ce.x2,Ce.y2,Ce.x3,Ce.y3,Ce.x4,Ce.y4)}ue?P.call(this):E.call(this,de)},E=function(R){switch(R){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},P=function(){this.pdf.clip(),this.pdf.discardPath()},T=function(R,M){this.pdf.internal.out(n(R)+" "+r(M)+" m")},N=function(R){var M;switch(R.align){case"right":case"end":M="right";break;case"center":M="center";break;default:M="left"}var Y,X,V,Z=this.pdf.getTextDimensions(R.text),de=k.call(this,R.y),ue=j.call(this,de)-Z.h,se=this.ctx.transform.applyToPoint(new a(R.x,de));if(this.autoPaging){var he=this.ctx.transform.decompose(),ie=new c;ie=(ie=(ie=ie.multiply(he.translate)).multiply(he.skew)).multiply(he.scale);for(var Ce=this.ctx.transform.applyToRectangle(new o(R.x,de,Z.w,Z.h)),Ie=ie.applyToRectangle(new o(R.x,ue,Z.w,Z.h)),te=g.call(this,Ie),je=[],nt=0;nt<te.length;nt+=1)je.indexOf(te[nt])===-1&&je.push(te[nt]);x(je);for(var rt=je[0],Ne=je[je.length-1],st=rt;st<Ne+1;st++){this.pdf.setPage(st);var we=st===1?this.posY+this.margin[0]:this.margin[0],He=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ve=this.pdf.internal.pageSize.height-this.margin[2],Dt=Ve-this.margin[0],pt=this.pdf.internal.pageSize.width-this.margin[1],ye=pt-this.margin[3],Be=st===1?0:He+(st-2)*Dt;if(this.ctx.clip_path.length!==0){var Ge=this.path;Y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Y,this.posX+this.margin[3],-1*Be+we),w.call(this,"fill",!0),this.path=Ge}var Ue=v([JSON.parse(JSON.stringify(Ie))],this.posX+this.margin[3],-Be+we+this.ctx.prevPageLastElemOffset)[0];R.scale>=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*R.scale),V=this.lineWidth,this.lineWidth=V*R.scale);var Ze=this.autoPaging!=="text";if(Ze||Ue.y+Ue.h<=Ve){if(Ze||Ue.y>=we&&Ue.x<=pt){var pe=Ze?R.text:this.pdf.splitTextToSize(R.text,R.maxWidth||pt-Ue.x)[0],mt=v([JSON.parse(JSON.stringify(Ce))],this.posX+this.margin[3],-Be+we+this.ctx.prevPageLastElemOffset)[0],ft=Ze&&(st>rt||st<Ne)&&m.call(this);ft&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ye,Dt,null).clip().discardPath()),this.pdf.text(pe,mt.x,mt.y,{angle:R.angle,align:M,renderingMode:R.renderingMode}),ft&&this.pdf.restoreGraphicsState()}}else Ue.y<Ve&&(this.ctx.prevPageLastElemOffset+=Ve-Ue.y);R.scale>=.01&&(this.pdf.setFontSize(X),this.lineWidth=V)}}else R.scale>=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*R.scale),V=this.lineWidth,this.lineWidth=V*R.scale),this.pdf.text(R.text,se.x+this.posX,se.y+this.posY,{angle:R.angle,align:M,renderingMode:R.renderingMode,maxWidth:R.maxWidth}),R.scale>=.01&&(this.pdf.setFontSize(X),this.lineWidth=V)},F=function(R,M,Y,X){Y=Y||0,X=X||0,this.pdf.internal.out(n(R+Y)+" "+r(M+X)+" l")},L=function(R,M,Y){return this.pdf.lines(R,M,Y,null,null)},U=function(R,M,Y,X,V,Z,de,ue){this.pdf.internal.out([t(i(Y+R)),t(s(X+M)),t(i(V+R)),t(s(Z+M)),t(i(de+R)),t(s(ue+M)),"c"].join(" "))},H=function(R,M,Y,X){for(var V=2*Math.PI,Z=Math.PI/2;M>Y;)M-=V;var de=Math.abs(Y-M);de<V&&X&&(de=V-de);for(var ue=[],se=X?-1:1,he=M;de>1e-5;){var ie=he+se*Math.min(de,Z);ue.push(W.call(this,R,he,ie)),de-=Math.abs(ie-he),he=ie}return ue},W=function(R,M,Y){var X=(Y-M)/2,V=R*Math.cos(X),Z=R*Math.sin(X),de=V,ue=-Z,se=de*de+ue*ue,he=se+de*V+ue*Z,ie=4/3*(Math.sqrt(2*se*he)-he)/(de*Z-ue*V),Ce=de-ie*ue,Ie=ue+ie*de,te=Ce,je=-Ie,nt=X+M,rt=Math.cos(nt),Ne=Math.sin(nt);return{x1:R*Math.cos(M),y1:R*Math.sin(M),x2:Ce*rt-Ie*Ne,y2:Ce*Ne+Ie*rt,x3:te*rt-je*Ne,y3:te*Ne+je*rt,x4:R*Math.cos(Y),y4:R*Math.sin(Y)}},$=function(R){return 180*R/Math.PI},z=function(R,M,Y,X,V,Z){var de=R+.5*(Y-R),ue=M+.5*(X-M),se=V+.5*(Y-V),he=Z+.5*(X-Z),ie=Math.min(R,V,de,se),Ce=Math.max(R,V,de,se),Ie=Math.min(M,Z,ue,he),te=Math.max(M,Z,ue,he);return new o(ie,Ie,Ce-ie,te-Ie)},Q=function(R,M,Y,X,V,Z,de,ue){var se,he,ie,Ce,Ie,te,je,nt,rt,Ne,st,we,He,Ve,Dt=Y-R,pt=X-M,ye=V-Y,Be=Z-X,Ge=de-V,Ue=ue-Z;for(he=0;he<41;he++)rt=(je=(ie=R+(se=he/40)*Dt)+se*((Ie=Y+se*ye)-ie))+se*(Ie+se*(V+se*Ge-Ie)-je),Ne=(nt=(Ce=M+se*pt)+se*((te=X+se*Be)-Ce))+se*(te+se*(Z+se*Ue-te)-nt),he==0?(st=rt,we=Ne,He=rt,Ve=Ne):(st=Math.min(st,rt),we=Math.min(we,Ne),He=Math.max(He,rt),Ve=Math.max(Ve,Ne));return new o(Math.round(st),Math.round(we),Math.round(He-st),Math.round(Ve-we))},ce=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var R,M,Y=(R=this.ctx.lineDash,M=this.ctx.lineDashOffset,JSON.stringify({lineDash:R,lineDashOffset:M}));this.prevLineDash!==Y&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Y)}}})(Ot.API),function(e){var t=function(a){var o,c,u,d,h,A,f,p,m,g;for(c=[],u=0,d=(a+=o="\0\0\0\0".slice(a.length%4||4)).length;d>u;u+=4)(h=(a.charCodeAt(u)<<24)+(a.charCodeAt(u+1)<<16)+(a.charCodeAt(u+2)<<8)+a.charCodeAt(u+3))!==0?(A=(h=((h=((h=((h=(h-(g=h%85))/85)-(m=h%85))/85)-(p=h%85))/85)-(f=h%85))/85)%85,c.push(A+33,f+33,p+33,m+33,g+33)):c.push(122);return function(y,v){for(var x=v;x>0;x--)y.pop()}(c,o.length),String.fromCharCode.apply(String,c)+"~>"},n=function(a){var o,c,u,d,h,A=String,f="length",p=255,m="charCodeAt",g="slice",y="replace";for(a[g](-2),a=a[g](0,-2)[y](/\s/g,"")[y]("z","!!!!!"),u=[],d=0,h=(a+=o="uuuuu"[g](a[f]%5||5))[f];h>d;d+=5)c=52200625*(a[m](d)-33)+614125*(a[m](d+1)-33)+7225*(a[m](d+2)-33)+85*(a[m](d+3)-33)+(a[m](d+4)-33),u.push(p&c>>24,p&c>>16,p&c>>8,p&c);return function(v,x){for(var b=x;b>0;b--)v.pop()}(u,o[f]),A.fromCharCode.apply(A,u)},r=function(a){return a.split("").map(function(o){return("0"+o.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(a){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),o.test(a)===!1)return"";for(var c="",u=0;u<a.length;u+=2)c+=String.fromCharCode("0x"+(a[u]+a[u+1]));return c},s=function(a){for(var o=new Uint8Array(a.length),c=a.length;c--;)o[c]=a.charCodeAt(c);return(o=vR(o)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};e.processDataByFilters=function(a,o){var c=0,u=a||"",d=[];for(typeof(o=o||[])=="string"&&(o=[o]),c=0;c<o.length;c+=1)switch(o[c]){case"ASCII85Decode":case"/ASCII85Decode":u=n(u),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=t(u),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=i(u),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=r(u),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=s(u),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[c]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}}(Ot.API),function(e){e.loadFile=function(t,n,r){return function(i,s,a){s=s!==!1,a=typeof a=="function"?a:function(){};var o=void 0;try{o=function(c,u,d){var h=new XMLHttpRequest,A=0,f=function(p){var m=p.length,g=[],y=String.fromCharCode;for(A=0;A<m;A+=1)g.push(y(255&p.charCodeAt(A)));return g.join("")};if(h.open("GET",c,!u),h.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(h.onload=function(){h.status===200?d(f(this.responseText)):d(void 0)}),h.send(null),u&&h.status===200)return f(h.responseText)}(i,s,a)}catch{}return o}(t,n,r)},e.allowFsRead=void 0,e.loadImageFile=e.loadFile}(Ot.API),function(e){function t(){return(Jt.html2canvas?Promise.resolve(Jt.html2canvas):v_(()=>Promise.resolve().then(()=>oTt),void 0)).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function n(){return(Jt.DOMPurify?Promise.resolve(Jt.DOMPurify):v_(()=>import("./purify.es-dhnUglUx.js"),[])).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var r=function(o){var c=Zn(o);return c==="undefined"?"undefined":c==="string"||o instanceof String?"string":c==="number"||o instanceof Number?"number":c==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":c==="object"?"object":"unknown"},i=function(o,c){var u=document.createElement(o);for(var d in c.className&&(u.className=c.className),c.innerHTML&&c.dompurify&&(u.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)u.style[d]=c.style[d];return u},s=function o(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),h=c.firstChild;h;h=h.nextSibling)u!==!0&&h.nodeType===1&&h.nodeName==="SCRIPT"||d.appendChild(o(h,u));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d},a=function o(c){var u=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),d=o.convert(Promise.resolve(),u);return(d=d.setProgress(1,o,1,[o])).set(c)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(o,c){return o.__proto__=c||a.prototype,o},a.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},a.prototype.from=function(o,c){return this.then(function(){switch(c=c||function(u){switch(r(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o),c){case"string":return this.then(n).then(function(u){return this.set({src:i("div",{innerHTML:o,dompurify:u})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},a.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},a.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},a.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(t).then(function(c){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,c(this.prop.container,u)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(t).then(function(c){var u=this.opt.jsPDF,d=this.opt.fontFaces,h=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,A=Object.assign({async:!0,allowTaint:!0,scale:h,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete A.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=d,d)for(var f=0;f<d.length;++f){var p=d[f],m=p.src.find(function(g){return g.format==="truetype"});m&&u.addFont(m.url,p.ref.name,p.ref.style)}return A.windowHeight=A.windowHeight||0,A.windowHeight=A.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):A.windowHeight,u.context2d.save(!0),c(this.prop.container,A)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(o,c,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,c):this.outputPdf(o,c)},a.prototype.outputPdf=function(o,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,c)})},a.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},a.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(o){if(r(o)!=="object")return this;var c=Object.keys(o||{}).map(function(u){if(u in a.template.prop)return function(){this.prop[u]=o[u]};switch(u){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[u]=o[u]}}},this);return this.then(function(){return this.thenList(c)})},a.prototype.get=function(o,c){return this.then(function(){var u=o in a.template.prop?this.prop[o]:this.opt[o];return c?c(u):u})},a.prototype.setMargin=function(o){return this.then(function(){switch(r(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},a.prototype.setPageSize=function(o){function c(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(o=o||Ot.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:c(o.inner.width,o.k),height:c(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},a.prototype.setProgress=function(o,c,u,d){return o!=null&&(this.progress.val=o),c!=null&&(this.progress.state=c),u!=null&&(this.progress.n=u),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(o,c,u,d){return this.setProgress(o?this.progress.val+o:null,c||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},a.prototype.then=function(o,c){var u=this;return this.thenCore(o,c,function(d,h){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(A){return u.updateProgress(null,d),A}).then(d,h).then(function(A){return u.updateProgress(1),A})})},a.prototype.thenCore=function(o,c,u){u=u||Promise.prototype.then;var d=this;o&&(o=o.bind(d)),c&&(c=c.bind(d));var h=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:a.convert(Object.assign({},d),Promise.prototype),A=u.call(h,o,c);return a.convert(A,d.__proto__)},a.prototype.thenExternal=function(o,c){return Promise.prototype.then.call(this,o,c)},a.prototype.thenList=function(o){var c=this;return o.forEach(function(u){c=c.thenCore(u)}),c},a.prototype.catch=function(o){o&&(o=o.bind(this));var c=Promise.prototype.catch.call(this,o);return a.convert(c,this)},a.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},a.prototype.error=function(o){return this.then(function(){throw new Error(o)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Ot.getPageSize=function(o,c,u){if(Zn(o)==="object"){var d=o;o=d.orientation,c=d.unit||c,u=d.format||u}c=c||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,A=(""+u).toLowerCase(),f={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(c){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=.75;break;case"pc":case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+c}var p,m=0,g=0;if(f.hasOwnProperty(A))m=f[A][1]/h,g=f[A][0]/h;else try{m=u[1],g=u[0]}catch{throw new Error("Invalid format: "+u)}if(o==="p"||o==="portrait")o="p",g>m&&(p=g,g=m,m=p);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",m>g&&(p=g,g=m,m=p)}return{width:g,height:m,unit:c,k:h,orientation:o}},e.html=function(o,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(dO):null;var u=new a(c);return c.worker?u:u.from(o).doCallback()}}(Ot.API),Ot.API.addJS=function(e){var t,n,r=function(i){for(var s="",a=0;a<i.length;a++){var o=i[a];if(o==="("||o===")"){for(var c=0,u=a-1;u>=0&&i[u]==="\\";u--)c++;s+=c%2==0?"\\"+o:o}else s+=o}return s}(e);return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),n=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){t!==void 0&&n!==void 0&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=n.outline.render().split(/\r\n/),s=0;s<i.length;s++){var a=i[s],o=r.exec(a);if(o!=null){var c=o[1];n.internal.newObjectDeferredBegin(c,!1)}n.internal.write(a)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,d=[];for(s=0;s<u;s++){var h=n.internal.newObject();d.push(h);var A=n.internal.getPageInfo(s+1);n.internal.write("<< /D["+A.objId+" 0 R /XYZ null null null]>> endobj")}var f=n.internal.newObject();for(n.internal.write("<< /Names [ "),s=0;s<d.length;s++)n.internal.write("(page_"+(s+1)+")"+d[s]+" 0 R");n.internal.write(" ] >>","endobj"),t=n.internal.newObject(),n.internal.write("<< /Dests "+f+" 0 R"),n.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,i,s){var a={title:i,options:s,children:[]};return r==null&&(r=this.root),r.children.push(a),a},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,s=0;s<r.children.length;s++){var a=r.children[s];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(r)),s>0&&this.line("/Prev "+this.makeRef(r.children[s-1])),s<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[s+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var o=this.count=this.count_r({count:0},a);if(o>0&&this.line("/Count "+o),a.options&&a.options.pageNumber){var c=n.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var u=0;u<r.children.length;u++)this.renderItems(r.children[u])},n.outline.line=function(r){this.ctx.val+=r+`\r
`},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
`+r.id+` 0 obj\r
<<\r
`},n.outline.objEnd=function(){this.ctx.val+=`>> \r
endobj\r
`},n.outline.count_r=function(r,i){for(var s=0;s<i.children.length;s++)r.count++,this.count_r(r,i.children[s]);return r.count}}])}(Ot.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,r,i,s,a,o){var c,u=this.decode.DCT_DECODE,d=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=a||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,c=function(h){for(var A,f=256*h.charCodeAt(4)+h.charCodeAt(5),p=h.length,m={width:0,height:0,numcomponents:1},g=4;g<p;g+=2){if(g+=f,t.indexOf(h.charCodeAt(g+1))!==-1){A=256*h.charCodeAt(g+5)+h.charCodeAt(g+6),m={width:256*h.charCodeAt(g+7)+h.charCodeAt(g+8),height:A,numcomponents:h.charCodeAt(g+9)};break}f=256*h.charCodeAt(g+2)+h.charCodeAt(g+3)}return m}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),c.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}d={data:n,width:c.width,height:c.height,colorSpace:o,bitsPerComponent:8,filter:u,index:r,alias:i}}return d}}(Ot.API),Ot.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,s=Jkt(e,{checkCrc:!0}),a=s.width,o=s.height,c=s.channels,u=s.palette,d=s.depth;i=u&&c===1?function(B){for(var E=B.width,P=B.height,T=B.data,N=B.palette,F=B.depth,L=!1,U=[],H=[],W=void 0,$=!1,z=0,Q=0;Q<N.length;Q++){var ce=tJ(N[Q],4),R=ce[0],M=ce[1],Y=ce[2],X=ce[3];U.push(R,M,Y),X!=null&&(X===0?(z++,H.length<1&&H.push(Q)):X<255&&($=!0))}if($||z>1){L=!0,H=void 0;var V=E*P;W=new Uint8Array(V);for(var Z=new DataView(T.buffer),de=0;de<V;de++){var ue=fO(Z,de,F),se=tJ(N[ue],4)[3];W[de]=se}}else z===0&&(H=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:L?8:void 0,colorBytes:T,alphaBytes:W,needSMask:L,palette:U,mask:H}}(s):c===2||c===4?function(B){for(var E=B.data,P=B.width,T=B.height,N=B.channels,F=B.depth,L=N===2?"DeviceGray":"DeviceRGB",U=N-1,H=P*T,W=U,$=H*W,z=1*H,Q=Math.ceil($*F/8),ce=Math.ceil(z*F/8),R=new Uint8Array(Q),M=new Uint8Array(ce),Y=new DataView(E.buffer),X=new DataView(R.buffer),V=new DataView(M.buffer),Z=!1,de=0;de<H;de++){for(var ue=de*N,se=0;se<W;se++)AZ(X,fO(Y,ue+se,F),de*W+se,F);var he=fO(Y,ue+W,F);he<(1<<F)-1&&(Z=!0),AZ(V,he,1*de,F)}return{colorSpace:L,colorsPerPixel:U,sMaskBitsPerComponent:Z?F:void 0,colorBytes:R,alphaBytes:M,needSMask:Z}}(s):function(B){var E=B.data,P=B.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:P,colorsPerPixel:P==="DeviceGray"?1:3,colorBytes:E instanceof Uint16Array?function(T){for(var N=T.length,F=new Uint8Array(2*N),L=new DataView(F.buffer,F.byteOffset,F.byteLength),U=0;U<N;U++)L.setUint16(2*U,T[U],!1);return F}(E):E,needSMask:!1}}(s);var h,A,f,p=i,m=p.colorSpace,g=p.colorsPerPixel,y=p.sMaskBitsPerComponent,v=p.colorBytes,x=p.alphaBytes,b=p.needSMask,w=p.palette,k=p.mask,j=null;return r!==Ot.API.image_compression.NONE&&typeof vR=="function"?(j=function(B){var E;switch(B){case Ot.API.image_compression.FAST:E=11;break;case Ot.API.image_compression.MEDIUM:E=13;break;case Ot.API.image_compression.SLOW:E=14;break;default:E=12}return E}(r),h=this.decode.FLATE_DECODE,A="/Predictor ".concat(j," /Colors ").concat(g," /BitsPerComponent ").concat(d," /Columns ").concat(a),e=cZ(v,Math.ceil(a*g*d/8),g,d,r),b&&(f=cZ(x,Math.ceil(a*y/8),1,y,r))):(h=void 0,A=void 0,e=v,b&&(f=x)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(f&&this.__addimage__.isArrayBuffer(f)||this.__addimage__.isArrayBufferView(f))&&(f=this.__addimage__.arrayBufferToBinaryString(f)),{alias:n,data:e,index:t,filter:h,decodeParameters:A,transparency:k,palette:w,sMask:f,predictor:j,width:a,height:o,bitsPerComponent:d,sMaskBitsPerComponent:y,colorSpace:m}}},function(e){e.processGIF89A=function(t,n,r,i){var s=new v_t(t),a=s.width,o=s.height,c=[];s.decodeAndBlitFrameRGBA(0,c);var u={data:c,width:a,height:o},d=new AO(100).encode(u,100);return e.processJPEG.call(this,d,n,r,i)},e.processGIF87A=e.processGIF89A}(Ot.API),Xl.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:r,blue:n,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Xl.prototype.parseBGR=function(){this.pos=this.offset;var e="bit"+this.bitPP,t=this.width*this.height*4;if(t>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(t);try{this[e]()}catch(n){dr.log("bit decode error:"+n)}},Xl.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,o=0;o<8&&8*i+o<this.width;o++){var c=this.palette[s>>7-o&1];this.data[a+4*o]=c.blue,this.data[a+4*o+1]=c.green,this.data[a+4*o+2]=c.red,this.data[a+4*o+3]=255}n!==0&&(this.pos+=4-n)}},Xl.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<e;i++){var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,o=s>>4,c=15&s,u=this.palette[o];if(this.data[a]=u.blue,this.data[a+1]=u.green,this.data[a+2]=u.red,this.data[a+3]=255,2*i+1>=this.width)break;u=this.palette[c],this.data[a+4]=u.blue,this.data[a+4+1]=u.green,this.data[a+4+2]=u.red,this.data[a+4+3]=255}t!==0&&(this.pos+=4-t)}},Xl.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),s=n*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[s]=a.red,this.data[s+1]=a.green,this.data[s+2]=a.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}e!==0&&(this.pos+=4-e)}},Xl.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(s&t)/t*255|0,o=(s>>5&t)/t*255|0,c=(s>>10&t)/t*255|0,u=s>>15?255:0,d=r*this.width*4+4*i;this.data[d]=c,this.data[d+1]=o,this.data[d+2]=a,this.data[d+3]=u}this.pos+=e}},Xl.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&t)/t*255|0,c=(a>>5&n)/n*255|0,u=(a>>11)/t*255|0,d=i*this.width*4+4*s;this.data[d]=u,this.data[d+1]=c,this.data[d+2]=o,this.data[d+3]=255}this.pos+=e}},Xl.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=t*this.width*4+4*n;this.data[a]=s,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},Xl.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*n;this.data[o]=s,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=a}},Xl.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,r,i){var s=new Xl(t,!1),a=s.width,o=s.height,c={data:s.getData(),width:a,height:o},u=new AO(100).encode(c,100);return e.processJPEG.call(this,u,n,r,i)}}(Ot.API),mZ.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,r,i){var s=new mZ(t),a=s.width,o=s.height,c={data:s.getData(),width:a,height:o},u=new AO(100).encode(c,100);return e.processJPEG.call(this,u,n,r,i)}}(Ot.API),Ot.API.processRGBA=function(e,t,n){for(var r=e.data,i=r.length,s=new Uint8Array(i/4*3),a=new Uint8Array(i/4),o=0,c=0,u=0;u<i;u+=4){var d=r[u],h=r[u+1],A=r[u+2],f=r[u+3];s[o++]=d,s[o++]=h,s[o++]=A,a[c++]=f}var p=this.__addimage__.arrayBufferToBinaryString(s);return{alpha:this.__addimage__.arrayBufferToBinaryString(a),data:p,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Ot.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Sg=Ot.API,dk=Sg.getCharWidthsArray=function(e,t){var n,r,i=(t=t||{}).font||this.internal.getFont(),s=t.fontSize||this.internal.getFontSize(),a=t.charSpace||this.internal.getCharSpace(),o=t.widths?t.widths:i.metadata.Unicode.widths,c=o.fof?o.fof:1,u=t.kerning?t.kerning:i.metadata.Unicode.kerning,d=u.fof?u.fof:1,h=t.doKerning!==!1,A=0,f=e.length,p=0,m=o[0]||c,g=[];for(n=0;n<f;n++)r=e.charCodeAt(n),typeof i.metadata.widthOfString=="function"?g.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+a*(1e3/s)||0)/1e3):(A=h&&Zn(u[r])==="object"&&!isNaN(parseInt(u[r][p],10))?u[r][p]/d:0,g.push((o[r]||m)/c+A)),p=r;return g},aZ=Sg.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return Sg.processArabic&&(e=Sg.processArabic(e)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(e,n,i)/n:dk.apply(this,arguments).reduce(function(s,a){return s+a},0)},oZ=function(e,t,n,r){for(var i=[],s=0,a=e.length,o=0;s!==a&&o+t[s]<n;)o+=t[s],s++;i.push(e.slice(0,s));var c=s;for(o=0;s!==a;)o+t[s]>r&&(i.push(e.slice(c,s)),o=0,c=s),o+=t[s],s++;return c!==s&&i.push(e.slice(c,s)),i},lZ=function(e,t,n){n||(n={});var r,i,s,a,o,c,u,d=[],h=[d],A=n.textIndent||0,f=0,p=0,m=e.split(" "),g=dk.apply(this,[" ",n])[0];if(c=n.lineIndent===-1?m[0].length+2:n.lineIndent||0){var y=Array(c).join(" "),v=[];m.map(function(b){(b=b.split(/\s*\n/)).length>1?v=v.concat(b.map(function(w,k){return(k&&w.length?`
`:"")+w})):v.push(b[0])}),m=v,c=aZ.apply(this,[y,n])}for(s=0,a=m.length;s<a;s++){var x=0;if(r=m[s],c&&r[0]==`
`&&(r=r.substr(1),x=1),A+f+(p=(i=dk.apply(this,[r,n])).reduce(function(b,w){return b+w},0))>t||x){if(p>t){for(o=oZ.apply(this,[r,i,t-(A+f),t]),d.push(o.shift()),d=[o.pop()];o.length;)h.push([o.shift()]);p=i.slice(r.length-(d[0]?d[0].length:0)).reduce(function(b,w){return b+w},0)}else d=[r];h.push(d),A=p+c,f=g}else d.push(r),A+=f+p,f=g}return u=c?function(b,w){return(w?y:"")+b.join(" ")}:function(b){return b.join(" ")},h.map(u)},Sg.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),s=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var h=this.internal.getFont(d.fontName,d.fontStyle),A="Unicode";return h.metadata[A]?{widths:h.metadata[A].widths||{0:1},kerning:h.metadata[A].kerning||{}}:{font:h.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var a=1*this.internal.scaleFactor*t/i;s.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,s.lineIndent=n.lineIndent;var o,c,u=[];for(o=0,c=r.length;o<c;o++)u=u.concat(lZ.apply(this,[r[o],a,s]));return u},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},s=0;s<16;s++)r[n[s]]=t[s],i[t[s]]=n[s];var a=function(A){return"0x"+parseInt(A,10).toString(16)},o=e.__fontmetrics__.compress=function(A){var f,p,m,g,y=["{"];for(var v in A){if(f=A[v],isNaN(parseInt(v,10))?p="'"+v+"'":(v=parseInt(v,10),p=(p=a(v).slice(2)).slice(0,-1)+i[p.slice(-1)]),typeof f=="number")f<0?(m=a(f).slice(3),g="-"):(m=a(f).slice(2),g=""),m=g+m.slice(0,-1)+i[m.slice(-1)];else{if(Zn(f)!=="object")throw new Error("Don't know what to do with value type "+Zn(f)+".");m=o(f)}y.push(p+m)}return y.push("}"),y.join("")},c=e.__fontmetrics__.uncompress=function(A){if(typeof A!="string")throw new Error("Invalid argument passed to uncompress.");for(var f,p,m,g,y={},v=1,x=y,b=[],w="",k="",j=A.length-1,B=1;B<j;B+=1)(g=A[B])=="'"?f?(m=f.join(""),f=void 0):f=[]:f?f.push(g):g=="{"?(b.push([x,m]),x={},m=void 0):g=="}"?((p=b.pop())[0][p[1]]=x,m=void 0,x=p[0]):g=="-"?v=-1:m===void 0?r.hasOwnProperty(g)?(w+=r[g],m=parseInt(w,16)*v,v=1,w=""):w+=g:r.hasOwnProperty(g)?(k+=r[g],x[m]=parseInt(k,16)*v,v=1,m=void 0,k=""):k+=g;return y},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},h={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":c("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(A){var f=A.font,p=h.Unicode[f.postScriptName];p&&(f.metadata.Unicode={},f.metadata.Unicode.widths=p.widths,f.metadata.Unicode.kerning=p.kerning);var m=d.Unicode[f.postScriptName];m&&(f.metadata.Unicode.encoding=m,f.encoding=m.codePages[0])}])}(Ot.API),function(e){var t=function(n){for(var r=n.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=n.charCodeAt(s);return i};e.API.events.push(["addFont",function(n){var r=void 0,i=n.font,s=n.instance;if(!i.isStandardFont){if(s===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=s.existsFileInVFS(i.postScriptName)===!1?s.loadFile(i.postScriptName):s.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,o){o=/^\x00\x01\x00\x00/.test(o)?t(o):t(b_(o)),a.metadata=e.API.TTFFont.open(o),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,r)}}])}(Ot),Ot.API.addSvgAsImage=function(e,t,n,r,i,s,a,o){if(isNaN(t)||isNaN(n))throw dr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw dr.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=r,c.height=i;var u=c.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,c.width,c.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return(Jt.canvg?Promise.resolve(Jt.canvg):v_(()=>import("./index.es-CRBeRoIQ.js"),[])).catch(function(A){return Promise.reject(new Error("Could not load canvg: "+A))}).then(function(A){return A.default?A.default:A}).then(function(A){return A.fromString(u,e,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(d)}).then(function(){h.addImage(c.toDataURL("image/jpeg",1),t,n,r,i,a,o)})},Ot.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},Ot.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,s,a={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},o=Object.keys(a),c=[],u=0,d=0,h=0;function A(p,m){var g,y=!1;for(g=0;g<p.length;g+=1)p[g]===m&&(y=!0);return y}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var f=o.length;for(h=0;h<f;h+=1)n[o[h]].value=n[o[h]].defaultValue,n[o[h]].explicitSet=!1}if(Zn(e)==="object"){for(i in e)if(s=e[i],A(o,i)&&s!==void 0){if(n[i].type==="boolean"&&typeof s=="boolean")n[i].value=s;else if(n[i].type==="name"&&A(n[i].valueSet,s))n[i].value=s;else if(n[i].type==="integer"&&Number.isInteger(s))n[i].value=s;else if(n[i].type==="array"){for(u=0;u<s.length;u+=1)if(r=!0,s[u].length===1&&typeof s[u][0]=="number")c.push(String(s[u]-1));else if(s[u].length>1){for(d=0;d<s[u].length;d+=1)typeof s[u][d]!="number"&&(r=!1);r===!0&&c.push([s[u][0]-1,s[u][1]-1].join(" "))}n[i].value="["+c.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,m=[];for(p in n)n[p].explicitSet===!0&&(n[p].type==="name"?m.push("/"+p+" /"+n[p].value):m.push("/"+p+" "+n[p].value));m.length!==0&&this.internal.write(`/ViewerPreferences
<<
`+m.join(`
`)+`
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},Ot.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??"http://jspdf.default.namespaceuri/",rawXml:typeof t=="boolean"&&t},this.internal.events.subscribe("putCatalog",w_t),this.internal.events.subscribe("postPutResources",x_t)),this},function(e){var t=e.API,n=t.pdfEscape16=function(s,a){for(var o,c=a.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],h=0,A=s.length;h<A;++h){if(o=a.metadata.characterToGlyph(s.charCodeAt(h)),a.metadata.glyIdsUsed.push(o),a.metadata.toUnicode[o]=s.charCodeAt(h),c.indexOf(o)==-1&&(c.push(o),c.push([parseInt(a.metadata.widthOfGlyph(o),10)])),o=="0")return d.join("");o=o.toString(16),d.push(u[4-o.length],o)}return d.join("")},r=function(s){var a,o,c,u,d,h,A;for(d=`/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo <<
  /Registry (Adobe)
  /Ordering (UCS)
  /Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000><ffff>
endcodespacerange`,c=[],h=0,A=(o=Object.keys(s).sort(function(f,p){return f-p})).length;h<A;h++)a=o[h],c.length>=100&&(d+=`
`+c.length+` beginbfchar
`+c.join(`
`)+`
endbfchar`,c=[]),s[a]!==void 0&&s[a]!==null&&typeof s[a].toString=="function"&&(u=("0000"+s[a].toString(16)).slice(-4),a=("0000"+(+a).toString(16)).slice(-4),c.push("<"+a+"><"+u+">"));return c.length&&(d+=`
`+c.length+` beginbfchar
`+c.join(`
`)+`
endbfchar
`),d+`endcmap
CMapName currentdict /CMap defineresource pop
end
end`};t.events.push(["putFont",function(s){(function(a){var o=a.font,c=a.out,u=a.newObject,d=a.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="Identity-H"){for(var h=o.metadata.Unicode.widths,A=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),f="",p=0;p<A.length;p++)f+=String.fromCharCode(A[p]);var m=u();d({data:f,addLength1:!0,objectId:m}),c("endobj");var g=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:g}),c("endobj");var y=u();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+Dg(o.fontName)),c("/FontFile2 "+m+" 0 R"),c("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),c("/Flags "+o.metadata.flags),c("/StemV "+o.metadata.stemV),c("/ItalicAngle "+o.metadata.italicAngle),c("/Ascent "+o.metadata.ascender),c("/Descent "+o.metadata.decender),c("/CapHeight "+o.metadata.capHeight),c(">>"),c("endobj");var v=u();c("<<"),c("/Type /Font"),c("/BaseFont /"+Dg(o.fontName)),c("/FontDescriptor "+y+" 0 R"),c("/W "+e.API.PDFObject.convert(h)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+o.encoding+")"),c(">>"),c(">>"),c("endobj"),o.objectNumber=u(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+g+" 0 R"),c("/BaseFont /"+Dg(o.fontName)),c("/Encoding /"+o.encoding),c("/DescendantFonts ["+v+" 0 R]"),c(">>"),c("endobj"),o.isAlreadyPutted=!0}})(s)}]),t.events.push(["putFont",function(s){(function(a){var o=a.font,c=a.out,u=a.newObject,d=a.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var h=o.metadata.rawData,A="",f=0;f<h.length;f++)A+=String.fromCharCode(h[f]);var p=u();d({data:A,addLength1:!0,objectId:p}),c("endobj");var m=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:m}),c("endobj");var g=u();c("<<"),c("/Descent "+o.metadata.decender),c("/CapHeight "+o.metadata.capHeight),c("/StemV "+o.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+p+" 0 R"),c("/Flags 96"),c("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),c("/FontName /"+Dg(o.fontName)),c("/ItalicAngle "+o.metadata.italicAngle),c("/Ascent "+o.metadata.ascender),c(">>"),c("endobj"),o.objectNumber=u();for(var y=0;y<o.metadata.hmtx.widths.length;y++)o.metadata.hmtx.widths[y]=parseInt(o.metadata.hmtx.widths[y]*(1e3/o.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+m+" 0 R/BaseFont/"+Dg(o.fontName)+"/FontDescriptor "+g+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),c("endobj"),o.isAlreadyPutted=!0}})(s)}]);var i=function(s){var a,o=s.text||"",c=s.x,u=s.y,d=s.options||{},h=s.mutex||{},A=h.pdfEscape,f=h.activeFontKey,p=h.fonts,m=f,g="",y=0,v="",x=p[m].encoding;if(p[m].encoding!=="Identity-H")return{text:o,x:c,y:u,options:d,mutex:h};for(v=o,m=f,Array.isArray(o)&&(v=o[0]),y=0;y<v.length;y+=1)p[m].metadata.hasOwnProperty("cmap")&&(a=p[m].metadata.cmap.unicode.codeMap[v[y].charCodeAt(0)]),a||v[y].charCodeAt(0)<256&&p[m].metadata.hasOwnProperty("Unicode")?g+=v[y]:g+="";var b="";return parseInt(m.slice(1))<14||x==="WinAnsiEncoding"?b=A(g,m).split("").map(function(w){return w.charCodeAt(0).toString(16)}).join(""):x==="Identity-H"&&(b=n(g,p[m])),h.isHex=!0,{text:b,x:c,y:u,options:d,mutex:h}};t.events.push(["postProcessText",function(s){var a=s.text||"",o=[],c={text:a,x:s.x,y:s.y,options:s.options,mutex:s.mutex};if(Array.isArray(a)){var u=0;for(u=0;u<a.length;u+=1)Array.isArray(a[u])&&a[u].length===3?o.push([i(Object.assign({},c,{text:a[u][0]})).text,a[u][1],a[u][2]]):o.push(i(Object.assign({},c,{text:a[u]})).text);s.text=o}else s.text=i(Object.assign({},c,{text:a})).text}])}(Ot),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0},e.addFileToVFS=function(n,r){return t.call(this),this.internal.vFS[n]=r,this},e.getFileFromVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}}(Ot.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(r){var i,s,a,o,c,u,d,h=t,A=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],p={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},m={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},g=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],y=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),v=!1,x=0;this.__bidiEngine__={};var b=function(T){var N=T.charCodeAt(),F=N>>8,L=m[F];return L!==void 0?h[256*L+(255&N)]:F===252||F===253?"AL":y.test(F)?"L":F===8?"R":"N"},w=function(T){for(var N,F=0;F<T.length;F++){if((N=b(T.charAt(F)))==="L")return!1;if(N==="R")return!0}return!1},k=function(T,N,F,L){var U,H,W,$,z=N[L];switch(z){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":v=!1;break;case"N":case"AN":break;case"EN":v&&(z="AN");break;case"AL":v=!0,z="R";break;case"WS":case"BN":z="N";break;case"CS":L<1||L+1>=N.length||(U=F[L-1])!=="EN"&&U!=="AN"||(H=N[L+1])!=="EN"&&H!=="AN"?z="N":v&&(H="AN"),z=H===U?H:"N";break;case"ES":z=(U=L>0?F[L-1]:"B")==="EN"&&L+1<N.length&&N[L+1]==="EN"?"EN":"N";break;case"ET":if(L>0&&F[L-1]==="EN"){z="EN";break}if(v){z="N";break}for(W=L+1,$=N.length;W<$&&N[W]==="ET";)W++;z=W<$&&N[W]==="EN"?"EN":"N";break;case"NSM":if(a&&!o){for($=N.length,W=L+1;W<$&&N[W]==="NSM";)W++;if(W<$){var Q=T[L],ce=Q>=1425&&Q<=2303||Q===64286;if(U=N[W],ce&&(U==="R"||U==="AL")){z="R";break}}}z=L<1||(U=N[L-1])==="B"?"N":F[L-1];break;case"B":v=!1,i=!0,z=x;break;case"S":s=!0,z="N"}return z},j=function(T,N,F){var L=T.split("");return F&&B(L,F,{hiLevel:x}),L.reverse(),N&&N.reverse(),L.join("")},B=function(T,N,F){var L,U,H,W,$,z=-1,Q=T.length,ce=0,R=[],M=x?f:A,Y=[];for(v=!1,i=!1,s=!1,U=0;U<Q;U++)Y[U]=b(T[U]);for(H=0;H<Q;H++){if($=ce,R[H]=k(T,Y,R,H),L=240&(ce=M[$][p[R[H]]]),ce&=15,N[H]=W=M[ce][5],L>0)if(L===16){for(U=z;U<H;U++)N[U]=1;z=-1}else z=-1;if(M[ce][6])z===-1&&(z=H);else if(z>-1){for(U=z;U<H;U++)N[U]=W;z=-1}Y[H]==="B"&&(N[H]=0),F.hiLevel|=W}s&&function(X,V,Z){for(var de=0;de<Z;de++)if(X[de]==="S"){V[de]=x;for(var ue=de-1;ue>=0&&X[ue]==="WS";ue--)V[ue]=x}}(Y,N,Q)},E=function(T,N,F,L,U){if(!(U.hiLevel<T)){if(T===1&&x===1&&!i)return N.reverse(),void(F&&F.reverse());for(var H,W,$,z,Q=N.length,ce=0;ce<Q;){if(L[ce]>=T){for($=ce+1;$<Q&&L[$]>=T;)$++;for(z=ce,W=$-1;z<W;z++,W--)H=N[z],N[z]=N[W],N[W]=H,F&&(H=F[z],F[z]=F[W],F[W]=H);ce=$}ce++}}},P=function(T,N,F){var L=T.split(""),U={hiLevel:x};return F||(F=[]),B(L,F,U),function(H,W,$){if($.hiLevel!==0&&d)for(var z,Q=0;Q<H.length;Q++)W[Q]===1&&(z=g.indexOf(H[Q]))>=0&&(H[Q]=g[z+1])}(L,F,U),E(2,L,N,F,U),E(1,L,N,F,U),L.join("")};return this.__bidiEngine__.doBidiReorder=function(T,N,F){if(function(U,H){if(H)for(var W=0;W<U.length;W++)H[W]=W;o===void 0&&(o=w(U)),u===void 0&&(u=w(U))}(T,N),a||!c||u)if(a&&c&&o^u)x=o?1:0,T=j(T,N,F);else if(!a&&c&&u)x=o?1:0,T=P(T,N,F),T=j(T,N);else if(!a||o||c||u){if(a&&!c&&o^u)T=j(T,N),o?(x=0,T=P(T,N,F)):(x=1,T=P(T,N,F),T=j(T,N));else if(a&&o&&!c&&u)x=1,T=P(T,N,F),T=j(T,N);else if(!a&&!c&&o^u){var L=d;o?(x=1,T=P(T,N,F),x=0,d=!1,T=P(T,N,F),d=L):(x=0,T=P(T,N,F),T=j(T,N),x=1,d=!1,T=P(T,N,F),d=L,T=j(T,N))}}else x=0,T=P(T,N,F);else x=o?1:0,T=P(T,N,F);return T},this.__bidiEngine__.setOptions=function(T){T&&(a=T.isInputVisual,c=T.isOutputVisual,o=T.isInputRtl,u=T.isOutputRtl,d=T.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(r){var i=r.text;r.x,r.y;var s=r.options||{};r.mutex,s.lang;var a=[];if(s.isInputVisual=typeof s.isInputVisual!="boolean"||s.isInputVisual,n.setOptions(s),Object.prototype.toString.call(i)==="[object Array]"){var o=0;for(a=[],o=0;o<i.length;o+=1)Object.prototype.toString.call(i[o])==="[object Array]"?a.push([n.doBidiReorder(i[o][0]),i[o][1],i[o][2]]):a.push([n.doBidiReorder(i[o])]);r.text=a}else r.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])}(Ot),Ot.API.TTFFont=function(){function e(t){var n;if(this.rawData=t,n=this.contents=new Lf(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new M_t(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new b_t(this.contents),this.head=new S_t(this),this.name=new N_t(this),this.cmap=new Eve(this),this.toUnicode={},this.hhea=new k_t(this),this.maxp=new E_t(this),this.hmtx=new T_t(this),this.post=new j_t(this),this.os2=new __t(this),this.loca=new F_t(this),this.glyf=new I_t(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,n,r,i,s;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var a,o,c,u;for(u=[],a=0,o=(c=this.bbox).length;a<o;a++)t=c[a],u.push(Math.round(t*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),32768&(n=i>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var n;return((n=this.cmap.unicode)!=null?n.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},e.prototype.widthOfString=function(t,n,r){var i,s,a,o;for(a=0,s=0,o=(t=""+t).length;0<=o?s<o:s>o;s=0<=o?++s:--s)i=t.charCodeAt(s),a+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/n)||0;return a*(n/1e3)},e.prototype.lineHeight=function(t,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*t},e}();var Ic,Lf=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var n,r;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},e.prototype.writeString=function(t){var n,r,i;for(i=[],n=0,r=t.length;0<=r?n<r:n>r;n=0<=r?++n:--n)i.push(this.writeByte(t.charCodeAt(n)));return i},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,n,r,i,s,a,o,c;return t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),o=this.readByte(),c=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^s)+65536*(255^a)+256*(255^o)+(255^c)+1):72057594037927940*t+281474976710656*n+1099511627776*r+4294967296*i+16777216*s+65536*a+256*o+c},e.prototype.writeLongLong=function(t){var n,r;return n=Math.floor(t/4294967296),r=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var n,r;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n.push(this.readByte());return n},e.prototype.write=function(t){var n,r,i,s;for(s=[],r=0,i=t.length;r<i;r++)n=t[r],s.push(this.writeByte(n));return s},e}(),b_t=function(){var e;function t(n){var r,i,s;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},i=0,s=this.tableCount;0<=s?i<s:i>s;i=0<=s?++i:--i)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return t.prototype.encode=function(n){var r,i,s,a,o,c,u,d,h,A,f,p,m;for(m in f=Object.keys(n).length,c=Math.log(2),h=16*Math.floor(Math.log(f)/c),a=Math.floor(h/c),d=16*f-h,(i=new Lf).writeInt(this.scalarType),i.writeShort(f),i.writeShort(h),i.writeShort(a),i.writeShort(d),s=16*f,u=i.pos+s,o=null,p=[],n)for(A=n[m],i.writeString(m),i.writeInt(e(A)),i.writeInt(u),i.writeInt(A.length),p=p.concat(A),m==="head"&&(o=u),u+=A.length;u%4;)p.push(0),u++;return i.write(p),r=2981146554-e(i.data),i.pos=o+8,i.writeUInt32(r),i.data},e=function(n){var r,i,s,a;for(n=Tve.call(n);n.length%4;)n.push(0);for(s=new Lf(n),i=0,r=0,a=n.length;r<a;r=r+=4)i+=s.readUInt32();return 4294967295&i},t}(),C_t={}.hasOwnProperty,Su=function(e,t){for(var n in t)C_t.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};Ic=function(){function e(t){var n;this.file=t,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var S_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var n;return(n=new Lf).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},e}(),gZ=function(){function e(t,n){var r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),h=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(c=0;c<256;++c)this.codeMap[c]=t.readByte();break;case 4:for(f=t.readUInt16(),A=f/2,t.pos+=6,s=function(){var b,w;for(w=[],c=b=0;0<=A?b<A:b>A;c=0<=A?++b:--b)w.push(t.readUInt16());return w}(),t.pos+=2,m=function(){var b,w;for(w=[],c=b=0;0<=A?b<A:b>A;c=0<=A?++b:--b)w.push(t.readUInt16());return w}(),u=function(){var b,w;for(w=[],c=b=0;0<=A?b<A:b>A;c=0<=A?++b:--b)w.push(t.readUInt16());return w}(),d=function(){var b,w;for(w=[],c=b=0;0<=A?b<A:b>A;c=0<=A?++b:--b)w.push(t.readUInt16());return w}(),i=(this.length-t.pos+this.offset)/2,o=function(){var b,w;for(w=[],c=b=0;0<=i?b<i:b>i;c=0<=i?++b:--b)w.push(t.readUInt16());return w}(),c=y=0,x=s.length;y<x;c=++y)for(g=s[c],r=v=p=m[c];p<=g?v<=g:v>=g;r=p<=g?++v:--v)d[c]===0?a=r+u[c]:(a=o[d[c]/2+(r-p)-(A-c)]||0)!==0&&(a+=u[c]),this.codeMap[r]=65535&a}t.pos=h}return e.encode=function(t,n){var r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,b,w,k,j,B,E,P,T,N,F,L,U,H,W,$,z,Q,ce,R,M,Y,X,V,Z,de,ue,se,he,ie;switch(L=new Lf,a=Object.keys(t).sort(function(Ce,Ie){return Ce-Ie}),n){case"macroman":for(m=0,g=function(){var Ce=[];for(p=0;p<256;++p)Ce.push(0);return Ce}(),v={0:0},s={},U=0,z=a.length;U<z;U++)v[ue=t[i=a[U]]]==null&&(v[ue]=++m),s[i]={old:t[i],new:v[t[i]]},g[i]=v[t[i]];return L.writeUInt16(1),L.writeUInt16(0),L.writeUInt32(12),L.writeUInt16(0),L.writeUInt16(262),L.writeUInt16(0),L.write(g),{charMap:s,subtable:L.data,maxGlyphID:m+1};case"unicode":for(N=[],h=[],x=0,v={},r={},y=u=null,H=0,Q=a.length;H<Q;H++)v[w=t[i=a[H]]]==null&&(v[w]=++x),r[i]={old:w,new:v[w]},o=v[w]-i,y!=null&&o===u||(y&&h.push(y),N.push(i),u=o),y=i;for(y&&h.push(y),h.push(65535),N.push(65535),P=2*(E=N.length),B=2*Math.pow(Math.log(E)/Math.LN2,2),A=Math.log(B/2)/Math.LN2,j=2*E-B,c=[],k=[],f=[],p=W=0,ce=N.length;W<ce;p=++W){if(T=N[p],d=h[p],T===65535){c.push(0),k.push(0);break}if(T-(F=r[T].new)>=32768)for(c.push(0),k.push(2*(f.length+E-p)),i=$=T;T<=d?$<=d:$>=d;i=T<=d?++$:--$)f.push(r[i].new);else c.push(F-T),k.push(0)}for(L.writeUInt16(3),L.writeUInt16(1),L.writeUInt32(12),L.writeUInt16(4),L.writeUInt16(16+8*E+2*f.length),L.writeUInt16(0),L.writeUInt16(P),L.writeUInt16(B),L.writeUInt16(A),L.writeUInt16(j),Z=0,R=h.length;Z<R;Z++)i=h[Z],L.writeUInt16(i);for(L.writeUInt16(0),de=0,M=N.length;de<M;de++)i=N[de],L.writeUInt16(i);for(se=0,Y=c.length;se<Y;se++)o=c[se],L.writeUInt16(o);for(he=0,X=k.length;he<X;he++)b=k[he],L.writeUInt16(b);for(ie=0,V=f.length;ie<V;ie++)m=f[ie],L.writeUInt16(m);return{charMap:r,subtable:L.data,maxGlyphID:x+1}}},e}(),Eve=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="cmap",e.prototype.parse=function(t){var n,r,i;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)n=new gZ(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},e.encode=function(t,n){var r,i;return n==null&&(n="macroman"),r=gZ.encode(t,n),(i=new Lf).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},e}(),k_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(),__t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="OS/2",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,r;for(r=[],n=0;n<10;++n)r.push(t.readByte());return r}(),this.charRange=function(){var n,r;for(r=[],n=0;n<4;++n)r.push(t.readInt());return r}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,r;for(r=[],n=0;n<2;n=++n)r.push(t.readInt());return r}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e}(),j_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="post",e.prototype.parse=function(t){var n,r,i;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var s;for(r=t.readUInt16(),this.glyphNameIndex=[],s=0;0<=r?s<r:s>r;s=0<=r?++s:--s)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],i=[];t.pos<this.offset+this.length;)n=t.readByte(),i.push(this.names.push(t.readString(n)));return i;case 151552:return r=t.readUInt16(),this.offsets=t.read(r);case 262144:return this.map=(function(){var a,o,c;for(c=[],s=a=0,o=this.file.maxp.numGlyphs;0<=o?a<o:a>o;s=0<=o?++a:--a)c.push(t.readUInt32());return c}).call(this)}},e}(),B_t=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},N_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="name",e.prototype.parse=function(t){var n,r,i,s,a,o,c,u,d,h,A;for(t.pos=this.offset,t.readShort(),n=t.readShort(),o=t.readShort(),r=[],s=0;0<=n?s<n:s>n;s=0<=n?++s:--s)r.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(c={},s=d=0,h=r.length;d<h;s=++d)i=r[s],t.pos=i.offset,u=t.readString(i.length),a=new B_t(u,i),c[A=i.nameID]==null&&(c[A]=[]),c[i.nameID].push(a);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},e}(),E_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e}(),T_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="hmtx",e.prototype.parse=function(t){var n,r,i,s,a,o,c;for(t.pos=this.offset,this.metrics=[],n=0,o=this.file.hhea.numberOfMetrics;0<=o?n<o:n>o;n=0<=o?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var u,d;for(d=[],n=u=0;0<=i?u<i:u>i;n=0<=i?++u:--u)d.push(t.readInt16());return d}(),this.widths=(function(){var u,d,h,A;for(A=[],u=0,d=(h=this.metrics).length;u<d;u++)s=h[u],A.push(s.advance);return A}).call(this),r=this.widths[this.widths.length-1],c=[],n=a=0;0<=i?a<i:a>i;n=0<=i?++a:--a)c.push(this.widths.push(r));return c},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(),Tve=[].slice,I_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var n,r,i,s,a,o,c,u,d,h;return t in this.cache?this.cache[t]:(s=this.file.loca,n=this.file.contents,r=s.indexOf(t),(i=s.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+r,a=(o=new Lf(n.read(i))).readShort(),u=o.readShort(),h=o.readShort(),c=o.readShort(),d=o.readShort(),this.cache[t]=a===-1?new O_t(o,u,h,c,d):new P_t(o,a,u,h,c,d),this.cache[t]))},e.prototype.encode=function(t,n,r){var i,s,a,o,c;for(a=[],s=[],o=0,c=n.length;o<c;o++)i=t[n[o]],s.push(a.length),i&&(a=a.concat(i.encode(r)));return s.push(a.length),{table:a,offsets:s}},e}(),P_t=function(){function e(t,n,r,i,s,a){this.raw=t,this.numberOfContours=n,this.xMin=r,this.yMin=i,this.xMax=s,this.yMax=a,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),O_t=function(){function e(t,n,r,i,s){var a,o;for(this.raw=t,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=s,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;o=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&o;)a.pos+=1&o?4:2,128&o?a.pos+=8:64&o?a.pos+=4:8&o&&(a.pos+=2)}return e.prototype.encode=function(){var t,n,r;for(n=new Lf(Tve.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)n.pos=this.glyphOffsets[t];return n.data},e}(),F_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Su(e,Ic),e.prototype.tag="loca",e.prototype.parse=function(t){var n,r;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=2)s.push(2*t.readUInt16());return s}).call(this):(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=4)s.push(t.readUInt32());return s}).call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,n){for(var r=new Uint32Array(this.offsets.length),i=0,s=0,a=0;a<r.length;++a)if(r[a]=i,s<n.length&&n[s]==a){++s,r[a]=i;var o=this.offsets[a],c=this.offsets[a+1]-o;c>0&&(i+=c)}for(var u=new Array(4*r.length),d=0;d<r.length;++d)u[4*d+3]=255&r[d],u[4*d+2]=(65280&r[d])>>8,u[4*d+1]=(16711680&r[d])>>16,u[4*d]=(4278190080&r[d])>>24;return u},e}(),M_t=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,n,r,i,s;for(n in i=this.font.cmap.tables[0].codeMap,t={},s=this.subset)r=s[n],t[n]=i[r];return t},e.prototype.glyphsFor=function(t){var n,r,i,s,a,o,c;for(i={},a=0,o=t.length;a<o;a++)i[s=t[a]]=this.font.glyf.glyphFor(s);for(s in n=[],i)(r=i[s])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(s in c=this.glyphsFor(n))r=c[s],i[s]=r;return i},e.prototype.encode=function(t,n){var r,i,s,a,o,c,u,d,h,A,f,p,m,g,y;for(i in r=Eve.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(t),f={0:0},y=r.charMap)f[(c=y[i]).old]=c.new;for(p in A=r.maxGlyphID,a)p in f||(f[p]=A++);return d=function(v){var x,b;for(x in b={},v)b[v[x]]=x;return b}(f),h=Object.keys(d).sort(function(v,x){return v-x}),m=function(){var v,x,b;for(b=[],v=0,x=h.length;v<x;v++)o=h[v],b.push(d[o]);return b}(),s=this.font.glyf.encode(a,m,f),u=this.font.loca.encode(s.offsets,m),g={cmap:this.font.cmap.raw(),glyf:s.table,loca:u,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(g["OS/2"]=this.font.os2.raw()),this.font.directory.encode(g)},e}();Ot.API.PDFObject=function(){var e;function t(){}return e=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},t.convert=function(n){var r,i,s,a;if(Array.isArray(n))return"["+function(){var o,c,u;for(u=[],o=0,c=n.length;o<c;o++)r=n[o],u.push(t.convert(r));return u}().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n!=null&&n.isString)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(i in s=["<<"],n)a=n[i],s.push("/"+i+" "+t.convert(a));return s.push(">>"),s.join(`
`)}return""+n},t}();/*!
 * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var PR=function(e,t){return PR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},PR(e,t)};function Pc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");PR(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var OR=function(){return OR=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},OR.apply(this,arguments)};function ya(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?s(d.value):i(d.value).then(o,c)}u((r=r.apply(e,[])).next())})}function Ws(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function hk(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||t)}var Ed=function(){function e(t,n,r,i){this.left=t,this.top=n,this.width=r,this.height=i}return e.prototype.add=function(t,n,r,i){return new e(this.left+t,this.top+n,this.width+r,this.height+i)},e.fromClientRect=function(t,n){return new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height)},e.fromDOMRectList=function(t,n){var r=Array.from(n).find(function(i){return i.width!==0});return r?new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),pT=function(e,t){return Ed.fromClientRect(e,t.getBoundingClientRect())},L_t=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw new Error("Unable to get document size");var r=Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),i=Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight));return new Ed(0,0,r,i)},mT=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var s=e.charCodeAt(n++);(s&64512)===56320?t.push(((i&1023)<<10)+(s&1023)+65536):(t.push(i),n--)}else t.push(i)}return t},yi=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var r=[],i=-1,s="";++i<n;){var a=e[i];a<=65535?r.push(a):(a-=65536,r.push((a>>10)+55296,a%1024+56320)),(i+1===n||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},yZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",R_t=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var fk=0;fk<yZ.length;fk++)R_t[yZ.charCodeAt(fk)]=fk;var vZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Ak=0;Ak<vZ.length;Ak++)fw[vZ.charCodeAt(Ak)]=Ak;var D_t=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,o,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),d=Array.isArray(u)?u:new Uint8Array(u);for(r=0;r<n;r+=4)s=fw[e.charCodeAt(r)],a=fw[e.charCodeAt(r+1)],o=fw[e.charCodeAt(r+2)],c=fw[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|c&63;return u},U_t=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},H_t=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},Lp=5,p$=11,pO=2,Q_t=p$-Lp,Ive=65536>>Lp,$_t=1<<Lp,mO=$_t-1,z_t=1024>>Lp,V_t=Ive+z_t,K_t=V_t,q_t=32,W_t=K_t+q_t,G_t=65536>>p$,Y_t=1<<Q_t,X_t=Y_t-1,xZ=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},J_t=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},Z_t=function(e,t){var n=D_t(e),r=Array.isArray(n)?H_t(n):new Uint32Array(n),i=Array.isArray(n)?U_t(n):new Uint16Array(n),s=24,a=xZ(i,s/2,r[4]/2),o=r[5]===2?xZ(i,(s+r[4])/2):J_t(r,Math.ceil((s+r[4])/4));return new ejt(r[0],r[1],r[2],r[3],a,o)},ejt=function(){function e(t,n,r,i,s,a){this.initialValue=t,this.errorValue=n,this.highStart=r,this.highValueIndex=i,this.index=s,this.data=a}return e.prototype.get=function(t){var n;if(t>=0){if(t<55296||t>56319&&t<=65535)return n=this.index[t>>Lp],n=(n<<pO)+(t&mO),this.data[n];if(t<=65535)return n=this.index[Ive+(t-55296>>Lp)],n=(n<<pO)+(t&mO),this.data[n];if(t<this.highStart)return n=W_t-G_t+(t>>p$),n=this.index[n],n+=t>>Lp&X_t,n=this.index[n],n=(n<<pO)+(t&mO),this.data[n];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),wZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tjt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var pk=0;pk<wZ.length;pk++)tjt[wZ.charCodeAt(pk)]=pk;var njt="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",bZ=50,rjt=1,Pve=2,Ove=3,ijt=4,sjt=5,CZ=7,Fve=8,SZ=9,Zh=10,FR=11,kZ=12,MR=13,ajt=14,Aw=15,LR=16,mk=17,Vx=18,ojt=19,_Z=20,RR=21,Kx=22,gO=23,kg=24,_o=25,pw=26,mw=27,_g=28,ljt=29,WA=30,cjt=31,gk=32,yk=33,DR=34,UR=35,HR=36,s2=37,QR=38,j_=39,B_=40,yO=41,Mve=42,ujt=43,djt=[9001,65288],Lve="!",kn="×",vk="÷",$R=Z_t(njt),Ku=[WA,HR],zR=[rjt,Pve,Ove,sjt],Rve=[Zh,Fve],jZ=[mw,pw],hjt=zR.concat(Rve),BZ=[QR,j_,B_,DR,UR],fjt=[Aw,MR],Ajt=function(e,t){t===void 0&&(t="strict");var n=[],r=[],i=[];return e.forEach(function(s,a){var o=$R.get(s);if(o>bZ?(i.push(!0),o-=bZ):i.push(!1),["normal","auto","loose"].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return r.push(a),n.push(LR);if(o===ijt||o===FR){if(a===0)return r.push(a),n.push(WA);var c=n[a-1];return hjt.indexOf(c)===-1?(r.push(r[a-1]),n.push(c)):(r.push(a),n.push(WA))}if(r.push(a),o===cjt)return n.push(t==="strict"?RR:s2);if(o===Mve||o===ljt)return n.push(WA);if(o===ujt)return s>=131072&&s<=196605||s>=196608&&s<=262141?n.push(s2):n.push(WA);n.push(o)}),[r,n,i]},vO=function(e,t,n,r){var i=r[n];if(Array.isArray(e)?e.indexOf(i)!==-1:e===i)for(var s=n;s<=r.length;){s++;var a=r[s];if(a===t)return!0;if(a!==Zh)break}if(i===Zh)for(var s=n;s>0;){s--;var o=r[s];if(Array.isArray(e)?e.indexOf(o)!==-1:e===o)for(var c=n;c<=r.length;){c++;var a=r[c];if(a===t)return!0;if(a!==Zh)break}if(o!==Zh)break}return!1},NZ=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r===Zh)n--;else return r}return 0},pjt=function(e,t,n,r,i){if(n[r]===0)return kn;var s=r-1;if(Array.isArray(i)&&i[s]===!0)return kn;var a=s-1,o=s+1,c=t[s],u=a>=0?t[a]:0,d=t[o];if(c===Pve&&d===Ove)return kn;if(zR.indexOf(c)!==-1)return Lve;if(zR.indexOf(d)!==-1||Rve.indexOf(d)!==-1)return kn;if(NZ(s,t)===Fve)return vk;if($R.get(e[s])===FR||(c===gk||c===yk)&&$R.get(e[o])===FR||c===CZ||d===CZ||c===SZ||[Zh,MR,Aw].indexOf(c)===-1&&d===SZ||[mk,Vx,ojt,kg,_g].indexOf(d)!==-1||NZ(s,t)===Kx||vO(gO,Kx,s,t)||vO([mk,Vx],RR,s,t)||vO(kZ,kZ,s,t))return kn;if(c===Zh)return vk;if(c===gO||d===gO)return kn;if(d===LR||c===LR)return vk;if([MR,Aw,RR].indexOf(d)!==-1||c===ajt||u===HR&&fjt.indexOf(c)!==-1||c===_g&&d===HR||d===_Z||Ku.indexOf(d)!==-1&&c===_o||Ku.indexOf(c)!==-1&&d===_o||c===mw&&[s2,gk,yk].indexOf(d)!==-1||[s2,gk,yk].indexOf(c)!==-1&&d===pw||Ku.indexOf(c)!==-1&&jZ.indexOf(d)!==-1||jZ.indexOf(c)!==-1&&Ku.indexOf(d)!==-1||[mw,pw].indexOf(c)!==-1&&(d===_o||[Kx,Aw].indexOf(d)!==-1&&t[o+1]===_o)||[Kx,Aw].indexOf(c)!==-1&&d===_o||c===_o&&[_o,_g,kg].indexOf(d)!==-1)return kn;if([_o,_g,kg,mk,Vx].indexOf(d)!==-1)for(var h=s;h>=0;){var A=t[h];if(A===_o)return kn;if([_g,kg].indexOf(A)!==-1)h--;else break}if([mw,pw].indexOf(d)!==-1)for(var h=[mk,Vx].indexOf(c)!==-1?a:s;h>=0;){var A=t[h];if(A===_o)return kn;if([_g,kg].indexOf(A)!==-1)h--;else break}if(QR===c&&[QR,j_,DR,UR].indexOf(d)!==-1||[j_,DR].indexOf(c)!==-1&&[j_,B_].indexOf(d)!==-1||[B_,UR].indexOf(c)!==-1&&d===B_||BZ.indexOf(c)!==-1&&[_Z,pw].indexOf(d)!==-1||BZ.indexOf(d)!==-1&&c===mw||Ku.indexOf(c)!==-1&&Ku.indexOf(d)!==-1||c===kg&&Ku.indexOf(d)!==-1||Ku.concat(_o).indexOf(c)!==-1&&d===Kx&&djt.indexOf(e[o])===-1||Ku.concat(_o).indexOf(d)!==-1&&c===Vx)return kn;if(c===yO&&d===yO){for(var f=n[s],p=1;f>0&&(f--,t[f]===yO);)p++;if(p%2!==0)return kn}return c===gk&&d===yk?kn:vk},mjt=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=Ajt(e,t.lineBreak),r=n[0],i=n[1],s=n[2];(t.wordBreak==="break-all"||t.wordBreak==="break-word")&&(i=i.map(function(o){return[_o,WA,Mve].indexOf(o)!==-1?s2:o}));var a=t.wordBreak==="keep-all"?s.map(function(o,c){return o&&e[c]>=19968&&e[c]<=40959}):void 0;return[r,i,a]},gjt=function(){function e(t,n,r,i){this.codePoints=t,this.required=n===Lve,this.start=r,this.end=i}return e.prototype.slice=function(){return yi.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),yjt=function(e,t){var n=mT(e),r=mjt(n,t),i=r[0],s=r[1],a=r[2],o=n.length,c=0,u=0;return{next:function(){if(u>=o)return{done:!0,value:null};for(var d=kn;u<o&&(d=pjt(n,s,i,++u,a))===kn;);if(d!==kn||u===o){var h=new gjt(n,d,c,u);return c=u,{value:h,done:!1}}return{done:!0,value:null}}}},vjt=1,xjt=2,nC=4,EZ=8,ON=10,TZ=47,cb=92,wjt=9,bjt=32,xk=34,qx=61,Cjt=35,Sjt=36,kjt=37,wk=39,bk=40,Wx=41,_jt=95,za=45,jjt=33,Bjt=60,Njt=62,Ejt=64,Tjt=91,Ijt=93,Pjt=61,Ojt=123,Ck=63,Fjt=125,IZ=124,Mjt=126,Ljt=128,PZ=65533,xO=42,hp=43,Rjt=44,Djt=58,Ujt=59,a2=46,Hjt=0,Qjt=8,$jt=11,zjt=14,Vjt=31,Kjt=127,zc=-1,Dve=48,Uve=97,Hve=101,qjt=102,Wjt=117,Gjt=122,Qve=65,$ve=69,zve=70,Yjt=85,Xjt=90,Xs=function(e){return e>=Dve&&e<=57},Jjt=function(e){return e>=55296&&e<=57343},jg=function(e){return Xs(e)||e>=Qve&&e<=zve||e>=Uve&&e<=qjt},Zjt=function(e){return e>=Uve&&e<=Gjt},eBt=function(e){return e>=Qve&&e<=Xjt},tBt=function(e){return Zjt(e)||eBt(e)},nBt=function(e){return e>=Ljt},Sk=function(e){return e===ON||e===wjt||e===bjt},FN=function(e){return tBt(e)||nBt(e)||e===_jt},OZ=function(e){return FN(e)||Xs(e)||e===za},rBt=function(e){return e>=Hjt&&e<=Qjt||e===$jt||e>=zjt&&e<=Vjt||e===Kjt},Sh=function(e,t){return e!==cb?!1:t!==ON},kk=function(e,t,n){return e===za?FN(t)||Sh(t,n):FN(e)?!0:!!(e===cb&&Sh(e,t))},wO=function(e,t,n){return e===hp||e===za?Xs(t)?!0:t===a2&&Xs(n):Xs(e===a2?t:e)},iBt=function(e){var t=0,n=1;(e[t]===hp||e[t]===za)&&(e[t]===za&&(n=-1),t++);for(var r=[];Xs(e[t]);)r.push(e[t++]);var i=r.length?parseInt(yi.apply(void 0,r),10):0;e[t]===a2&&t++;for(var s=[];Xs(e[t]);)s.push(e[t++]);var a=s.length,o=a?parseInt(yi.apply(void 0,s),10):0;(e[t]===$ve||e[t]===Hve)&&t++;var c=1;(e[t]===hp||e[t]===za)&&(e[t]===za&&(c=-1),t++);for(var u=[];Xs(e[t]);)u.push(e[t++]);var d=u.length?parseInt(yi.apply(void 0,u),10):0;return n*(i+o*Math.pow(10,-a))*Math.pow(10,c*d)},sBt={type:2},aBt={type:3},oBt={type:4},lBt={type:13},cBt={type:8},uBt={type:21},dBt={type:9},hBt={type:10},fBt={type:11},ABt={type:12},pBt={type:14},_k={type:23},mBt={type:1},gBt={type:25},yBt={type:24},vBt={type:26},xBt={type:27},wBt={type:28},bBt={type:29},CBt={type:31},VR={type:32},Vve=function(){function e(){this._value=[]}return e.prototype.write=function(t){this._value=this._value.concat(mT(t))},e.prototype.read=function(){for(var t=[],n=this.consumeToken();n!==VR;)t.push(n),n=this.consumeToken();return t},e.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case xk:return this.consumeStringToken(xk);case Cjt:var n=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(OZ(n)||Sh(r,i)){var s=kk(n,r,i)?xjt:vjt,a=this.consumeName();return{type:5,value:a,flags:s}}break;case Sjt:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),lBt;break;case wk:return this.consumeStringToken(wk);case bk:return sBt;case Wx:return aBt;case xO:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),pBt;break;case hp:if(wO(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case Rjt:return oBt;case za:var o=t,c=this.peekCodePoint(0),u=this.peekCodePoint(1);if(wO(o,c,u))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(kk(o,c,u))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(c===za&&u===Njt)return this.consumeCodePoint(),this.consumeCodePoint(),yBt;break;case a2:if(wO(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case TZ:if(this.peekCodePoint(0)===xO)for(this.consumeCodePoint();;){var d=this.consumeCodePoint();if(d===xO&&(d=this.consumeCodePoint(),d===TZ))return this.consumeToken();if(d===zc)return this.consumeToken()}break;case Djt:return vBt;case Ujt:return xBt;case Bjt:if(this.peekCodePoint(0)===jjt&&this.peekCodePoint(1)===za&&this.peekCodePoint(2)===za)return this.consumeCodePoint(),this.consumeCodePoint(),gBt;break;case Ejt:var h=this.peekCodePoint(0),A=this.peekCodePoint(1),f=this.peekCodePoint(2);if(kk(h,A,f)){var a=this.consumeName();return{type:7,value:a}}break;case Tjt:return wBt;case cb:if(Sh(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case Ijt:return bBt;case Pjt:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),cBt;break;case Ojt:return fBt;case Fjt:return ABt;case Wjt:case Yjt:var p=this.peekCodePoint(0),m=this.peekCodePoint(1);return p===hp&&(jg(m)||m===Ck)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case IZ:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),dBt;if(this.peekCodePoint(0)===IZ)return this.consumeCodePoint(),uBt;break;case Mjt:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),hBt;break;case zc:return VR}return Sk(t)?(this.consumeWhiteSpace(),CBt):Xs(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):FN(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:yi(t)}},e.prototype.consumeCodePoint=function(){var t=this._value.shift();return typeof t>"u"?-1:t},e.prototype.reconsumeCodePoint=function(t){this._value.unshift(t)},e.prototype.peekCodePoint=function(t){return t>=this._value.length?-1:this._value[t]},e.prototype.consumeUnicodeRangeToken=function(){for(var t=[],n=this.consumeCodePoint();jg(n)&&t.length<6;)t.push(n),n=this.consumeCodePoint();for(var r=!1;n===Ck&&t.length<6;)t.push(n),n=this.consumeCodePoint(),r=!0;if(r){var i=parseInt(yi.apply(void 0,t.map(function(c){return c===Ck?Dve:c})),16),s=parseInt(yi.apply(void 0,t.map(function(c){return c===Ck?zve:c})),16);return{type:30,start:i,end:s}}var a=parseInt(yi.apply(void 0,t),16);if(this.peekCodePoint(0)===za&&jg(this.peekCodePoint(1))){this.consumeCodePoint(),n=this.consumeCodePoint();for(var o=[];jg(n)&&o.length<6;)o.push(n),n=this.consumeCodePoint();var s=parseInt(yi.apply(void 0,o),16);return{type:30,start:a,end:s}}else return{type:30,start:a,end:a}},e.prototype.consumeIdentLikeToken=function(){var t=this.consumeName();return t.toLowerCase()==="url"&&this.peekCodePoint(0)===bk?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===bk?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},e.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===zc)return{type:22,value:""};var n=this.peekCodePoint(0);if(n===wk||n===xk){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===zc||this.peekCodePoint(0)===Wx)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),_k)}for(;;){var i=this.consumeCodePoint();if(i===zc||i===Wx)return{type:22,value:yi.apply(void 0,t)};if(Sk(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===zc||this.peekCodePoint(0)===Wx?(this.consumeCodePoint(),{type:22,value:yi.apply(void 0,t)}):(this.consumeBadUrlRemnants(),_k);if(i===xk||i===wk||i===bk||rBt(i))return this.consumeBadUrlRemnants(),_k;if(i===cb)if(Sh(i,this.peekCodePoint(0)))t.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),_k;else t.push(i)}},e.prototype.consumeWhiteSpace=function(){for(;Sk(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(t===Wx||t===zc)return;Sh(t,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(t){for(var n=5e4,r="";t>0;){var i=Math.min(n,t);r+=yi.apply(void 0,this._value.splice(0,i)),t-=i}return this._value.shift(),r},e.prototype.consumeStringToken=function(t){var n="",r=0;do{var i=this._value[r];if(i===zc||i===void 0||i===t)return n+=this.consumeStringSlice(r),{type:0,value:n};if(i===ON)return this._value.splice(0,r),mBt;if(i===cb){var s=this._value[r+1];s!==zc&&s!==void 0&&(s===ON?(n+=this.consumeStringSlice(r),r=-1,this._value.shift()):Sh(i,s)&&(n+=this.consumeStringSlice(r),n+=yi(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},e.prototype.consumeNumber=function(){var t=[],n=nC,r=this.peekCodePoint(0);for((r===hp||r===za)&&t.push(this.consumeCodePoint());Xs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(r===a2&&Xs(i))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),n=EZ;Xs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((r===$ve||r===Hve)&&((i===hp||i===za)&&Xs(s)||Xs(i)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),n=EZ;Xs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[iBt(t),n]},e.prototype.consumeNumericToken=function(){var t=this.consumeNumber(),n=t[0],r=t[1],i=this.peekCodePoint(0),s=this.peekCodePoint(1),a=this.peekCodePoint(2);if(kk(i,s,a)){var o=this.consumeName();return{type:15,number:n,flags:r,unit:o}}return i===kjt?(this.consumeCodePoint(),{type:16,number:n,flags:r}):{type:17,number:n,flags:r}},e.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(jg(t)){for(var n=yi(t);jg(this.peekCodePoint(0))&&n.length<6;)n+=yi(this.consumeCodePoint());Sk(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(n,16);return r===0||Jjt(r)||r>1114111?PZ:r}return t===zc?PZ:t},e.prototype.consumeName=function(){for(var t="";;){var n=this.consumeCodePoint();if(OZ(n))t+=yi(n);else if(Sh(n,this.peekCodePoint(0)))t+=yi(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(n),t}},e}(),Kve=function(){function e(t){this._tokens=t}return e.create=function(t){var n=new Vve;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var t=this.consumeToken();t.type===31;)t=this.consumeToken();if(t.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(t);var n=this.consumeComponentValue();do t=this.consumeToken();while(t.type===31);if(t.type===32)return n;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var t=[];;){var n=this.consumeComponentValue();if(n.type===32)return t;t.push(n),t.push()}},e.prototype.consumeComponentValue=function(){var t=this.consumeToken();switch(t.type){case 11:case 28:case 2:return this.consumeSimpleBlock(t.type);case 19:return this.consumeFunction(t)}return t},e.prototype.consumeSimpleBlock=function(t){for(var n={type:t,values:[]},r=this.consumeToken();;){if(r.type===32||kBt(r,t))return n;this.reconsumeToken(r),n.values.push(this.consumeComponentValue()),r=this.consumeToken()}},e.prototype.consumeFunction=function(t){for(var n={name:t.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return n;this.reconsumeToken(r),n.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var t=this._tokens.shift();return typeof t>"u"?VR:t},e.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},e}(),rC=function(e){return e.type===15},R0=function(e){return e.type===17},sr=function(e){return e.type===20},SBt=function(e){return e.type===0},KR=function(e,t){return sr(e)&&e.value===t},qve=function(e){return e.type!==31},Gv=function(e){return e.type!==31&&e.type!==4},ku=function(e){var t=[],n=[];return e.forEach(function(r){if(r.type===4){if(n.length===0)throw new Error("Error parsing function args, zero tokens for arg");t.push(n),n=[];return}r.type!==31&&n.push(r)}),n.length&&t.push(n),t},kBt=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Rf=function(e){return e.type===17||e.type===15},Oi=function(e){return e.type===16||Rf(e)},Wve=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},Is={type:17,number:0,flags:nC},m$={type:16,number:50,flags:nC},ef={type:16,number:100,flags:nC},gw=function(e,t,n){var r=e[0],i=e[1];return[Sr(r,t),Sr(typeof i<"u"?i:r,n)]},Sr=function(e,t){if(e.type===16)return e.number/100*t;if(rC(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},Gve="deg",Yve="grad",Xve="rad",Jve="turn",gT={name:"angle",parse:function(e,t){if(t.type===15)switch(t.unit){case Gve:return Math.PI*t.number/180;case Yve:return Math.PI/200*t.number;case Xve:return t.number;case Jve:return Math.PI*2*t.number}throw new Error("Unsupported angle type")}},Zve=function(e){return e.type===15&&(e.unit===Gve||e.unit===Yve||e.unit===Xve||e.unit===Jve)},e0e=function(e){var t=e.filter(sr).map(function(n){return n.value}).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Is,Is];case"to top":case"bottom":return xl(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Is,ef];case"to right":case"left":return xl(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ef,ef];case"to bottom":case"top":return xl(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ef,Is];case"to left":case"right":return xl(270)}return 0},xl=function(e){return Math.PI*e/180},kf={name:"color",parse:function(e,t){if(t.type===18){var n=_Bt[t.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return n(e,t.values)}if(t.type===5){if(t.value.length===3){var r=t.value.substring(0,1),i=t.value.substring(1,2),s=t.value.substring(2,3);return tf(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(t.value.length===4){var r=t.value.substring(0,1),i=t.value.substring(1,2),s=t.value.substring(2,3),a=t.value.substring(3,4);return tf(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(a+a,16)/255)}if(t.value.length===6){var r=t.value.substring(0,2),i=t.value.substring(2,4),s=t.value.substring(4,6);return tf(parseInt(r,16),parseInt(i,16),parseInt(s,16),1)}if(t.value.length===8){var r=t.value.substring(0,2),i=t.value.substring(2,4),s=t.value.substring(4,6),a=t.value.substring(6,8);return tf(parseInt(r,16),parseInt(i,16),parseInt(s,16),parseInt(a,16)/255)}}if(t.type===20){var o=md[t.value.toUpperCase()];if(typeof o<"u")return o}return md.TRANSPARENT}},_f=function(e){return(255&e)===0},rs=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+r+","+n+","+t/255+")":"rgb("+i+","+r+","+n+")"},tf=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(r*255)<<0)>>>0},FZ=function(e,t){if(e.type===17)return e.number;if(e.type===16){var n=t===3?1:255;return t===3?e.number/100*n:Math.round(e.number/100*n)}return 0},MZ=function(e,t){var n=t.filter(Gv);if(n.length===3){var r=n.map(FZ),i=r[0],s=r[1],a=r[2];return tf(i,s,a,1)}if(n.length===4){var o=n.map(FZ),i=o[0],s=o[1],a=o[2],c=o[3];return tf(i,s,a,c)}return 0};function bO(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<1/2?t:n<2/3?(t-e)*6*(2/3-n)+e:e}var LZ=function(e,t){var n=t.filter(Gv),r=n[0],i=n[1],s=n[2],a=n[3],o=(r.type===17?xl(r.number):gT.parse(e,r))/(Math.PI*2),c=Oi(i)?i.number/100:0,u=Oi(s)?s.number/100:0,d=typeof a<"u"&&Oi(a)?Sr(a,1):1;if(c===0)return tf(u*255,u*255,u*255,1);var h=u<=.5?u*(c+1):u+c-u*c,A=u*2-h,f=bO(A,h,o+1/3),p=bO(A,h,o),m=bO(A,h,o-1/3);return tf(f*255,p*255,m*255,d)},_Bt={hsl:LZ,hsla:LZ,rgb:MZ,rgba:MZ},ub=function(e,t){return kf.parse(e,Kve.create(t).parseComponentValue())},md={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},jBt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(n){if(sr(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},BBt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},yT=function(e,t){var n=kf.parse(e,t[0]),r=t[1];return r&&Oi(r)?{color:n,stop:r}:{color:n,stop:null}},RZ=function(e,t){var n=e[0],r=e[e.length-1];n.stop===null&&(n.stop=Is),r.stop===null&&(r.stop=ef);for(var i=[],s=0,a=0;a<e.length;a++){var o=e[a].stop;if(o!==null){var c=Sr(o,t);c>s?i.push(c):i.push(s),s=c}else i.push(null)}for(var u=null,a=0;a<i.length;a++){var d=i[a];if(d===null)u===null&&(u=a);else if(u!==null){for(var h=a-u,A=i[u-1],f=(d-A)/(h+1),p=1;p<=h;p++)i[u+p-1]=f*p;u=null}}return e.map(function(m,g){var y=m.color;return{color:y,stop:Math.max(Math.min(1,i[g]/t),0)}})},NBt=function(e,t,n){var r=t/2,i=n/2,s=Sr(e[0],t)-r,a=i-Sr(e[1],n);return(Math.atan2(a,s)+Math.PI*2)%(Math.PI*2)},EBt=function(e,t,n){var r=typeof e=="number"?e:NBt(e,t,n),i=Math.abs(t*Math.sin(r))+Math.abs(n*Math.cos(r)),s=t/2,a=n/2,o=i/2,c=Math.sin(r-Math.PI/2)*o,u=Math.cos(r-Math.PI/2)*o;return[i,s-u,s+u,a-c,a+c]},Zl=function(e,t){return Math.sqrt(e*e+t*t)},DZ=function(e,t,n,r,i){var s=[[0,0],[0,t],[e,0],[e,t]];return s.reduce(function(a,o){var c=o[0],u=o[1],d=Zl(n-c,r-u);return(i?d<a.optimumDistance:d>a.optimumDistance)?{optimumCorner:o,optimumDistance:d}:a},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},TBt=function(e,t,n,r,i){var s=0,a=0;switch(e.size){case 0:e.shape===0?s=a=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(s=Math.min(Math.abs(t),Math.abs(t-r)),a=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(e.shape===0)s=a=Math.min(Zl(t,n),Zl(t,n-i),Zl(t-r,n),Zl(t-r,n-i));else if(e.shape===1){var o=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),c=DZ(r,i,t,n,!0),u=c[0],d=c[1];s=Zl(u-t,(d-n)/o),a=o*s}break;case 1:e.shape===0?s=a=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(s=Math.max(Math.abs(t),Math.abs(t-r)),a=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(e.shape===0)s=a=Math.max(Zl(t,n),Zl(t,n-i),Zl(t-r,n),Zl(t-r,n-i));else if(e.shape===1){var o=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r)),h=DZ(r,i,t,n,!1),u=h[0],d=h[1];s=Zl(u-t,(d-n)/o),a=o*s}break}return Array.isArray(e.size)&&(s=Sr(e.size[0],r),a=e.size.length===2?Sr(e.size[1],i):s),[s,a]},IBt=function(e,t){var n=xl(180),r=[];return ku(t).forEach(function(i,s){if(s===0){var a=i[0];if(a.type===20&&a.value==="to"){n=e0e(i);return}else if(Zve(a)){n=gT.parse(e,a);return}}var o=yT(e,i);r.push(o)}),{angle:n,stops:r,type:1}},jk=function(e,t){var n=xl(180),r=[];return ku(t).forEach(function(i,s){if(s===0){var a=i[0];if(a.type===20&&["top","left","right","bottom"].indexOf(a.value)!==-1){n=e0e(i);return}else if(Zve(a)){n=(gT.parse(e,a)+xl(270))%xl(360);return}}var o=yT(e,i);r.push(o)}),{angle:n,stops:r,type:1}},PBt=function(e,t){var n=xl(180),r=[],i=1,s=0,a=3,o=[];return ku(t).forEach(function(c,u){var d=c[0];if(u===0){if(sr(d)&&d.value==="linear"){i=1;return}else if(sr(d)&&d.value==="radial"){i=2;return}}if(d.type===18){if(d.name==="from"){var h=kf.parse(e,d.values[0]);r.push({stop:Is,color:h})}else if(d.name==="to"){var h=kf.parse(e,d.values[0]);r.push({stop:ef,color:h})}else if(d.name==="color-stop"){var A=d.values.filter(Gv);if(A.length===2){var h=kf.parse(e,A[1]),f=A[0];R0(f)&&r.push({stop:{type:16,number:f.number*100,flags:f.flags},color:h})}}}}),i===1?{angle:(n+xl(180))%xl(360),stops:r,type:i}:{size:a,shape:s,stops:r,position:o,type:i}},t0e="closest-side",n0e="farthest-side",r0e="closest-corner",i0e="farthest-corner",s0e="circle",a0e="ellipse",o0e="cover",l0e="contain",OBt=function(e,t){var n=0,r=3,i=[],s=[];return ku(t).forEach(function(a,o){var c=!0;if(o===0){var u=!1;c=a.reduce(function(h,A){if(u)if(sr(A))switch(A.value){case"center":return s.push(m$),h;case"top":case"left":return s.push(Is),h;case"right":case"bottom":return s.push(ef),h}else(Oi(A)||Rf(A))&&s.push(A);else if(sr(A))switch(A.value){case s0e:return n=0,!1;case a0e:return n=1,!1;case"at":return u=!0,!1;case t0e:return r=0,!1;case o0e:case n0e:return r=1,!1;case l0e:case r0e:return r=2,!1;case i0e:return r=3,!1}else if(Rf(A)||Oi(A))return Array.isArray(r)||(r=[]),r.push(A),!1;return h},c)}if(c){var d=yT(e,a);i.push(d)}}),{size:r,shape:n,stops:i,position:s,type:2}},Bk=function(e,t){var n=0,r=3,i=[],s=[];return ku(t).forEach(function(a,o){var c=!0;if(o===0?c=a.reduce(function(d,h){if(sr(h))switch(h.value){case"center":return s.push(m$),!1;case"top":case"left":return s.push(Is),!1;case"right":case"bottom":return s.push(ef),!1}else if(Oi(h)||Rf(h))return s.push(h),!1;return d},c):o===1&&(c=a.reduce(function(d,h){if(sr(h))switch(h.value){case s0e:return n=0,!1;case a0e:return n=1,!1;case l0e:case t0e:return r=0,!1;case n0e:return r=1,!1;case r0e:return r=2,!1;case o0e:case i0e:return r=3,!1}else if(Rf(h)||Oi(h))return Array.isArray(r)||(r=[]),r.push(h),!1;return d},c)),c){var u=yT(e,a);i.push(u)}}),{size:r,shape:n,stops:i,position:s,type:2}},FBt=function(e){return e.type===1},MBt=function(e){return e.type===2},g$={name:"image",parse:function(e,t){if(t.type===22){var n={url:t.value,type:0};return e.cache.addImage(t.value),n}if(t.type===18){var r=c0e[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return r(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function LBt(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!c0e[e.name])}var c0e={"linear-gradient":IBt,"-moz-linear-gradient":jk,"-ms-linear-gradient":jk,"-o-linear-gradient":jk,"-webkit-linear-gradient":jk,"radial-gradient":OBt,"-moz-radial-gradient":Bk,"-ms-radial-gradient":Bk,"-o-radial-gradient":Bk,"-webkit-radial-gradient":Bk,"-webkit-gradient":PBt},RBt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var n=t[0];return n.type===20&&n.value==="none"?[]:t.filter(function(r){return Gv(r)&&LBt(r)}).map(function(r){return g$.parse(e,r)})}},DBt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(n){if(sr(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},UBt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return ku(t).map(function(n){return n.filter(Oi)}).map(Wve)}},HBt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return ku(t).map(function(n){return n.filter(sr).map(function(r){return r.value}).join(" ")}).map(QBt)}},QBt=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},Hy;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(Hy||(Hy={}));var $Bt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return ku(t).map(function(n){return n.filter(zBt)})}},zBt=function(e){return sr(e)||Oi(e)},vT=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},VBt=vT("top"),KBt=vT("right"),qBt=vT("bottom"),WBt=vT("left"),xT=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(t,n){return Wve(n.filter(Oi))}}},GBt=xT("top-left"),YBt=xT("top-right"),XBt=xT("bottom-right"),JBt=xT("bottom-left"),wT=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(t,n){switch(n){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},ZBt=wT("top"),eNt=wT("right"),tNt=wT("bottom"),nNt=wT("left"),bT=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,n){return rC(n)?n.number:0}}},rNt=bT("top"),iNt=bT("right"),sNt=bT("bottom"),aNt=bT("left"),oNt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},lNt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},cNt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(sr).reduce(function(n,r){return n|uNt(r.value)},0)}},uNt=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},dNt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},hNt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return t.type===20&&t.value==="normal"?0:t.type===17||t.type===15?t.number:0}},MN;(function(e){e.NORMAL="normal",e.STRICT="strict"})(MN||(MN={}));var fNt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return MN.STRICT;case"normal":default:return MN.NORMAL}}},ANt={name:"line-height",initialValue:"normal",prefix:!1,type:4},UZ=function(e,t){return sr(e)&&e.value==="normal"?1.2*t:e.type===17?t*e.number:Oi(e)?Sr(e,t):t},pNt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value==="none"?null:g$.parse(e,t)}},mNt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){switch(t){case"inside":return 0;case"outside":default:return 1}}},qR={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},CT=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},gNt=CT("top"),yNt=CT("right"),vNt=CT("bottom"),xNt=CT("left"),wNt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(sr).map(function(n){switch(n.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},bNt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-word":return"break-word";case"normal":default:return"normal"}}},ST=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},CNt=ST("top"),SNt=ST("right"),kNt=ST("bottom"),_Nt=ST("left"),jNt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},BNt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},NNt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&KR(t[0],"none")?[]:ku(t).map(function(n){for(var r={color:md.TRANSPARENT,offsetX:Is,offsetY:Is,blur:Is},i=0,s=0;s<n.length;s++){var a=n[s];Rf(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:r.blur=a,i++):r.color=kf.parse(e,a)}return r})}},ENt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},TNt={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(t.type===20&&t.value==="none")return null;if(t.type===18){var n=ONt[t.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return n(t.values)}return null}},INt=function(e){var t=e.filter(function(n){return n.type===17}).map(function(n){return n.number});return t.length===6?t:null},PNt=function(e){var t=e.filter(function(c){return c.type===17}).map(function(c){return c.number}),n=t[0],r=t[1];t[2],t[3];var i=t[4],s=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var a=t[12],o=t[13];return t[14],t[15],t.length===16?[n,r,i,s,a,o]:null},ONt={matrix:INt,matrix3d:PNt},HZ={type:16,number:50,flags:nC},FNt=[HZ,HZ],MNt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var n=t.filter(Oi);return n.length!==2?FNt:[n[0],n[1]]}},LNt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},db;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(db||(db={}));var RNt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return db.BREAK_ALL;case"keep-all":return db.KEEP_ALL;case"normal":default:return db.NORMAL}}},DNt={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(t.type===20)return{auto:!0,order:0};if(R0(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},u0e={name:"time",parse:function(e,t){if(t.type===15)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},UNt={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return R0(t)?t.number:1}},HNt={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},QNt={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(sr).map(function(n){switch(n.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(n){return n!==0})}},$Nt={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var n=[],r=[];return t.forEach(function(i){switch(i.type){case 20:case 0:n.push(i.value);break;case 17:n.push(i.number.toString());break;case 4:r.push(n.join(" ")),n.length=0;break}}),n.length&&r.push(n.join(" ")),r.map(function(i){return i.indexOf(" ")===-1?i:"'"+i+"'"})}},zNt={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},VNt={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){if(R0(t))return t.number;if(sr(t))switch(t.value){case"bold":return 700;case"normal":default:return 400}return 400}},KNt={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(sr).map(function(n){return n.value})}},qNt={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},Gi=function(e,t){return(e&t)!==0},WNt={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var n=t[0];return n.type===20&&n.value==="none"?[]:t}},GNt={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var n=t[0];if(n.type===20&&n.value==="none")return null;for(var r=[],i=t.filter(qve),s=0;s<i.length;s++){var a=i[s],o=i[s+1];if(a.type===20){var c=o&&R0(o)?o.number:1;r.push({counter:a.value,increment:c})}}return r}},YNt={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return[];for(var n=[],r=t.filter(qve),i=0;i<r.length;i++){var s=r[i],a=r[i+1];if(sr(s)&&s.value!=="none"){var o=a&&R0(a)?a.number:0;n.push({counter:s.value,reset:o})}}return n}},XNt={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(rC).map(function(n){return u0e.parse(e,n)})}},JNt={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var n=t[0];if(n.type===20&&n.value==="none")return null;var r=[],i=t.filter(SBt);if(i.length%2!==0)return null;for(var s=0;s<i.length;s+=2){var a=i[s].value,o=i[s+1].value;r.push({open:a,close:o})}return r}},QZ=function(e,t,n){if(!e)return"";var r=e[Math.min(t,e.length-1)];return r?n?r.open:r.close:""},ZNt={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&KR(t[0],"none")?[]:ku(t).map(function(n){for(var r={color:255,offsetX:Is,offsetY:Is,blur:Is,spread:Is,inset:!1},i=0,s=0;s<n.length;s++){var a=n[s];KR(a,"inset")?r.inset=!0:Rf(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:i===2?r.blur=a:r.spread=a,i++):r.color=kf.parse(e,a)}return r})}},eEt={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var n=[0,1,2],r=[];return t.filter(sr).forEach(function(i){switch(i.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),n.forEach(function(i){r.indexOf(i)===-1&&r.push(i)}),r}},tEt={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},nEt={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return rC(t)?t.number:0}},rEt=function(){function e(t,n){var r,i;this.animationDuration=ut(t,XNt,n.animationDuration),this.backgroundClip=ut(t,jBt,n.backgroundClip),this.backgroundColor=ut(t,BBt,n.backgroundColor),this.backgroundImage=ut(t,RBt,n.backgroundImage),this.backgroundOrigin=ut(t,DBt,n.backgroundOrigin),this.backgroundPosition=ut(t,UBt,n.backgroundPosition),this.backgroundRepeat=ut(t,HBt,n.backgroundRepeat),this.backgroundSize=ut(t,$Bt,n.backgroundSize),this.borderTopColor=ut(t,VBt,n.borderTopColor),this.borderRightColor=ut(t,KBt,n.borderRightColor),this.borderBottomColor=ut(t,qBt,n.borderBottomColor),this.borderLeftColor=ut(t,WBt,n.borderLeftColor),this.borderTopLeftRadius=ut(t,GBt,n.borderTopLeftRadius),this.borderTopRightRadius=ut(t,YBt,n.borderTopRightRadius),this.borderBottomRightRadius=ut(t,XBt,n.borderBottomRightRadius),this.borderBottomLeftRadius=ut(t,JBt,n.borderBottomLeftRadius),this.borderTopStyle=ut(t,ZBt,n.borderTopStyle),this.borderRightStyle=ut(t,eNt,n.borderRightStyle),this.borderBottomStyle=ut(t,tNt,n.borderBottomStyle),this.borderLeftStyle=ut(t,nNt,n.borderLeftStyle),this.borderTopWidth=ut(t,rNt,n.borderTopWidth),this.borderRightWidth=ut(t,iNt,n.borderRightWidth),this.borderBottomWidth=ut(t,sNt,n.borderBottomWidth),this.borderLeftWidth=ut(t,aNt,n.borderLeftWidth),this.boxShadow=ut(t,ZNt,n.boxShadow),this.color=ut(t,oNt,n.color),this.direction=ut(t,lNt,n.direction),this.display=ut(t,cNt,n.display),this.float=ut(t,dNt,n.cssFloat),this.fontFamily=ut(t,$Nt,n.fontFamily),this.fontSize=ut(t,zNt,n.fontSize),this.fontStyle=ut(t,qNt,n.fontStyle),this.fontVariant=ut(t,KNt,n.fontVariant),this.fontWeight=ut(t,VNt,n.fontWeight),this.letterSpacing=ut(t,hNt,n.letterSpacing),this.lineBreak=ut(t,fNt,n.lineBreak),this.lineHeight=ut(t,ANt,n.lineHeight),this.listStyleImage=ut(t,pNt,n.listStyleImage),this.listStylePosition=ut(t,mNt,n.listStylePosition),this.listStyleType=ut(t,qR,n.listStyleType),this.marginTop=ut(t,gNt,n.marginTop),this.marginRight=ut(t,yNt,n.marginRight),this.marginBottom=ut(t,vNt,n.marginBottom),this.marginLeft=ut(t,xNt,n.marginLeft),this.opacity=ut(t,UNt,n.opacity);var s=ut(t,wNt,n.overflow);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0],this.overflowWrap=ut(t,bNt,n.overflowWrap),this.paddingTop=ut(t,CNt,n.paddingTop),this.paddingRight=ut(t,SNt,n.paddingRight),this.paddingBottom=ut(t,kNt,n.paddingBottom),this.paddingLeft=ut(t,_Nt,n.paddingLeft),this.paintOrder=ut(t,eEt,n.paintOrder),this.position=ut(t,BNt,n.position),this.textAlign=ut(t,jNt,n.textAlign),this.textDecorationColor=ut(t,HNt,(r=n.textDecorationColor)!==null&&r!==void 0?r:n.color),this.textDecorationLine=ut(t,QNt,(i=n.textDecorationLine)!==null&&i!==void 0?i:n.textDecoration),this.textShadow=ut(t,NNt,n.textShadow),this.textTransform=ut(t,ENt,n.textTransform),this.transform=ut(t,TNt,n.transform),this.transformOrigin=ut(t,MNt,n.transformOrigin),this.visibility=ut(t,LNt,n.visibility),this.webkitTextStrokeColor=ut(t,tEt,n.webkitTextStrokeColor),this.webkitTextStrokeWidth=ut(t,nEt,n.webkitTextStrokeWidth),this.wordBreak=ut(t,RNt,n.wordBreak),this.zIndex=ut(t,DNt,n.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return _f(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return Gi(this.display,4)||Gi(this.display,33554432)||Gi(this.display,268435456)||Gi(this.display,536870912)||Gi(this.display,67108864)||Gi(this.display,134217728)},e}(),iEt=function(){function e(t,n){this.content=ut(t,WNt,n.content),this.quotes=ut(t,JNt,n.quotes)}return e}(),$Z=function(){function e(t,n){this.counterIncrement=ut(t,GNt,n.counterIncrement),this.counterReset=ut(t,YNt,n.counterReset)}return e}(),ut=function(e,t,n){var r=new Vve,i=n!==null&&typeof n<"u"?n.toString():t.initialValue;r.write(i);var s=new Kve(r.read());switch(t.type){case 2:var a=s.parseComponentValue();return t.parse(e,sr(a)?a.value:t.initialValue);case 0:return t.parse(e,s.parseComponentValue());case 1:return t.parse(e,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(t.format){case"angle":return gT.parse(e,s.parseComponentValue());case"color":return kf.parse(e,s.parseComponentValue());case"image":return g$.parse(e,s.parseComponentValue());case"length":var o=s.parseComponentValue();return Rf(o)?o:Is;case"length-percentage":var c=s.parseComponentValue();return Oi(c)?c:Is;case"time":return u0e.parse(e,s.parseComponentValue())}break}},sEt="data-html2canvas-debug",aEt=function(e){var t=e.getAttribute(sEt);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},WR=function(e,t){var n=aEt(e);return n===1||t===n},_u=function(){function e(t,n){if(this.context=t,this.textNodes=[],this.elements=[],this.flags=0,WR(n,3))debugger;this.styles=new rEt(t,window.getComputedStyle(n,null)),XR(n)&&(this.styles.animationDuration.some(function(r){return r>0})&&(n.style.animationDuration="0s"),this.styles.transform!==null&&(n.style.transform="none")),this.bounds=pT(this.context,n),WR(n,4)&&(this.flags|=16)}return e}(),oEt="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",zZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Nk=0;Nk<zZ.length;Nk++)yw[zZ.charCodeAt(Nk)]=Nk;var lEt=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,o,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),d=Array.isArray(u)?u:new Uint8Array(u);for(r=0;r<n;r+=4)s=yw[e.charCodeAt(r)],a=yw[e.charCodeAt(r+1)],o=yw[e.charCodeAt(r+2)],c=yw[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|c&63;return u},cEt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},uEt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},Rp=5,y$=11,CO=2,dEt=y$-Rp,d0e=65536>>Rp,hEt=1<<Rp,SO=hEt-1,fEt=1024>>Rp,AEt=d0e+fEt,pEt=AEt,mEt=32,gEt=pEt+mEt,yEt=65536>>y$,vEt=1<<dEt,xEt=vEt-1,VZ=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},wEt=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},bEt=function(e,t){var n=lEt(e),r=Array.isArray(n)?uEt(n):new Uint32Array(n),i=Array.isArray(n)?cEt(n):new Uint16Array(n),s=24,a=VZ(i,s/2,r[4]/2),o=r[5]===2?VZ(i,(s+r[4])/2):wEt(r,Math.ceil((s+r[4])/4));return new CEt(r[0],r[1],r[2],r[3],a,o)},CEt=function(){function e(t,n,r,i,s,a){this.initialValue=t,this.errorValue=n,this.highStart=r,this.highValueIndex=i,this.index=s,this.data=a}return e.prototype.get=function(t){var n;if(t>=0){if(t<55296||t>56319&&t<=65535)return n=this.index[t>>Rp],n=(n<<CO)+(t&SO),this.data[n];if(t<=65535)return n=this.index[d0e+(t-55296>>Rp)],n=(n<<CO)+(t&SO),this.data[n];if(t<this.highStart)return n=gEt-yEt+(t>>y$),n=this.index[n],n+=t>>Rp&xEt,n=this.index[n],n=(n<<CO)+(t&SO),this.data[n];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),KZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",SEt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Ek=0;Ek<KZ.length;Ek++)SEt[KZ.charCodeAt(Ek)]=Ek;var kEt=1,kO=2,_O=3,qZ=4,WZ=5,_Et=7,GZ=8,jO=9,BO=10,YZ=11,XZ=12,JZ=13,ZZ=14,NO=15,jEt=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var s=e.charCodeAt(n++);(s&64512)===56320?t.push(((i&1023)<<10)+(s&1023)+65536):(t.push(i),n--)}else t.push(i)}return t},BEt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var r=[],i=-1,s="";++i<n;){var a=e[i];a<=65535?r.push(a):(a-=65536,r.push((a>>10)+55296,a%1024+56320)),(i+1===n||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},NEt=bEt(oEt),al="×",EO="÷",EEt=function(e){return NEt.get(e)},TEt=function(e,t,n){var r=n-2,i=t[r],s=t[n-1],a=t[n];if(s===kO&&a===_O)return al;if(s===kO||s===_O||s===qZ||a===kO||a===_O||a===qZ)return EO;if(s===GZ&&[GZ,jO,YZ,XZ].indexOf(a)!==-1||(s===YZ||s===jO)&&(a===jO||a===BO)||(s===XZ||s===BO)&&a===BO||a===JZ||a===WZ||a===_Et||s===kEt)return al;if(s===JZ&&a===ZZ){for(;i===WZ;)i=t[--r];if(i===ZZ)return al}if(s===NO&&a===NO){for(var o=0;i===NO;)o++,i=t[--r];if(o%2===0)return al}return EO},IEt=function(e){var t=jEt(e),n=t.length,r=0,i=0,s=t.map(EEt);return{next:function(){if(r>=n)return{done:!0,value:null};for(var a=al;r<n&&(a=TEt(t,s,++r))===al;);if(a!==al||r===n){var o=BEt.apply(null,t.slice(i,r));return i=r,{value:o,done:!1}}return{done:!0,value:null}}}},PEt=function(e){for(var t=IEt(e),n=[],r;!(r=t.next()).done;)r.value&&n.push(r.value.slice());return n},OEt=function(e){var t=123;if(e.createRange){var n=e.createRange();if(n.getBoundingClientRect){var r=e.createElement("boundtest");r.style.height=t+"px",r.style.display="block",e.body.appendChild(r),n.selectNode(r);var i=n.getBoundingClientRect(),s=Math.round(i.height);if(e.body.removeChild(r),s===t)return!0}}return!1},FEt=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var n=e.createRange();t.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var r=t.firstChild,i=mT(r.data).map(function(c){return yi(c)}),s=0,a={},o=i.every(function(c,u){n.setStart(r,s),n.setEnd(r,s+c.length);var d=n.getBoundingClientRect();s+=c.length;var h=d.x>a.x||d.y>a.y;return a=d,u===0?!0:h});return e.body.removeChild(t),o},MEt=function(){return typeof new Image().crossOrigin<"u"},LEt=function(){return typeof new XMLHttpRequest().responseType=="string"},REt=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),n.toDataURL()}catch{return!1}return!0},eee=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},DEt=function(e){var t=e.createElement("canvas"),n=100;t.width=n,t.height=n;var r=t.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,n,n);var i=new Image,s=t.toDataURL();i.src=s;var a=GR(n,n,0,0,i);return r.fillStyle="red",r.fillRect(0,0,n,n),tee(a).then(function(o){r.drawImage(o,0,0);var c=r.getImageData(0,0,n,n).data;r.fillStyle="red",r.fillRect(0,0,n,n);var u=e.createElement("div");return u.style.backgroundImage="url("+s+")",u.style.height=n+"px",eee(c)?tee(GR(n,n,0,0,u)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),eee(r.getImageData(0,0,n,n).data)}).catch(function(){return!1})},GR=function(e,t,n,r,i){var s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return a.setAttributeNS(null,"width",e.toString()),a.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",n.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(o),o.appendChild(i),a},tee=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},js={get SUPPORT_RANGE_BOUNDS(){var e=OEt(document);return Object.defineProperty(js,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=js.SUPPORT_RANGE_BOUNDS&&FEt(document);return Object.defineProperty(js,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=REt(document);return Object.defineProperty(js,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?DEt(document):Promise.resolve(!1);return Object.defineProperty(js,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=MEt();return Object.defineProperty(js,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=LEt();return Object.defineProperty(js,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(js,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(js,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},hb=function(){function e(t,n){this.text=t,this.bounds=n}return e}(),UEt=function(e,t,n,r){var i=$Et(t,n),s=[],a=0;return i.forEach(function(o){if(n.textDecorationLine.length||o.trim().length>0)if(js.SUPPORT_RANGE_BOUNDS){var c=nee(r,a,o.length).getClientRects();if(c.length>1){var u=v$(o),d=0;u.forEach(function(A){s.push(new hb(A,Ed.fromDOMRectList(e,nee(r,d+a,A.length).getClientRects()))),d+=A.length})}else s.push(new hb(o,Ed.fromDOMRectList(e,c)))}else{var h=r.splitText(o.length);s.push(new hb(o,HEt(e,r))),r=h}else js.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));a+=o.length}),s},HEt=function(e,t){var n=t.ownerDocument;if(n){var r=n.createElement("html2canvaswrapper");r.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(r,t);var s=pT(e,r);return r.firstChild&&i.replaceChild(r.firstChild,r),s}}return Ed.EMPTY},nee=function(e,t,n){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),i},v$=function(e){if(js.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(n){return n.segment})}return PEt(e)},QEt=function(e,t){if(js.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(e)).map(function(r){return r.segment})}return VEt(e,t)},$Et=function(e,t){return t.letterSpacing!==0?v$(e):QEt(e,t)},zEt=[32,160,4961,65792,65793,4153,4241],VEt=function(e,t){for(var n=yjt(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap==="break-word"?"break-word":t.wordBreak}),r=[],i,s=function(){if(i.value){var a=i.value.slice(),o=mT(a),c="";o.forEach(function(u){zEt.indexOf(u)===-1?c+=yi(u):(c.length&&r.push(c),r.push(yi(u)),c="")}),c.length&&r.push(c)}};!(i=n.next()).done;)s();return r},KEt=function(){function e(t,n,r){this.text=qEt(n.data,r.textTransform),this.textBounds=UEt(t,this.text,r,n)}return e}(),qEt=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(WEt,GEt);case 2:return e.toUpperCase();default:return e}},WEt=/(^|\s|:|-|\(|\))([a-z])/g,GEt=function(e,t,n){return e.length>0?t+n.toUpperCase():e},h0e=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.src=r.currentSrc||r.src,i.intrinsicWidth=r.naturalWidth,i.intrinsicHeight=r.naturalHeight,i.context.cache.addImage(i.src),i}return t}(_u),f0e=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.canvas=r,i.intrinsicWidth=r.width,i.intrinsicHeight=r.height,i}return t}(_u),A0e=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this,s=new XMLSerializer,a=pT(n,r);return r.setAttribute("width",a.width+"px"),r.setAttribute("height",a.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(s.serializeToString(r)),i.intrinsicWidth=r.width.baseVal.value,i.intrinsicHeight=r.height.baseVal.value,i.context.cache.addImage(i.svg),i}return t}(_u),p0e=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.value=r.value,i}return t}(_u),YR=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.start=r.start,i.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,i}return t}(_u),YEt=[{type:15,flags:0,unit:"px",number:3}],XEt=[{type:16,flags:0,number:50}],JEt=function(e){return e.width>e.height?new Ed(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new Ed(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},ZEt=function(e){var t=e.type===e5t?new Array(e.value.length+1).join("•"):e.value;return t.length===0?e.placeholder||"":t},LN="checkbox",RN="radio",e5t="password",ree=707406591,x$=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;switch(i.type=r.type.toLowerCase(),i.checked=r.checked,i.value=ZEt(r),(i.type===LN||i.type===RN)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=JEt(i.bounds)),i.type){case LN:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=YEt;break;case RN:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=XEt;break}return i}return t}(_u),m0e=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this,s=r.options[r.selectedIndex||0];return i.value=s&&s.text||"",i}return t}(_u),g0e=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.value=r.value,i}return t}(_u),y0e=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;i.src=r.src,i.width=parseInt(r.width,10)||0,i.height=parseInt(r.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){i.tree=x0e(n,r.contentWindow.document.documentElement);var s=r.contentWindow.document.documentElement?ub(n,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):md.TRANSPARENT,a=r.contentWindow.document.body?ub(n,getComputedStyle(r.contentWindow.document.body).backgroundColor):md.TRANSPARENT;i.backgroundColor=_f(s)?_f(a)?i.styles.backgroundColor:a:s}}catch{}return i}return t}(_u),t5t=["OL","UL","MENU"],N_=function(e,t,n,r){for(var i=t.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,w0e(i)&&i.data.trim().length>0)n.textNodes.push(new KEt(e,i,n.styles));else if(uy(i))if(k0e(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return N_(e,o,n,r)});else{var a=v0e(e,i);a.styles.isVisible()&&(n5t(i,a,r)?a.flags|=4:r5t(a.styles)&&(a.flags|=2),t5t.indexOf(i.tagName)!==-1&&(a.flags|=8),n.elements.push(a),i.slot,i.shadowRoot?N_(e,i.shadowRoot,a,r):!DN(i)&&!b0e(i)&&!UN(i)&&N_(e,i,a,r))}},v0e=function(e,t){return JR(t)?new h0e(e,t):C0e(t)?new f0e(e,t):b0e(t)?new A0e(e,t):i5t(t)?new p0e(e,t):s5t(t)?new YR(e,t):a5t(t)?new x$(e,t):UN(t)?new m0e(e,t):DN(t)?new g0e(e,t):S0e(t)?new y0e(e,t):new _u(e,t)},x0e=function(e,t){var n=v0e(e,t);return n.flags|=4,N_(e,t,n,n),n},n5t=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||w$(e)&&n.styles.isTransparent()},r5t=function(e){return e.isPositioned()||e.isFloating()},w0e=function(e){return e.nodeType===Node.TEXT_NODE},uy=function(e){return e.nodeType===Node.ELEMENT_NODE},XR=function(e){return uy(e)&&typeof e.style<"u"&&!E_(e)},E_=function(e){return typeof e.className=="object"},i5t=function(e){return e.tagName==="LI"},s5t=function(e){return e.tagName==="OL"},a5t=function(e){return e.tagName==="INPUT"},o5t=function(e){return e.tagName==="HTML"},b0e=function(e){return e.tagName==="svg"},w$=function(e){return e.tagName==="BODY"},C0e=function(e){return e.tagName==="CANVAS"},iee=function(e){return e.tagName==="VIDEO"},JR=function(e){return e.tagName==="IMG"},S0e=function(e){return e.tagName==="IFRAME"},see=function(e){return e.tagName==="STYLE"},l5t=function(e){return e.tagName==="SCRIPT"},DN=function(e){return e.tagName==="TEXTAREA"},UN=function(e){return e.tagName==="SELECT"},k0e=function(e){return e.tagName==="SLOT"},aee=function(e){return e.tagName.indexOf("-")>0},c5t=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(t){var n=this.counters[t];return n&&n.length?n[n.length-1]:1},e.prototype.getCounterValues=function(t){var n=this.counters[t];return n||[]},e.prototype.pop=function(t){var n=this;t.forEach(function(r){return n.counters[r].pop()})},e.prototype.parse=function(t){var n=this,r=t.counterIncrement,i=t.counterReset,s=!0;r!==null&&r.forEach(function(o){var c=n.counters[o.counter];c&&o.increment!==0&&(s=!1,c.length||c.push(1),c[Math.max(0,c.length-1)]+=o.increment)});var a=[];return s&&i.forEach(function(o){var c=n.counters[o.counter];a.push(o.counter),c||(c=n.counters[o.counter]=[]),c.push(o.reset)}),a},e}(),oee={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},lee={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},u5t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},d5t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Bg=function(e,t,n,r,i,s){return e<t||e>n?o2(e,i,s.length>0):r.integers.reduce(function(a,o,c){for(;e>=o;)e-=o,a+=r.values[c];return a},"")+s},_0e=function(e,t,n,r){var i="";do n||e--,i=r(e)+i,e/=t;while(e*t>=t);return i},gi=function(e,t,n,r,i){var s=n-t+1;return(e<0?"-":"")+(_0e(Math.abs(e),s,r,function(a){return yi(Math.floor(a%s)+t)})+i)},PA=function(e,t,n){n===void 0&&(n=". ");var r=t.length;return _0e(Math.abs(e),r,!1,function(i){return t[Math.floor(i%r)]})+n},Ug=1,ph=2,mh=4,vw=8,qu=function(e,t,n,r,i,s){if(e<-9999||e>9999)return o2(e,4,i.length>0);var a=Math.abs(e),o=i;if(a===0)return t[0]+o;for(var c=0;a>0&&c<=4;c++){var u=a%10;u===0&&Gi(s,Ug)&&o!==""?o=t[u]+o:u>1||u===1&&c===0||u===1&&c===1&&Gi(s,ph)||u===1&&c===1&&Gi(s,mh)&&e>100||u===1&&c>1&&Gi(s,vw)?o=t[u]+(c>0?n[c-1]:"")+o:u===1&&c>0&&(o=n[c-1]+o),a=Math.floor(a/10)}return(e<0?r:"")+o},cee="十百千萬",uee="拾佰仟萬",dee="マイナス",TO="마이너스",o2=function(e,t,n){var r=n?". ":"",i=n?"、":"",s=n?", ":"",a=n?" ":"";switch(t){case 0:return"•"+a;case 1:return"◦"+a;case 2:return"◾"+a;case 5:var o=gi(e,48,57,!0,r);return o.length<4?"0"+o:o;case 4:return PA(e,"〇一二三四五六七八九",i);case 6:return Bg(e,1,3999,oee,3,r).toLowerCase();case 7:return Bg(e,1,3999,oee,3,r);case 8:return gi(e,945,969,!1,r);case 9:return gi(e,97,122,!1,r);case 10:return gi(e,65,90,!1,r);case 11:return gi(e,1632,1641,!0,r);case 12:case 49:return Bg(e,1,9999,lee,3,r);case 35:return Bg(e,1,9999,lee,3,r).toLowerCase();case 13:return gi(e,2534,2543,!0,r);case 14:case 30:return gi(e,6112,6121,!0,r);case 15:return PA(e,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return PA(e,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return qu(e,"零一二三四五六七八九",cee,"負",i,ph|mh|vw);case 47:return qu(e,"零壹貳參肆伍陸柒捌玖",uee,"負",i,Ug|ph|mh|vw);case 42:return qu(e,"零一二三四五六七八九",cee,"负",i,ph|mh|vw);case 41:return qu(e,"零壹贰叁肆伍陆柒捌玖",uee,"负",i,Ug|ph|mh|vw);case 26:return qu(e,"〇一二三四五六七八九","十百千万",dee,i,0);case 25:return qu(e,"零壱弐参四伍六七八九","拾百千万",dee,i,Ug|ph|mh);case 31:return qu(e,"영일이삼사오육칠팔구","십백천만",TO,s,Ug|ph|mh);case 33:return qu(e,"零一二三四五六七八九","十百千萬",TO,s,0);case 32:return qu(e,"零壹貳參四五六七八九","拾百千",TO,s,Ug|ph|mh);case 18:return gi(e,2406,2415,!0,r);case 20:return Bg(e,1,19999,d5t,3,r);case 21:return gi(e,2790,2799,!0,r);case 22:return gi(e,2662,2671,!0,r);case 22:return Bg(e,1,10999,u5t,3,r);case 23:return PA(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return PA(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return gi(e,3302,3311,!0,r);case 28:return PA(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return PA(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return gi(e,3792,3801,!0,r);case 37:return gi(e,6160,6169,!0,r);case 38:return gi(e,4160,4169,!0,r);case 39:return gi(e,2918,2927,!0,r);case 40:return gi(e,1776,1785,!0,r);case 43:return gi(e,3046,3055,!0,r);case 44:return gi(e,3174,3183,!0,r);case 45:return gi(e,3664,3673,!0,r);case 46:return gi(e,3872,3881,!0,r);case 3:default:return gi(e,48,57,!0,r)}},j0e="data-html2canvas-ignore",hee=function(){function e(t,n,r){if(this.context=t,this.options=r,this.scrolledElements=[],this.referenceElement=n,this.counters=new c5t,this.quoteDepth=0,!n.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(n.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(t,n){var r=this,i=h5t(t,n);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=t.defaultView.pageXOffset,a=t.defaultView.pageYOffset,o=i.contentWindow,c=o.document,u=p5t(i).then(function(){return ya(r,void 0,void 0,function(){var d,h;return Ws(this,function(A){switch(A.label){case 0:return this.scrolledElements.forEach(v5t),o&&(o.scrollTo(n.left,n.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==n.top||o.scrollX!==n.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-n.left,o.scrollY-n.top,0,0))),d=this.options.onclone,h=this.clonedReferenceElement,typeof h>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:A.sent(),A.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,A5t(c)]:[3,4];case 3:A.sent(),A.label=4;case 4:return typeof d=="function"?[2,Promise.resolve().then(function(){return d(c,h)}).then(function(){return i})]:[2,i]}})})});return c.open(),c.write(g5t(document.doctype)+"<html></html>"),y5t(this.referenceElement.ownerDocument,s,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),u},e.prototype.createElementClone=function(t){if(WR(t,2))debugger;if(C0e(t))return this.createCanvasClone(t);if(iee(t))return this.createVideoClone(t);if(see(t))return this.createStyleClone(t);var n=t.cloneNode(!1);return JR(n)&&(JR(t)&&t.currentSrc&&t.currentSrc!==t.src&&(n.src=t.currentSrc,n.srcset=""),n.loading==="lazy"&&(n.loading="eager")),aee(n)?this.createCustomElementClone(n):n},e.prototype.createCustomElementClone=function(t){var n=document.createElement("html2canvascustomelement");return IO(t.style,n),n},e.prototype.createStyleClone=function(t){try{var n=t.sheet;if(n&&n.cssRules){var r=[].slice.call(n.cssRules,0).reduce(function(s,a){return a&&typeof a.cssText=="string"?s+a.cssText:s},""),i=t.cloneNode(!1);return i.textContent=r,i}}catch(s){if(this.context.logger.error("Unable to access cssRules property",s),s.name!=="SecurityError")throw s}return t.cloneNode(!1)},e.prototype.createCanvasClone=function(t){var n;if(this.options.inlineImages&&t.ownerDocument){var r=t.ownerDocument.createElement("img");try{return r.src=t.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}var i=t.cloneNode(!1);try{i.width=t.width,i.height=t.height;var s=t.getContext("2d"),a=i.getContext("2d");if(a)if(!this.options.allowTaint&&s)a.putImageData(s.getImageData(0,0,t.width,t.height),0,0);else{var o=(n=t.getContext("webgl2"))!==null&&n!==void 0?n:t.getContext("webgl");if(o){var c=o.getContextAttributes();(c==null?void 0:c.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t)}a.drawImage(t,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",t)}return i},e.prototype.createVideoClone=function(t){var n=t.ownerDocument.createElement("canvas");n.width=t.offsetWidth,n.height=t.offsetHeight;var r=n.getContext("2d");try{return r&&(r.drawImage(t,0,0,n.width,n.height),this.options.allowTaint||r.getImageData(0,0,n.width,n.height)),n}catch{this.context.logger.info("Unable to clone video as it is tainted",t)}var i=t.ownerDocument.createElement("canvas");return i.width=t.offsetWidth,i.height=t.offsetHeight,i},e.prototype.appendChildNode=function(t,n,r){(!uy(n)||!l5t(n)&&!n.hasAttribute(j0e)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(n)))&&(!this.options.copyStyles||!uy(n)||!see(n))&&t.appendChild(this.cloneNode(n,r))},e.prototype.cloneChildNodes=function(t,n,r){for(var i=this,s=t.shadowRoot?t.shadowRoot.firstChild:t.firstChild;s;s=s.nextSibling)if(uy(s)&&k0e(s)&&typeof s.assignedNodes=="function"){var a=s.assignedNodes();a.length&&a.forEach(function(o){return i.appendChildNode(n,o,r)})}else this.appendChildNode(n,s,r)},e.prototype.cloneNode=function(t,n){if(w0e(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var r=t.ownerDocument.defaultView;if(r&&uy(t)&&(XR(t)||E_(t))){var i=this.createElementClone(t);i.style.transitionProperty="none";var s=r.getComputedStyle(t),a=r.getComputedStyle(t,":before"),o=r.getComputedStyle(t,":after");this.referenceElement===t&&XR(i)&&(this.clonedReferenceElement=i),w$(i)&&b5t(i);var c=this.counters.parse(new $Z(this.context,s)),u=this.resolvePseudoContent(t,i,a,fb.BEFORE);aee(t)&&(n=!0),iee(t)||this.cloneChildNodes(t,i,n),u&&i.insertBefore(u,i.firstChild);var d=this.resolvePseudoContent(t,i,o,fb.AFTER);return d&&i.appendChild(d),this.counters.pop(c),(s&&(this.options.copyStyles||E_(t))&&!S0e(t)||n)&&IO(s,i),(t.scrollTop!==0||t.scrollLeft!==0)&&this.scrolledElements.push([i,t.scrollLeft,t.scrollTop]),(DN(t)||UN(t))&&(DN(i)||UN(i))&&(i.value=t.value),i}return t.cloneNode(!1)},e.prototype.resolvePseudoContent=function(t,n,r,i){var s=this;if(r){var a=r.content,o=n.ownerDocument;if(!(!o||!a||a==="none"||a==="-moz-alt-content"||r.display==="none")){this.counters.parse(new $Z(this.context,r));var c=new iEt(this.context,r),u=o.createElement("html2canvaspseudoelement");IO(r,u),c.content.forEach(function(h){if(h.type===0)u.appendChild(o.createTextNode(h.value));else if(h.type===22){var A=o.createElement("img");A.src=h.value,A.style.opacity="1",u.appendChild(A)}else if(h.type===18){if(h.name==="attr"){var f=h.values.filter(sr);f.length&&u.appendChild(o.createTextNode(t.getAttribute(f[0].value)||""))}else if(h.name==="counter"){var p=h.values.filter(Gv),m=p[0],g=p[1];if(m&&sr(m)){var y=s.counters.getCounterValue(m.value),v=g&&sr(g)?qR.parse(s.context,g.value):3;u.appendChild(o.createTextNode(o2(y,v,!1)))}}else if(h.name==="counters"){var x=h.values.filter(Gv),m=x[0],b=x[1],g=x[2];if(m&&sr(m)){var w=s.counters.getCounterValues(m.value),k=g&&sr(g)?qR.parse(s.context,g.value):3,j=b&&b.type===0?b.value:"",B=w.map(function(T){return o2(T,k,!1)}).join(j);u.appendChild(o.createTextNode(B))}}}else if(h.type===20)switch(h.value){case"open-quote":u.appendChild(o.createTextNode(QZ(c.quotes,s.quoteDepth++,!0)));break;case"close-quote":u.appendChild(o.createTextNode(QZ(c.quotes,--s.quoteDepth,!1)));break;default:u.appendChild(o.createTextNode(h.value))}}),u.className=ZR+" "+eD;var d=i===fb.BEFORE?" "+ZR:" "+eD;return E_(n)?n.className.baseValue+=d:n.className+=d,u}}},e.destroy=function(t){return t.parentNode?(t.parentNode.removeChild(t),!0):!1},e}(),fb;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(fb||(fb={}));var h5t=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute(j0e,"true"),e.body.appendChild(n),n},f5t=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},A5t=function(e){return Promise.all([].slice.call(e.images,0).map(f5t))},p5t=function(e){return new Promise(function(t,n){var r=e.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var s=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(s),t(e))},50)}})},m5t=["all","d","content"],IO=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);m5t.indexOf(r)===-1&&t.style.setProperty(r,e.getPropertyValue(r))}return t},g5t=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},y5t=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},v5t=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},x5t=":before",w5t=":after",ZR="___html2canvas___pseudoelement_before",eD="___html2canvas___pseudoelement_after",fee=`{
    content: "" !important;
    display: none !important;
}`,b5t=function(e){C5t(e,"."+ZR+x5t+fee+`
         .`+eD+w5t+fee)},C5t=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}},B0e=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),S5t=function(){function e(t,n){this.context=t,this._options=n,this._cache={}}return e.prototype.addImage=function(t){var n=Promise.resolve();return this.has(t)||(OO(t)||B5t(t))&&(this._cache[t]=this.loadImage(t)).catch(function(){}),n},e.prototype.match=function(t){return this._cache[t]},e.prototype.loadImage=function(t){return ya(this,void 0,void 0,function(){var n,r,i,s,a=this;return Ws(this,function(o){switch(o.label){case 0:return n=B0e.isSameOrigin(t),r=!PO(t)&&this._options.useCORS===!0&&js.SUPPORT_CORS_IMAGES&&!n,i=!PO(t)&&!n&&!OO(t)&&typeof this._options.proxy=="string"&&js.SUPPORT_CORS_XHR&&!r,!n&&this._options.allowTaint===!1&&!PO(t)&&!OO(t)&&!i&&!r?[2]:(s=t,i?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(c,u){var d=new Image;d.onload=function(){return c(d)},d.onerror=u,(N5t(s)||r)&&(d.crossOrigin="anonymous"),d.src=s,d.complete===!0&&setTimeout(function(){return c(d)},500),a._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(t){return typeof this._cache[t]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(t){var n=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var i=t.substring(0,256);return new Promise(function(s,a){var o=js.SUPPORT_RESPONSE_TYPE?"blob":"text",c=new XMLHttpRequest;c.onload=function(){if(c.status===200)if(o==="text")s(c.response);else{var h=new FileReader;h.addEventListener("load",function(){return s(h.result)},!1),h.addEventListener("error",function(A){return a(A)},!1),h.readAsDataURL(c.response)}else a("Failed to proxy resource "+i+" with status code "+c.status)},c.onerror=a;var u=r.indexOf("?")>-1?"&":"?";if(c.open("GET",""+r+u+"url="+encodeURIComponent(t)+"&responseType="+o),o!=="text"&&c instanceof XMLHttpRequest&&(c.responseType=o),n._options.imageTimeout){var d=n._options.imageTimeout;c.timeout=d,c.ontimeout=function(){return a("Timed out ("+d+"ms) proxying "+i)}}c.send()})},e}(),k5t=/^data:image\/svg\+xml/i,_5t=/^data:image\/.*;base64,/i,j5t=/^data:image\/.*/i,B5t=function(e){return js.SUPPORT_SVG_DRAWING||!E5t(e)},PO=function(e){return j5t.test(e)},N5t=function(e){return _5t.test(e)},OO=function(e){return e.substr(0,4)==="blob"},E5t=function(e){return e.substr(-3).toLowerCase()==="svg"||k5t.test(e)},it=function(){function e(t,n){this.type=0,this.x=t,this.y=n}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),Ng=function(e,t,n){return new it(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Tk=function(){function e(t,n,r,i){this.type=1,this.start=t,this.startControl=n,this.endControl=r,this.end=i}return e.prototype.subdivide=function(t,n){var r=Ng(this.start,this.startControl,t),i=Ng(this.startControl,this.endControl,t),s=Ng(this.endControl,this.end,t),a=Ng(r,i,t),o=Ng(i,s,t),c=Ng(a,o,t);return n?new e(this.start,r,a,c):new e(c,o,s,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Al=function(e){return e.type===1},T5t=function(){function e(t){var n=t.styles,r=t.bounds,i=gw(n.borderTopLeftRadius,r.width,r.height),s=i[0],a=i[1],o=gw(n.borderTopRightRadius,r.width,r.height),c=o[0],u=o[1],d=gw(n.borderBottomRightRadius,r.width,r.height),h=d[0],A=d[1],f=gw(n.borderBottomLeftRadius,r.width,r.height),p=f[0],m=f[1],g=[];g.push((s+c)/r.width),g.push((p+h)/r.width),g.push((a+m)/r.height),g.push((u+A)/r.height);var y=Math.max.apply(Math,g);y>1&&(s/=y,a/=y,c/=y,u/=y,h/=y,A/=y,p/=y,m/=y);var v=r.width-c,x=r.height-A,b=r.width-h,w=r.height-m,k=n.borderTopWidth,j=n.borderRightWidth,B=n.borderBottomWidth,E=n.borderLeftWidth,P=Sr(n.paddingTop,t.bounds.width),T=Sr(n.paddingRight,t.bounds.width),N=Sr(n.paddingBottom,t.bounds.width),F=Sr(n.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||a>0?Qr(r.left+E/3,r.top+k/3,s-E/3,a-k/3,qn.TOP_LEFT):new it(r.left+E/3,r.top+k/3),this.topRightBorderDoubleOuterBox=s>0||a>0?Qr(r.left+v,r.top+k/3,c-j/3,u-k/3,qn.TOP_RIGHT):new it(r.left+r.width-j/3,r.top+k/3),this.bottomRightBorderDoubleOuterBox=h>0||A>0?Qr(r.left+b,r.top+x,h-j/3,A-B/3,qn.BOTTOM_RIGHT):new it(r.left+r.width-j/3,r.top+r.height-B/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Qr(r.left+E/3,r.top+w,p-E/3,m-B/3,qn.BOTTOM_LEFT):new it(r.left+E/3,r.top+r.height-B/3),this.topLeftBorderDoubleInnerBox=s>0||a>0?Qr(r.left+E*2/3,r.top+k*2/3,s-E*2/3,a-k*2/3,qn.TOP_LEFT):new it(r.left+E*2/3,r.top+k*2/3),this.topRightBorderDoubleInnerBox=s>0||a>0?Qr(r.left+v,r.top+k*2/3,c-j*2/3,u-k*2/3,qn.TOP_RIGHT):new it(r.left+r.width-j*2/3,r.top+k*2/3),this.bottomRightBorderDoubleInnerBox=h>0||A>0?Qr(r.left+b,r.top+x,h-j*2/3,A-B*2/3,qn.BOTTOM_RIGHT):new it(r.left+r.width-j*2/3,r.top+r.height-B*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Qr(r.left+E*2/3,r.top+w,p-E*2/3,m-B*2/3,qn.BOTTOM_LEFT):new it(r.left+E*2/3,r.top+r.height-B*2/3),this.topLeftBorderStroke=s>0||a>0?Qr(r.left+E/2,r.top+k/2,s-E/2,a-k/2,qn.TOP_LEFT):new it(r.left+E/2,r.top+k/2),this.topRightBorderStroke=s>0||a>0?Qr(r.left+v,r.top+k/2,c-j/2,u-k/2,qn.TOP_RIGHT):new it(r.left+r.width-j/2,r.top+k/2),this.bottomRightBorderStroke=h>0||A>0?Qr(r.left+b,r.top+x,h-j/2,A-B/2,qn.BOTTOM_RIGHT):new it(r.left+r.width-j/2,r.top+r.height-B/2),this.bottomLeftBorderStroke=p>0||m>0?Qr(r.left+E/2,r.top+w,p-E/2,m-B/2,qn.BOTTOM_LEFT):new it(r.left+E/2,r.top+r.height-B/2),this.topLeftBorderBox=s>0||a>0?Qr(r.left,r.top,s,a,qn.TOP_LEFT):new it(r.left,r.top),this.topRightBorderBox=c>0||u>0?Qr(r.left+v,r.top,c,u,qn.TOP_RIGHT):new it(r.left+r.width,r.top),this.bottomRightBorderBox=h>0||A>0?Qr(r.left+b,r.top+x,h,A,qn.BOTTOM_RIGHT):new it(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=p>0||m>0?Qr(r.left,r.top+w,p,m,qn.BOTTOM_LEFT):new it(r.left,r.top+r.height),this.topLeftPaddingBox=s>0||a>0?Qr(r.left+E,r.top+k,Math.max(0,s-E),Math.max(0,a-k),qn.TOP_LEFT):new it(r.left+E,r.top+k),this.topRightPaddingBox=c>0||u>0?Qr(r.left+Math.min(v,r.width-j),r.top+k,v>r.width+j?0:Math.max(0,c-j),Math.max(0,u-k),qn.TOP_RIGHT):new it(r.left+r.width-j,r.top+k),this.bottomRightPaddingBox=h>0||A>0?Qr(r.left+Math.min(b,r.width-E),r.top+Math.min(x,r.height-B),Math.max(0,h-j),Math.max(0,A-B),qn.BOTTOM_RIGHT):new it(r.left+r.width-j,r.top+r.height-B),this.bottomLeftPaddingBox=p>0||m>0?Qr(r.left+E,r.top+Math.min(w,r.height-B),Math.max(0,p-E),Math.max(0,m-B),qn.BOTTOM_LEFT):new it(r.left+E,r.top+r.height-B),this.topLeftContentBox=s>0||a>0?Qr(r.left+E+F,r.top+k+P,Math.max(0,s-(E+F)),Math.max(0,a-(k+P)),qn.TOP_LEFT):new it(r.left+E+F,r.top+k+P),this.topRightContentBox=c>0||u>0?Qr(r.left+Math.min(v,r.width+E+F),r.top+k+P,v>r.width+E+F?0:c-E+F,u-(k+P),qn.TOP_RIGHT):new it(r.left+r.width-(j+T),r.top+k+P),this.bottomRightContentBox=h>0||A>0?Qr(r.left+Math.min(b,r.width-(E+F)),r.top+Math.min(x,r.height+k+P),Math.max(0,h-(j+T)),A-(B+N),qn.BOTTOM_RIGHT):new it(r.left+r.width-(j+T),r.top+r.height-(B+N)),this.bottomLeftContentBox=p>0||m>0?Qr(r.left+E+F,r.top+w,Math.max(0,p-(E+F)),m-(B+N),qn.BOTTOM_LEFT):new it(r.left+E+F,r.top+r.height-(B+N))}return e}(),qn;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(qn||(qn={}));var Qr=function(e,t,n,r,i){var s=4*((Math.sqrt(2)-1)/3),a=n*s,o=r*s,c=e+n,u=t+r;switch(i){case qn.TOP_LEFT:return new Tk(new it(e,u),new it(e,u-o),new it(c-a,t),new it(c,t));case qn.TOP_RIGHT:return new Tk(new it(e,t),new it(e+a,t),new it(c,u-o),new it(c,u));case qn.BOTTOM_RIGHT:return new Tk(new it(c,t),new it(c,t+o),new it(e+a,u),new it(e,u));case qn.BOTTOM_LEFT:default:return new Tk(new it(c,u),new it(c-a,u),new it(e,t+o),new it(e,t))}},HN=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},I5t=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},QN=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},P5t=function(){function e(t,n,r){this.offsetX=t,this.offsetY=n,this.matrix=r,this.type=0,this.target=6}return e}(),Ik=function(){function e(t,n){this.path=t,this.target=n,this.type=1}return e}(),O5t=function(){function e(t){this.opacity=t,this.type=2,this.target=6}return e}(),F5t=function(e){return e.type===0},N0e=function(e){return e.type===1},M5t=function(e){return e.type===2},Aee=function(e,t){return e.length===t.length?e.some(function(n,r){return n===t[r]}):!1},L5t=function(e,t,n,r,i){return e.map(function(s,a){switch(a){case 0:return s.add(t,n);case 1:return s.add(t+r,n);case 2:return s.add(t+r,n+i);case 3:return s.add(t,n+i)}return s})},E0e=function(){function e(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),T0e=function(){function e(t,n){if(this.container=t,this.parent=n,this.effects=[],this.curves=new T5t(this.container),this.container.styles.opacity<1&&this.effects.push(new O5t(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new P5t(r,i,s))}if(this.container.styles.overflowX!==0){var a=HN(this.curves),o=QN(this.curves);Aee(a,o)?this.effects.push(new Ik(a,6)):(this.effects.push(new Ik(a,2)),this.effects.push(new Ik(o,4)))}}return e.prototype.getEffects=function(t){for(var n=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,i=this.effects.slice(0);r;){var s=r.effects.filter(function(c){return!N0e(c)});if(n||r.container.styles.position!==0||!r.parent){if(i.unshift.apply(i,s),n=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var a=HN(r.curves),o=QN(r.curves);Aee(a,o)||i.unshift(new Ik(o,6))}}else i.unshift.apply(i,s);r=r.parent}return i.filter(function(c){return Gi(c.target,t)})},e}(),tD=function(e,t,n,r){e.container.elements.forEach(function(i){var s=Gi(i.flags,4),a=Gi(i.flags,2),o=new T0e(i,e);Gi(i.styles.display,2048)&&r.push(o);var c=Gi(i.flags,8)?[]:r;if(s||a){var u=s||i.styles.isPositioned()?n:t,d=new E0e(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var h=i.styles.zIndex.order;if(h<0){var A=0;u.negativeZIndex.some(function(p,m){return h>p.element.container.styles.zIndex.order?(A=m,!1):A>0}),u.negativeZIndex.splice(A,0,d)}else if(h>0){var f=0;u.positiveZIndex.some(function(p,m){return h>=p.element.container.styles.zIndex.order?(f=m+1,!1):f>0}),u.positiveZIndex.splice(f,0,d)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else i.styles.isFloating()?u.nonPositionedFloats.push(d):u.nonPositionedInlineLevel.push(d);tD(o,d,s?d:n,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),tD(o,t,n,c);Gi(i.flags,8)&&I0e(i,c)})},I0e=function(e,t){for(var n=e instanceof YR?e.start:1,r=e instanceof YR?e.reversed:!1,i=0;i<t.length;i++){var s=t[i];s.container instanceof p0e&&typeof s.container.value=="number"&&s.container.value!==0&&(n=s.container.value),s.listValue=o2(n,s.container.styles.listStyleType,!0),n+=r?-1:1}},R5t=function(e){var t=new T0e(e,null),n=new E0e(t),r=[];return tD(t,n,n,r),I0e(t.container,r),n},pee=function(e,t){switch(t){case 0:return wl(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return wl(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return wl(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return wl(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},D5t=function(e,t){switch(t){case 0:return wl(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return wl(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return wl(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return wl(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},U5t=function(e,t){switch(t){case 0:return wl(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return wl(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return wl(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return wl(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},H5t=function(e,t){switch(t){case 0:return Pk(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Pk(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Pk(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return Pk(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Pk=function(e,t){var n=[];return Al(e)?n.push(e.subdivide(.5,!1)):n.push(e),Al(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},wl=function(e,t,n,r){var i=[];return Al(e)?i.push(e.subdivide(.5,!1)):i.push(e),Al(n)?i.push(n.subdivide(.5,!0)):i.push(n),Al(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Al(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},P0e=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},$N=function(e){var t=e.styles,n=e.bounds,r=Sr(t.paddingLeft,n.width),i=Sr(t.paddingRight,n.width),s=Sr(t.paddingTop,n.width),a=Sr(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,s+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+s+a))},Q5t=function(e,t){return e===0?t.bounds:e===2?$N(t):P0e(t)},$5t=function(e,t){return e===0?t.bounds:e===2?$N(t):P0e(t)},FO=function(e,t,n){var r=Q5t(Hg(e.styles.backgroundOrigin,t),e),i=$5t(Hg(e.styles.backgroundClip,t),e),s=z5t(Hg(e.styles.backgroundSize,t),n,r),a=s[0],o=s[1],c=gw(Hg(e.styles.backgroundPosition,t),r.width-a,r.height-o),u=V5t(Hg(e.styles.backgroundRepeat,t),c,s,r,i),d=Math.round(r.left+c[0]),h=Math.round(r.top+c[1]);return[u,d,h,a,o]},Eg=function(e){return sr(e)&&e.value===Hy.AUTO},Ok=function(e){return typeof e=="number"},z5t=function(e,t,n){var r=t[0],i=t[1],s=t[2],a=e[0],o=e[1];if(!a)return[0,0];if(Oi(a)&&o&&Oi(o))return[Sr(a,n.width),Sr(o,n.height)];var c=Ok(s);if(sr(a)&&(a.value===Hy.CONTAIN||a.value===Hy.COVER)){if(Ok(s)){var u=n.width/n.height;return u<s!=(a.value===Hy.COVER)?[n.width,n.width/s]:[n.height*s,n.height]}return[n.width,n.height]}var d=Ok(r),h=Ok(i),A=d||h;if(Eg(a)&&(!o||Eg(o))){if(d&&h)return[r,i];if(!c&&!A)return[n.width,n.height];if(A&&c){var f=d?r:i*s,p=h?i:r/s;return[f,p]}var m=d?r:n.width,g=h?i:n.height;return[m,g]}if(c){var y=0,v=0;return Oi(a)?y=Sr(a,n.width):Oi(o)&&(v=Sr(o,n.height)),Eg(a)?y=v*s:(!o||Eg(o))&&(v=y/s),[y,v]}var x=null,b=null;if(Oi(a)?x=Sr(a,n.width):o&&Oi(o)&&(b=Sr(o,n.height)),x!==null&&(!o||Eg(o))&&(b=d&&h?x/r*i:n.height),b!==null&&Eg(a)&&(x=d&&h?b/i*r:n.width),x!==null&&b!==null)return[x,b];throw new Error("Unable to calculate background-size for element")},Hg=function(e,t){var n=e[t];return typeof n>"u"?e[0]:n},V5t=function(e,t,n,r,i){var s=t[0],a=t[1],o=n[0],c=n[1];switch(e){case 2:return[new it(Math.round(r.left),Math.round(r.top+a)),new it(Math.round(r.left+r.width),Math.round(r.top+a)),new it(Math.round(r.left+r.width),Math.round(c+r.top+a)),new it(Math.round(r.left),Math.round(c+r.top+a))];case 3:return[new it(Math.round(r.left+s),Math.round(r.top)),new it(Math.round(r.left+s+o),Math.round(r.top)),new it(Math.round(r.left+s+o),Math.round(r.height+r.top)),new it(Math.round(r.left+s),Math.round(r.height+r.top))];case 1:return[new it(Math.round(r.left+s),Math.round(r.top+a)),new it(Math.round(r.left+s+o),Math.round(r.top+a)),new it(Math.round(r.left+s+o),Math.round(r.top+a+c)),new it(Math.round(r.left+s),Math.round(r.top+a+c))];default:return[new it(Math.round(i.left),Math.round(i.top)),new it(Math.round(i.left+i.width),Math.round(i.top)),new it(Math.round(i.left+i.width),Math.round(i.height+i.top)),new it(Math.round(i.left),Math.round(i.height+i.top))]}},K5t="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",mee="Hidden Text",q5t=function(){function e(t){this._data={},this._document=t}return e.prototype.parseMetrics=function(t,n){var r=this._document.createElement("div"),i=this._document.createElement("img"),s=this._document.createElement("span"),a=this._document.body;r.style.visibility="hidden",r.style.fontFamily=t,r.style.fontSize=n,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",a.appendChild(r),i.src=K5t,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",s.style.fontFamily=t,s.style.fontSize=n,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(mee)),r.appendChild(s),r.appendChild(i);var o=i.offsetTop-s.offsetTop+2;r.removeChild(s),r.appendChild(this._document.createTextNode(mee)),r.style.lineHeight="normal",i.style.verticalAlign="super";var c=i.offsetTop-r.offsetTop+2;return a.removeChild(r),{baseline:o,middle:c}},e.prototype.getMetrics=function(t,n){var r=t+" "+n;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(t,n)),this._data[r]},e}(),O0e=function(){function e(t,n){this.context=t,this.options=n}return e}(),W5t=1e4,G5t=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i._activeEffects=[],i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),r.canvas||(i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px"),i.fontMetrics=new q5t(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),i}return t.prototype.applyEffects=function(n){for(var r=this;this._activeEffects.length;)this.popEffect();n.forEach(function(i){return r.applyEffect(i)})},t.prototype.applyEffect=function(n){this.ctx.save(),M5t(n)&&(this.ctx.globalAlpha=n.opacity),F5t(n)&&(this.ctx.translate(n.offsetX,n.offsetY),this.ctx.transform(n.matrix[0],n.matrix[1],n.matrix[2],n.matrix[3],n.matrix[4],n.matrix[5]),this.ctx.translate(-n.offsetX,-n.offsetY)),N0e(n)&&(this.path(n.path),this.ctx.clip()),this._activeEffects.push(n)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(n){return ya(this,void 0,void 0,function(){var r;return Ws(this,function(i){switch(i.label){case 0:return r=n.element.container.styles,r.isVisible()?[4,this.renderStackContent(n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(n){return ya(this,void 0,void 0,function(){return Ws(this,function(r){switch(r.label){case 0:if(Gi(n.container.flags,16))debugger;return n.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(n)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(n)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(n,r,i){var s=this;if(r===0)this.ctx.fillText(n.text,n.bounds.left,n.bounds.top+i);else{var a=v$(n.text);a.reduce(function(o,c){return s.ctx.fillText(c,o,n.bounds.top+i),o+s.ctx.measureText(c).width},n.bounds.left)}},t.prototype.createFontStyle=function(n){var r=n.fontVariant.filter(function(a){return a==="normal"||a==="small-caps"}).join(""),i=eTt(n.fontFamily).join(", "),s=rC(n.fontSize)?""+n.fontSize.number+n.fontSize.unit:n.fontSize.number+"px";return[[n.fontStyle,r,n.fontWeight,s,i].join(" "),i,s]},t.prototype.renderTextNode=function(n,r){return ya(this,void 0,void 0,function(){var i,s,a,o,c,u,d,h,A=this;return Ws(this,function(f){return i=this.createFontStyle(r),s=i[0],a=i[1],o=i[2],this.ctx.font=s,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",c=this.fontMetrics.getMetrics(a,o),u=c.baseline,d=c.middle,h=r.paintOrder,n.textBounds.forEach(function(p){h.forEach(function(m){switch(m){case 0:A.ctx.fillStyle=rs(r.color),A.renderTextWithLetterSpacing(p,r.letterSpacing,u);var g=r.textShadow;g.length&&p.text.trim().length&&(g.slice(0).reverse().forEach(function(y){A.ctx.shadowColor=rs(y.color),A.ctx.shadowOffsetX=y.offsetX.number*A.options.scale,A.ctx.shadowOffsetY=y.offsetY.number*A.options.scale,A.ctx.shadowBlur=y.blur.number,A.renderTextWithLetterSpacing(p,r.letterSpacing,u)}),A.ctx.shadowColor="",A.ctx.shadowOffsetX=0,A.ctx.shadowOffsetY=0,A.ctx.shadowBlur=0),r.textDecorationLine.length&&(A.ctx.fillStyle=rs(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(y){switch(y){case 1:A.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top+u),p.bounds.width,1);break;case 2:A.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top),p.bounds.width,1);break;case 3:A.ctx.fillRect(p.bounds.left,Math.ceil(p.bounds.top+d),p.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&p.text.trim().length&&(A.ctx.strokeStyle=rs(r.webkitTextStrokeColor),A.ctx.lineWidth=r.webkitTextStrokeWidth,A.ctx.lineJoin=window.chrome?"miter":"round",A.ctx.strokeText(p.text,p.bounds.left,p.bounds.top+u)),A.ctx.strokeStyle="",A.ctx.lineWidth=0,A.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(n,r,i){if(i&&n.intrinsicWidth>0&&n.intrinsicHeight>0){var s=$N(n),a=QN(r);this.path(a),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,n.intrinsicWidth,n.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(n){return ya(this,void 0,void 0,function(){var r,i,s,a,o,c,v,v,u,d,h,A,b,f,p,w,m,g,y,v,x,b,w;return Ws(this,function(k){switch(k.label){case 0:this.applyEffects(n.getEffects(4)),r=n.container,i=n.curves,s=r.styles,a=0,o=r.textNodes,k.label=1;case 1:return a<o.length?(c=o[a],[4,this.renderTextNode(c,s)]):[3,4];case 2:k.sent(),k.label=3;case 3:return a++,[3,1];case 4:if(!(r instanceof h0e))return[3,8];k.label=5;case 5:return k.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return v=k.sent(),this.renderReplacedElement(r,i,v),[3,8];case 7:return k.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof f0e&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof A0e))return[3,12];k.label=9;case 9:return k.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return v=k.sent(),this.renderReplacedElement(r,i,v),[3,12];case 11:return k.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof y0e&&r.tree?(u=new t(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,u.render(r.tree)]):[3,14];case 13:d=k.sent(),r.width&&r.height&&this.ctx.drawImage(d,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),k.label=14;case 14:if(r instanceof x$&&(h=Math.min(r.bounds.width,r.bounds.height),r.type===LN?r.checked&&(this.ctx.save(),this.path([new it(r.bounds.left+h*.39363,r.bounds.top+h*.79),new it(r.bounds.left+h*.16,r.bounds.top+h*.5549),new it(r.bounds.left+h*.27347,r.bounds.top+h*.44071),new it(r.bounds.left+h*.39694,r.bounds.top+h*.5649),new it(r.bounds.left+h*.72983,r.bounds.top+h*.23),new it(r.bounds.left+h*.84,r.bounds.top+h*.34085),new it(r.bounds.left+h*.39363,r.bounds.top+h*.79)]),this.ctx.fillStyle=rs(ree),this.ctx.fill(),this.ctx.restore()):r.type===RN&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+h/2,r.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=rs(ree),this.ctx.fill(),this.ctx.restore())),Y5t(r)&&r.value.length){switch(A=this.createFontStyle(s),b=A[0],f=A[1],p=this.fontMetrics.getMetrics(b,f).baseline,this.ctx.font=b,this.ctx.fillStyle=rs(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=J5t(r.styles.textAlign),w=$N(r),m=0,r.styles.textAlign){case 1:m+=w.width/2;break;case 2:m+=w.width;break}g=w.add(m,0,0,-w.height/2+1),this.ctx.save(),this.path([new it(w.left,w.top),new it(w.left+w.width,w.top),new it(w.left+w.width,w.top+w.height),new it(w.left,w.top+w.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new hb(r.value,g),s.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Gi(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(y=r.styles.listStyleImage,y.type!==0)return[3,18];v=void 0,x=y.url,k.label=15;case 15:return k.trys.push([15,17,,18]),[4,this.context.cache.match(x)];case 16:return v=k.sent(),this.ctx.drawImage(v,r.bounds.left-(v.width+10),r.bounds.top),[3,18];case 17:return k.sent(),this.context.logger.error("Error loading list-style-image "+x),[3,18];case 18:return[3,20];case 19:n.listValue&&r.styles.listStyleType!==-1&&(b=this.createFontStyle(s)[0],this.ctx.font=b,this.ctx.fillStyle=rs(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",w=new Ed(r.bounds.left,r.bounds.top+Sr(r.styles.paddingTop,r.bounds.width),r.bounds.width,UZ(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new hb(n.listValue,w),s.letterSpacing,UZ(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),k.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(n){return ya(this,void 0,void 0,function(){var r,i,y,s,a,y,o,c,y,u,d,y,h,A,y,f,p,y,m,g,y;return Ws(this,function(v){switch(v.label){case 0:if(Gi(n.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(n.element)];case 1:v.sent(),r=0,i=n.negativeZIndex,v.label=2;case 2:return r<i.length?(y=i[r],[4,this.renderStack(y)]):[3,5];case 3:v.sent(),v.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(n.element)];case 6:v.sent(),s=0,a=n.nonInlineLevel,v.label=7;case 7:return s<a.length?(y=a[s],[4,this.renderNode(y)]):[3,10];case 8:v.sent(),v.label=9;case 9:return s++,[3,7];case 10:o=0,c=n.nonPositionedFloats,v.label=11;case 11:return o<c.length?(y=c[o],[4,this.renderStack(y)]):[3,14];case 12:v.sent(),v.label=13;case 13:return o++,[3,11];case 14:u=0,d=n.nonPositionedInlineLevel,v.label=15;case 15:return u<d.length?(y=d[u],[4,this.renderStack(y)]):[3,18];case 16:v.sent(),v.label=17;case 17:return u++,[3,15];case 18:h=0,A=n.inlineLevel,v.label=19;case 19:return h<A.length?(y=A[h],[4,this.renderNode(y)]):[3,22];case 20:v.sent(),v.label=21;case 21:return h++,[3,19];case 22:f=0,p=n.zeroOrAutoZIndexOrTransformedOrOpacity,v.label=23;case 23:return f<p.length?(y=p[f],[4,this.renderStack(y)]):[3,26];case 24:v.sent(),v.label=25;case 25:return f++,[3,23];case 26:m=0,g=n.positiveZIndex,v.label=27;case 27:return m<g.length?(y=g[m],[4,this.renderStack(y)]):[3,30];case 28:v.sent(),v.label=29;case 29:return m++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(n){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(n.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(n){this.ctx.beginPath(),this.formatPath(n),this.ctx.closePath()},t.prototype.formatPath=function(n){var r=this;n.forEach(function(i,s){var a=Al(i)?i.start:i;s===0?r.ctx.moveTo(a.x,a.y):r.ctx.lineTo(a.x,a.y),Al(i)&&r.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},t.prototype.renderRepeat=function(n,r,i,s){this.path(n),this.ctx.fillStyle=r,this.ctx.translate(i,s),this.ctx.fill(),this.ctx.translate(-i,-s)},t.prototype.resizeImage=function(n,r,i){var s;if(n.width===r&&n.height===i)return n;var a=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=a.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,i);var c=o.getContext("2d");return c.drawImage(n,0,0,n.width,n.height,0,0,r,i),o},t.prototype.renderBackgroundImage=function(n){return ya(this,void 0,void 0,function(){var r,i,s,a,o,c;return Ws(this,function(u){switch(u.label){case 0:r=n.styles.backgroundImage.length-1,i=function(d){var h,A,f,P,H,W,F,L,B,p,P,H,W,F,L,m,g,y,v,x,b,w,k,j,B,E,P,T,N,F,L,U,H,W,$,z,Q,ce,R,M,Y,X;return Ws(this,function(V){switch(V.label){case 0:if(d.type!==0)return[3,5];h=void 0,A=d.url,V.label=1;case 1:return V.trys.push([1,3,,4]),[4,s.context.cache.match(A)];case 2:return h=V.sent(),[3,4];case 3:return V.sent(),s.context.logger.error("Error loading background-image "+A),[3,4];case 4:return h&&(f=FO(n,r,[h.width,h.height,h.width/h.height]),P=f[0],H=f[1],W=f[2],F=f[3],L=f[4],B=s.ctx.createPattern(s.resizeImage(h,F,L),"repeat"),s.renderRepeat(P,B,H,W)),[3,6];case 5:FBt(d)?(p=FO(n,r,[null,null,null]),P=p[0],H=p[1],W=p[2],F=p[3],L=p[4],m=EBt(d.angle,F,L),g=m[0],y=m[1],v=m[2],x=m[3],b=m[4],w=document.createElement("canvas"),w.width=F,w.height=L,k=w.getContext("2d"),j=k.createLinearGradient(y,x,v,b),RZ(d.stops,g).forEach(function(Z){return j.addColorStop(Z.stop,rs(Z.color))}),k.fillStyle=j,k.fillRect(0,0,F,L),F>0&&L>0&&(B=s.ctx.createPattern(w,"repeat"),s.renderRepeat(P,B,H,W))):MBt(d)&&(E=FO(n,r,[null,null,null]),P=E[0],T=E[1],N=E[2],F=E[3],L=E[4],U=d.position.length===0?[m$]:d.position,H=Sr(U[0],F),W=Sr(U[U.length-1],L),$=TBt(d,H,W,F,L),z=$[0],Q=$[1],z>0&&Q>0&&(ce=s.ctx.createRadialGradient(T+H,N+W,0,T+H,N+W,z),RZ(d.stops,z*2).forEach(function(Z){return ce.addColorStop(Z.stop,rs(Z.color))}),s.path(P),s.ctx.fillStyle=ce,z!==Q?(R=n.bounds.left+.5*n.bounds.width,M=n.bounds.top+.5*n.bounds.height,Y=Q/z,X=1/Y,s.ctx.save(),s.ctx.translate(R,M),s.ctx.transform(1,0,0,Y,0,0),s.ctx.translate(-R,-M),s.ctx.fillRect(T,X*(N-M)+M,F,L*X),s.ctx.restore()):s.ctx.fill())),V.label=6;case 6:return r--,[2]}})},s=this,a=0,o=n.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return a<o.length?(c=o[a],[5,i(c)]):[3,4];case 2:u.sent(),u.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(n,r,i){return ya(this,void 0,void 0,function(){return Ws(this,function(s){return this.path(pee(i,r)),this.ctx.fillStyle=rs(n),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(n,r,i,s){return ya(this,void 0,void 0,function(){var a,o;return Ws(this,function(c){switch(c.label){case 0:return r<3?[4,this.renderSolidBorder(n,i,s)]:[3,2];case 1:return c.sent(),[2];case 2:return a=D5t(s,i),this.path(a),this.ctx.fillStyle=rs(n),this.ctx.fill(),o=U5t(s,i),this.path(o),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(n){return ya(this,void 0,void 0,function(){var r,i,s,a,o,c,u,d,h=this;return Ws(this,function(A){switch(A.label){case 0:return this.applyEffects(n.getEffects(2)),r=n.container.styles,i=!_f(r.backgroundColor)||r.backgroundImage.length,s=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],a=X5t(Hg(r.backgroundClip,0),n.curves),i||r.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),_f(r.backgroundColor)||(this.ctx.fillStyle=rs(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(n.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(f){h.ctx.save();var p=HN(n.curves),m=f.inset?0:W5t,g=L5t(p,-m+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(h.path(p),h.ctx.clip(),h.mask(g)):(h.mask(p),h.ctx.clip(),h.path(g)),h.ctx.shadowOffsetX=f.offsetX.number+m,h.ctx.shadowOffsetY=f.offsetY.number,h.ctx.shadowColor=rs(f.color),h.ctx.shadowBlur=f.blur.number,h.ctx.fillStyle=f.inset?rs(f.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),A.label=2;case 2:o=0,c=0,u=s,A.label=3;case 3:return c<u.length?(d=u[c],d.style!==0&&!_f(d.color)&&d.width>0?d.style!==2?[3,5]:[4,this.renderDashedDottedBorder(d.color,d.width,o,n.curves,2)]:[3,11]):[3,13];case 4:return A.sent(),[3,11];case 5:return d.style!==3?[3,7]:[4,this.renderDashedDottedBorder(d.color,d.width,o,n.curves,3)];case 6:return A.sent(),[3,11];case 7:return d.style!==4?[3,9]:[4,this.renderDoubleBorder(d.color,d.width,o,n.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(d.color,o,n.curves)];case 10:A.sent(),A.label=11;case 11:o++,A.label=12;case 12:return c++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(n,r,i,s,a){return ya(this,void 0,void 0,function(){var o,c,u,d,h,A,f,p,m,g,y,v,x,b,w,k,w,k;return Ws(this,function(j){return this.ctx.save(),o=H5t(s,i),c=pee(s,i),a===2&&(this.path(c),this.ctx.clip()),Al(c[0])?(u=c[0].start.x,d=c[0].start.y):(u=c[0].x,d=c[0].y),Al(c[1])?(h=c[1].end.x,A=c[1].end.y):(h=c[1].x,A=c[1].y),i===0||i===2?f=Math.abs(u-h):f=Math.abs(d-A),this.ctx.beginPath(),a===3?this.formatPath(o):this.formatPath(c.slice(0,2)),p=r<3?r*3:r*2,m=r<3?r*2:r,a===3&&(p=r,m=r),g=!0,f<=p*2?g=!1:f<=p*2+m?(y=f/(2*p+m),p*=y,m*=y):(v=Math.floor((f+m)/(p+m)),x=(f-v*p)/(v-1),b=(f-(v+1)*p)/v,m=b<=0||Math.abs(m-x)<Math.abs(m-b)?x:b),g&&(a===3?this.ctx.setLineDash([0,p+m]):this.ctx.setLineDash([p,m])),a===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=rs(n),this.ctx.stroke(),this.ctx.setLineDash([]),a===2&&(Al(c[0])&&(w=c[3],k=c[0],this.ctx.beginPath(),this.formatPath([new it(w.end.x,w.end.y),new it(k.start.x,k.start.y)]),this.ctx.stroke()),Al(c[1])&&(w=c[1],k=c[2],this.ctx.beginPath(),this.formatPath([new it(w.end.x,w.end.y),new it(k.start.x,k.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(n){return ya(this,void 0,void 0,function(){var r;return Ws(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=rs(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=R5t(n),[4,this.renderStack(r)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},t}(O0e),Y5t=function(e){return e instanceof g0e||e instanceof m0e?!0:e instanceof x$&&e.type!==RN&&e.type!==LN},X5t=function(e,t){switch(e){case 0:return HN(t);case 2:return I5t(t);case 1:default:return QN(t)}},J5t=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Z5t=["-apple-system","system-ui"],eTt=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(t){return Z5t.indexOf(t)===-1}):e},tTt=function(e){Pc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=r,i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),i}return t.prototype.render=function(n){return ya(this,void 0,void 0,function(){var r,i;return Ws(this,function(s){switch(s.label){case 0:return r=GR(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,n),[4,nTt(r)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=rs(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t}(O0e),nTt=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},rTt=function(){function e(t){var n=t.id,r=t.enabled;this.id=n,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,hk([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,hk([this.id,this.getTime()+"ms"],t))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,hk([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,hk([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.instances={},e}(),iTt=function(){function e(t,n){var r;this.windowBounds=n,this.instanceName="#"+e.instanceCount++,this.logger=new rTt({id:this.instanceName,enabled:t.logging}),this.cache=(r=t.cache)!==null&&r!==void 0?r:new S5t(this,t)}return e.instanceCount=1,e}(),F0e=function(e,t){return t===void 0&&(t={}),sTt(e,t)};typeof window<"u"&&B0e.setContext(window);var sTt=function(e,t){return ya(void 0,void 0,void 0,function(){var n,r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,b,w,j,k,j,B,E,P,T,N,F,L,U,H,W,$,z,Q,ce,R,M,Y;return Ws(this,function(X){switch(X.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(n=e.ownerDocument,!n)throw new Error("Element is not attached to a Document");if(r=n.defaultView,!r)throw new Error("Document is not attached to a Window");return i={allowTaint:(B=t.allowTaint)!==null&&B!==void 0?B:!1,imageTimeout:(E=t.imageTimeout)!==null&&E!==void 0?E:15e3,proxy:t.proxy,useCORS:(P=t.useCORS)!==null&&P!==void 0?P:!1},s=OR({logging:(T=t.logging)!==null&&T!==void 0?T:!0,cache:t.cache},i),a={windowWidth:(N=t.windowWidth)!==null&&N!==void 0?N:r.innerWidth,windowHeight:(F=t.windowHeight)!==null&&F!==void 0?F:r.innerHeight,scrollX:(L=t.scrollX)!==null&&L!==void 0?L:r.pageXOffset,scrollY:(U=t.scrollY)!==null&&U!==void 0?U:r.pageYOffset},o=new Ed(a.scrollX,a.scrollY,a.windowWidth,a.windowHeight),c=new iTt(s,o),u=(H=t.foreignObjectRendering)!==null&&H!==void 0?H:!1,d={allowTaint:(W=t.allowTaint)!==null&&W!==void 0?W:!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:u,copyStyles:u},c.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),h=new hee(c,e,d),A=h.clonedReferenceElement,A?[4,h.toIFrame(n,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=X.sent(),p=w$(A)||o5t(A)?L_t(A.ownerDocument):pT(c,A),m=p.width,g=p.height,y=p.left,v=p.top,x=aTt(c,A,t.backgroundColor),b={canvas:t.canvas,backgroundColor:x,scale:(z=($=t.scale)!==null&&$!==void 0?$:r.devicePixelRatio)!==null&&z!==void 0?z:1,x:((Q=t.x)!==null&&Q!==void 0?Q:0)+y,y:((ce=t.y)!==null&&ce!==void 0?ce:0)+v,width:(R=t.width)!==null&&R!==void 0?R:Math.ceil(m),height:(M=t.height)!==null&&M!==void 0?M:Math.ceil(g)},u?(c.logger.debug("Document cloned, using foreign object rendering"),j=new tTt(c,b),[4,j.render(A)]):[3,3];case 2:return w=X.sent(),[3,5];case 3:return c.logger.debug("Document cloned, element located at "+y+","+v+" with size "+m+"x"+g+" using computed rendering"),c.logger.debug("Starting DOM parsing"),k=x0e(c,A),x===k.styles.backgroundColor&&(k.styles.backgroundColor=md.TRANSPARENT),c.logger.debug("Starting renderer for element at "+b.x+","+b.y+" with size "+b.width+"x"+b.height),j=new G5t(c,b),[4,j.render(k)];case 4:w=X.sent(),X.label=5;case 5:return(!((Y=t.removeContainer)!==null&&Y!==void 0)||Y)&&(hee.destroy(f)||c.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),c.logger.debug("Finished rendering"),[2,w]}})})},aTt=function(e,t,n){var r=t.ownerDocument,i=r.documentElement?ub(e,getComputedStyle(r.documentElement).backgroundColor):md.TRANSPARENT,s=r.body?ub(e,getComputedStyle(r.body).backgroundColor):md.TRANSPARENT,a=typeof n=="string"?ub(e,n):n===null?md.TRANSPARENT:4294967295;return t===r.documentElement?_f(i)?_f(s)?a:s:i:a};const oTt=Object.freeze(Object.defineProperty({__proto__:null,default:F0e},Symbol.toStringTag,{value:"Module"}));function lTt({payload:e,targetId:t}){const[n,r]=C.useState(!1),[i,s]=C.useState(!1),a=async()=>{r(!0);try{const c=document.getElementById(t);if(!c)throw new Error("Report container not found");const u=await F0e(c,{scale:2,useCORS:!0,backgroundColor:"#ffffff",windowWidth:c.scrollWidth}),d=u.toDataURL("image/png"),h=new Ot({unit:"px",format:[u.width,u.height]});h.addImage(d,"PNG",0,0,u.width,u.height),h.save(`Holden_MarketPulse_${e.zip}_${new Date().toISOString().slice(0,10)}.pdf`)}catch(c){console.error(c),alert("Could not generate PDF. Try the HTML download instead.")}finally{r(!1)}},o=async()=>{s(!0);try{const{data:c,error:u}=await Me.functions.invoke("generate-market-pulse-html",{body:{payload:e}});if(u)throw u;const d=c==null?void 0:c.html;if(!d)throw new Error("No HTML returned");const h=new Blob([d],{type:"text/html"}),A=URL.createObjectURL(h),f=document.createElement("a");f.href=A,f.download=`Holden_MarketPulse_${e.zip}_${new Date().toISOString().slice(0,10)}.html`,f.click(),URL.revokeObjectURL(A)}catch(c){console.error(c),alert("Could not generate HTML. Please try again.")}finally{s(!1)}};return l.jsxs("div",{className:"flex flex-wrap gap-3",children:[l.jsxs("button",{onClick:a,disabled:n,className:"inline-flex items-center gap-2 px-4 py-2.5 bg-foreground text-background text-[11px] uppercase tracking-[0.2em] font-medium hover:opacity-90 disabled:opacity-50",children:[n?l.jsx(Ea,{size:14,className:"animate-spin"}):l.jsx(t2e,{size:14})," Download PDF"]}),l.jsxs("button",{onClick:o,disabled:i,className:"inline-flex items-center gap-2 px-4 py-2.5 border border-border text-foreground text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-muted disabled:opacity-50",children:[i?l.jsx(Ea,{size:14,className:"animate-spin"}):l.jsx(Vp,{size:14})," Download HTML"]})]})}function cTt({role:e,content:t}){const n=e==="user";return l.jsx("div",{className:`flex ${n?"justify-end":"justify-start"}`,children:l.jsx("div",{className:`max-w-[85%] px-3.5 py-2.5 text-sm leading-relaxed ${n?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:n?l.jsx("p",{className:"whitespace-pre-wrap",children:t}):l.jsx("div",{className:"prose prose-sm max-w-none prose-p:my-1.5 prose-p:text-foreground prose-strong:text-foreground prose-ul:my-1.5 prose-ol:my-1.5 prose-li:my-0",children:l.jsx(U6,{children:t||"…"})})})})}function uTt({chips:e,onPick:t}){return l.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(n=>l.jsx("button",{onClick:()=>t(n),className:"text-[11px] px-3 py-1.5 bg-background border border-border text-foreground/80 hover:bg-muted transition-colors text-left",children:n},n))})}function dTt({zip:e,lens:t,onDismiss:n}){const[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(!1),[h,A]=C.useState(!1),f=async()=>{if(!(!r||!o)){d(!0);try{await Me.functions.invoke("aeo-lead-capture",{body:{name:r,phone:s,email:o,question:`Market Pulse chat — ${t} lens for ${e}`,source_page:`/market-pulse/${e}?lens=${t}`}}),A(!0)}catch(p){console.error(p),alert("Something went wrong sending your info. Please text Holden directly at (616) 403-6393.")}finally{d(!1)}}};return h?l.jsx("div",{className:"bg-muted border border-border p-4 my-2",children:l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l.jsx(Sl,{size:16})," Thanks — Holden will reach out shortly."]})}):l.jsxs("div",{className:"bg-muted border border-border p-4 my-2 space-y-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground",children:"Want Holden to follow up personally?"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx("input",{value:r,onChange:p=>i(p.target.value),placeholder:"Name",className:"bg-background border border-border px-2.5 py-1.5 text-sm"}),l.jsx("input",{value:s,onChange:p=>a(p.target.value),placeholder:"Phone",className:"bg-background border border-border px-2.5 py-1.5 text-sm"})]}),l.jsx("input",{value:o,onChange:p=>c(p.target.value),placeholder:"Email",type:"email",className:"w-full bg-background border border-border px-2.5 py-1.5 text-sm"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:f,disabled:u||!r||!o,className:"flex-1 inline-flex items-center justify-center gap-2 px-3 py-2 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.2em] font-medium disabled:opacity-50",children:[u?l.jsx(Ea,{size:14,className:"animate-spin"}):null," Send"]}),l.jsx("button",{onClick:n,className:"px-3 py-2 text-[11px] uppercase tracking-[0.2em] text-muted-foreground hover:text-foreground",children:"Dismiss"})]})]})}const hTt=/\b(tour|visit|see it|list|sell my|pre.?approval|preapproval|ready to buy|let.?s do|set up|book|schedule)\b/i;function fTt(e,t){const n=`mp_session_${e}_${t}`;let r=localStorage.getItem(n);return r||(r=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,localStorage.setItem(n,r)),r}function ATt({payload:e,rates:t}){const[n,r]=C.useState(!1),[i,s]=C.useState([]),[a,o]=C.useState(""),[c,u]=C.useState(!1),[d,h]=C.useState(!1),[A,f]=C.useState(!1),p=C.useRef(null),m=fTt(e.zip,e.lens);C.useEffect(()=>{(async()=>{const{data:v}=await Me.from("market_pulse_chats").select("role, content").eq("session_id",m).eq("zip",e.zip).eq("lens",e.lens).order("created_at",{ascending:!0});v&&v.length&&s(v.map(x=>({role:x.role,content:x.content})))})()},[m,e.zip,e.lens]),C.useEffect(()=>{var v;(v=p.current)==null||v.scrollTo({top:p.current.scrollHeight,behavior:"smooth"})},[i,n]);const g=e.lens==="seller"?[`Why is ${e.zip} ${e.heat_index>=60?"a strong":"this kind of"} market right now?`,`What would my net be at $${Math.round(e.snapshot.median_sale_price/1e3)}k?`,`How does ${e.zip} compare to nearby zips?`,"Should I list now or wait until spring?"]:[`Is now a good time to buy in ${e.zip}?`,`What does a $${Math.round(e.snapshot.median_sale_price/1e3)}k home cost monthly?`,`Where can I find more inventory near ${e.zip}?`,"What should my offer strategy be here?"];async function y(v){var B,E,P;const x=v.trim();if(!x||c)return;o("");const b={role:"user",content:x},w=[...i,b,{role:"assistant",content:""}];s(w),u(!0),Me.from("market_pulse_chats").insert({session_id:m,zip:e.zip,lens:e.lens,role:"user",content:x}).then(()=>{});const k=w.filter(T=>T.role==="user").length;!A&&(hTt.test(x)||k>0&&k%4===0)&&h(!0);let j="";try{const N=await fetch("https://khmmwvmdbhaplcfcndjx.supabase.co/functions/v1/market-pulse-chat",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q"},body:JSON.stringify({payload:e,rates:t,messages:[...i,b].map(W=>({role:W.role,content:W.content}))})});if(N.status===429)throw new Error("Too many requests — please wait a moment and try again.");if(N.status===402)throw new Error("AI credits exhausted. Please contact Holden directly.");if(!N.ok||!N.body)throw new Error(`Chat failed (${N.status})`);const F=N.body.getReader(),L=new TextDecoder;let U="",H=!1;for(;!H;){const{done:W,value:$}=await F.read();if(W)break;U+=L.decode($,{stream:!0});let z;for(;(z=U.indexOf(`
`))!==-1;){let Q=U.slice(0,z);if(U=U.slice(z+1),Q.endsWith("\r")&&(Q=Q.slice(0,-1)),!Q.startsWith("data: "))continue;const ce=Q.slice(6).trim();if(ce==="[DONE]"){H=!0;break}try{const M=(P=(E=(B=JSON.parse(ce).choices)==null?void 0:B[0])==null?void 0:E.delta)==null?void 0:P.content;M&&(j+=M,s(Y=>{const X=[...Y];return X[X.length-1]={role:"assistant",content:j},X}))}catch{U=Q+`
`+U;break}}}}catch(T){j=`_${T.message||"Sorry — something went wrong. Please try again."}_`,s(N=>{const F=[...N];return F[F.length-1]={role:"assistant",content:j},F})}finally{u(!1),j&&Me.from("market_pulse_chats").insert({session_id:m,zip:e.zip,lens:e.lens,role:"assistant",content:j}).then(()=>{})}}return l.jsxs(l.Fragment,{children:[!n&&l.jsxs("button",{onClick:()=>r(!0),className:"fixed bottom-20 right-4 md:bottom-24 md:right-6 z-50 inline-flex items-center gap-2 px-4 py-3 bg-primary text-primary-foreground shadow-2xl hover:bg-primary/90","aria-label":"Ask Holden's AI about this report",children:[l.jsx(df,{size:16}),l.jsxs("span",{className:"text-[11px] uppercase tracking-[0.2em] font-medium",children:["Ask About ",e.zip]})]}),n&&l.jsxs("div",{className:"fixed inset-x-0 bottom-0 md:inset-auto md:bottom-20 md:right-6 z-50 md:w-[400px] md:h-[560px] bg-card border border-border shadow-2xl flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-primary text-primary-foreground",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] opacity-80",children:"Ask Holden's AI"}),l.jsxs("div",{className:"text-sm font-semibold",children:["About ",e.zip," · ",e.area]})]}),l.jsx("button",{onClick:()=>r(!1),className:"p-1 hover:opacity-80","aria-label":"Close chat",children:l.jsx(ra,{size:18})})]}),l.jsxs("div",{ref:p,className:"flex-1 overflow-y-auto p-4 space-y-3",children:[i.length===0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Hey — I'm Holden's AI. Ask me anything about this report and I'll answer with what I'm seeing in ",e.zip,"."]}),l.jsx(uTt,{chips:g,onPick:y})]}),i.map((v,x)=>l.jsx(cTt,{role:v.role,content:v.content},x)),d&&!A&&l.jsx(dTt,{zip:e.zip,lens:e.lens,onDismiss:()=>{h(!1),f(!0)}})]}),l.jsxs("form",{onSubmit:v=>{v.preventDefault(),y(a)},className:"border-t border-border p-3 flex items-center gap-2",children:[l.jsx("input",{value:a,onChange:v=>o(v.target.value),placeholder:`Ask about ${e.zip}…`,className:"flex-1 bg-background border border-border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary",disabled:c}),l.jsx("button",{type:"submit",disabled:c||!a.trim(),className:"inline-flex items-center justify-center w-9 h-9 bg-primary text-primary-foreground disabled:opacity-50","aria-label":"Send",children:c?l.jsx(Ea,{size:14,className:"animate-spin"}):l.jsx(Nre,{size:14})})]}),l.jsx("div",{className:"px-3 pb-2 text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60 text-center",children:"AI assistant · Not a contractual response"})]})]})}function pTt(){var v,x;const{zip:e=""}=gm(),[t]=Qie(),n=t.get("lens")==="buyer"?"buyer":"seller",r=t.get("run")==="1",i=t.get("t")||"",[s,a]=C.useState(null),[o,c]=C.useState(null),[u,d]=C.useState(!1),[h,A]=C.useState(null),[f,p]=C.useState(!1),m=Xae(e),g=m?((v=d4e(e))==null?void 0:v.city)||"Grand Rapids area":"",y=async()=>{if(!m){A("Invalid ZIP code");return}p(!0),d(!0),A(null),a(null);try{Me.functions.invoke("market-pulse-rates",{body:{}}).catch(()=>{});const{data:b,error:w}=await Me.functions.invoke("market-pulse-report",{body:{zip:e,lens:n}});if(w)throw new Error(w.message);if(b!=null&&b.error)throw new Error(b.error);const k=b==null?void 0:b.payload;if(!k)throw new Error("No report returned");a(k);const{data:j}=await Me.from("market_pulse_rates").select("rates, source, fetched_at").order("fetched_at",{ascending:!1}).limit(1).maybeSingle();j&&c({rates:j.rates,source:j.source,fetched_at:j.fetched_at})}catch(b){A(b.message||"Failed to generate report")}finally{d(!1)}};return C.useEffect(()=>{r&&m&&y()},[e,n,i,r]),l.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[l.jsxs(Vn,{children:[l.jsx("title",{children:`Market Pulse · ZIP ${e} · ${n==="seller"?"Seller":"Buyer"} Report · HoldenGR`}),l.jsx("meta",{name:"description",content:`Live market report for ZIP ${e} from Grand Rapids REALTOR® Holden Richardson. Heat index, price trends, mortgage rates, MI net sheet calculator, and personal AI chat.`}),l.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/market-pulse/${e}`}),l.jsx("meta",{property:"og:title",content:`Market Pulse · ZIP ${e} · ${n==="seller"?"Seller":"Buyer"} Report`}),l.jsx("meta",{property:"og:description",content:`Live market report for ZIP ${e} from Grand Rapids REALTOR® Holden Richardson — heat index, price trends, rates, and AI chat.`}),l.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/market-pulse/${e}`}),l.jsx("meta",{property:"og:type",content:"article"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:`Market Pulse · ZIP ${e}`}),l.jsx("meta",{name:"twitter:description",content:`Live ${e} Grand Rapids market report from Holden Richardson.`}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx(EE,{}),l.jsx("main",{className:"flex-1 pt-20 pb-24",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4 py-6 border-b border-border",children:[l.jsxs("div",{children:[l.jsxs(St,{to:"/",className:"inline-flex items-center gap-1 text-[10px] uppercase tracking-[0.25em] text-muted-foreground hover:text-foreground",children:[l.jsx(mm,{size:12})," Home"]}),l.jsxs("h1",{className:"text-3xl md:text-4xl font-bold mt-2",children:["Market Pulse · ZIP ",e]}),l.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[n==="seller"?"Seller report":"Buyer report"," · ",s?`${s.city} — ${s.area}`:g]})]}),l.jsx("div",{className:"w-full md:w-auto md:max-w-sm",children:l.jsx(h6,{compact:!0})})]}),!f&&!u&&!s&&!h&&l.jsxs("div",{className:"py-10 md:py-14 space-y-12",children:[l.jsxs("div",{className:"bg-card border border-border p-6 md:p-10 text-center max-w-3xl mx-auto",children:[l.jsxs("div",{className:"inline-flex items-center gap-2 mb-4 px-3 py-1 bg-primary/10 text-primary text-[10px] uppercase tracking-[0.25em] font-medium",children:[l.jsx(tj,{size:12})," Live Report Ready"]}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-bold mb-3",children:["Generate your ",n==="seller"?"seller":"buyer"," report for ZIP ",e]}),l.jsxs("p",{className:"text-sm md:text-base text-foreground/75 max-w-xl mx-auto mb-6 leading-relaxed",children:["I'll research ",l.jsx("span",{className:"font-medium text-foreground",children:g})," live — pulling current price trends, days on market, today's mortgage rates, and Michigan-specific closing costs. Takes about 20–40 seconds."]}),l.jsxs("button",{onClick:y,disabled:!m,className:"inline-flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.25em] font-medium hover:bg-primary/90 transition-colors disabled:opacity-40",children:[l.jsx(Os,{size:14})," Run Report"]}),l.jsx("p",{className:"text-[10px] text-muted-foreground mt-4",children:"Free · No login · You can switch ZIP or buyer/seller anytime"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.3em] text-primary font-semibold mb-2",children:"What's Inside"}),l.jsx("h3",{className:"text-xl md:text-2xl font-bold",children:"A snapshot of what you'll get"})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[{icon:bre,title:"Heat Index",body:"0–100 score telling you if this ZIP is a seller's, balanced, or buyer's market right now."},{icon:yre,title:"Price & Velocity Trends",body:"24 months of median price + 12 months of days-on-market and list-to-sale ratio."},{icon:tj,title:"Today's Mortgage Rates",body:"Live 30-yr, 15-yr, FHA, VA, and 7/1 ARM rates from FRED + Mortgage News Daily."},{icon:mre,title:n==="seller"?"MI Net Sheet":"PITI Calculator",body:n==="seller"?"Michigan transfer tax + Kent County + tiered title — see your net proceeds at the median price.":"Principal, interest, taxes, insurance, and auto-tiered PMI for the median home."},{icon:df,title:"Chat With The Report",body:"Ask follow-up questions like 'what about ZIP 49503?' or 'should I list in March?' — context stays."},{icon:wre,title:"PDF + Standalone HTML",body:"Download the full report to share with your spouse, lender, or just keep for reference."}].map(({icon:b,title:w,body:k})=>l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx(b,{size:18,className:"text-primary mb-3"}),l.jsx("div",{className:"text-sm font-semibold mb-1.5",children:w}),l.jsx("div",{className:"text-xs text-foreground/70 leading-relaxed",children:k})]},w))})]}),l.jsxs("div",{className:"bg-muted/30 border border-border p-6 md:p-8",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground mb-3",children:"Sample · Holden's Take"}),l.jsx("p",{className:"text-base md:text-lg leading-snug font-medium mb-4 italic text-foreground/85",children:`"Heritage Hill is still firmly a seller's market — homes are moving in 14 days at 99% of list, but new listings ticked up 18% this month. If you're selling, list before May. If you're buying, watch for price reductions on anything sitting over 21 days."`}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mt-5",children:[{l:"Median Price",v:"$385K",s:"+6.2% YoY"},{l:"Days on Market",v:"14",s:"vs 21 last yr"},{l:"List-to-Sale",v:"99.2%",s:"Strong"},{l:"Heat Index",v:"78/100",s:"Seller's market"}].map(({l:b,v:w,s:k})=>l.jsxs("div",{className:"bg-background border border-border p-3",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-1",children:b}),l.jsx("div",{className:"text-lg font-bold tabular-nums",children:w}),l.jsx("div",{className:"text-[10px] text-foreground/60",children:k})]},b))}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70 mt-4",children:["Sample only · Your report uses live data for ZIP ",e]})]})]}),u&&l.jsxs("div",{className:"py-24 flex flex-col items-center text-center",children:[l.jsx(Ea,{size:32,className:"animate-spin text-primary mb-4"}),l.jsxs("p",{className:"text-sm text-muted-foreground max-w-md",children:["Researching ",e," live — gathering market data, mortgage rates, and Holden's take. This takes 20–40 seconds for fresh reports."]})]}),h&&!u&&l.jsxs("div",{className:"py-16 max-w-md mx-auto text-center",children:[l.jsx(X1e,{size:32,className:"text-destructive mx-auto mb-3"}),l.jsx("p",{className:"text-sm text-foreground/80 mb-4",children:h}),l.jsx("button",{onClick:y,className:"inline-flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.2em]",children:"Try Again"})]}),s&&!u&&l.jsxs("div",{id:"market-pulse-report",className:"py-8 space-y-8",children:[l.jsxs("div",{className:"bg-primary text-primary-foreground p-5 md:p-6",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] opacity-70 mb-1",children:"Holden's Take"}),l.jsx("p",{className:"text-lg md:text-xl leading-snug",children:s.holdens_take})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[l.jsx("div",{className:"lg:col-span-1",children:l.jsx(m2t,{value:s.heat_index,label:s.heat_label,lens:n})}),l.jsx("div",{className:"lg:col-span-2",children:l.jsx(v2t,{snapshot:s.snapshot,lens:n})})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(x2t,{data:s.price_trend_24mo}),l.jsx(w2t,{data:s.velocity_trend_12mo})]}),l.jsx(b2t,{percentile:s.metro_score_percentile,comps:s.metro_comps,zip:s.zip}),l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-2",children:n==="seller"?"Sell Now or Wait?":"Buy Now or Wait?"}),l.jsx("p",{className:"text-lg font-semibold mb-2",children:s.now_or_wait.verdict}),l.jsx("p",{className:"text-sm text-foreground/80 leading-relaxed",children:s.now_or_wait.reasoning})]}),l.jsx(j2t,{md:s.writeup_md,area:s.area}),l.jsx(C2t,{}),n==="seller"?l.jsx(k2t,{defaultPrice:s.snapshot.median_sale_price}):l.jsx(_2t,{defaultPrice:s.snapshot.median_sale_price}),l.jsx(E2t,{lens:n}),((x=s.sources)==null?void 0:x.length)>0&&l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-3",children:"Sources"}),l.jsx("ul",{className:"space-y-1.5 text-sm",children:s.sources.map((b,w)=>l.jsx("li",{children:l.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:b.title})},w))}),l.jsx("p",{className:"text-[10px] text-muted-foreground/70 mt-3",children:"AI-researched · Not MLS-verified · Confirm with your agent before decisions."})]}),l.jsxs("div",{className:"bg-muted/30 border border-border p-5",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-3",children:"Take This Report With You"}),l.jsx(lTt,{payload:s,targetId:"market-pulse-report"})]})]})]})}),s&&l.jsx(T2t,{}),s&&l.jsx(ATt,{payload:s,rates:o}),l.jsx(d6,{})]})}const mTt=[{icon:bre,title:"Heat Index",desc:"Instant read on whether your ZIP is a buyer's, seller's, or balanced market."},{icon:yre,title:"Price & Velocity Trends",desc:"12-month median price and days-on-market charts pulled live."},{icon:tj,title:"Live Mortgage Rates",desc:"Today's 30-yr, 15-yr, and FHA rates refreshed daily."},{icon:mre,title:"Net Sheet & PITI Calculators",desc:"Michigan-accurate seller proceeds and buyer payment math."},{icon:df,title:"AI Chat with Holden's Take",desc:"Ask questions about your ZIP and get answers grounded in the report."},{icon:wre,title:"Downloadable Report",desc:"Save or share a clean PDF of your full market snapshot."}];function gTt(){return l.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[l.jsxs(Vn,{children:[l.jsx("title",{children:"Market Pulse · Live Grand Rapids ZIP Reports · HoldenGR"}),l.jsx("meta",{name:"description",content:"Get a live, ZIP-specific Grand Rapids real estate market report. Heat index, price trends, mortgage rates, Michigan net sheet, and AI chat — free, no login."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/market-pulse"}),l.jsx("meta",{property:"og:title",content:"Market Pulse · Live Grand Rapids ZIP Reports"}),l.jsx("meta",{property:"og:description",content:"Get a live, ZIP-specific Grand Rapids real estate market report. Heat index, price trends, mortgage rates, Michigan net sheet, and AI chat — free, no login."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/market-pulse"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Market Pulse · Live Grand Rapids ZIP Reports"}),l.jsx("meta",{name:"twitter:description",content:"Get a live, ZIP-specific Grand Rapids real estate market report — heat index, price trends, rates, and AI chat."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx(EE,{}),l.jsxs("main",{className:"flex-1 pt-20",children:[l.jsx("section",{className:"border-b border-border bg-muted/30",children:l.jsx("div",{className:"container-page py-16 md:py-24",children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Os,{size:14,className:"text-primary"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-primary",children:"Market Pulse"})]}),l.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-semibold tracking-tight mb-6",children:"Your ZIP. My take. Real numbers."}),l.jsx("p",{className:"text-lg text-foreground/70 mb-8 max-w-xl",children:"Drop your Grand Rapids ZIP and get an instant market report — heat index, price trends, live mortgage rates, a Michigan-accurate net sheet, and an AI chat that answers questions about your specific neighborhood."}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Free · No login · Built and personally tuned by Holden Richardson, REALTOR®"})]}),l.jsx("div",{children:l.jsx(h6,{})})]})})}),l.jsxs("section",{className:"container-page py-16 md:py-24",children:[l.jsxs("div",{className:"max-w-2xl mb-12",children:[l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-3",children:"What you get"}),l.jsx("p",{className:"text-foreground/70",children:"Every Market Pulse report pulls live data for your specific ZIP, then layers Holden's local context on top so the numbers actually mean something."})]}),l.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:mTt.map(({icon:e,title:t,desc:n})=>l.jsxs("div",{className:"border border-border p-6 bg-background hover:border-primary/40 transition-colors",children:[l.jsx(e,{size:20,className:"text-primary mb-4"}),l.jsx("h3",{className:"font-semibold mb-2",children:t}),l.jsx("p",{className:"text-sm text-foreground/70",children:n})]},t))})]}),l.jsx("section",{className:"border-t border-border bg-muted/30",children:l.jsx("div",{className:"container-page py-16 md:pt-20 md:pb-28",children:l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-foreground/60 mr-2",children:"Popular ZIPs"}),[{zip:"49506",label:"East Grand Rapids / Eastown"},{zip:"49503",label:"Heritage Hill / Downtown"},{zip:"49504",label:"West Side"},{zip:"49505",label:"Creston / NE GR"},{zip:"49508",label:"Alger Heights"},{zip:"49546",label:"Forest Hills / Cascade"}].map(e=>l.jsxs("a",{href:`/market-pulse/${e.zip}?run=1`,className:"inline-flex items-center gap-2 px-3 py-1.5 border border-border bg-background text-xs hover:border-primary/40 hover:text-primary transition-colors",children:[l.jsx("span",{className:"tabular-nums font-semibold",children:e.zip}),l.jsxs("span",{className:"text-foreground/60",children:["· ",e.label]})]},e.zip))]})})})]}),l.jsx(d6,{})]})}const M0e=Object.assign({"../pages/groovy.html":()=>v_(()=>import("./groovy-C3QU58Km.js"),[]).then(e=>e.default)});function yTt(e){const t=`../pages/${e}.html`;return Object.prototype.hasOwnProperty.call(M0e,t)?t:null}function vTt({slug:e}={}){const{slug:t}=gm(),n=e??t??null,[r,i]=C.useState(null),[s,a]=C.useState(!1);if(C.useEffect(()=>{if(!n){a(!0);return}const u=yTt(n);if(!u){a(!0);return}const d=M0e[u];d().then(i).catch(()=>a(!0))},[n]),s||!n)return l.jsx(vy,{to:"/",replace:!0});if(r===null)return l.jsx("div",{className:"p-8 text-center",children:"Loading…"});const o=r.match(/<body[^>]*>([\s\S]*)<\/body>/i),c=o?o[1].trim():r;return l.jsx("div",{className:"migration-page-contents",dangerouslySetInnerHTML:{__html:c}})}const xTt=l.jsx(l.Fragment,{children:l.jsx(Tt,{path:"groovy",element:l.jsx(vTt,{slug:"groovy"})})}),wTt=new $ke,bTt=()=>{const e=co();return C.useEffect(()=>{Fje()},[e.pathname]),null},CTt=()=>{const t=co().pathname.replace(/^\/about\/news\//,"");return l.jsx(vy,{to:`/news/${t}`,replace:!0})},STt=()=>l.jsx(Gie,{children:l.jsx(Wke,{client:wTt,children:l.jsxs(xU,{children:[l.jsx(uCe,{}),l.jsx(QCe,{}),l.jsxs(nje,{children:[l.jsx(Mje,{}),l.jsx(bTt,{}),l.jsxs(W_e,{children:[l.jsx(Tt,{path:"/",element:l.jsx(K4e,{})}),l.jsx(Tt,{path:"/properties",element:l.jsx(mOe,{})}),l.jsx(Tt,{path:"/properties/:id",element:l.jsx(gOe,{})}),l.jsx(Tt,{path:"/about",element:l.jsx(SOe,{})}),l.jsx(Tt,{path:"/about/testimonials",element:l.jsx(EOe,{})}),l.jsx(Tt,{path:"/about/news",element:l.jsx(vy,{to:"/news",replace:!0})}),l.jsx(Tt,{path:"/about/news/:slug",element:l.jsx(CTt,{})}),l.jsx(Tt,{path:"/about/:slug",element:l.jsx(y_,{})}),l.jsx(Tt,{path:"/contact",element:l.jsx(MOe,{})}),l.jsx(Tt,{path:"/home-valuation",element:l.jsx(ROe,{})}),l.jsx(Tt,{path:"/idx",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/idx/:a",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/idx/:a/:b",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/idx/:a/:b/:c",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/idx/:a/:b/:c/:d",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/idx/*",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/client",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/client/:a",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/client/:a/:b",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/client/:a/:b/:c",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/client/:a/:b/:c/:d",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/r",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/r/:a",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/r/:a/:b",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/r/:a/:b/:c",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/search",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/search/:a",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/search/:a/:b",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/search/:a/:b/:c",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/preview-property",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/preview-property/:a",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/preview-property/:a/:b",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/magic-redirect",element:l.jsx(Wr,{})}),l.jsx(Tt,{path:"/auth",element:l.jsx(qOe,{})}),l.jsx(Tt,{path:"/blog",element:l.jsx(ZOe,{})}),l.jsx(Tt,{path:"/blog/:slug",element:l.jsx(e3e,{})}),l.jsx(Tt,{path:"/faq",element:l.jsx(n6e,{})}),l.jsx(Tt,{path:"/news",element:l.jsx(i6e,{})}),l.jsx(Tt,{path:"/news/:slug",element:l.jsx(y_,{})}),l.jsx(Tt,{path:"/admin",element:l.jsx(I1t,{})}),l.jsx(Tt,{path:"/admin/blog",element:l.jsx(gqe,{})}),l.jsx(Tt,{path:"/admin/profile",element:l.jsx(yqe,{})}),l.jsx(Tt,{path:"/admin/aeo",element:l.jsx(Qbt,{})}),l.jsx(Tt,{path:"/admin/list",element:l.jsx(C1t,{})}),l.jsx(Tt,{path:"/list",element:l.jsx(Y1t,{})}),l.jsx(Tt,{path:"/list/benefits",element:l.jsx(t2t,{})}),l.jsx(Tt,{path:"/list/new-intent",element:l.jsx(n2t,{})}),l.jsx(Tt,{path:"/savings-program",element:l.jsx(vy,{to:"/list",replace:!0})}),l.jsx(Tt,{path:"/1-percent",element:l.jsx(vy,{to:"/list",replace:!0})}),l.jsx(Tt,{path:"/reset-password",element:l.jsx(r2t,{})}),l.jsx(Tt,{path:"/privacy-policy",element:l.jsx(i2t,{})}),l.jsx(Tt,{path:"/terms-of-service",element:l.jsx(s2t,{})}),l.jsx(Tt,{path:"/accessibility",element:l.jsx(a2t,{})}),l.jsx(Tt,{path:"/market-pulse",element:l.jsx(gTt,{})}),l.jsx(Tt,{path:"/market-pulse/:zip",element:l.jsx(pTt,{})}),xTt,l.jsx(Tt,{path:"/:category",element:l.jsx(wye,{})}),l.jsx(Tt,{path:"/:category/:slug",element:l.jsx(p2t,{})}),l.jsx(Tt,{path:"/:category/:subcategory/:slug",element:l.jsx(y_,{})}),l.jsx(Tt,{path:"*",element:l.jsx(o2t,{})})]})]})]})})});Dne(document.getElementById("root")).render(l.jsx(STt,{}));export{Qh as c,Mn as g};